X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/74d6135e4db4cf9a70994d5bc2062be30311d0f3..081a5fa6db149252a499575da751c45f340312bd:/ITMTRemote.h diff --git a/ITMTRemote.h b/ITMTRemote.h index 693d908..aedbc4d 100755 --- a/ITMTRemote.h +++ b/ITMTRemote.h @@ -1,140 +1,113 @@ -/* - * 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. - */ +/**************************************** + ITMTRemote 1.0 (MenuTunes Remotes) + ITMTRemote.h + + Responsibility: + Joseph Spiros + + Copyright (c) 2002 - 2003 by iThink Software. + All Rights Reserved. +****************************************/ #import -typedef enum { - stopped = -1, - paused, - playing, - rewinding, - forwarding -} ITMTRemotePlayerState; +#import +#import +#import +#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. - */ +/*! + @typedef ITMTGenericProperty + @constant ITMTNameProperty The object's human readable name. + @constant ITMTImageProperty An image that can be associated with the object. +*/ +typedef enum { + ITMTNameProperty, + ITMTImageProperty +} ITMTGenericProperty; +/*! + @typedef ITMTRemoteProperty + @constant ITMTRemoteNameProperty + @constant ITMTRemoteImageProperty + @constant ITMTRemoteAuthorProperty + @constant ITMTRemoteDescriptionProperty + @constant ITMTRemoteURLProperty + @constant ITMTRemoteCopyrightProperty +*/ +typedef enum { + ITMTRemoteNameProperty, + ITMTRemoteImageProperty, + ITMTRemoteAuthorProperty, + ITMTRemoteDescriptionProperty, + ITMTRemoteURLProperty, + ITMTRemoteCopyrightProperty, + ITMTRemoteActivationStringProperty, + ITMTRemoteDeactivationStringProperty +} ITMTRemoteProperty +/*! + @typedef ITMTPlayerStyle + @constant ITMTSinglePlayerStyle Like iTunes, One player controls all available songs. + @constant ITMTMultiplePlayerStyle Like Audion, Multiple players control multiple playlists. + @constant ITMTSinglePlayerSinglePlaylistStyle Like *Amp, XMMS. Not recommended, but instead, developers are urged to use ITMTSinglePlayerStyle with emulated support for multiple playlists. +*/ +typedef enum { + ITMTSinglePlayerStyle, + ITMTMultiplePlayerStyle, + ITMTSinglePlayerSinglePlaylistStyle +} ITMTPlayerStyle; + +/*! + @protocol ITMTRemote + @abstract The ITMTRemote protocol is the protocol that all MenuTunes remotes' primary class must implement. +*/ @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. - */ +/*! + @method remote + @result Returns an autoreleased instance of the remote. +*/ + (id)remote; -/*! @method title: - * @abstract Returns the title of the plugin, which should be player name. - * @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; - -/*! @method isAppRunning: - * @abstract Returns controlled application's running status (is or isn't running). - * @result BOOL of the controlled application's running status. - */ -- (BOOL)isAppRunning; - -/*! @method playerState: - * @abstract Returns controlled application's playing state. - * @result ITMTRemotePlayerState of the controlled application's playing state. - */ -- (ITMTRemotePlayerState)playerState; - -- (NSArray *)playlists; -- (int)numberOfSongsInPlaylistAtIndex:(int)index; -- (NSString *)classOfPlaylistAtIndex:(int)index; -- (int)currentPlaylistIndex; - -- (NSString *)songTitleAtIndex:(int)index; -- (int)currentSongIndex; - -- (NSString *)currentSongTitle; -- (NSString *)currentSongArtist; -- (NSString *)currentSongAlbum; -- (NSString *)currentSongGenre; -- (NSString *)currentSongLength; -- (NSString *)currentSongRemaining; - -- (float)currentSongRating; -- (BOOL)setCurrentSongRating:(float)rating; - -- (NSArray *)eqPresets; -- (int)currentEQPresetIndex; - -- (float)volume; -- (BOOL)setVolume:(float)volume; - -- (BOOL)play; -- (BOOL)pause; -- (BOOL)goToNextSong; -- (BOOL)goToPreviousSong; -- (BOOL)fastForward; -- (BOOL)rewind; - -- (BOOL)switchToPlaylistAtIndex:(int)index; -- (BOOL)switchToSongAtIndex:(int)index; -- (BOOL)switchToEQAtIndex:(int)index; - +/*! + @method valueOfProperty: +*/ +- (id)valueOfProperty:(ITMTRemoteProperty)property; + +/*! + @method propertiesAndValues +*/ +- (NSDictionary *)propertiesAndValues; + +/*! + @method playerStyle + @result An ITMTPlayerStyle defining how the remote works with players and playlists. +*/ +- (ITMTPlayerStyle)playerStyle; + +/*! + @method activate + @result A BOOL indicating success or failure. +*/ +- (BOOL)activate; +/*! + @method deactivate + @result A BOOL indicating success or failure. +*/ +- (BOOL)deactivate; + +/*! + @method currentPlayer + @result An ITMTPlayer object representing the currently active player that the remote is controlling. +*/ +- (ITMTPlayer *)currentPlayer +/*! + @method players + @result An NSArray filled with ITMTPlayer objects. +*/ +- (NSArray *)players; @end - +/*! + @class ITMTRemote +*/ @interface ITMTRemote : NSObject - @end