cog/Application/PlaybackController.h

119 lines
2.9 KiB
C
Raw Normal View History

/* PlaybackController */
2006-01-20 15:41:31 +00:00
#import <Cocoa/Cocoa.h>
#import "AppController.h"
#import "CogAudio/AudioPlayer.h"
2021-02-06 21:20:03 +00:00
#import "CogAudio/Status.h"
2006-01-20 15:41:31 +00:00
#import "TrackingSlider.h"
2022-01-16 15:32:47 +00:00
#import <AVFoundation/AVFoundation.h>
2022-01-16 15:32:47 +00:00
#import <AudioToolbox/AudioToolbox.h>
#import <AudioUnit/AudioUnit.h>
#import <CoreAudio/CoreAudioTypes.h>
#import "EqualizerWindowController.h"
2006-01-20 15:41:31 +00:00
#import "PlaylistEntry.h"
#define DEFAULT_VOLUME_DOWN 5
#define DEFAULT_VOLUME_UP DEFAULT_VOLUME_DOWN
extern NSString *CogPlaybackDidBeginNotficiation;
extern NSString *CogPlaybackDidPauseNotficiation;
extern NSString *CogPlaybackDidResumeNotficiation;
extern NSString *CogPlaybackDidStopNotficiation;
extern NSDictionary *makeRGInfo(PlaylistEntry *pe);
@class PlaylistController;
2006-01-20 15:41:31 +00:00
@class PlaylistView;
@class PlaylistLoader;
2006-01-20 15:41:31 +00:00
@interface PlaybackController : NSObject {
IBOutlet AppController *appController;
IBOutlet PlaylistController *playlistController;
2006-01-20 15:41:31 +00:00
IBOutlet PlaylistView *playlistView;
IBOutlet PlaylistLoader *playlistLoader;
IBOutlet EqualizerWindowController *equalizerWindowController;
2006-05-13 13:37:32 +00:00
IBOutlet NSSlider *volumeSlider;
IBOutlet NSArrayController *outputDevices;
NSTimer *positionTimer;
AudioPlayer *audioPlayer;
2021-02-06 21:20:03 +00:00
CogStatus playbackStatus;
double position;
double lastPosition;
BOOL seekable;
2009-02-28 21:19:26 +00:00
BOOL fading;
// progress bar display
NSProgress *progressOverall;
NSProgress *progressJob;
AudioUnit _eq;
}
2006-01-20 15:41:31 +00:00
2021-02-06 21:20:03 +00:00
@property CogStatus playbackStatus;
@property NSProgress *progressOverall;
@property NSProgress *progressJob;
2006-01-20 15:41:31 +00:00
- (IBAction)changeVolume:(id)sender;
- (IBAction)volumeDown:(id)sender;
- (IBAction)volumeUp:(id)sender;
2006-01-20 15:41:31 +00:00
- (IBAction)playPauseResume:(id)sender;
- (IBAction)pauseResume:(id)sender;
- (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;
- (IBAction)seek:(id)sender toTime:(NSTimeInterval)time;
- (IBAction)eventSeekForward:(id)sender;
- (void)seekForward:(double)sender;
- (IBAction)eventSeekBackward:(id)sender;
- (void)seekBackward:(double)amount;
- (IBAction)fade:(id)sender;
2006-01-20 15:41:31 +00:00
2022-01-16 15:32:47 +00:00
- (IBAction)spam:(id)sender;
- (void)sendMetaData;
2007-02-26 05:26:48 +00:00
- (void)initDefaults;
- (void)audioFadeDown:(NSTimer *)audioTimer;
- (void)audioFadeUp:(NSTimer *)audioTimer;
2006-01-20 15:41:31 +00:00
- (void)playEntryAtIndex:(NSInteger)i;
- (void)playEntryAtIndex:(NSInteger)i startPaused:(BOOL)paused;
- (void)playEntryAtIndex:(NSInteger)i startPaused:(BOOL)paused andSeekTo:(id)offset;
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;
- (void)playEntry:(PlaylistEntry *)pe startPaused:(BOOL)paused andSeekTo:(id)offset;
2006-01-20 15:41:31 +00:00
// Playlist notifications
- (void)playlistDidChange:(PlaylistController *)p;
// For bindings
- (void)setPosition:(double)p;
- (double)position;
- (void)setSeekable:(BOOL)s;
- (BOOL)seekable;
2006-01-20 15:41:31 +00:00
@end