audio settings menu
This commit is contained in:
@@ -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()) {
|
||||
|
||||
+16
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user