Skip to content

Commit

Permalink
add disconnect button to voice window as Per Special Request
Browse files Browse the repository at this point in the history
  • Loading branch information
ouwou committed Jun 1, 2024
1 parent 96687f0 commit 8215a8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/windows/voicewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ VoiceWindow::VoiceWindow(Snowflake channel_id)
, m_deafen("Deafen")
, m_noise_suppression("Suppress Noise")
, m_mix_mono("Mix Mono")
, m_disconnect("Disconnect")
, m_channel_id(channel_id)
, m_menu_view("View")
, m_menu_view_settings("More _Settings", true) {
Expand Down Expand Up @@ -185,6 +186,10 @@ VoiceWindow::VoiceWindow(Snowflake channel_id)
Abaddon::Get().GetAudio().SetMixMono(m_mix_mono.get_active());
});

m_disconnect.signal_clicked().connect([this]() {
Abaddon::Get().GetDiscordClient().DisconnectFromVoice();
});

auto *playback_renderer = Gtk::make_managed<Gtk::CellRendererText>();
m_playback_combo.set_valign(Gtk::ALIGN_END);
m_playback_combo.set_hexpand(true);
Expand Down Expand Up @@ -253,6 +258,7 @@ VoiceWindow::VoiceWindow(Snowflake channel_id)
m_controls.add(m_deafen);
m_controls.add(m_noise_suppression);
m_controls.add(m_mix_mono);
m_controls.pack_end(m_disconnect, false, true);
m_main.pack_start(m_menu_bar, false, true);
m_main.pack_start(m_controls, false, true);
m_main.pack_start(m_vad_value, false, true);
Expand Down
2 changes: 2 additions & 0 deletions src/windows/voicewindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class VoiceWindow : public Gtk::Window {
Gtk::CheckButton m_noise_suppression;
Gtk::CheckButton m_mix_mono;

Gtk::Button m_disconnect;

Gtk::ComboBoxText m_vad_combo;
Gtk::ComboBox m_playback_combo;
Gtk::ComboBox m_capture_combo;
Expand Down

0 comments on commit 8215a8d

Please sign in to comment.