From 142456f7922d7d2a5762edc6db51558dbb7e1294 Mon Sep 17 00:00:00 2001 From: Joseph Spiros Date: Sun, 7 Sep 2003 17:59:53 +0000 Subject: [PATCH] ITMTRemote now builds, but working on the API still, some things still need to be added. --- ITMTEqualizer.h | 40 --------- ITMTEqualizer.m | 6 -- ITMTPlayer.h | 87 -------------------- ITMTPlayer.m | 6 -- ITMTPlaylist.h | 46 ----------- ITMTPlaylist.m | 6 -- ITMTRemote.h | 211 +++++++++++++++++++++++++++++++++++------------- ITMTRemote.m | 3 +- ITMTTrack.h | 31 ------- ITMTTrack.m | 6 -- 10 files changed, 155 insertions(+), 287 deletions(-) delete mode 100755 ITMTEqualizer.h delete mode 100755 ITMTEqualizer.m delete mode 100755 ITMTPlayer.h delete mode 100755 ITMTPlayer.m delete mode 100755 ITMTPlaylist.h delete mode 100755 ITMTPlaylist.m delete mode 100755 ITMTTrack.h delete mode 100755 ITMTTrack.m diff --git a/ITMTEqualizer.h b/ITMTEqualizer.h deleted file mode 100755 index 909c61d..0000000 --- a/ITMTEqualizer.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************** - ITMTRemote 1.0 (MenuTunes Remotes) - ITMTEqualizer.h - - Responsibility: - Joseph Spiros - - Copyright (c) 2002 - 2003 by iThink Software. - All Rights Reserved. -****************************************/ - -#import - -#import - -typedef enum { - ITMT32HzEqualizerBandLevel, - ITMT64HzEqualizerBandLevel, - ITMT125HzEqualizerBandLevel, - ITMT250HzEqualizerBandLevel, - ITMT500HzEqualizerBandLevel, - ITMT1kHzEqualizerBandLevel, - ITMT2kHzEqualizerBandLevel, - ITMT4kHzEqualizerBandLevel, - ITMT8kHzEqualizerBandLevel, - ITMT16kHzEqualizerBandLevel, - ITMTEqualizerPreampLevel -} ITMTEqualizerLevel; - -@protocol ITMTEqualizer -- (BOOL)writable; - -- (ITMTPlayer *)player; - -- (float)dBForLevel:(ITMTEqualizerLevel)level; -- (BOOL)setdB:(float)dB forLevel:(ITMTEqualizerLevel)level; -@end - -@interface ITMTEqualizer : NSObject -@end diff --git a/ITMTEqualizer.m b/ITMTEqualizer.m deleted file mode 100755 index b08dce2..0000000 --- a/ITMTEqualizer.m +++ /dev/null @@ -1,6 +0,0 @@ -/* Copyright (c) 2002 - 2003 by iThink Software. All Rights Reserved. */ - -#import "ITMTEqualizer.h" - -@implementation ITMTEqualizer -@end diff --git a/ITMTPlayer.h b/ITMTPlayer.h deleted file mode 100755 index 8ae8343..0000000 --- a/ITMTPlayer.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************** - ITMTRemote 1.0 (MenuTunes Remotes) - ITMTPlayer.h - - Responsibility: - Joseph Spiros - - Copyright (c) 2002 - 2003 by iThink Software. - All Rights Reserved. -****************************************/ - -#import - -#import - -/*! - @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 -/*! - @method writable -*/ -- (BOOL)writable; - -/*! - @method show -*/ -- (BOOL)show; - -/*! - @method setValue:forProperty: -*/ -- (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property; -/*! - @method valueOfProperty: -*/ -- (id)valueOfProperty:(ITMTGenericProperty)property; -/*! - @method propertiesAndValues -*/ -- (NSDictionary *)propertiesAndValues; - -/*! - @method remote -*/ -- (ITMTRemote *)remote; - -/*! - @method currentPlaylist -*/ -- (ITMTPlaylist *)currentPlaylist; -/*! - @method currentTrack -*/ -- (ITMTTrack *)currentTrack; -/*! - @method currentEqualizer -*/ -- (ITMTEqualizer *)currentEqualizer; - -/*! - @method playlists -*/ -- (NSArray *)playlists; - -/*! - @method tracks -*/ -- (NSArray *)tracks; -/*! - @method libraryPlaylist -*/ -- (ITMTPlaylist *)libraryPlaylist; - -/*! - @method equalizers -*/ -- (NSArray *)equalizers; -@end - -/*! - @class ITMTPlayer -*/ -@interface ITMTPlayer : NSObject -@end diff --git a/ITMTPlayer.m b/ITMTPlayer.m deleted file mode 100755 index c92715f..0000000 --- a/ITMTPlayer.m +++ /dev/null @@ -1,6 +0,0 @@ -/* Copyright (c) 2002 - 2003 by iThink Software. All Rights Reserved. */ - -#import "ITMTPlayer.h" - -@implementation ITMTPlayer -@end diff --git a/ITMTPlaylist.h b/ITMTPlaylist.h deleted file mode 100755 index 01a3f53..0000000 --- a/ITMTPlaylist.h +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************** - ITMTRemote 1.0 (MenuTunes Remotes) - ITMTPlaylist.h - - Responsibility: - Joseph Spiros - - Copyright (c) 2002 - 2003 by iThink Software. - All Rights Reserved. -****************************************/ - -#import - -#import - -@protocol ITMTPlaylist -- (BOOL)writable; - -- (BOOL)show; // graphical - -- (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 *)trackArray; -@end - -@interface ITMTPlaylist : NSObject -@end diff --git a/ITMTPlaylist.m b/ITMTPlaylist.m deleted file mode 100755 index 5665229..0000000 --- a/ITMTPlaylist.m +++ /dev/null @@ -1,6 +0,0 @@ -/* Copyright (c) 2002 - 2003 by iThink Software. All Rights Reserved. */ - -#import "ITMTPlaylist.h" - -@implementation ITMTPlaylist -@end diff --git a/ITMTRemote.h b/ITMTRemote.h index aedbc4d..50c0df1 100755 --- a/ITMTRemote.h +++ b/ITMTRemote.h @@ -11,29 +11,11 @@ #import -#import -#import -#import -#import - -/*! - @typedef ITMTGenericProperty - @constant ITMTNameProperty The object's human readable name. - @constant ITMTImageProperty An image that can be associated with the object. -*/ typedef enum { ITMTNameProperty, ITMTImageProperty } ITMTGenericProperty; -/*! - @typedef ITMTRemoteProperty - @constant ITMTRemoteNameProperty - @constant ITMTRemoteImageProperty - @constant ITMTRemoteAuthorProperty - @constant ITMTRemoteDescriptionProperty - @constant ITMTRemoteURLProperty - @constant ITMTRemoteCopyrightProperty -*/ + typedef enum { ITMTRemoteNameProperty, ITMTRemoteImageProperty, @@ -43,7 +25,24 @@ typedef enum { ITMTRemoteCopyrightProperty, ITMTRemoteActivationStringProperty, ITMTRemoteDeactivationStringProperty -} ITMTRemoteProperty +} ITMTRemoteProperty; + +typedef enum { + 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. @@ -56,58 +55,156 @@ typedef enum { ITMTSinglePlayerSinglePlaylistStyle } ITMTPlayerStyle; -/*! - @protocol ITMTRemote - @abstract The ITMTRemote protocol is the protocol that all MenuTunes remotes' primary class must implement. -*/ +typedef enum { + ITMT32HzEqualizerBandLevel, + ITMT64HzEqualizerBandLevel, + ITMT125HzEqualizerBandLevel, + ITMT250HzEqualizerBandLevel, + ITMT500HzEqualizerBandLevel, + ITMT1kHzEqualizerBandLevel, + ITMT2kHzEqualizerBandLevel, + ITMT4kHzEqualizerBandLevel, + ITMT8kHzEqualizerBandLevel, + ITMT16kHzEqualizerBandLevel, + ITMTEqualizerPreampLevel +} ITMTEqualizerLevel; + +typedef enum { + ITMTTrackStopped = -1, + ITMTTrackPaused, + ITMTTrackPlaying, + ITMTTrackForwarding, + ITMTTrackRewinding +} ITMTTrackState; + +@class ITMTRemote, ITMTPlayer, ITMTPlaylist, ITMTTrack, ITMTEqualizer; + @protocol ITMTRemote -/*! - @method remote - @result Returns an autoreleased instance of the remote. -*/ + (id)remote; -/*! - @method valueOfProperty: -*/ - (id)valueOfProperty:(ITMTRemoteProperty)property; -/*! - @method propertiesAndValues -*/ - (NSDictionary *)propertiesAndValues; -/*! - @method playerStyle - @result An ITMTPlayerStyle defining how the remote works with players and playlists. -*/ - (ITMTPlayerStyle)playerStyle; -/*! - @method activate - @result A BOOL indicating success or failure. -*/ - (BOOL)activate; -/*! - @method deactivate - @result A BOOL indicating success or failure. -*/ - (BOOL)deactivate; -/*! - @method currentPlayer - @result An ITMTPlayer object representing the currently active player that the remote is controlling. -*/ -- (ITMTPlayer *)currentPlayer -/*! - @method players - @result An NSArray filled with ITMTPlayer objects. -*/ +- (ITMTPlayer *)currentPlayer; +- (BOOL)selectPlayer:(ITMTPlayer *)player; - (NSArray *)players; @end +@interface ITMTRemote : NSObject +@end + /*! - @class ITMTRemote + @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. */ -@interface ITMTRemote : NSObject +@protocol ITMTPlayer +- (BOOL)writable; + +- (BOOL)show; + +- (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property; +- (id)valueOfProperty:(ITMTGenericProperty)property; +- (NSDictionary *)propertiesAndValues; + +- (ITMTRemote *)remote; + +- (ITMTPlaylist *)currentPlaylist; +- (BOOL)selectPlaylist:(ITMTPlaylist *)playlist; +- (ITMTTrack *)currentTrack; +- (BOOL)selectTrack:(ITMTTrack *)track; +- (ITMTEqualizer *)currentEqualizer; +- (BOOL)selectEqualizer:(ITMTEqualizer *)equalizer; + +- (NSArray *)playlists; + +- (NSArray *)tracks; +- (ITMTPlaylist *)libraryPlaylist; + +- (NSArray *)equalizers; +@end + +@interface ITMTPlayer : NSObject +@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 +@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 diff --git a/ITMTRemote.m b/ITMTRemote.m index 8284318..f67ab66 100755 --- a/ITMTRemote.m +++ b/ITMTRemote.m @@ -2,5 +2,4 @@ #import "ITMTRemote.h" -@implementation ITMTRemote -@end +// Put Implementations of Default Classes Here Soon! diff --git a/ITMTTrack.h b/ITMTTrack.h deleted file mode 100755 index 4f45307..0000000 --- a/ITMTTrack.h +++ /dev/null @@ -1,31 +0,0 @@ -/**************************************** - ITMTRemote 1.0 (MenuTunes Remotes) - ITMTTrack.h - - Responsibility: - Joseph Spiros - - Copyright (c) 2002 - 2003 by iThink Software. - All Rights Reserved. -****************************************/ - -#import - -#import - -@protocol ITMTTrack -- (BOOL)writable; - -- (BOOL)addToPlaylist:(ITMTPlaylist *)playlist; -- (BOOL)addToPlaylist:(ITMTPlaylist *)playlist atIndex:(int)index; - -- (ITMTPlayer *)player; -- (NSArray *)playlists; - -- (BOOL)setValue:(id)value forProperty:(ITMTTrackProperty)property; // setting nil as value removes value completely -- (id)valueOfProperty:(ITMTTrackProperty)property; -- (NSDictionary *)propertiesAndValues; -@end - -@interface ITMTTrack : NSObject -@end \ No newline at end of file diff --git a/ITMTTrack.m b/ITMTTrack.m deleted file mode 100755 index b8063fb..0000000 --- a/ITMTTrack.m +++ /dev/null @@ -1,6 +0,0 @@ -/* Copyright (c) 2002 - 2003 by iThink Software. All Rights Reserved. */ - -#import "ITMTTrack.h" - -@implementation ITMTTrack -@end -- 2.20.1