X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/616ff6ad61cfc198ff23200bdb450c24d9436073..2d58e7c682543939c0ae261514af569f7ac51fa3:/ITMTRemote.h diff --git a/ITMTRemote.h b/ITMTRemote.h index dd6ca6b..b3f3efa 100755 --- a/ITMTRemote.h +++ b/ITMTRemote.h @@ -1,38 +1,38 @@ /* - * 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. - * - */ - -/* - * TO DO: - * - * - Capability methods - * - */ - -/*! @header ITMTRemote - * @abstract Declares the necessary protocol and class to implement a MenuTunes Remote. - */ - -#import + 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 { - ITMTRemotePlayerNotRunning = -1, - ITMTRemotePlayerLaunching, - ITMTRemotePlayerRunning -} ITMTRemotePlayerRunningStatus; + ITMTRemoteName, + ITMTRemoteVersion, + ITMTRemotePublisher, + ITMTRemoteCopyright, + ITMTRemoteDescription +} ITMTRemoteInformationString; typedef enum { ITMTRemotePlayerStopped = -1, @@ -40,111 +40,96 @@ typedef enum { ITMTRemotePlayerPlaying, ITMTRemotePlayerRewinding, ITMTRemotePlayerForwarding -} ITMTRemotePlayerState; - -/*! @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 +} ITMTRemoteControlState; +typedef enum { + ITMTRemoteStop = -1, + ITMTRemotePause, + ITMTRemotePlay, + ITMTRemoteRewind, + ITMTRemoteFastForward, + ITMTRemotePreviousTrack, + ITMTRemoteNextTrack +} ITMTRemoteControlAction; -/*! @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; - -/*! @method pluginTitle: - * @abstract Returns the title of the plugin, which should be player name. - * @result An NSString containing the title. - */ -- (NSString *)pluginTitle; - -/*! @method pluginInformation: - * @abstract Returns a description of the remote. - * @result An NSString containing the description. - */ -- (NSString *)pluginInformation; - -/*! @method pluginIcon: - * @abstract Returns a icon for the remote. - * @result An NSImage containing the icon. - */ -- (NSImage *)pluginIcon; - -/*! @method begin: - * @abstract Sent when the plugin should begin operation. - * @result A result code signifying success. - */ -- (BOOL)begin; +typedef enum { + ITMTRemoteSinglePlaylist, + ITMTRemoteLibraryAndPlaylists, + ITMTRemoteSeperatePlaylists +} ITMTRemotePlaylistMode; -/*! @method halt: - * @abstract Sent when the plugin should cease operation. - * @result A result code signifying success. - */ -- (BOOL)halt; +typedef enum { + ITMTRemoteTrackName, + ITMTRemoteTrackArtist, + ITMTRemoteTrackAlbum, + ITMTRemoteTrackComposer, + ITMTRemoteTrackNumber, + ITMTRemoteTrackTotal, + ITMTRemoteTrackComment, + ITMTRemoteTrackGenre, + ITMTRemoteTrackYear, + ITMTRemoteTrackRating, + ITMTRemoteTrackArt +} ITMTRemoteTrackProperty; -- (NSString *)playerFullName; +typedef enum { + ITMTRemoteRepeatNone, + ITMTRemoteRepeatAll, + ITMTRemoteRepeatOne +} ITMTRemoteRepeatMode; -- (NSString *)playerSimpleName; +enum { + ITMTRemoteCustomPreset = -1; +} -/*! @method playerRunningStatus: - * @abstract Returns controlled application's running status (is or isn't running). - * @result BOOL of the controlled application's running status. - */ -- (ITMTRemotePlayerRunningStatus)playerRunningStatus; +@protocol ITMTRemote ++ (id)remote; +- (NSString*)informationString:(ITMTRemoteInformationString)string; +- (NSImage*)icon; -/*! @method playerState: - * @abstract Returns controlled application's playing state. - * @result ITMTRemotePlayerState of the controlled application's playing state. - */ -- (ITMTRemotePlayerState)playerState; +- (BOOL)begin; +- (BOOL)halt; -- (NSArray *)playlists; -- (int)numberOfSongsInPlaylistAtIndex:(int)index; -- (NSString *)classOfPlaylistAtIndex:(int)index; -- (int)currentPlaylistIndex; +- (BOOL)supportsControlAction:(ITMTRemoteControlAction)action; +- (BOOL)sendControlAction:(ITMTRemoteControlAction)action; +- (ITMTRemoteControlState)controlState; -- (NSString *)songTitleAtIndex:(int)index; -- (int)currentSongIndex; +- (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 *)currentSongTitle; -- (NSString *)currentSongArtist; -- (NSString *)currentSongAlbum; -- (NSString *)currentSongGenre; -- (NSString *)currentSongLength; -- (NSString *)currentSongRemaining; +- (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 -- (float)currentSongRating; -- (BOOL)setCurrentSongRating:(float)rating; +- (BOOL)supportsShuffle; +- (BOOL)setShuffle:(BOOL)toggle; +- (BOOL)shuffle; -- (NSArray *)eqPresets; -- (int)currentEQPresetIndex; +- (BOOL)supportsRepeatMode:(ITMTRemoteRepeatMode)repeatMode; +- (BOOL)setRepeatMode:(ITMTRemoteRepeatMode)repeatMode; +- (BOOL)repeatMode; -- (float)volume; +- (BOOL)supportsVolume; - (BOOL)setVolume:(float)volume; +- (float)volume; -- (BOOL)play; -- (BOOL)pause; -- (BOOL)goToNextSong; -- (BOOL)goToPreviousSong; -- (BOOL)forward; -- (BOOL)rewind; +- (BOOL)supportsCustomEqualizer; +- (BOOL)showEqualizerWindow; -- (BOOL)switchToPlaylistAtIndex:(int)index; -- (BOOL)switchToSongAtIndex:(int)index; -- (BOOL)switchToEQAtIndex:(int)index; +- (BOOL)supportsEqualizerPresets; +- (NSArray*)equalizerPresetNames; +- (BOOL)switchToEqualizerPreset:(int)index; // ITMTRemoteCustomPreset = Custom -@end +- (BOOL)supportsExternalWindow; +- (NSString*)externalWindowName; +- (BOOL)showExternalWindow; +@end @interface ITMTRemote : NSObject -@end +@end \ No newline at end of file