/*
- * 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.
- *
- */
+ 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>
-/*
- * TO DO:
- *
- * - Capability methods
- *
- */
+typedef enum {
+ ITMTRemoteName,
+ ITMTRemoteVersion,
+ ITMTRemotePublisher,
+ ITMTRemoteCopyright,
+ ITMTRemoteDescription
+} ITMTRemoteInformationString;
-/*! @header ITMTRemote
- * @abstract Declares the necessary protocol and class to implement a MenuTunes Remote.
- */
+typedef enum {
+ ITMTRemotePlayerStopped = -1,
+ ITMTRemotePlayerPaused,
+ ITMTRemotePlayerPlaying,
+ ITMTRemotePlayerRewinding,
+ ITMTRemotePlayerForwarding
+} ITMTRemoteControlState;
-#import <Cocoa/Cocoa.h>
+typedef enum {
+ ITMTRemoteStop = -1,
+ ITMTRemotePause,
+ ITMTRemotePlay,
+ ITMTRemoteRewind,
+ ITMTRemoteFastForward,
+ ITMTRemotePreviousTrack,
+ ITMTRemoteNextTrack
+} ITMTRemoteControlAction;
typedef enum {
- stopped = -1,
- paused,
- playing,
- rewinding,
- forwarding
-} PlayerState;
-
-/*! @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.
- */
-@protocol ITMTRemote
+ 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;
+}
-/*! @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.
- */
+@protocol ITMTRemote
+ (id)remote;
+- (NSString*)informationString:(ITMTRemoteInformationString)string;
+- (NSImage*)icon;
-/*! @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;
-- (BOOL)isAppRunning;
-- (PlayerState)playerState;
+- (BOOL)supportsControlAction:(ITMTRemoteControlAction)action;
+- (BOOL)sendControlAction:(ITMTRemoteControlAction)action;
+- (ITMTRemoteControlState)controlState;
-- (NSArray *)playlists;
-- (int)numberOfSongsInPlaylistAtIndex:(int)index;
-- (NSString *)classOfPlaylistAtIndex:(int)index;
-- (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)index;
-- (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;
-- (int)currentSongRating;
-- (BOOL)setCurrentSongRating:(int)rating;
+- (BOOL)supportsRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
+- (BOOL)setRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
+- (BOOL)repeatMode;
-- (NSArray *)eqPresets;
-- (int)currentEQPresetIndex;
+- (BOOL)supportsVolume;
+- (BOOL)setVolume:(float)volume;
+- (float)volume;
-- (BOOL)play;
-- (BOOL)pause;
-- (BOOL)goToNextSong;
-- (BOOL)goToPreviousSong;
-- (BOOL)fastForward;
-- (BOOL)rewind;
+- (BOOL)supportsCustomEqualizer;
+- (BOOL)showEqualizerWindow;
-- (BOOL)switchToPlaylistAtIndex:(int)index;
-- (BOOL)switchToSongAtIndex:(int)index;
-- (BOOL)switchToEQAtIndex:(int)index;
+- (BOOL)supportsEqualizerPresets;
+- (NSArray*)equalizerPresetNames;
+- (BOOL)switchToEqualizerPreset:(int)index; // ITMTRemoteCustomPreset = Custom
-@end
+- (BOOL)supportsExternalWindow;
+- (NSString*)externalWindowName;
+- (BOOL)showExternalWindow;
+@end
@interface ITMTRemote : NSObject <ITMTRemote>
-@end
+@end
\ No newline at end of file