2007-02-24 20:36:27 +00:00
|
|
|
/* PlaybackController */
|
2006-01-20 15:41:31 +00:00
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
#import "CogAudio/AudioPlayer.h"
|
2006-01-20 15:41:31 +00:00
|
|
|
#import "TrackingSlider.h"
|
2007-02-25 02:43:56 +00:00
|
|
|
#import "AudioScrobbler.h"
|
2006-01-20 15:41:31 +00:00
|
|
|
|
2008-02-13 18:03:06 +00:00
|
|
|
#define DEFAULT_VOLUME_DOWN 5
|
|
|
|
#define DEFAULT_VOLUME_UP DEFAULT_VOLUME_DOWN
|
|
|
|
|
2009-03-05 17:03:30 +00:00
|
|
|
extern NSString *CogPlaybackDidBeginNotficiation;
|
|
|
|
extern NSString *CogPlaybackDidPauseNotficiation;
|
|
|
|
extern NSString *CogPlaybackDidResumeNotficiation;
|
|
|
|
extern NSString *CogPlaybackDidStopNotficiation;
|
|
|
|
|
2013-10-02 09:30:04 +00:00
|
|
|
extern NSDictionary * makeRGInfo(PlaylistEntry *pe);
|
2009-03-05 17:03:30 +00:00
|
|
|
|
2007-03-14 02:28:30 +00:00
|
|
|
@class PlaylistController;
|
2006-01-20 15:41:31 +00:00
|
|
|
@class PlaylistView;
|
2013-10-07 23:15:15 +00:00
|
|
|
@class PlaylistLoader;
|
2006-01-20 15:41:31 +00:00
|
|
|
|
2009-03-05 17:03:30 +00:00
|
|
|
@interface PlaybackController : NSObject
|
2006-01-20 15:41:31 +00:00
|
|
|
{
|
|
|
|
IBOutlet PlaylistController *playlistController;
|
|
|
|
IBOutlet PlaylistView *playlistView;
|
2013-10-07 23:15:15 +00:00
|
|
|
IBOutlet PlaylistLoader *playlistLoader;
|
2006-01-20 15:41:31 +00:00
|
|
|
|
2006-05-13 13:37:32 +00:00
|
|
|
IBOutlet NSSlider *volumeSlider;
|
2006-01-20 15:41:31 +00:00
|
|
|
|
2007-02-20 01:02:23 +00:00
|
|
|
IBOutlet NSArrayController *outputDevices;
|
|
|
|
|
2006-04-02 15:44:08 +00:00
|
|
|
NSTimer *positionTimer;
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
AudioPlayer *audioPlayer;
|
2006-01-20 15:41:31 +00:00
|
|
|
|
|
|
|
int playbackStatus;
|
2009-02-22 22:28:09 +00:00
|
|
|
double position;
|
|
|
|
BOOL seekable;
|
2009-02-28 21:19:26 +00:00
|
|
|
BOOL fading;
|
2006-01-20 15:41:31 +00:00
|
|
|
}
|
|
|
|
|
2008-02-23 22:20:14 +00:00
|
|
|
@property int playbackStatus;
|
|
|
|
|
2006-01-20 15:41:31 +00:00
|
|
|
- (IBAction)changeVolume:(id)sender;
|
2008-02-17 18:44:11 +00:00
|
|
|
- (IBAction)volumeDown:(id)sender;
|
|
|
|
- (IBAction)volumeUp:(id)sender;
|
2006-01-20 15:41:31 +00:00
|
|
|
|
|
|
|
- (IBAction)playPauseResume:(id)sender;
|
|
|
|
- (IBAction)pauseResume:(id)sender;
|
2008-02-14 19:25:01 +00:00
|
|
|
- (IBAction)skipToNextAlbum:(id)sender;
|
|
|
|
- (IBAction)skipToPreviousAlbum:(id)sender;
|
2007-11-01 01:53:52 +00:00
|
|
|
|
2006-01-20 15:41:31 +00:00
|
|
|
- (IBAction)play:(id)sender;
|
|
|
|
- (IBAction)pause:(id)sender;
|
|
|
|
- (IBAction)resume:(id)sender;
|
|
|
|
- (IBAction)stop:(id)sender;
|
|
|
|
|
|
|
|
- (IBAction)next:(id)sender;
|
|
|
|
- (IBAction)prev:(id)sender;
|
|
|
|
- (IBAction)seek:(id)sender;
|
2008-02-13 18:03:06 +00:00
|
|
|
- (IBAction)eventSeekForward:(id)sender;
|
|
|
|
- (void)seekForward:(double)sender;
|
|
|
|
- (IBAction)eventSeekBackward:(id)sender;
|
|
|
|
- (void)seekBackward:(double)amount;
|
2008-02-23 22:20:14 +00:00
|
|
|
- (IBAction)fade:(id)sender;
|
2006-01-20 15:41:31 +00:00
|
|
|
|
2013-10-04 11:16:09 +00:00
|
|
|
- (IBAction)spam;
|
|
|
|
|
2007-02-26 05:26:48 +00:00
|
|
|
- (void)initDefaults;
|
2008-02-16 16:30:18 +00:00
|
|
|
- (void)audioFadeDown:(NSTimer *)audioTimer;
|
|
|
|
- (void)audioFadeUp:(NSTimer *)audioTimer;
|
2006-01-20 15:41:31 +00:00
|
|
|
|
|
|
|
- (void)playEntryAtIndex:(int)i;
|
2013-10-13 02:16:47 +00:00
|
|
|
- (void)playEntryAtIndex:(int)i startPaused:(BOOL)paused;
|
2006-01-20 15:41:31 +00:00
|
|
|
- (void)playEntry:(PlaylistEntry *)pe;
|
2013-10-13 02:16:47 +00:00
|
|
|
- (void)playEntry:(PlaylistEntry *)pe startPaused:(BOOL)paused;
|
2006-01-20 15:41:31 +00:00
|
|
|
|
2009-02-28 18:57:21 +00:00
|
|
|
// Playlist notifications
|
|
|
|
- (void)playlistDidChange:(PlaylistController *)p;
|
|
|
|
|
2009-02-22 22:28:09 +00:00
|
|
|
// For bindings
|
|
|
|
|
|
|
|
- (void)setPosition:(double)p;
|
|
|
|
- (double)position;
|
|
|
|
|
|
|
|
- (void)setSeekable:(BOOL)s;
|
|
|
|
- (BOOL)seekable;
|
|
|
|
|
2006-01-20 15:41:31 +00:00
|
|
|
@end
|