nomlib
Loading...
Searching...
No Matches
include
nomlib
audio
NullAudioDeviceCaps.hpp
1
/******************************************************************************
2
3
nomlib - C++11 cross-platform game engine
4
5
Copyright (c) 2013, 2014 Jeffrey Carpenter <i8degrees@gmail.com>
6
All rights reserved.
7
8
Redistribution and use in source and binary forms, with or without
9
modification, are permitted provided that the following conditions are met:
10
11
1. Redistributions of source code must retain the above copyright notice, this
12
list of conditions and the following disclaimer.
13
2. Redistributions in binary form must reproduce the above copyright notice,
14
this list of conditions and the following disclaimer in the documentation
15
and/or other materials provided with the distribution.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28
******************************************************************************/
29
#ifndef NOMLIB_AUDIO_NULL_DEVICE_CAPS_HPP
30
#define NOMLIB_AUDIO_NULL_DEVICE_CAPS_HPP
31
32
#include "nomlib/config.hpp"
33
#include "nomlib/math/Point3.hpp"
34
#include "nomlib/audio/IOAudioEngine.hpp"
35
36
namespace
nom {
37
namespace
audio {
38
39
// Forward declarations
40
struct
SoundBuffer
;
41
42
// TODO(jeff): Add const to getters!
43
class
NullAudioEngineCaps:
public
IOAudioEngine
44
{
45
public
:
46
NullAudioEngineCaps();
47
virtual
~NullAudioEngineCaps();
48
49
virtual
50
uint32 channel_format(uint32 num_channels, uint32 channel_format)
override
;
51
52
virtual
bool
valid_audio_buffer(
SoundBuffer
* buffer)
override
;
53
virtual
bool
valid_sound_buffer(
SoundBuffer
* buffer)
override
;
54
55
virtual
uint32 state(
SoundBuffer
* target)
override
;
56
virtual
real32 pitch(
SoundBuffer
* target)
override
;
57
58
virtual
real32 volume()
const override
;
59
virtual
Point3f position()
const override
;
60
61
virtual
real32 volume(
SoundBuffer
* buffer)
const override
;
62
virtual
real32 min_volume(
SoundBuffer
* buffer)
override
;
63
virtual
real32 max_volume(
SoundBuffer
* buffer)
override
;
64
65
virtual
Point3f velocity(
SoundBuffer
* buffer)
override
;
66
virtual
Point3f position(
SoundBuffer
* buffer)
override
;
67
virtual
real32 playback_position(
SoundBuffer
* buffer)
override
;
68
virtual
real32 playback_samples(
SoundBuffer
* buffer)
override
;
69
70
virtual
void
set_state(
SoundBuffer
* target, uint32 state)
override
;
71
72
virtual
void
set_volume(real32 gain)
override
;
73
virtual
void
set_position(
const
Point3f& p)
override
;
74
75
virtual
void
set_min_volume(
SoundBuffer
* target, real32 gain)
override
;
76
virtual
void
set_max_volume(
SoundBuffer
* target, real32 gain)
override
;
77
virtual
void
set_volume(
SoundBuffer
* target, real32 gain)
override
;
78
79
virtual
void
set_velocity(
SoundBuffer
* target,
const
Point3f& v)
override
;
80
virtual
void
set_position(
SoundBuffer
* target,
const
Point3f& p)
override
;
81
virtual
void
set_pitch(
SoundBuffer
* target, real32 pitch)
override
;
82
virtual
void
set_playback_position(
SoundBuffer
* target, real32 offset_seconds)
override
;
83
virtual
void
play(
SoundBuffer
* target)
override
;
84
virtual
void
stop(
SoundBuffer
* target)
override
;
85
virtual
void
pause(
SoundBuffer
* target)
override
;
86
virtual
void
resume(
SoundBuffer
* target)
override
;
87
88
virtual
bool
fill_audio_buffer(
SoundBuffer
* buffer)
override
;
89
virtual
void
free_buffer(
SoundBuffer
* buffer)
override
;
90
91
virtual
void
suspend()
override
;
92
virtual
void
resume()
override
;
93
};
94
95
}
// namespace audio
96
}
// namespace nom
97
98
#endif
// include guard defined
nom::audio::SoundBuffer
Definition
SoundBuffer.hpp:39
Generated on
for nomlib by
1.16.1