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) 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
<?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
#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
#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
-(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
def xmp(filename) | |
xap = "http://ns.adobe.com/xap/1.0/\0".freeze | |
f = File.open(filename, 'r') | |
xml = nil | |
begin | |
return nil unless f.readbyte == 0xFF | |
return nil unless f.readbyte == 0xD8 | |
while !f.eof | |
case f.readbyte |
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
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) | |
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) | |
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |
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"?> | |
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> | |
<channel> | |
<title>Magic Music Changes</title> | |
<link>https://gist.github.com/runeb/8774083/raw/gistfile1.xml</link> | |
<description>Most recent changes with links to updates.</description> | |
<language>en</language> | |
<item><title>Version 1.0 (12)</title><pubDate>Sun, 02 Feb 2014 21:35:32 +0000</pubDate><enclosure url="http" length="1234567890" type="application/octet-stream" sparkle:version="12" sparkle:shortVersionString="1.0" sparkle:dsaSignature="dsa"/></item></channel> | |
</rss> |