Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SimpleSource.cpp
Go to the documentation of this file.
1
//
2
// C++ Implementation: Audio::SimpleSource
3
//
4
5
#include "
SimpleSource.h
"
6
#include "config.h"
7
8
namespace
Audio {
9
10
SimpleSource::~SimpleSource
()
11
{
12
}
13
14
SimpleSource::SimpleSource
(SharedPtr<Sound> sound,
bool
looping)
throw
() :
15
Source
(sound, looping),
16
playing(
false
),
17
scene(0)
18
{
19
}
20
21
void
SimpleSource::notifySceneAttached
(
SimpleScene
*scn)
throw
()
22
{
23
scene = scn;
24
}
25
26
SimpleScene
*
SimpleSource::getScene
()
const
throw()
27
{
28
return
scene;
29
}
30
31
void
SimpleSource::startPlayingImpl
(
Timestamp
start
)
throw
(
Exception
)
32
{
33
// If it's playing, must stop and restart - cannot simply play again.
34
if
(isPlaying())
35
stopPlaying();
36
37
setLastKnownPlayingTime(
start
);
38
playing =
true
;
39
40
if
(getScene())
41
getScene()->notifySourcePlaying(shared_from_this(),
true
);
42
}
43
44
void
SimpleSource::stopPlayingImpl
() throw(
Exception
)
45
{
46
if
(
isPlaying
()) {
47
playing =
false
;
48
49
if
(
getScene
())
50
getScene
()->
notifySourcePlaying
(shared_from_this(),
false
);
51
}
52
}
53
54
bool
SimpleSource::isPlayingImpl
()
const
throw(
Exception
)
55
{
56
return
playing;
57
}
58
59
};
src
audio
SimpleSource.cpp
Generated on Fri May 29 2015 23:07:06 for Vegastrike 0.5.1 rc1 by
1.8.4