2007-02-24 20:36:27 +00:00
|
|
|
//
|
|
|
|
// AudioController.h
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 8/7/05.
|
|
|
|
// Copyright 2005 Vincent Spader. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
|
|
|
@class BufferChain;
|
|
|
|
@class OutputNode;
|
|
|
|
|
|
|
|
@interface AudioPlayer : NSObject
|
|
|
|
{
|
|
|
|
BufferChain *bufferChain;
|
|
|
|
OutputNode *output;
|
|
|
|
|
2008-02-13 01:50:39 +00:00
|
|
|
double volume;
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
NSMutableArray *chainQueue;
|
|
|
|
|
|
|
|
NSURL *nextStream;
|
|
|
|
id nextStreamUserInfo;
|
2013-10-02 09:30:04 +00:00
|
|
|
NSDictionary *nextStreamRGInfo;
|
2007-02-24 20:36:27 +00:00
|
|
|
|
|
|
|
id delegate;
|
2007-03-19 00:19:47 +00:00
|
|
|
|
|
|
|
BOOL outputLaunched;
|
2009-02-28 19:11:22 +00:00
|
|
|
BOOL endOfInputReached;
|
2013-10-13 02:16:47 +00:00
|
|
|
BOOL startedPaused;
|
|
|
|
BOOL initialBufferFilled;
|
2007-02-24 20:36:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id)init;
|
|
|
|
|
|
|
|
- (void)setDelegate:(id)d;
|
|
|
|
- (id)delegate;
|
|
|
|
|
|
|
|
- (void)play:(NSURL *)url;
|
2013-10-02 09:30:04 +00:00
|
|
|
- (void)play:(NSURL *)url withUserInfo:(id)userInfo withRGInfo:(NSDictionary*)rgi;
|
2013-10-13 02:16:47 +00:00
|
|
|
- (void)play:(NSURL *)url withUserInfo:(id)userInfo withRGInfo:(NSDictionary*)rgi startPaused:(BOOL)paused;
|
2007-02-24 20:36:27 +00:00
|
|
|
|
|
|
|
- (void)stop;
|
|
|
|
- (void)pause;
|
|
|
|
- (void)resume;
|
|
|
|
|
|
|
|
- (void)seekToTime:(double)time;
|
|
|
|
- (void)setVolume:(double)v;
|
2008-02-13 01:50:39 +00:00
|
|
|
- (double)volume;
|
2008-02-17 18:44:11 +00:00
|
|
|
- (double)volumeUp:(double)amount;
|
|
|
|
- (double)volumeDown:(double)amount;
|
2007-02-24 20:36:27 +00:00
|
|
|
|
|
|
|
- (double)amountPlayed;
|
|
|
|
|
|
|
|
- (void)setNextStream:(NSURL *)url;
|
2013-10-02 09:30:04 +00:00
|
|
|
- (void)setNextStream:(NSURL *)url withUserInfo:(id)userInfo withRGInfo:(NSDictionary*)rgi;
|
2009-02-28 18:57:21 +00:00
|
|
|
- (void)resetNextStreams;
|
2007-02-24 20:36:27 +00:00
|
|
|
|
|
|
|
+ (NSArray *)fileTypes;
|
2007-03-09 01:16:06 +00:00
|
|
|
+ (NSArray *)schemes;
|
2007-10-09 01:20:46 +00:00
|
|
|
+ (NSArray *)containerTypes;
|
2007-02-24 20:36:27 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface AudioPlayer (Private) //Dont use this stuff!
|
|
|
|
|
|
|
|
- (OutputNode *) output;
|
|
|
|
- (BufferChain *) bufferChain;
|
|
|
|
- (id)initWithDelegate:(id)d;
|
|
|
|
|
2008-02-22 03:46:04 +00:00
|
|
|
- (void)setPlaybackStatus:(int)status waitUntilDone:(BOOL)wait;
|
2007-02-24 20:36:27 +00:00
|
|
|
- (void)setPlaybackStatus:(int)s;
|
|
|
|
|
|
|
|
- (void)requestNextStream:(id)userInfo;
|
|
|
|
- (void)requestNextStreamMainThread:(id)userInfo;
|
2009-02-28 18:57:21 +00:00
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
- (void)notifyStreamChanged:(id)userInfo;
|
|
|
|
- (void)notifyStreamChangedMainThread:(id)userInfo;
|
|
|
|
|
2007-10-11 02:08:29 +00:00
|
|
|
- (BOOL)endOfInputReached:(BufferChain *)sender;
|
2007-02-24 20:36:27 +00:00
|
|
|
- (void)setShouldContinue:(BOOL)s;
|
2016-06-30 05:10:29 +00:00
|
|
|
//- (BufferChain *)bufferChain;
|
2007-03-19 00:19:47 +00:00
|
|
|
- (void)launchOutputThread;
|
2007-02-24 20:36:27 +00:00
|
|
|
- (void)endOfInputPlayed;
|
|
|
|
- (void)sendDelegateMethod:(SEL)selector withObject:(id)obj waitUntilDone:(BOOL)wait;
|
2009-03-05 17:03:30 +00:00
|
|
|
- (void)sendDelegateMethod:(SEL)selector withObject:(id)obj withObject:(id)obj2 waitUntilDone:(BOOL)wait;
|
2007-02-24 20:36:27 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol AudioPlayerDelegate
|
2009-03-05 17:03:30 +00:00
|
|
|
- (void)audioPlayer:(AudioPlayer *)player willEndStream:(id)userInfo; //You must use setNextStream in this method
|
|
|
|
- (void)audioPlayer:(AudioPlayer *)player didBeginStream:(id)userInfo;
|
|
|
|
- (void)audioPlayer:(AudioPlayer *)player didChangeStatus:(id)status;
|
2007-02-24 20:36:27 +00:00
|
|
|
@end
|
|
|
|
|