From 345e57698f99491486972d80e2b59ab08027a31d Mon Sep 17 00:00:00 2001 From: vspader Date: Sat, 3 May 2008 15:15:45 +0000 Subject: [PATCH] Cog now begins playback and clears the playlist when adding songs. --- English.lproj/MainMenu.xib | 29 +++++++++++++++++++++++------ Playlist/PlaylistLoader.h | 2 ++ Playlist/PlaylistLoader.m | 13 +++++++++++++ Utils/TrackingSlider.h | 2 ++ 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index d331788b2..06f44a613 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -8,11 +8,11 @@ 352.00 YES - - - + + + @@ -5859,6 +5859,14 @@ MDA4AA 2119 + + + playbackController + + + + 2120 + @@ -8799,7 +8807,7 @@ MDA4AA - 2119 + 2120 @@ -9298,8 +9306,17 @@ MDA4AA PlaylistLoader NSObject - playlistController - PlaylistController + YES + + YES + playbackController + playlistController + + + YES + PlaybackController + PlaylistController + IBProjectSource diff --git a/Playlist/PlaylistLoader.h b/Playlist/PlaylistLoader.h index b58087dec..853680c9b 100755 --- a/Playlist/PlaylistLoader.h +++ b/Playlist/PlaylistLoader.h @@ -9,6 +9,7 @@ #import @class PlaylistController; +@class PlaybackController; @class PlaylistEntry; typedef enum { @@ -18,6 +19,7 @@ typedef enum { @interface PlaylistLoader : NSObject { IBOutlet PlaylistController *playlistController; + IBOutlet PlaybackController *playbackController; } //load arrays of urls... diff --git a/Playlist/PlaylistLoader.m b/Playlist/PlaylistLoader.m index 797452742..ac07ee937 100755 --- a/Playlist/PlaylistLoader.m +++ b/Playlist/PlaylistLoader.m @@ -8,6 +8,7 @@ #import "PlaylistLoader.h" #import "PlaylistController.h" +#import "PlaybackController.h" #import "PlaylistEntry.h" #import "FilePlaylistEntry.h" #import "AppController.h" @@ -153,7 +154,13 @@ if (index < 0) index = 0; + + if (1) { + [playlistController clear:self]; + index = 0; + } + NSURL *url; for (url in urls) { @@ -274,6 +281,12 @@ //Select the first entry in the group that was just added [playlistController setSelectionIndex:index]; [self performSelectorInBackground:@selector(loadInfoForEntries:) withObject:entries]; + + + //Auto start playback + if (1) { + [playbackController playEntry: [entries objectAtIndex:0]]; + } } - (void)loadInfoForEntries:(NSArray *)entries diff --git a/Utils/TrackingSlider.h b/Utils/TrackingSlider.h index eddaa8ed7..6fe0e2cd7 100644 --- a/Utils/TrackingSlider.h +++ b/Utils/TrackingSlider.h @@ -1,10 +1,12 @@ /* TrackingSlider + This is an ubersimple subclass of NSSlider that exposes a tracking method on the cell which can be used to tell if the user is currently dragging the slider. This is used in the action of the slider (the slider action is sent continuously) so the position text label is updated, without actually seeking the song until the mouse is released. + */ #import