Cog now begins playback and clears the playlist when adding songs.

CQTexperiment
vspader 2008-05-03 15:15:45 +00:00
parent bedc3a2ade
commit 345e57698f
4 changed files with 40 additions and 6 deletions

View File

@ -8,11 +8,11 @@
<string key="IBDocument.HIToolboxVersion">352.00</string> <string key="IBDocument.HIToolboxVersion">352.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="21"/>
<integer value="1063"/>
<integer value="513"/>
<integer value="1324"/> <integer value="1324"/>
<integer value="463"/> <integer value="463"/>
<integer value="1063"/>
<integer value="21"/>
<integer value="513"/>
<integer value="419"/> <integer value="419"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
@ -5859,6 +5859,14 @@ MDA4AA</bytes>
</object> </object>
<int key="connectionID">2119</int> <int key="connectionID">2119</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">playbackController</string>
<reference key="source" ref="362908833"/>
<reference key="destination" ref="936098491"/>
</object>
<int key="connectionID">2120</int>
</object>
</object> </object>
<object class="IBMutableOrderedSet" key="objectRecords"> <object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects"> <object class="NSArray" key="orderedObjects">
@ -8799,7 +8807,7 @@ MDA4AA</bytes>
</object> </object>
</object> </object>
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">2119</int> <int key="maxID">2120</int>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"> <object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions"> <object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -9298,8 +9306,17 @@ MDA4AA</bytes>
<string key="className">PlaylistLoader</string> <string key="className">PlaylistLoader</string>
<string key="superclassName">NSObject</string> <string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets"> <object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">playlistController</string> <bool key="EncodedWithXMLCoder">YES</bool>
<string key="NS.object.0">PlaylistController</string> <object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>playbackController</string>
<string>playlistController</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>PlaybackController</string>
<string>PlaylistController</string>
</object>
</object> </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier"> <object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string> <string key="majorKey">IBProjectSource</string>

View File

@ -9,6 +9,7 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
@class PlaylistController; @class PlaylistController;
@class PlaybackController;
@class PlaylistEntry; @class PlaylistEntry;
typedef enum { typedef enum {
@ -18,6 +19,7 @@ typedef enum {
@interface PlaylistLoader : NSObject { @interface PlaylistLoader : NSObject {
IBOutlet PlaylistController *playlistController; IBOutlet PlaylistController *playlistController;
IBOutlet PlaybackController *playbackController;
} }
//load arrays of urls... //load arrays of urls...

View File

@ -8,6 +8,7 @@
#import "PlaylistLoader.h" #import "PlaylistLoader.h"
#import "PlaylistController.h" #import "PlaylistController.h"
#import "PlaybackController.h"
#import "PlaylistEntry.h" #import "PlaylistEntry.h"
#import "FilePlaylistEntry.h" #import "FilePlaylistEntry.h"
#import "AppController.h" #import "AppController.h"
@ -154,6 +155,12 @@
if (index < 0) if (index < 0)
index = 0; index = 0;
if (1) {
[playlistController clear:self];
index = 0;
}
NSURL *url; NSURL *url;
for (url in urls) for (url in urls)
{ {
@ -274,6 +281,12 @@
//Select the first entry in the group that was just added //Select the first entry in the group that was just added
[playlistController setSelectionIndex:index]; [playlistController setSelectionIndex:index];
[self performSelectorInBackground:@selector(loadInfoForEntries:) withObject:entries]; [self performSelectorInBackground:@selector(loadInfoForEntries:) withObject:entries];
//Auto start playback
if (1) {
[playbackController playEntry: [entries objectAtIndex:0]];
}
} }
- (void)loadInfoForEntries:(NSArray *)entries - (void)loadInfoForEntries:(NSArray *)entries

View File

@ -1,10 +1,12 @@
/* TrackingSlider /* TrackingSlider
This is an ubersimple subclass of NSSlider that This is an ubersimple subclass of NSSlider that
exposes a tracking method on the cell which can exposes a tracking method on the cell which can
be used to tell if the user is currently dragging the slider. 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 This is used in the action of the slider (the slider action is
sent continuously) so the position text label is updated, sent continuously) so the position text label is updated,
without actually seeking the song until the mouse is released. without actually seeking the song until the mouse is released.
*/ */
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>