2007-02-24 17:36:27 -03:00
|
|
|
/* PlaybackController */
|
2006-01-20 12:41:31 -03:00
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
#import "AppController.h"
|
|
|
|
#import "AudioScrobbler.h"
|
2007-02-24 17:36:27 -03:00
|
|
|
#import "CogAudio/AudioPlayer.h"
|
2021-02-06 18:20:03 -03:00
|
|
|
#import "CogAudio/Status.h"
|
2006-01-20 12:41:31 -03:00
|
|
|
#import "TrackingSlider.h"
|
2022-01-16 12:32:47 -03:00
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
#import <AVFoundation/AVFoundation.h>
|
2022-01-16 12:32:47 -03:00
|
|
|
#import <AudioToolbox/AudioToolbox.h>
|
|
|
|
#import <AudioUnit/AudioUnit.h>
|
|
|
|
#import <CoreAudio/CoreAudioTypes.h>
|
|
|
|
|
2022-02-13 16:05:32 -03:00
|
|
|
#import "EqualizerWindowController.h"
|
2006-01-20 12:41:31 -03:00
|
|
|
|
2008-02-13 15:03:06 -03:00
|
|
|
#define DEFAULT_VOLUME_DOWN 5
|
|
|
|
#define DEFAULT_VOLUME_UP DEFAULT_VOLUME_DOWN
|
|
|
|
|
2009-03-05 14:03:30 -03:00
|
|
|
extern NSString *CogPlaybackDidBeginNotficiation;
|
|
|
|
extern NSString *CogPlaybackDidPauseNotficiation;
|
|
|
|
extern NSString *CogPlaybackDidResumeNotficiation;
|
|
|
|
extern NSString *CogPlaybackDidStopNotficiation;
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
extern NSDictionary *makeRGInfo(PlaylistEntry *pe);
|
2009-03-05 14:03:30 -03:00
|
|
|
|
2007-03-13 22:28:30 -04:00
|
|
|
@class PlaylistController;
|
2006-01-20 12:41:31 -03:00
|
|
|
@class PlaylistView;
|
2013-10-07 20:15:15 -03:00
|
|
|
@class PlaylistLoader;
|
2006-01-20 12:41:31 -03:00
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
@interface PlaybackController : NSObject {
|
|
|
|
IBOutlet AppController *appController;
|
|
|
|
|
|
|
|
IBOutlet PlaylistController *playlistController;
|
2006-01-20 12:41:31 -03:00
|
|
|
IBOutlet PlaylistView *playlistView;
|
2013-10-07 20:15:15 -03:00
|
|
|
IBOutlet PlaylistLoader *playlistLoader;
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2022-02-13 16:05:32 -03:00
|
|
|
IBOutlet EqualizerWindowController *equalizerWindowController;
|
|
|
|
|
2006-05-13 09:37:32 -04:00
|
|
|
IBOutlet NSSlider *volumeSlider;
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2007-02-19 22:02:23 -03:00
|
|
|
IBOutlet NSArrayController *outputDevices;
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2006-04-02 11:44:08 -04:00
|
|
|
NSTimer *positionTimer;
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2007-02-24 17:36:27 -03:00
|
|
|
AudioPlayer *audioPlayer;
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2021-02-06 18:20:03 -03:00
|
|
|
CogStatus playbackStatus;
|
2009-02-22 19:28:09 -03:00
|
|
|
double position;
|
2022-02-07 02:49:27 -03:00
|
|
|
double lastPosition;
|
2009-02-22 19:28:09 -03:00
|
|
|
BOOL seekable;
|
2009-02-28 18:19:26 -03:00
|
|
|
BOOL fading;
|
2022-02-07 02:49:27 -03:00
|
|
|
|
|
|
|
// progress bar display
|
[Job Queue] Overhauled long action handling
Long actions, such as file opening, playlist loading, metadata loading
and refreshing, etc, are now handled through NSProgress. Additionally,
a new status bar change displays the progress of the task instead of
the total duration of the playlist. Finally, app quit is blocked by a
running task, and if the app is quit while a task is running, it will
be delayed until the task completes, at which time the app will
terminate cleanly.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-15 04:01:45 -04:00
|
|
|
NSProgress *progressOverall;
|
|
|
|
NSProgress *progressJob;
|
2022-02-07 02:49:27 -03:00
|
|
|
|
|
|
|
AudioUnit _eq;
|
|
|
|
}
|
2006-01-20 12:41:31 -03:00
|
|
|
|
2021-02-06 18:20:03 -03:00
|
|
|
@property CogStatus playbackStatus;
|
2008-02-23 19:20:14 -03:00
|
|
|
|
[Job Queue] Overhauled long action handling
Long actions, such as file opening, playlist loading, metadata loading
and refreshing, etc, are now handled through NSProgress. Additionally,
a new status bar change displays the progress of the task instead of
the total duration of the playlist. Finally, app quit is blocked by a
running task, and if the app is quit while a task is running, it will
be delayed until the task completes, at which time the app will
terminate cleanly.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-15 04:01:45 -04:00
|
|
|
@property NSProgress *progressOverall;
|
|
|
|
@property NSProgress *progressJob;
|
2022-01-09 07:10:08 -03:00
|
|
|
|
2006-01-20 12:41:31 -03:00
|
|
|
- (IBAction)changeVolume:(id)sender;
|
2008-02-17 15:44:11 -03:00
|
|
|
- (IBAction)volumeDown:(id)sender;
|
|
|
|
- (IBAction)volumeUp:(id)sender;
|
2006-01-20 12:41:31 -03:00
|
|
|
|
|
|
|
- (IBAction)playPauseResume:(id)sender;
|
|
|
|
- (IBAction)pauseResume:(id)sender;
|
2008-02-14 16:25:01 -03:00
|
|
|
- (IBAction)skipToNextAlbum:(id)sender;
|
|
|
|
- (IBAction)skipToPreviousAlbum:(id)sender;
|
2007-10-31 22:53:52 -03:00
|
|
|
|
2006-01-20 12:41:31 -03: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;
|
2019-11-14 00:13:59 -03:00
|
|
|
- (IBAction)seek:(id)sender toTime:(NSTimeInterval)time;
|
2008-02-13 15:03:06 -03:00
|
|
|
- (IBAction)eventSeekForward:(id)sender;
|
|
|
|
- (void)seekForward:(double)sender;
|
|
|
|
- (IBAction)eventSeekBackward:(id)sender;
|
|
|
|
- (void)seekBackward:(double)amount;
|
2008-02-23 19:20:14 -03:00
|
|
|
- (IBAction)fade:(id)sender;
|
2006-01-20 12:41:31 -03:00
|
|
|
|
2022-01-16 12:32:47 -03:00
|
|
|
- (IBAction)spam:(id)sender;
|
|
|
|
|
2019-11-14 00:13:59 -03:00
|
|
|
- (void)sendMetaData;
|
|
|
|
|
2007-02-26 02:26:48 -03:00
|
|
|
- (void)initDefaults;
|
2008-02-16 13:30:18 -03:00
|
|
|
- (void)audioFadeDown:(NSTimer *)audioTimer;
|
|
|
|
- (void)audioFadeUp:(NSTimer *)audioTimer;
|
2006-01-20 12:41:31 -03:00
|
|
|
|
2021-04-29 21:16:24 -04:00
|
|
|
- (void)playEntryAtIndex:(NSInteger)i;
|
|
|
|
- (void)playEntryAtIndex:(NSInteger)i startPaused:(BOOL)paused;
|
2021-12-26 09:35:54 -03:00
|
|
|
- (void)playEntryAtIndex:(NSInteger)i startPaused:(BOOL)paused andSeekTo:(id)offset;
|
2006-01-20 12:41:31 -03:00
|
|
|
- (void)playEntry:(PlaylistEntry *)pe;
|
2013-10-12 23:16:47 -03:00
|
|
|
- (void)playEntry:(PlaylistEntry *)pe startPaused:(BOOL)paused;
|
2021-12-26 09:35:54 -03:00
|
|
|
- (void)playEntry:(PlaylistEntry *)pe startPaused:(BOOL)paused andSeekTo:(id)offset;
|
2006-01-20 12:41:31 -03:00
|
|
|
|
2009-02-28 15:57:21 -03:00
|
|
|
// Playlist notifications
|
|
|
|
- (void)playlistDidChange:(PlaylistController *)p;
|
|
|
|
|
2009-02-22 19:28:09 -03:00
|
|
|
// For bindings
|
|
|
|
|
|
|
|
- (void)setPosition:(double)p;
|
|
|
|
- (double)position;
|
|
|
|
|
|
|
|
- (void)setSeekable:(BOOL)s;
|
|
|
|
- (BOOL)seekable;
|
|
|
|
|
2006-01-20 12:41:31 -03:00
|
|
|
@end
|