Permalink
Browse files

Update Rdio.framework to be iPhone 5 compatible.

  • Loading branch information...
1 parent a5c70aa commit 718eacc63a5ccb693be432ba917558fb7bcb034a R. Kevin Nelson committed Mar 30, 2013
@@ -36,8 +36,10 @@
////////////////////////////////////////////////////////////////////////////////
/**
- * A helper object implementing the <RDAPIRequestDelegate> protocol, used to direct
- * the load and fail calls to specific selectors.
+ * A helper object implementing the
+ * \ref RDAPIRequestDelegate-p "&lt;RDAPIRequestDelegate&gt;" protocol, used to
+ * direct the load and fail calls to specific selectors.
+ *
* This class is useful if you want to make multiple requests from within
* a single object.
*
@@ -68,7 +70,7 @@
*
* @param target The object to which the given selectors should be applied
* @param load A selector like rdioRequest:didLoadData: to be called when load completes
- * @param load A selector like rdioRequest:didFailWithError: to be called when load completes
+ * @param fail A selector like rdioRequest:didFailWithError: to be called when load completes
*/
+ (id)delegateToTarget:(id)target loadedAction:(SEL)load failedAction:(SEL)fail;
@@ -96,7 +98,7 @@
@class RD_OAToken;
/**
- * A request to the Rdio Web Service API. See [Rdio callAPIMethod]
+ * A request to the Rdio Web Service API. See Rdio::callAPIMethod:withParameters:delegate:
*/
@interface RDAPIRequest : NSObject {
id<RDAPIRequestDelegate> delegate_;
@@ -107,8 +109,11 @@
RD_OAToken *token_;
int numRetries_;
}
-// Coming soon:
-// - (void)cancel;
+
+/**
+ * Cancels the Rdio API request
+ */
+ - (void)cancel;
/**
* The parameter dictionary passed to the request. Includes a "method" value
@@ -36,6 +36,16 @@ typedef enum {
* Notification that the player has changed states. See <code>RDPlayerState</code>.
*/
-(void)rdioPlayerChangedFromState:(RDPlayerState)oldState toState:(RDPlayerState)newState;
+
+/**
+ * Notification that the play queue has been updated.
+ *
+ * For example, when new tracks are added using the queueSource and queueSources
+ * methods.
+ */
+@optional
+-(void)rdioPlayerQueueDidChange;
+
@end
////////////////////////////////////////////////////////////////////////////////
@@ -48,8 +58,10 @@ typedef enum {
* Responsible for playback. Handles playing and enqueueing track sources,
* advancing to the next track, logging plays with the server, etc.
*
- * For now only track keys are supported, but future versions will accept
- * album and playlist keys or dictionary objects.
+ * To observe track changes, position changes, etc., use KVO. For example:
+ * \code
+ * [player addObserver:self forKeyPath:@"currentTrack" options:NSKeyValueObservingOptionNew context:nil];
+ * \endcode
*/
@interface RDPlayer : NSObject {
@private
@@ -83,44 +95,64 @@ typedef enum {
}
/**
- * Starts playing a track key, such as "t1232".
+ * Starts playing a source key, such as "t1232".
+ *
+ * Supported source keys include tracks, albums, playlists, and artist stations.
+ *
* Track keys can be found by calling web service API methods.
* Objects such as Album contain a 'trackKeys' property.
+ *
+ * @param sourceKey a source key such as "t1232"
*/
-(void)playSource:(NSString *)sourceKey;
/**
* Play through a list of track keys, pre-buffering and automatically advancing
* between songs.
*
- * Note: full queue support coming soon.
+ * Supported source keys include tracks, albums, playlists, and artist stations.
+ *
+ * @param sourceKeys list of source keys
*/
-(void)playSources:(NSArray *)sourceKeys;
/**
- * Advances to the next track in the trackKeys array.
- * This method only works within the array passed to the <code>playSources:</code> method.
+ * Advances to the next track in the \ref RDPlayer::trackKeys "trackKeys" array.
+ * This method only works within the array passed to the RDPlayer::playSources: method.
*/
-(void)next;
/**
- * Play the previous track in the trackKeys array.
+ * Play the previous track in the \ref RDPlayer::trackKeys "trackKeys" array.
* This method only works within a list passed to the <code>playSources:</code> method.
*/
-(void)previous;
/**
* Continues playing the current track
+ *
+ * This is the same as calling RDPlayer::playAndRestart:YES
*/
- (void)play;
+/**
+ * Continues playing the current track with an option to restart the track if
+ * it's already playing
+ *
+ * If the player is already playing, setting shouldRestart to YES will restart
+ * the track from the begining.
+ *
+ * @param shouldRestart if the player should restart the currently playing track
+ */
+- (void)playAndRestart:(BOOL)shouldRestart;
+
/**
* Toggles paused state.
*/
- (void)togglePause;
/**
- * Stops playback and release resources.
+ * Stops playback and releases resources.
*/
- (void)stop;
@@ -130,6 +162,40 @@ typedef enum {
*/
- (void)seekToPosition:(double)positionInSeconds;
+/**
+ * Add a source key to the end of the existing play queue
+ *
+ * Supported source keys include tracks, albums, playlists, and artist stations.
+ *
+ * @param sourceKey A source key, such as "t1232"
+ */
+- (void)queueSource:(NSString*)sourceKey;
+
+/**
+ * Add the list of source keys to the end of the existing play queue
+ *
+ * Supported source keys include tracks, albums, playlists, and artist stations.
+ *
+ * @param sourceKeys List of source keys, such as "t1232"
+ */
+- (void)queueSources:(NSArray*)sourceKeys;
+
+/**
+ * Replace the play queue with a different list of track keys.
+ *
+ * This method replaces the entire play queue much like RDPlayer::playSources:.
+ * Unlike RDPlayer::playSources:, this method does not stop playback of the
+ * current track.
+ *
+ * If the index does not point at the currently playing track, the method will
+ * not update the queue and will return NO.
+ *
+ * @param sourceKeys List of track keys, such as "t1232"
+ * @param index Index of the currently playing track
+ * @return NO if the queue was not updated
+ */
+- (BOOL)updateQueue:(NSArray*)sourceKeys withCurrentTrackIndex:(int)index;
+
/**
* Current playback state.
*/
@@ -151,12 +217,12 @@ typedef enum {
@property (nonatomic, readonly) NSString *currentTrack;
/**
- * Index in the trackKeys array that is currently playing.
+ * Index in the \ref RDPlayer::trackKeys "trackKeys" array that is currently playing.
*/
@property (nonatomic, readonly) int currentTrackIndex;
/**
- * List of keys passed to playSources:
+ * List of track keys that represents the play queue
*/
@property (nonatomic, readonly) NSArray *trackKeys;
View
Binary file not shown.
@@ -36,8 +36,10 @@
////////////////////////////////////////////////////////////////////////////////
/**
- * A helper object implementing the <RDAPIRequestDelegate> protocol, used to direct
- * the load and fail calls to specific selectors.
+ * A helper object implementing the
+ * \ref RDAPIRequestDelegate-p "&lt;RDAPIRequestDelegate&gt;" protocol, used to
+ * direct the load and fail calls to specific selectors.
+ *
* This class is useful if you want to make multiple requests from within
* a single object.
*
@@ -68,7 +70,7 @@
*
* @param target The object to which the given selectors should be applied
* @param load A selector like rdioRequest:didLoadData: to be called when load completes
- * @param load A selector like rdioRequest:didFailWithError: to be called when load completes
+ * @param fail A selector like rdioRequest:didFailWithError: to be called when load completes
*/
+ (id)delegateToTarget:(id)target loadedAction:(SEL)load failedAction:(SEL)fail;
@@ -96,7 +98,7 @@
@class RD_OAToken;
/**
- * A request to the Rdio Web Service API. See [Rdio callAPIMethod]
+ * A request to the Rdio Web Service API. See Rdio::callAPIMethod:withParameters:delegate:
*/
@interface RDAPIRequest : NSObject {
id<RDAPIRequestDelegate> delegate_;
@@ -107,8 +109,11 @@
RD_OAToken *token_;
int numRetries_;
}
-// Coming soon:
-// - (void)cancel;
+
+/**
+ * Cancels the Rdio API request
+ */
+ - (void)cancel;
/**
* The parameter dictionary passed to the request. Includes a "method" value
Oops, something went wrong.

0 comments on commit 718eacc

Please sign in to comment.