reverting
[MenuTunes.git] / ITMTRemote.h
index b2e2d5e..b3f3efa 100755 (executable)
 /*
- *  MenuTunes
- *  ITMTRemote
- *    Plugin definition for audio player control via MenuTunes
- *
- *  Original Author : Matt Judy <mjudy@ithinksw.com>
- *   Responsibility : Matt Judy <mjudy@ithinksw.com>
- *
- *  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
- *
- */
-
-#import <Cocoa/Cocoa.h>
+    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 <Foundation/Foundation.h>
+
+typedef enum {
+    ITMTRemoteName,
+    ITMTRemoteVersion,
+    ITMTRemotePublisher,
+    ITMTRemoteCopyright,
+    ITMTRemoteDescription
+} ITMTRemoteInformationString;
+
+typedef enum {
+    ITMTRemotePlayerStopped = -1,
+    ITMTRemotePlayerPaused,
+    ITMTRemotePlayerPlaying,
+    ITMTRemotePlayerRewinding,
+    ITMTRemotePlayerForwarding
+} ITMTRemoteControlState;
+
+typedef enum {
+    ITMTRemoteStop = -1,
+    ITMTRemotePause,
+    ITMTRemotePlay,
+    ITMTRemoteRewind,
+    ITMTRemoteFastForward,
+    ITMTRemotePreviousTrack,
+    ITMTRemoteNextTrack
+} ITMTRemoteControlAction;
+
+typedef enum {
+    ITMTRemoteSinglePlaylist,
+    ITMTRemoteLibraryAndPlaylists,
+    ITMTRemoteSeperatePlaylists
+} ITMTRemotePlaylistMode;
+
+typedef enum {
+    ITMTRemoteTrackName,
+    ITMTRemoteTrackArtist,
+    ITMTRemoteTrackAlbum,
+    ITMTRemoteTrackComposer,
+    ITMTRemoteTrackNumber,
+    ITMTRemoteTrackTotal,
+    ITMTRemoteTrackComment,
+    ITMTRemoteTrackGenre,
+    ITMTRemoteTrackYear,
+    ITMTRemoteTrackRating,
+    ITMTRemoteTrackArt
+} ITMTRemoteTrackProperty;
+
+typedef enum {
+    ITMTRemoteRepeatNone,
+    ITMTRemoteRepeatAll,
+    ITMTRemoteRepeatOne
+} ITMTRemoteRepeatMode;
+
+enum {
+    ITMTRemoteCustomPreset = -1;
+}
 
 @protocol ITMTRemote
-
 + (id)remote;
-// Return an autoreleased instance of the remote.
-// Should be very quick and compact.
-// EXAMPLE:
-//   + (id)remote
-//   {
-//       return [[[MyRemote alloc] init] autorelease];
-//   }
-
-- (NSString *)title;
-// Return the title of the remote.
-
-- (NSString *)description;
-// Return a short description of the remote.
-
-- (NSImage *)icon;
-// Return a 16x16 icon representation for the remote.
+- (NSString*)informationString:(ITMTRemoteInformationString)string;
+- (NSImage*)icon;
 
 - (BOOL)begin;
-// Sent to the plugin when it should begin operation.
-
 - (BOOL)halt;
-// Sent to the plugin when it should cease operation.
 
-- (NSArray *)sources;
-- (int)currentSourceIndex;
+- (BOOL)supportsControlAction:(ITMTRemoteControlAction)action;
+- (BOOL)sendControlAction:(ITMTRemoteControlAction)action;
+- (ITMTRemoteControlState)controlState;
 
-- (NSArray *)playlistsForCurrentSource;
-- (int)currentPlaylistIndex;
+- (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 *)songTitleAtIndex;
-- (int)currentSongIndex;
+- (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
 
-- (NSString *)currentSongTitle;
-- (NSString *)currentSongArtist;
-- (NSString *)currentSongAlbum;
-- (NSString *)currentSongGenre;
-- (NSString *)currentSongLength;
-- (NSString *)currentSongRemaining;
+- (BOOL)supportsShuffle;
+- (BOOL)setShuffle:(BOOL)toggle;
+- (BOOL)shuffle;
 
-- (NSArray *)eqPresets;
+- (BOOL)supportsRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
+- (BOOL)setRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
+- (BOOL)repeatMode;
 
-- (BOOL)play;
-- (BOOL)pause;
-- (BOOL)goToNextSong;
-- (BOOL)goToPreviousSong;
-- (BOOL)goToNextPlaylist;
-- (BOOL)goToPreviousPlaylist;
+- (BOOL)supportsVolume;
+- (BOOL)setVolume:(float)volume;
+- (float)volume;
 
-- (BOOL)switchToSourceAtIndex:(int)index;
-- (BOOL)switchToPlaylistAtIndex:(int)index;
-- (BOOL)switchToSongAtIndex:(int)index;
-- (BOOL)switchToEQAtIndex:(int)index;
+- (BOOL)supportsCustomEqualizer;
+- (BOOL)showEqualizerWindow;
 
-@end
+- (BOOL)supportsEqualizerPresets;
+- (NSArray*)equalizerPresetNames;
+- (BOOL)switchToEqualizerPreset:(int)index; // ITMTRemoteCustomPreset = Custom
 
+- (BOOL)supportsExternalWindow;
+- (NSString*)externalWindowName;
+- (BOOL)showExternalWindow;
+
+@end
 
 @interface ITMTRemote : NSObject <ITMTRemote>
 
-@end
+@end
\ No newline at end of file