ScummVM API documentation
MusicHandler.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
/*
23
* Copyright (C) 2006-2010 - Frictional Games
24
*
25
* This file is part of HPL1 Engine.
26
*/
27
28
#ifndef HPL_MUSICHANDLER_H
29
#define HPL_MUSICHANDLER_H
30
31
#include "common/list.h"
32
#include "hpl1/engine/system/SystemTypes.h"
33
34
namespace
hpl
{
35
36
class
iLowLevelSound;
37
class
iSoundChannel;
38
42
43
class
cMusicLock
{
44
public
:
45
cMusicLock
() : msFileName(
""
), mfVolume(0) {}
46
47
tString
msFileName;
48
float
mfVolume;
49
bool
mbLoop;
50
};
51
55
56
class
cMusicEntry
{
57
public
:
58
cMusicEntry
() : msFileName(
""
), mpStream(NULL), mfMaxVolume(1),
59
mfVolume(0), mfVolumeAdd(0.01f) {}
60
61
tString
msFileName;
62
iSoundChannel
*mpStream;
63
float
mfMaxVolume;
64
float
mfVolume;
65
float
mfVolumeAdd;
66
bool
mbLoop;
67
};
68
69
typedef
Common::List<cMusicEntry *>
tMusicEntryList
;
70
typedef
tMusicEntryList::iterator
tMusicEntryListIt
;
71
75
76
class
cResources
;
77
78
class
cMusicHandler
{
79
public
:
80
cMusicHandler
(
iLowLevelSound
*apLowLevelSound,
cResources
*apResources);
81
~
cMusicHandler
();
82
91
bool
Play(
const
tString
&asFileName,
float
afVolume,
float
afFadeStepSize,
bool
abLoop);
92
97
void
Stop(
float
afFadeStepSize);
98
void
Pause();
99
void
Resume();
100
105
void
Lock(
cMusicLock
*apLock);
109
void
UnLock();
110
tString
GetCurrentSongName();
111
float
GetCurrentSongVolume();
112
113
cMusicEntry
*GetCurrentSong();
114
115
void
Update(
float
afTimeStep);
116
117
private
:
118
iLowLevelSound
*mpLowLevelSound;
119
cResources
*mpResources;
120
121
tMusicEntryList mlstFadingSongs;
122
cMusicEntry
*mpMainSong;
123
cMusicLock
*mpLock;
124
bool
mbIsPaused;
125
126
bool
LoadAndStart(
const
tString
&asFileName,
cMusicEntry
*apSong,
float
afVolume,
bool
abLoop);
127
};
128
129
}
// namespace hpl
130
#endif // HPL_MUSICHANDLER_H
hpl
Definition:
AI.h:36
Common::String
Definition:
str.h:59
hpl::cMusicEntry
Definition:
MusicHandler.h:56
Common::List< cMusicEntry * >
hpl::cMusicHandler
Definition:
MusicHandler.h:78
hpl::cMusicLock
Definition:
MusicHandler.h:43
hpl::cResources
Definition:
Resources.h:160
hpl::iSoundChannel
Definition:
SoundChannel.h:46
hpl::iLowLevelSound
Definition:
LowLevelSound.h:45
Common::ListInternal::Iterator
Definition:
list_intern.h:51
engines
hpl1
engine
sound
MusicHandler.h
Generated on Fri Nov 22 2024 09:18:13 for ScummVM API documentation by
1.8.13