Audaspace
1.9.0
A high level audio library.
Toggle main menu visibility
Loading...
Searching...
No Matches
fx
PlaybackCategory.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright 2015-2016 Juan Francisco Crespo Galán
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
******************************************************************************/
16
17
#pragma once
18
24
25
#include "
devices/IHandle.h
"
26
#include "
devices/IDevice.h
"
27
#include "
VolumeStorage.h
"
28
29
#include <unordered_map>
30
#include <memory>
31
32
AUD_NAMESPACE_BEGIN
33
37
class
AUD_API
PlaybackCategory
38
{
39
private
:
43
unsigned
int
m_currentID;
44
48
std::unordered_map<unsigned int, std::shared_ptr<IHandle>> m_handles;
49
53
std::shared_ptr<IDevice> m_device;
54
58
Status
m_status;
59
63
std::shared_ptr<VolumeStorage> m_volumeStorage;
64
65
// delete copy constructor and operator=
66
PlaybackCategory(
const
PlaybackCategory&) =
delete
;
67
PlaybackCategory& operator=(
const
PlaybackCategory&) =
delete
;
68
69
public
:
74
PlaybackCategory
(std::shared_ptr<IDevice> device);
75
~PlaybackCategory();
76
82
std::shared_ptr<IHandle>
play
(std::shared_ptr<ISound> sound);
83
87
void
resume
();
88
92
void
pause
();
93
98
float
getVolume
();
99
104
void
setVolume
(
float
volume);
105
109
void
stop
();
110
115
std::shared_ptr<VolumeStorage>
getSharedVolume
();
116
121
void
cleanHandles
();
122
123
private
:
124
static
void
cleanHandleCallback(
void
* data);
125
};
126
127
AUD_NAMESPACE_END
AUD_NAMESPACE_END
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition
Audaspace.h:119
AUD_NAMESPACE_BEGIN
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition
Audaspace.h:116
AUD_API
#define AUD_API
Used for exporting symbols in the shared library.
Definition
Audaspace.h:93
IDevice.h
The IDevice interface.
IHandle.h
Defines the IHandle interface as well as possible states of the handle.
Status
Status
Status of a playback handle.
Definition
IHandle.h:31
VolumeStorage.h
The VolumeStorage class.
PlaybackCategory::getVolume
float getVolume()
Retrieves the volume of the category.
PlaybackCategory::cleanHandles
void cleanHandles()
Cleans the category erasing all the invalid handles.
PlaybackCategory::resume
void resume()
Resumes all the paused sounds of the category.
PlaybackCategory::PlaybackCategory
PlaybackCategory(std::shared_ptr< IDevice > device)
Creates a new PlaybackCategory.
PlaybackCategory::setVolume
void setVolume(float volume)
Sets the volume for the category.
PlaybackCategory::stop
void stop()
Stops all the playing back or paused sounds.
PlaybackCategory::pause
void pause()
Pauses all current played back sounds of the category.
PlaybackCategory::play
std::shared_ptr< IHandle > play(std::shared_ptr< ISound > sound)
Plays a new sound in the category.
PlaybackCategory::getSharedVolume
std::shared_ptr< VolumeStorage > getSharedVolume()
Retrieves the shared volume of the category.
Generated by
1.17.0