diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-11-08 04:01:54 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-11-08 04:01:54 -0500 |
commit | 047168873235c3d835aaf9836f549de08bd96a47 (patch) | |
tree | 6c2a862253e0192795ac4df25fc19b8fcd226754 /src/windows | |
parent | f97a6ff266881936c2885c3265ae20524d66c874 (diff) | |
download | abaddon-portaudio-047168873235c3d835aaf9836f549de08bd96a47.tar.gz abaddon-portaudio-047168873235c3d835aaf9836f549de08bd96a47.zip |
add ability to set capture device
Diffstat (limited to 'src/windows')
-rw-r--r-- | src/windows/voicewindow.cpp | 18 | ||||
-rw-r--r-- | src/windows/voicewindow.hpp | 1 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/windows/voicewindow.cpp b/src/windows/voicewindow.cpp index 95d1036..19d9863 100644 --- a/src/windows/voicewindow.cpp +++ b/src/windows/voicewindow.cpp @@ -121,17 +121,28 @@ VoiceWindow::VoiceWindow(Snowflake channel_id) m_signal_gain.emit(val / 100.0); }); - auto *renderer = Gtk::make_managed<Gtk::CellRendererText>(); + auto *playback_renderer = Gtk::make_managed<Gtk::CellRendererText>(); m_playback_combo.set_valign(Gtk::ALIGN_END); m_playback_combo.set_hexpand(true); m_playback_combo.set_halign(Gtk::ALIGN_FILL); m_playback_combo.set_model(Abaddon::Get().GetAudio().GetDevices().GetPlaybackDeviceModel()); - m_playback_combo.pack_start(*renderer); - m_playback_combo.add_attribute(*renderer, "text", 0); + m_playback_combo.pack_start(*playback_renderer); + m_playback_combo.add_attribute(*playback_renderer, "text", 0); m_playback_combo.signal_changed().connect([this]() { Abaddon::Get().GetAudio().SetPlaybackDevice(m_playback_combo.get_active()); }); + auto *capture_renderer = Gtk::make_managed<Gtk::CellRendererText>(); + m_capture_combo.set_valign(Gtk::ALIGN_END); + m_capture_combo.set_hexpand(true); + m_capture_combo.set_halign(Gtk::ALIGN_FILL); + m_capture_combo.set_model(Abaddon::Get().GetAudio().GetDevices().GetCaptureDeviceModel()); + m_capture_combo.pack_start(*capture_renderer); + m_capture_combo.add_attribute(*capture_renderer, "text", 0); + m_capture_combo.signal_changed().connect([this]() { + Abaddon::Get().GetAudio().SetCaptureDevice(m_capture_combo.get_active()); + }); + m_scroll.add(m_user_list); m_controls.add(m_mute); m_controls.add(m_deafen); @@ -141,6 +152,7 @@ VoiceWindow::VoiceWindow(Snowflake channel_id) m_main.add(m_capture_gain); m_main.add(m_scroll); m_main.add(m_playback_combo); + m_main.add(m_capture_combo); add(m_main); show_all_children(); diff --git a/src/windows/voicewindow.hpp b/src/windows/voicewindow.hpp index e36846c..f9ea23f 100644 --- a/src/windows/voicewindow.hpp +++ b/src/windows/voicewindow.hpp @@ -47,6 +47,7 @@ private: Gtk::Scale m_capture_gain; Gtk::ComboBox m_playback_combo; + Gtk::ComboBox m_capture_combo; Snowflake m_channel_id; |