Created
August 11, 2013 04:22
-
-
Save cdl/6203372 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
* Rdio.h | |
*/ | |
#import <AppKit/AppKit.h> | |
#import <ScriptingBridge/ScriptingBridge.h> | |
@class RdioApplication, RdioTrack, RdioApplication; | |
enum RdioEPSS { | |
RdioEPSSPaused = 'kPSp', | |
RdioEPSSPlaying = 'kPSP', | |
RdioEPSSStopped = 'kPSS' | |
}; | |
typedef enum RdioEPSS RdioEPSS; | |
/* | |
* Rdio Suite | |
*/ | |
// The Rdio application. | |
@interface RdioApplication : SBApplication | |
@property (copy, readonly) RdioTrack *currentTrack; // The current playing track. | |
@property NSInteger soundVolume; // The sound output volume (0 = min, 100 = max) | |
@property (readonly) RdioEPSS playerState; // Is Rdio stopped, paused, or playing? | |
@property double playerPosition; // The player’s position within the currently playing track in seconds. | |
@property BOOL shuffle; // The player's shuffle state | |
- (void) addToCollection; // Add current song to your collection. | |
- (void) removeFromCollection; // Remove current song from your collection. | |
- (void) syncToMobile; // Sync current song to mobile. | |
- (void) removeFromMobile; // Remove current song from mobile. | |
- (void) nextTrack; // Skip to the next track. | |
- (void) previousTrack; // Skip to the previous track. | |
- (void) playpause; // Toggle play/pause. | |
- (void) pause; // Pause playback. | |
- (void) playSource:(NSString *)source; // Resume playback. | |
@end | |
// A Rdio track. | |
@interface RdioTrack : SBObject | |
@property (copy, readonly) NSString *artist; // The artist of the track. | |
@property (copy, readonly) NSString *album; // The album of the track. | |
@property (readonly) NSInteger duration; // The length of the track in seconds. | |
@property (copy, readonly) NSString *name; // The name of the track. | |
@property (copy, readonly) NSData *artwork; // Artwork for the currently playing track. | |
@property (copy, readonly) NSString *rdioUrl; // The URL of the track. | |
@property (copy, readonly) NSString *key; // The current playing track's key. | |
@end | |
/* | |
* Standard Suite | |
*/ | |
// The application's top level scripting object. | |
@interface RdioApplication (StandardSuite) | |
@property (copy, readonly) NSString *name; // The name of the application. | |
@property (readonly) BOOL frontmost; // Is this the frontmost (active) application? | |
@property (copy, readonly) NSString *version; // The version of the application. | |
@end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment