/*
- * 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
- *
- */
-
-/*! @header ITMTRemote
- * @abstract Declares the necessary protocol and class to implement a MenuTunes Remote.
- */
-
-#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 {
- ITMTRemotePlayerNotRunning = -1,
- ITMTRemotePlayerLaunching,
- ITMTRemotePlayerRunning
-} ITMTRemotePlayerRunningStatus;
+ ITMTRemoteName,
+ ITMTRemoteVersion,
+ ITMTRemotePublisher,
+ ITMTRemoteCopyright,
+ ITMTRemoteDescription
+} ITMTRemoteInformationString;
typedef enum {
ITMTRemotePlayerStopped = -1,
ITMTRemotePlayerPlaying,
ITMTRemotePlayerRewinding,
ITMTRemotePlayerForwarding
-} ITMTRemotePlayerState;
-
-/*! @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
+} ITMTRemoteControlState;
+typedef enum {
+ ITMTRemoteStop = -1,
+ ITMTRemotePause,
+ ITMTRemotePlay,
+ ITMTRemoteRewind,
+ ITMTRemoteFastForward,
+ ITMTRemotePreviousTrack,
+ ITMTRemoteNextTrack
+} ITMTRemoteControlAction;
-/*! @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.
- */
-+ (id)remote;
-
-/*! @method pluginTitle:
- * @abstract Returns the title of the plugin, which should be player name.
- * @result An NSString containing the title.
- */
-- (NSString *)pluginTitle;
-
-/*! @method pluginInformation:
- * @abstract Returns a description of the remote.
- * @result An NSString containing the description.
- */
-- (NSString *)pluginInformation;
-
-/*! @method pluginIcon:
- * @abstract Returns a icon for the remote.
- * @result An NSImage containing the icon.
- */
-- (NSImage *)pluginIcon;
-
-/*! @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;
+typedef enum {
+ ITMTRemoteSinglePlaylist,
+ ITMTRemoteLibraryAndPlaylists,
+ ITMTRemoteSeperatePlaylists
+} ITMTRemotePlaylistMode;
-- (NSString *)playerFullName;
+typedef enum {
+ ITMTRemoteTrackName,
+ ITMTRemoteTrackArtist,
+ ITMTRemoteTrackAlbum,
+ ITMTRemoteTrackComposer,
+ ITMTRemoteTrackNumber,
+ ITMTRemoteTrackTotal,
+ ITMTRemoteTrackComment,
+ ITMTRemoteTrackGenre,
+ ITMTRemoteTrackYear,
+ ITMTRemoteTrackRating,
+ ITMTRemoteTrackArt
+} ITMTRemoteTrackProperty;
-- (NSString *)playerSimpleName;
+typedef enum {
+ ITMTRemoteRepeatNone,
+ ITMTRemoteRepeatAll,
+ ITMTRemoteRepeatOne
+} ITMTRemoteRepeatMode;
-/*! @method playerRunningStatus:
- * @abstract Returns controlled application's running status (is or isn't running).
- * @result BOOL of the controlled application's running status.
- */
-- (ITMTRemotePlayerRunningStatus)playerRunningStatus;
+enum {
+ ITMTRemoteCustomPreset = -1;
+}
-/*! @method playerState:
- * @abstract Returns controlled application's playing state.
- * @result ITMTRemotePlayerState of the controlled application's playing state.
- */
-- (ITMTRemotePlayerState)playerState;
+@protocol ITMTRemote
++ (id)remote;
+- (NSString*)informationString:(ITMTRemoteInformationString)string;
+- (NSImage*)icon;
-- (NSArray *)playlists;
-- (int)numberOfSongsInPlaylistAtIndex:(int)index;
-- (NSString *)classOfPlaylistAtIndex:(int)index;
-- (int)currentPlaylistIndex;
+- (BOOL)begin;
+- (BOOL)halt;
-- (NSString *)songTitleAtIndex:(int)index;
-- (int)currentSongIndex;
+- (BOOL)supportsControlAction:(ITMTRemoteControlAction)action;
+- (BOOL)sendControlAction:(ITMTRemoteControlAction)action;
+- (ITMTRemoteControlState)controlState;
-- (NSString *)currentSongTitle;
-- (NSString *)currentSongArtist;
-- (NSString *)currentSongAlbum;
-- (NSString *)currentSongGenre;
-- (NSString *)currentSongLength;
-- (NSString *)currentSongRemaining;
+- (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;
-- (float)currentSongRating;
-- (BOOL)setCurrentSongRating:(float)rating;
+- (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)equalizerEnabled;
-- (BOOL)setEqualizerEnabled:(BOOL)enabled;
+- (BOOL)supportsShuffle;
+- (BOOL)setShuffle:(BOOL)toggle;
+- (BOOL)shuffle;
-- (NSArray *)eqPresets;
-- (int)currentEQPresetIndex;
+- (BOOL)supportsRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
+- (BOOL)setRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
+- (BOOL)repeatMode;
-- (float)volume;
+- (BOOL)supportsVolume;
- (BOOL)setVolume:(float)volume;
+- (float)volume;
-- (BOOL)play;
-- (BOOL)pause;
-- (BOOL)goToNextSong;
-- (BOOL)goToPreviousSong;
-- (BOOL)forward;
-- (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