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>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="21"/>
<integer value="1063"/>
<integer value="513"/>
<integer value="1324"/>
<integer value="463"/>
<integer value="1063"/>
<integer value="21"/>
<integer value="513"/>
<integer value="419"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
@ -5859,6 +5859,14 @@ MDA4AA</bytes>
</object>
<int key="connectionID">2119</int>
</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 class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@ -8799,7 +8807,7 @@ MDA4AA</bytes>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">2119</int>
<int key="maxID">2120</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -9298,8 +9306,17 @@ MDA4AA</bytes>
<string key="className">PlaylistLoader</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">playlistController</string>
<string key="NS.object.0">PlaylistController</string>
<bool key="EncodedWithXMLCoder">YES</bool>
<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 class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>

View File

@ -9,6 +9,7 @@
#import <Cocoa/Cocoa.h>
@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...

View File

@ -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

View File

@ -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 <Cocoa/Cocoa.h>