X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/144f2a34f982b5e54907225977b6770646e94f4d..142456f7922d7d2a5762edc6db51558dbb7e1294:/ITMTRemote.h diff --git a/ITMTRemote.h b/ITMTRemote.h index 3527c85..50c0df1 100755 --- a/ITMTRemote.h +++ b/ITMTRemote.h @@ -1,99 +1,210 @@ -/* - * 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 -/*! @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 enum { + ITMTNameProperty, + ITMTImageProperty +} ITMTGenericProperty; + +typedef enum { + ITMTRemoteNameProperty, + ITMTRemoteImageProperty, + ITMTRemoteAuthorProperty, + ITMTRemoteDescriptionProperty, + ITMTRemoteURLProperty, + ITMTRemoteCopyrightProperty, + ITMTRemoteActivationStringProperty, + ITMTRemoteDeactivationStringProperty +} ITMTRemoteProperty; + +typedef enum { + ITMTTrackTitle, + ITMTTrackArtist, + ITMTTrackComposer, + ITMTTrackYear, + ITMTTrackImage, + ITMTTrackAlbum, + ITMTTrackNumber, + ITMTTrackTotal, + ITMTDiscNumber, + ITMTDiscTotal, + ITMTTrackComments, + ITMTTrackGenre, + ITMTTrackRating +} ITMTTrackProperty; + +/*! + @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; + +typedef enum { + ITMT32HzEqualizerBandLevel, + ITMT64HzEqualizerBandLevel, + ITMT125HzEqualizerBandLevel, + ITMT250HzEqualizerBandLevel, + ITMT500HzEqualizerBandLevel, + ITMT1kHzEqualizerBandLevel, + ITMT2kHzEqualizerBandLevel, + ITMT4kHzEqualizerBandLevel, + ITMT8kHzEqualizerBandLevel, + ITMT16kHzEqualizerBandLevel, + ITMTEqualizerPreampLevel +} ITMTEqualizerLevel; + +typedef enum { + ITMTTrackStopped = -1, + ITMTTrackPaused, + ITMTTrackPlaying, + ITMTTrackForwarding, + ITMTTrackRewinding +} ITMTTrackState; + +@class ITMTRemote, ITMTPlayer, ITMTPlaylist, ITMTTrack, ITMTEqualizer; @protocol ITMTRemote -/*! @method remote: - * @abstract Return 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 *)title; -// Return the title of the remote. +- (id)valueOfProperty:(ITMTRemoteProperty)property; -- (NSString *)description; -// Return a short description of the remote. +- (NSDictionary *)propertiesAndValues; -- (NSImage *)icon; -// Return a 16x16 icon representation for the remote. +- (ITMTPlayerStyle)playerStyle; -- (BOOL)begin; -// Sent to the plugin when it should begin operation. +- (BOOL)activate; +- (BOOL)deactivate; -- (BOOL)halt; -// Sent to the plugin when it should cease operation. +- (ITMTPlayer *)currentPlayer; +- (BOOL)selectPlayer:(ITMTPlayer *)player; +- (NSArray *)players; +@end + +@interface ITMTRemote : NSObject +@end -- (NSArray *)sources; -- (int)currentSourceIndex; +/*! + @protocol ITMTPlayer + @abstract Object representation for a controlled player. + @discussion Object representation for a controlled player. Players can be defined as things that control playlist(s) objects, a pool of track objects, and possibly, equalizer objects. +*/ +@protocol ITMTPlayer +- (BOOL)writable; -- (NSArray *)playlistsForCurrentSource; -- (int)currentPlaylistIndex; +- (BOOL)show; -- (NSString *)songTitleAtIndex; -- (int)currentSongIndex; +- (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property; +- (id)valueOfProperty:(ITMTGenericProperty)property; +- (NSDictionary *)propertiesAndValues; -- (NSString *)currentSongTitle; -- (NSString *)currentSongArtist; -- (NSString *)currentSongAlbum; -- (NSString *)currentSongGenre; -- (NSString *)currentSongLength; -- (NSString *)currentSongRemaining; +- (ITMTRemote *)remote; -- (NSArray *)eqPresets; +- (ITMTPlaylist *)currentPlaylist; +- (BOOL)selectPlaylist:(ITMTPlaylist *)playlist; +- (ITMTTrack *)currentTrack; +- (BOOL)selectTrack:(ITMTTrack *)track; +- (ITMTEqualizer *)currentEqualizer; +- (BOOL)selectEqualizer:(ITMTEqualizer *)equalizer; -- (BOOL)play; -- (BOOL)pause; -- (BOOL)goToNextSong; -- (BOOL)goToPreviousSong; -- (BOOL)goToNextPlaylist; -- (BOOL)goToPreviousPlaylist; +- (NSArray *)playlists; -- (BOOL)switchToSourceAtIndex:(int)index; -- (BOOL)switchToPlaylistAtIndex:(int)index; -- (BOOL)switchToSongAtIndex:(int)index; -- (BOOL)switchToEQAtIndex:(int)index; +- (NSArray *)tracks; +- (ITMTPlaylist *)libraryPlaylist; +- (NSArray *)equalizers; @end +@interface ITMTPlayer : NSObject +@end -@interface ITMTRemote : NSObject +@protocol ITMTPlaylist +- (BOOL)isEqualToPlaylist:(ITMTPlaylist *)playlist; + +- (BOOL)writable; + +- (BOOL)show; + +- (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property; +- (id)valueOfProperty:(ITMTGenericProperty)property; +- (NSDictionary *)propertiesAndValues; + +- (ITMTPlayer *)player; + +- (BOOL)addTrack:(ITMTTrack *)track; +- (BOOL)insertTrack:(ITMTTrack *)track atIndex:(int)index; + +- (BOOL)removeTrack:(ITMTTrack *)item; +- (BOOL)removeTrackAtIndex:(int)index; + +- (ITMTTrack *)trackAtIndex:(int)index; + +- (int)indexOfTrack:(ITMTTrack *)track; +- (ITMTTrack *)trackWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatch:(BOOL)partial; +- (NSArray *)tracksWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatches:(BOOL)partial; +- (int)indexOfTrackWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatch:(BOOL)partial; +- (NSArray *)indexesOfTracksWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatches:(BOOL)partial; + +- (int)trackCount; +- (NSArray *)tracks; + +- (ITMTTrack *)currentTrack; +- (int)indexOfCurrentTrack; +- (BOOL)selectTrack:(ITMTTrack *)track; +- (BOOL)selectTrackAtIndex:(int)index; @end + +@interface ITMTPlaylist : NSObject +@end + +@protocol ITMTTrack +- (BOOL)isEqualToTrack:(ITMTTrack *)track; + +- (BOOL)writable; + +- (BOOL)addToPlaylist:(ITMTPlaylist *)playlist; +- (BOOL)addToPlaylist:(ITMTPlaylist *)playlist atIndex:(int)index; + +- (ITMTPlayer *)player; +- (NSArray *)playlists; +- (ITMTPlaylist *)currentPlaylist; +- (BOOL)setCurrentPlaylist:(ITMTPlaylist *)playlist; + +- (BOOL)setValue:(id)value forProperty:(ITMTTrackProperty)property; +- (id)valueOfProperty:(ITMTTrackProperty)property; +- (NSDictionary *)propertiesAndValues; + +- (BOOL)setState:(ITMTTrackState)state; +- (ITMTTrackState)state; +@end + +@interface ITMTTrack : NSObject +@end + +@protocol ITMTEqualizer +- (BOOL)writable; + +- (ITMTPlayer *)player; + +- (float)dBForLevel:(ITMTEqualizerLevel)level; +- (BOOL)setdB:(float)dB forLevel:(ITMTEqualizerLevel)level; +@end + +@interface ITMTEqualizer : NSObject +@end \ No newline at end of file