X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/31ab86a87f78edfdd32810db1ff708ca8f5eaaca..2d58e7c682543939c0ae261514af569f7ac51fa3:/ITMTRemote.h diff --git a/ITMTRemote.h b/ITMTRemote.h index 3d2015f..b3f3efa 100755 --- a/ITMTRemote.h +++ b/ITMTRemote.h @@ -1,115 +1,135 @@ /* - * MenuTunes - * ITMTRemote - * Plugin definition for audio player control via MenuTunes - * - * Original Author : Matt Judy - * Responsibility : Matt Judy - * - * Copyright (c) 2002 - 2003 iThink Software. - * All Rights Reserved - * - * This header defines the Objective-C protocol which all MenuTunes Remote - * plugins must implement. To build a remote, create a subclass of this - * object, and implement each method in the @protocol below. - * - */ + iThink Software + MenuTunes SDK BETA (SUBJECT TO CHANGE) + ITMTRemote.h + + Copyright 2003 by iThink Software, All Rights Reserved. + This is under Non-Disclosure +*/ + +/* + Remotes need to include an Info.plist in their + bundle/wrapper. It needs to have the following keys + (with string values): + + ITMTRemoteName + ITMTRemoteVersion + ITMTRemotePublisher + ITMTRemoteCopyright + ITMTRemoteDescription + ITMTRemoteIconFile + + It also needs to have an icon file who's filename (Relative) + is indicated in the ITMTRemoteIconFile value. +*/ + + +#import + +typedef enum { + ITMTRemoteName, + ITMTRemoteVersion, + ITMTRemotePublisher, + ITMTRemoteCopyright, + ITMTRemoteDescription +} ITMTRemoteInformationString; + +typedef enum { + ITMTRemotePlayerStopped = -1, + ITMTRemotePlayerPaused, + ITMTRemotePlayerPlaying, + ITMTRemotePlayerRewinding, + ITMTRemotePlayerForwarding +} ITMTRemoteControlState; + +typedef enum { + ITMTRemoteStop = -1, + ITMTRemotePause, + ITMTRemotePlay, + ITMTRemoteRewind, + ITMTRemoteFastForward, + ITMTRemotePreviousTrack, + ITMTRemoteNextTrack +} ITMTRemoteControlAction; + +typedef enum { + ITMTRemoteSinglePlaylist, + ITMTRemoteLibraryAndPlaylists, + ITMTRemoteSeperatePlaylists +} ITMTRemotePlaylistMode; + +typedef enum { + ITMTRemoteTrackName, + ITMTRemoteTrackArtist, + ITMTRemoteTrackAlbum, + ITMTRemoteTrackComposer, + ITMTRemoteTrackNumber, + ITMTRemoteTrackTotal, + ITMTRemoteTrackComment, + ITMTRemoteTrackGenre, + ITMTRemoteTrackYear, + ITMTRemoteTrackRating, + ITMTRemoteTrackArt +} ITMTRemoteTrackProperty; + +typedef enum { + ITMTRemoteRepeatNone, + ITMTRemoteRepeatAll, + ITMTRemoteRepeatOne +} ITMTRemoteRepeatMode; + +enum { + ITMTRemoteCustomPreset = -1; +} -/* - * TO DO: - * - * - Capability methods - * - */ - -/*! @header ITMTRemote - * @abstract Declares the necessary protocol and class to implement a MenuTunes Remote. - */ - -#import - -/*! @protocol ITMTRemote - * @abstract Declares what a MenuTunes Remote must be able to do. - * @discussion A MenuTunes Remote must be able to return and change state information. - */ @protocol ITMTRemote - - -/*! @method remote - * @abstract Returns an autoreleased instance of the remote. - * @discussion Should be very quick and compact. - * EXAMPLE: - * + (id)remote - * { - * return [[[MyRemote alloc] init] autorelease]; - * } - * @result The instance. - */ + (id)remote; +- (NSString*)informationString:(ITMTRemoteInformationString)string; +- (NSImage*)icon; -/*! @method title: - * @abstract Returns an autoreleased instance of the remote. - * @result An NSString containing the title. - */ -- (NSString *)title; - -/*! @method description: - * @abstract Returns a description of the remote. - * @result An NSString containing the description. - */ -- (NSString *)information; - -/*! @method icon: - * @abstract Returns a icon for the remote. - * @result An NSImage containing the icon. - */ -- (NSImage *)icon; - -/*! @method begin: - * @abstract Sent when the plugin should begin operation. - * @result A result code signifying success. - */ - (BOOL)begin; - -/*! @method halt: - * @abstract Sent when the plugin should cease operation. - * @result A result code signifying success. - */ - (BOOL)halt; -- (NSArray *)sources; -- (int)currentSourceIndex; +- (BOOL)supportsControlAction:(ITMTRemoteControlAction)action; +- (BOOL)sendControlAction:(ITMTRemoteControlAction)action; +- (ITMTRemoteControlState)controlState; -- (NSArray *)playlistsForCurrentSource; -- (int)currentPlaylistIndex; +- (ITMTRemotePlaylistMode)playlistMode; +- (NSArray*)playlistNames; +- (BOOL)switchToPlaylist:(int)playlistIndex; +- (BOOL)switchToTrackAtIndex:(int)index; +- (int)indexForTrack:(int)identifier inPlaylist:(int)playlistIndex; +- (int)identifierForTrackAtIndex:(int)index inPlaylist:(int)playlistIndex; -- (NSString *)songTitleAtIndex; -- (int)currentSongIndex; +- (BOOL)supportsTrackProperty:(ITMTRemoteTrackProperty)property; +- (id)trackProperty:(ITMTRemoteTrackProperty)property atIndex:(int)index; +- (BOOL)setTrackProperty:(ITMTRemoteTrackProperty)property toValue:(id)property atIndex:(int)index; // currently only used to set Ratings... someday, we might provide a full frontend? well, it is possible that other apps could use MT remotes, as such, they might want to set other values. For Rating, send in an NSNumber from a float 0.0 - 1.0. For Art, send in an NSImage... this is also what you'll recieve when using the accessor -- (NSString *)currentSongTitle; -- (NSString *)currentSongArtist; -- (NSString *)currentSongAlbum; -- (NSString *)currentSongGenre; -- (NSString *)currentSongLength; -- (NSString *)currentSongRemaining; +- (BOOL)supportsShuffle; +- (BOOL)setShuffle:(BOOL)toggle; +- (BOOL)shuffle; -- (NSArray *)eqPresets; +- (BOOL)supportsRepeatMode:(ITMTRemoteRepeatMode)repeatMode; +- (BOOL)setRepeatMode:(ITMTRemoteRepeatMode)repeatMode; +- (BOOL)repeatMode; -- (BOOL)play; -- (BOOL)pause; -- (BOOL)goToNextSong; -- (BOOL)goToPreviousSong; -- (BOOL)goToNextPlaylist; -- (BOOL)goToPreviousPlaylist; +- (BOOL)supportsVolume; +- (BOOL)setVolume:(float)volume; +- (float)volume; -- (BOOL)switchToSourceAtIndex:(int)index; -- (BOOL)switchToPlaylistAtIndex:(int)index; -- (BOOL)switchToSongAtIndex:(int)index; -- (BOOL)switchToEQAtIndex:(int)index; +- (BOOL)supportsCustomEqualizer; +- (BOOL)showEqualizerWindow; -@end +- (BOOL)supportsEqualizerPresets; +- (NSArray*)equalizerPresetNames; +- (BOOL)switchToEqualizerPreset:(int)index; // ITMTRemoteCustomPreset = Custom + +- (BOOL)supportsExternalWindow; +- (NSString*)externalWindowName; +- (BOOL)showExternalWindow; +@end @interface ITMTRemote : NSObject -@end +@end \ No newline at end of file