diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-10-18 02:53:11 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-10-18 02:53:11 -0400 |
commit | 88f2e63eeb0b0b9912133ab14ad1f24a452b1c2b (patch) | |
tree | e6489c54cea281438820864b72867cb4f380cbff /src/windows | |
parent | 5a3bce7498aea568cb6eb83d04313f8d777e8c94 (diff) | |
download | abaddon-portaudio-88f2e63eeb0b0b9912133ab14ad1f24a452b1c2b.tar.gz abaddon-portaudio-88f2e63eeb0b0b9912133ab14ad1f24a452b1c2b.zip |
custom draw capture volume with gate indicator
Diffstat (limited to 'src/windows')
-rw-r--r-- | src/windows/voicewindow.cpp | 7 | ||||
-rw-r--r-- | src/windows/voicewindow.hpp | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/windows/voicewindow.cpp b/src/windows/voicewindow.cpp index 596f502..69eb969 100644 --- a/src/windows/voicewindow.cpp +++ b/src/windows/voicewindow.cpp @@ -105,7 +105,10 @@ VoiceWindow::VoiceWindow(Snowflake channel_id) m_capture_gate.set_value_pos(Gtk::POS_LEFT); m_capture_gate.set_value(0.0); m_capture_gate.signal_value_changed().connect([this]() { - m_signal_gate.emit(m_capture_gate.get_value()); + // todo this should probably emit 0-1 i dont think the mgr should be responsible for scaling down + const double val = m_capture_gate.get_value(); + m_signal_gate.emit(val); + m_capture_volume.SetTick(val / 100.0); }); m_scroll.add(m_user_list); @@ -149,7 +152,7 @@ void VoiceWindow::OnDeafenChanged() { } bool VoiceWindow::UpdateVoiceMeters() { - m_capture_volume.set_fraction(Abaddon::Get().GetAudio().GetCaptureVolumeLevel()); + m_capture_volume.SetVolume(Abaddon::Get().GetAudio().GetCaptureVolumeLevel()); for (auto [id, row] : m_rows) { const auto ssrc = Abaddon::Get().GetDiscordClient().GetSSRCOfUser(id); if (ssrc.has_value()) { diff --git a/src/windows/voicewindow.hpp b/src/windows/voicewindow.hpp index 5f5436b..86cedb8 100644 --- a/src/windows/voicewindow.hpp +++ b/src/windows/voicewindow.hpp @@ -2,6 +2,7 @@ #ifdef WITH_VOICE // clang-format off +#include "components/volumemeter.hpp" #include "discord/snowflake.hpp" #include <gtkmm/box.h> #include <gtkmm/checkbutton.h> @@ -40,7 +41,7 @@ private: Gtk::ScrolledWindow m_scroll; Gtk::ListBox m_user_list; - Gtk::ProgressBar m_capture_volume; + VolumeMeter m_capture_volume; Gtk::Scale m_capture_gate; Snowflake m_channel_id; |