-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAudioPlayer.h
42 lines (38 loc) · 1.09 KB
/
AudioPlayer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// AudioPlayer.h
// ap
//
// Created by yuta on 11/06/29.
// Copyright 2011 carocara. All rights reserved.
//
#import <Foundation/Foundation.h>
#include <AVFoundation/AVFoundation.h>
@protocol AudioPlayerDelegate
-(void) audioSequence:(double)currentTime;
-(void) audioFadein:(double)volume;
-(void) audioFadeout:(double)volume;
@optional
@end
@interface AudioPlayer : NSObject
<AVAudioPlayerDelegate>
{
NSTimer * timer;
NSTimer * timerFade;
AVAudioPlayer * audio;
float power, currentVolume;
double duration;
BOOL fading, pausing;
id<AudioPlayerDelegate> delegate;
}
@property (nonatomic, assign) id<AudioPlayerDelegate> delegate;
@property (nonatomic, retain) AVAudioPlayer * audio;
@property double duration;
@property float power;
@property float currentVolume;
-(id) initWithFilename:(NSString *)filename ofType:(NSString *)ofType delegate:(id)targetDelegate;
-(void)audioStart:(BOOL)fade currentTime:(double)currentTime volume:(float)volume;
-(void)audioStop:(BOOL)fade;
-(void)audioPause;
-(void)audioPlayThreaded:(id)threadAudio;
-(void)setVolume:(double)volume;
@end