This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) play:(NSMenuItem*) menuItem | |
{ | |
for(NSMenuItem *i in menuItems) { | |
[i setState:NSOffState]; | |
} | |
[menuItem setState:NSOnState]; | |
NSDictionary *station = [stations objectAtIndex:menuItem.tag]; | |
NSString *name = [station valueForKey:@"name"]; | |
[systemStatusItem setTitle:name]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) play:(NSMenuItem*) menuItem | |
{ | |
for(NSMenuItem *i in menuItems) { | |
[i setState:NSOffState]; | |
} | |
[menuItem setState:NSOnState]; | |
NSDictionary *station = [stations objectAtIndex:menuItem.tag]; | |
NSString *name = [station valueForKey:@"name"]; | |
[systemStatusItem setTitle:name]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
#import <QTKit/QTKit.h> | |
@interface RBAppDelegate : NSObject <NSApplicationDelegate> | |
{ | |
NSStatusItem *systemStatusItem; | |
QTMovie *radio; | |
NSMutableArray *menuItems; | |
NSArray *stations; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "RBAppDelegate.h" | |
@implementation RBAppDelegate | |
- (void) createMenu | |
{ | |
NSStatusBar *bar = [NSStatusBar systemStatusBar]; | |
systemStatusItem = [bar statusItemWithLength:NSVariableStatusItemLength]; | |
[systemStatusItem setTitle:@"Radio"]; | |
[systemStatusItem setHighlightMode:YES]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<array> | |
<dict> | |
<key>name</key> | |
<string>NRK P1</string> | |
<key>url</key> | |
<string>http://lyd.nrk.no/nrk_radio_p1_ostlandssendingen_mp3_h</string> | |
</dict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) playURLString:(NSString*) urlString | |
{ | |
NSURL *url = [NSURL URLWithString:urlString]; | |
NSDictionary *movieAttrs = [NSDictionary dictionaryWithObjectsAndKeys: | |
url, | |
QTMovieURLAttribute, | |
[NSNumber numberWithBool:YES], | |
QTMovieOpenForPlaybackAttribute, | |
nil]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
#import <QTKit/QTKit.h> | |
@interface RBAppDelegate : NSObject <NSApplicationDelegate> | |
{ | |
NSStatusItem *systemStatusItem; | |
QTMovie *radio; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
NSStatusBar *bar = [NSStatusBar systemStatusBar]; | |
systemStatusItem = [bar statusItemWithLength:NSVariableStatusItemLength]; | |
[systemStatusItem setTitle:@"Radio"]; | |
[systemStatusItem retain]; | |
NSMenu *appMenu = [[NSMenu alloc] init]; | |
[appMenu addItemWithTitle:@"Avslutt" action:@selector(quit) keyEquivalent:@""]; | |
[systemStatusItem setMenu:appMenu]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) quit { | |
[NSApp terminate:NULL]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
NSStatusBar *bar = [NSStatusBar systemStatusBar]; | |
systemStatusItem = [bar statusItemWithLength:NSVariableStatusItemLength]; | |
[systemStatusItem setTitle:@"Radio"]; | |
[systemStatusItem setMenu:NULL]; | |
[systemStatusItem retain]; | |
} |