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
RenderableSource.cpp
Go to the documentation of this file.
1
//
2
// C++ Implementation: Audio::RenderableSource
3
//
4
5
#include "
RenderableSource.h
"
6
#include "config.h"
7
#include <stdio.h>
8
9
namespace
Audio {
10
11
RenderableSource::RenderableSource
(
Source
*_source)
throw
() :
12
source(_source)
13
{
14
}
15
16
RenderableSource::~RenderableSource
()
17
{
18
// Just in case.
19
source = 0;
20
}
21
22
void
RenderableSource::startPlaying
(
Timestamp
start
)
23
throw
(
Exception
)
24
{
25
try
{
26
startPlayingImpl(
start
);
27
}
catch
(
EndOfStreamException
) {
28
// Silently discard EOS, results in the more transparent
29
// behavior of simply notifying listeners of source
30
// termination ASAP, which is also accurate.
31
};
32
}
33
34
void
RenderableSource::stopPlaying
()
35
throw()
36
{
37
// Cannot be playing if an exception rises,
38
// as that implies a problem with the underlying API
39
try
{
40
if
(
isPlaying
())
41
stopPlayingImpl
();
42
}
catch
(
Exception
e
) {}
43
}
44
45
bool
RenderableSource::isPlaying
()
const
46
throw()
47
{
48
try
{
49
return
isPlayingImpl
();
50
}
catch
(
Exception
e
) {
51
// Cannot be playing if an exception rises,
52
// as that implies a problem with the underlying API
53
return
false
;
54
}
55
}
56
57
Timestamp
RenderableSource::getPlayingTime
()
const
58
throw(
Exception
)
59
{
60
return
getPlayingTimeImpl
();
61
}
62
63
void
RenderableSource::update
(
int
flags,
const
Listener
& sceneListener)
64
throw
()
65
{
66
try
{
67
updateImpl(flags, sceneListener);
68
}
catch
(
Exception
e
) {
69
fprintf
(stderr,
"Ignoring exception in renderable update: %s"
, e.
what
());
70
}
71
}
72
73
void
RenderableSource::seek
(
Timestamp
time)
74
throw
(
Exception
)
75
{
76
seekImpl(time);
77
}
78
79
};
src
audio
RenderableSource.cpp
Generated on Fri May 29 2015 23:07:06 for Vegastrike 0.5.1 rc1 by
1.8.4