/
MusicManager.h
51 lines (41 loc) · 1 KB
/
MusicManager.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
43
44
45
46
47
48
49
50
51
//
// MusicManager.h
// Core3D
//
// Created by CoreCode on 08.09.11
// Copyright 2011 - 2012 CoreCode. Licensed under the MIT License, see LICENSE.txt
//
#ifndef __BLOCKS__
#define StringInBlock id
#endif
#ifdef TARGET_OS_IPHONE
#import <AVFoundation/AVAudioPlayer.h>
#elif defined(TARGET_OS_MAC)
#import <QTKit/QTMovie.h>
#endif
@interface MusicManager : NSObject
#ifdef TARGET_OS_IPHONE
<AVAudioPlayerDelegate>
#endif
{
#ifndef DISABLE_SOUND
StringInBlock songChangeBlock;
NSMutableArray *songs;
#if defined(SDL)
Mix_Music *music;
//#elif defined(GNUSTEP)
// NSSound *currentSong;
//#elif defined(__COCOTRON__)
#elif defined(TARGET_OS_MAC)
QTMovie *currentSong;
#elif defined(TARGET_OS_IPHONE)
AVAudioPlayer *currentSong;
#endif
#endif
}
- (id)initWithSongs:(NSArray *)_songs andSongChangeBlock:(StringInBlock)_songChangeBlock;
- (void)startPlayingWithDelay:(float)delay;
- (void)playSongInBackground;
- (void)pauseMusic;
- (void)unpauseMusic;
@end