Added Shuffle and Loop mode support.
[MenuTunes.git] / ITMTRemote.h
index 8c1dcef..cc96262 100755 (executable)
-/*
-    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 <joseph.spiros@ithinksw.com>
+    
+    Copyright (c) 2002 - 2003 by iThink Software.
+    All Rights Reserved.
+****************************************/
 
 #import <Cocoa/Cocoa.h>
 
 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 {
+    ITMTSinglePlayerStyle,
+    ITMTMultiplePlayerStyle,
+    ITMTSinglePlayerSinglePlaylistStyle
+} ITMTPlayerStyle;
 
 typedef enum {
-    ITMTRemoteSinglePlaylist,
-    ITMTRemoteLibraryAndPlaylists,
-    ITMTRemoteSeperatePlaylists
-} ITMTRemotePlaylistMode;
+    ITMT32HzEqualizerBandLevel,
+    ITMT64HzEqualizerBandLevel,
+    ITMT125HzEqualizerBandLevel,
+    ITMT250HzEqualizerBandLevel,
+    ITMT500HzEqualizerBandLevel,
+    ITMT1kHzEqualizerBandLevel,
+    ITMT2kHzEqualizerBandLevel,
+    ITMT4kHzEqualizerBandLevel,
+    ITMT8kHzEqualizerBandLevel,
+    ITMT16kHzEqualizerBandLevel,
+    ITMTEqualizerPreampLevel
+} ITMTEqualizerLevel;
 
 typedef enum {
-    ITMTRemoteTrackName,
-    ITMTRemoteTrackArtist,
-    ITMTRemoteTrackAlbum,
-    ITMTRemoteTrackComposer,
-    ITMTRemoteTrackNumber,
-    ITMTRemoteTrackTotal,
-    ITMTRemoteTrackComment,
-    ITMTRemoteTrackGenre,
-    ITMTRemoteTrackYear,
-    ITMTRemoteTrackRating,
-    ITMTRemoteTrackArt
-} ITMTRemoteTrackProperty;
+    ITMTTrackStopped = -1,
+    ITMTTrackPaused,
+    ITMTTrackPlaying,
+    ITMTTrackForwarding,
+    ITMTTrackRewinding
+} ITMTTrackState;
 
 typedef enum {
-    ITMTRemoteRepeatNone,
-    ITMTRemoteRepeatAll,
-    ITMTRemoteRepeatOne
-} ITMTRemoteRepeatMode;
+    ITMTRepeatNoneMode,
+    ITMTRepeatOneMode,
+    ITMTRepeatAllMode
+} ITMTRepeatMode;
 
-/*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;
 
-- (BOOL)supportsControlAction:(ITMTRemoteControlAction)action;
-- (BOOL)sendControlAction:(ITMTRemoteControlAction)action;
-- (ITMTRemoteControlState)controlState;
+- (ITMTPlayerStyle)playerStyle;
 
-- (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;
+- (BOOL)activate;
+- (BOOL)deactivate;
 
-- (BOOL)supportsTrackProperty:(ITMTRemoteTrackProperty)property;
-- (id)trackProperty:(ITMTRemoteTrackProperty)property atIndex:(int)index;
-- (BOOL)setTrackProperty:(ITMTRemoteTrackProperty)property toValue:(id)value 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 */
+- (ITMTPlayer *)currentPlayer;
+- (BOOL)selectPlayer:(ITMTPlayer *)player;
+- (NSArray *)players;
+@end
 
+@interface ITMTRemote : NSObject <ITMTRemote>
+@end
 
-- (BOOL)supportsShuffle;
-- (BOOL)setShuffle:(BOOL)toggle;
-- (BOOL)shuffle;
+/*!
+    @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)supportsRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
-- (BOOL)setRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
-- (ITMTRemoteRepeatMode)repeatMode;
+- (BOOL)show;
 
-- (BOOL)supportsVolume;
-- (BOOL)setVolume:(float)volume;
-- (float)volume;
+- (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property;
+- (id)valueOfProperty:(ITMTGenericProperty)property;
+- (NSDictionary *)propertiesAndValues;
 
-- (BOOL)supportsCustomEqualizer;
-- (BOOL)showEqualizerWindow;
+- (ITMTRemote *)remote;
 
-- (BOOL)supportsEqualizerPresets;
-- (NSArray*)equalizerPresetNames;
-- (BOOL)switchToEqualizerPreset:(int)index; // ITMTRemoteCustomPreset = Custom
+- (ITMTPlaylist *)currentPlaylist;
+- (BOOL)selectPlaylist:(ITMTPlaylist *)playlist;
+- (ITMTTrack *)currentTrack;
+- (BOOL)selectTrack:(ITMTTrack *)track;
+- (ITMTEqualizer *)currentEqualizer;
+- (BOOL)selectEqualizer:(ITMTEqualizer *)equalizer;
 
-- (BOOL)supportsExternalWindow;
-- (NSString*)externalWindowName;
-- (BOOL)showExternalWindow;
+- (NSArray *)playlists;
 
+- (NSArray *)tracks;
+- (ITMTPlaylist *)libraryPlaylist;
+
+- (NSArray *)equalizers;
+
+- (ITMTRepeatMode)repeatMode;
+- (BOOL)setRepeatMode:(ITMTRepeatMode)repeatMode;
+
+- (BOOL)shuffleEnabled;
+- (BOOL)enableShuffle:(BOOL)shuffle;
 @end
 
-@interface ITMTRemote : NSObject <ITMTRemote>
+@interface ITMTPlayer : NSObject <ITMTPlayer>
+@end
+
+@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 <ITMTPlaylist>
+@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 <ITMTTrack>
+@end
+
+@protocol ITMTEqualizer
+- (BOOL)writable;
+
+- (ITMTPlayer *)player;
+
+- (float)dBForLevel:(ITMTEqualizerLevel)level;
+- (BOOL)setdB:(float)dB forLevel:(ITMTEqualizerLevel)level;
+@end
 
+@interface ITMTEqualizer : NSObject <ITMTEqualizer>
 @end
\ No newline at end of file