mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
audio settings menu
This commit is contained in:
parent
9150af19ea
commit
a971f6dccf
6 changed files with 80 additions and 3 deletions
|
|
@ -356,6 +356,10 @@ Channel* audio::get_channel(int index) {
|
|||
return channels.at(index).get();
|
||||
}
|
||||
|
||||
Channel* audio::get_channel(const std::string& name) {
|
||||
return get_channel(get_channel_index(name));
|
||||
}
|
||||
|
||||
std::shared_ptr<Stream> audio::get_associated_stream(speakerid_t id) {
|
||||
auto found = streams.find(id);
|
||||
if (found != streams.end()) {
|
||||
|
|
|
|||
|
|
@ -55,6 +55,16 @@ namespace audio {
|
|||
/// @brief Get channel name
|
||||
const std::string& getName() const;
|
||||
|
||||
inline void setPaused(bool flag) {
|
||||
if (flag == paused)
|
||||
return;
|
||||
if (flag) {
|
||||
pause();
|
||||
} else {
|
||||
resume();
|
||||
}
|
||||
}
|
||||
|
||||
/// @brief Pause all speakers in channel
|
||||
void pause();
|
||||
|
||||
|
|
@ -472,10 +482,15 @@ namespace audio {
|
|||
extern int get_channel_index(const std::string& name);
|
||||
|
||||
/// @brief Get channel by index. 0 - is master channel
|
||||
/// @param name channel index
|
||||
/// @param index channel index
|
||||
/// @return channel or nullptr
|
||||
extern Channel* get_channel(int index);
|
||||
|
||||
/// @brief Get channel by name.
|
||||
/// @param name channel name
|
||||
/// @return channel or nullptr
|
||||
extern Channel* get_channel(const std::string& name);
|
||||
|
||||
/// @brief Get stream associated with speaker
|
||||
/// @param id speaker id
|
||||
/// @return stream or nullptr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue