forked from johannawald/ICT207
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sound.h
92 lines (85 loc) · 1.2 KB
/
Sound.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Sound.h: interface for the CSound class.
//
//////////////////////////////////////////////////////////////////////
#ifndef SOUND_H
#define SOUND_H
#include <SDL.h>
#include "SoundTime.h"
/**
* class CSound: This class is the sound object, and it allow to play, stop, etc
*
* @author Shannon, Grahan and Shay
*/
class CSound
{
public:
/**
* CSound:
*
* @param filename
* @param iSoundID
* @return
*/
CSound(char *filename, int iSoundID);
/**
* ~CSound:
*
* @return
*/
virtual ~CSound();
/**
* Play:
*
* @param start
* @param length
* @return bool
*/
bool Play(CSoundTime start, CSoundTime length);
/**
* Play:
*
* @return bool
*/
bool Play();
/**
* Stop:
*
* @return CSoundTime
*/
CSoundTime Stop();
/**
* GetLength:
*
* @return CSoundTime
*/
CSoundTime GetLength();
/**
* GetSoundID:
*
* @return int
*/
int GetSoundID() { return m_iSoundID; };
public:
/**
* m_data:
*/
Uint8 *m_data;
/**
* m_pos:
*/
CSoundTime m_pos;
/**
* m_len:
*/
CSoundTime m_len;
CSoundTime m_stop;
/**
* m_spec:
*/
SDL_AudioSpec m_spec;
/**
* m_iSoundID:
*/
int m_iSoundID; // id number for sound
};
#endif