X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/fcf4151edd4959d1ed0c2ca7b9077bd26682053f..142456f7922d7d2a5762edc6db51558dbb7e1294:/ITMTRemote.h diff --git a/ITMTRemote.h b/ITMTRemote.h index b3f3efa..50c0df1 100755 --- a/ITMTRemote.h +++ b/ITMTRemote.h @@ -1,135 +1,210 @@ -/* - iThink Software - MenuTunes SDK BETA (SUBJECT TO CHANGE) +/**************************************** + ITMTRemote 1.0 (MenuTunes Remotes) 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. -*/ - + Responsibility: + Joseph Spiros + + Copyright (c) 2002 - 2003 by iThink Software. + All Rights Reserved. +****************************************/ -#import +#import typedef enum { - ITMTRemoteName, - ITMTRemoteVersion, - ITMTRemotePublisher, - ITMTRemoteCopyright, - ITMTRemoteDescription -} ITMTRemoteInformationString; + ITMTNameProperty, + ITMTImageProperty +} ITMTGenericProperty; typedef enum { - ITMTRemotePlayerStopped = -1, - ITMTRemotePlayerPaused, - ITMTRemotePlayerPlaying, - ITMTRemotePlayerRewinding, - ITMTRemotePlayerForwarding -} ITMTRemoteControlState; + ITMTRemoteNameProperty, + ITMTRemoteImageProperty, + ITMTRemoteAuthorProperty, + ITMTRemoteDescriptionProperty, + ITMTRemoteURLProperty, + ITMTRemoteCopyrightProperty, + ITMTRemoteActivationStringProperty, + ITMTRemoteDeactivationStringProperty +} ITMTRemoteProperty; typedef enum { - ITMTRemoteStop = -1, - ITMTRemotePause, - ITMTRemotePlay, - ITMTRemoteRewind, - ITMTRemoteFastForward, - ITMTRemotePreviousTrack, - ITMTRemoteNextTrack -} ITMTRemoteControlAction; - + 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 { - ITMTRemoteSinglePlaylist, - ITMTRemoteLibraryAndPlaylists, - ITMTRemoteSeperatePlaylists -} ITMTRemotePlaylistMode; + ITMTSinglePlayerStyle, + ITMTMultiplePlayerStyle, + ITMTSinglePlayerSinglePlaylistStyle +} ITMTPlayerStyle; typedef enum { - ITMTRemoteTrackName, - ITMTRemoteTrackArtist, - ITMTRemoteTrackAlbum, - ITMTRemoteTrackComposer, - ITMTRemoteTrackNumber, - ITMTRemoteTrackTotal, - ITMTRemoteTrackComment, - ITMTRemoteTrackGenre, - ITMTRemoteTrackYear, - ITMTRemoteTrackRating, - ITMTRemoteTrackArt -} ITMTRemoteTrackProperty; + ITMT32HzEqualizerBandLevel, + ITMT64HzEqualizerBandLevel, + ITMT125HzEqualizerBandLevel, + ITMT250HzEqualizerBandLevel, + ITMT500HzEqualizerBandLevel, + ITMT1kHzEqualizerBandLevel, + ITMT2kHzEqualizerBandLevel, + ITMT4kHzEqualizerBandLevel, + ITMT8kHzEqualizerBandLevel, + ITMT16kHzEqualizerBandLevel, + ITMTEqualizerPreampLevel +} ITMTEqualizerLevel; typedef enum { - ITMTRemoteRepeatNone, - ITMTRemoteRepeatAll, - ITMTRemoteRepeatOne -} ITMTRemoteRepeatMode; + ITMTTrackStopped = -1, + ITMTTrackPaused, + ITMTTrackPlaying, + ITMTTrackForwarding, + ITMTTrackRewinding +} ITMTTrackState; -enum { - ITMTRemoteCustomPreset = -1; -} +@class ITMTRemote, ITMTPlayer, ITMTPlaylist, ITMTTrack, ITMTEqualizer; @protocol ITMTRemote + (id)remote; -- (NSString*)informationString:(ITMTRemoteInformationString)string; -- (NSImage*)icon; -- (BOOL)begin; -- (BOOL)halt; +- (id)valueOfProperty:(ITMTRemoteProperty)property; + +- (NSDictionary *)propertiesAndValues; + +- (ITMTPlayerStyle)playerStyle; + +- (BOOL)activate; +- (BOOL)deactivate; + +- (ITMTPlayer *)currentPlayer; +- (BOOL)selectPlayer:(ITMTPlayer *)player; +- (NSArray *)players; +@end -- (BOOL)supportsControlAction:(ITMTRemoteControlAction)action; -- (BOOL)sendControlAction:(ITMTRemoteControlAction)action; -- (ITMTRemoteControlState)controlState; +@interface ITMTRemote : NSObject +@end -- (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; +/*! + @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; -- (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 +- (BOOL)show; -- (BOOL)supportsShuffle; -- (BOOL)setShuffle:(BOOL)toggle; -- (BOOL)shuffle; +- (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property; +- (id)valueOfProperty:(ITMTGenericProperty)property; +- (NSDictionary *)propertiesAndValues; -- (BOOL)supportsRepeatMode:(ITMTRemoteRepeatMode)repeatMode; -- (BOOL)setRepeatMode:(ITMTRemoteRepeatMode)repeatMode; -- (BOOL)repeatMode; +- (ITMTRemote *)remote; -- (BOOL)supportsVolume; -- (BOOL)setVolume:(float)volume; -- (float)volume; +- (ITMTPlaylist *)currentPlaylist; +- (BOOL)selectPlaylist:(ITMTPlaylist *)playlist; +- (ITMTTrack *)currentTrack; +- (BOOL)selectTrack:(ITMTTrack *)track; +- (ITMTEqualizer *)currentEqualizer; +- (BOOL)selectEqualizer:(ITMTEqualizer *)equalizer; -- (BOOL)supportsCustomEqualizer; -- (BOOL)showEqualizerWindow; +- (NSArray *)playlists; -- (BOOL)supportsEqualizerPresets; -- (NSArray*)equalizerPresetNames; -- (BOOL)switchToEqualizerPreset:(int)index; // ITMTRemoteCustomPreset = Custom +- (NSArray *)tracks; +- (ITMTPlaylist *)libraryPlaylist; -- (BOOL)supportsExternalWindow; -- (NSString*)externalWindowName; -- (BOOL)showExternalWindow; +- (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