xoreos  0.0.5
functions_sound.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
26 
30 
32 
33 namespace Engines {
34 
35 namespace KotOR2 {
36 
39  if (area)
40  area->playAmbientMusic();
41 }
42 
45  if (area)
46  area->stopAmbientMusic();
47 }
48 
51  if (area)
52  area->setMusicDayTrack(ctx.getParams()[1].getInt());
53 }
54 
57  if (area)
58  area->setMusicNightTrack(ctx.getParams()[1].getInt());
59 }
60 
63 
64  ctx.getReturn() = area ? (int32)area->getMusicDayTrack() : -1;
65 }
66 
69 
70  ctx.getReturn() = area ? (int32)area->getMusicNightTrack() : -1;
71 }
72 
73 } // End of namespace KotOR2
74 
75 } // End of namespace Engines
void musicBackgroundPlay(Aurora::NWScript::FunctionContext &ctx)
void musicBackgroundGetDayTrack(Aurora::NWScript::FunctionContext &ctx)
A container of Star Wars: Knights of the Old Republic II - The Sith Lords objects.
Context of an NWScript function.
void setMusicNightTrack(uint32 track)
Set the music track ID playing by night.
Definition: area.cpp:136
The context holding a Star Wars: Knights of the Old Republic II - The Sith Lords area.
An object in a Star Wars: Knights of the Old Republic II - The Sith Lords area.
void setMusicDayTrack(uint32 track)
Set the music track ID playing by day.
Definition: area.cpp:131
Star Wars: Knights of the Old Republic II - The Sith Lords engine functions.
void stopAmbientMusic()
Stop the ambient music.
Definition: area.cpp:168
uint32 getMusicDayTrack() const
Return the music track ID playing by day.
Definition: area.cpp:119
void musicBackgroundChangeNight(Aurora::NWScript::FunctionContext &ctx)
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
Definition: functions.cpp:115
void musicBackgroundGetNightTrack(Aurora::NWScript::FunctionContext &ctx)
void playAmbientMusic(Common::UString music="")
Play the specified music (or the area&#39;s default) as ambient music.
Definition: area.cpp:176
void musicBackgroundChangeDay(Aurora::NWScript::FunctionContext &ctx)
uint32 getMusicNightTrack() const
Return the music track ID playing by night.
Definition: area.cpp:123
static Area * toArea(Aurora::NWScript::Object *object)
An area in Star Wars: Knights of the Old Republic II - The Sith Lords, holding all objects and rooms ...
Definition: area.h:64
void musicBackgroundStop(Aurora::NWScript::FunctionContext &ctx)
int32_t int32
Definition: types.h:203