ScummVM API documentation
sound.h
1
/* ScummVM - Graphic Adventure Engine
2
*
3
* ScummVM is the legal property of its developers, whose names
4
* are too numerous to list here. Please refer to the COPYRIGHT
5
* file distributed with this source distribution.
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*
20
*/
21
22
#ifndef NGI_SOUND_H
23
#define NGI_SOUND_H
24
25
#include "common/array.h"
26
#include "common/ptr.h"
27
28
namespace
Audio
{
29
class
SoundHandle;
30
}
31
32
namespace
NGI
{
33
34
class
Sound
:
public
MemoryObject
{
35
int
_id;
36
byte *_soundData;
37
Audio::SoundHandle
*_handle;
38
39
public
:
40
int16 _objectId;
41
42
public
:
43
Sound
();
44
~
Sound
()
override
;
45
46
virtual
bool
load(
MfcArchive
&file,
NGIArchive
*archive);
47
bool
load(
MfcArchive
&file)
override
{ assert(0);
return
false
; }
// Disable base class
48
void
updateVolume();
49
int
getId()
const
{
return
_id; }
50
Audio::SoundHandle
*getHandle()
const
{
return
_handle; }
51
52
void
play(
int
flag);
53
void
freeSound();
54
int
getVolume();
55
void
stop();
56
57
void
setPanAndVolumeByStaticAni();
58
void
setPanAndVolume(
int
vol,
int
pan);
59
};
60
61
class
SoundList
:
public
CObject
{
62
Common::Array<Sound>
_soundItems;
63
Common::ScopedPtr<NGIArchive>
_libHandle;
64
65
public
:
66
virtual
bool
load(
MfcArchive
&file,
const
Common::Path
&fname);
67
bool
load(
MfcArchive
&file)
override
{ assert(0);
return
false
; }
// Disable base class
68
bool
loadFile(
const
Common::Path
&fname,
const
Common::Path
&libname);
69
70
int
getCount() {
return
_soundItems.
size
(); }
71
Sound
&getSoundByIndex(
int
idx) {
return
_soundItems[idx]; }
72
Sound
*getSoundItemById(
int
id
);
73
};
74
75
}
// End of namespace NGI
76
77
#endif
/* NGI_SOUND_H */
NGI::MfcArchive
Definition:
utils.h:39
Common::Array
Definition:
array.h:52
Common::Path
Definition:
path.h:52
NGI::NGIArchive
Definition:
ngiarchive.h:44
NGI::SoundList
Definition:
sound.h:61
Common::ScopedPtr
Definition:
ptr.h:572
Audio::SoundHandle
Definition:
mixer.h:49
Common::Array::size
size_type size() const
Definition:
array.h:315
NGI::Sound
Definition:
sound.h:34
NGI
Definition:
anihandler.h:25
NGI::MemoryObject
Definition:
utils.h:139
Audio
Definition:
system.h:38
NGI::CObject
Definition:
utils.h:106
engines
ngi
sound.h
Generated on Thu Nov 14 2024 09:09:46 for ScummVM API documentation by
1.8.13