summaryrefslogtreecommitdiff
path: root/src/windows
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-10-27 01:38:17 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2023-10-27 01:38:17 -0400
commitc35d8b4e2d9c70bd5ed99c06da40908bfe5cb0db (patch)
tree77cecbc9b3dc780fcb0f5405bd3c76a626132c1a /src/windows
parent09cfa864be6e706fd2576eee60a285d5f4431b04 (diff)
parent399d073a77e20ec79be6c8fe27164f56c7994366 (diff)
downloadabaddon-portaudio-c35d8b4e2d9c70bd5ed99c06da40908bfe5cb0db.tar.gz
abaddon-portaudio-c35d8b4e2d9c70bd5ed99c06da40908bfe5cb0db.zip
Merge branch 'master' into classic-channels
Diffstat (limited to 'src/windows')
-rw-r--r--src/windows/profile/userinfopane.cpp62
-rw-r--r--src/windows/voicewindow.cpp7
-rw-r--r--src/windows/voicewindow.hpp1
3 files changed, 49 insertions, 21 deletions
diff --git a/src/windows/profile/userinfopane.cpp b/src/windows/profile/userinfopane.cpp
index b6f0d59..ab4f50f 100644
--- a/src/windows/profile/userinfopane.cpp
+++ b/src/windows/profile/userinfopane.cpp
@@ -1,6 +1,34 @@
#include "userinfopane.hpp"
#include <unordered_set>
+static std::string GetConnectionURL(const ConnectionData &conn) {
+ if (conn.Type == "github") {
+ return "https://github.com/" + conn.Name;
+ } else if (conn.Type == "steam") {
+ return "https://steamcommunity.com/profiles/" + conn.ID;
+ } else if (conn.Type == "twitch") {
+ return "https://twitch.tv/" + conn.Name;
+ } else if (conn.Type == "twitter") {
+ return "https://twitter.com/i/user/" + conn.ID;
+ } else if (conn.Type == "spotify") {
+ return "https://open.spotify.com/user/" + conn.ID;
+ } else if (conn.Type == "reddit") {
+ return "https://reddit.com/u/" + conn.Name;
+ } else if (conn.Type == "youtube") {
+ return "https://www.youtube.com/channel/" + conn.ID;
+ } else if (conn.Type == "facebook") {
+ return "https://www.facebook.com/" + conn.ID;
+ } else if (conn.Type == "ebay") {
+ return "https://www.ebay.com/usr/" + conn.Name;
+ } else if (conn.Type == "instagram") {
+ return "https://www.instagram.com/" + conn.Name;
+ } else if (conn.Type == "tiktok") {
+ return "https://www.tiktok.com/@" + conn.Name;
+ }
+
+ return "";
+}
+
ConnectionItem::ConnectionItem(const ConnectionData &conn)
: m_box(Gtk::ORIENTATION_HORIZONTAL)
, m_name(conn.Name) {
@@ -8,23 +36,7 @@ ConnectionItem::ConnectionItem(const ConnectionData &conn)
try {
pixbuf = Gdk::Pixbuf::create_from_file(Abaddon::GetResPath("/" + conn.Type + ".png"), 32, 32);
} catch (const Glib::Exception &e) {}
- std::string url;
- if (conn.Type == "github")
- url = "https://github.com/" + conn.Name;
- else if (conn.Type == "steam")
- url = "https://steamcommunity.com/profiles/" + conn.ID;
- else if (conn.Type == "twitch")
- url = "https://twitch.tv/" + conn.Name;
- else if (conn.Type == "twitter")
- url = "https://twitter.com/i/user/" + conn.ID;
- else if (conn.Type == "spotify")
- url = "https://open.spotify.com/user/" + conn.ID;
- else if (conn.Type == "reddit")
- url = "https://reddit.com/u/" + conn.Name;
- else if (conn.Type == "youtube")
- url = "https://www.youtube.com/channel/" + conn.ID;
- else if (conn.Type == "facebook")
- url = "https://www.facebook.com/" + conn.ID;
+ std::string url = GetConnectionURL(conn);
if (pixbuf) {
m_image = Gtk::manage(new Gtk::Image(pixbuf));
m_image->get_style_context()->add_class("profile-connection-image");
@@ -83,25 +95,33 @@ void ConnectionsContainer::SetConnections(const std::vector<ConnectionData> &con
static const std::unordered_set<std::string> supported_services = {
"battlenet",
+ "ebay",
+ "epicgames",
+ "facebook",
"github",
+ "instagram",
"leagueoflegends",
+ "paypal",
+ "playstation",
"reddit",
+ "riotgames",
"skype",
"spotify",
"steam",
+ "tiktok",
"twitch",
"twitter",
"xbox",
"youtube",
- "facebook"
};
- for (size_t i = 0; i < connections.size(); i++) {
- const auto &conn = connections[i];
+ int i = 0;
+ for (const auto &conn : connections) {
if (supported_services.find(conn.Type) == supported_services.end()) continue;
auto widget = Gtk::manage(new ConnectionItem(conn));
widget->show();
- attach(*widget, static_cast<int>(i % 2), static_cast<int>(i / 2), 1, 1);
+ attach(*widget, i % 2, i / 2, 1, 1);
+ i++;
}
set_halign(Gtk::ALIGN_FILL);
diff --git a/src/windows/voicewindow.cpp b/src/windows/voicewindow.cpp
index 73a09c2..16a9fed 100644
--- a/src/windows/voicewindow.cpp
+++ b/src/windows/voicewindow.cpp
@@ -89,6 +89,7 @@ VoiceWindow::VoiceWindow(Snowflake channel_id)
, m_mute("Mute")
, m_deafen("Deafen")
, m_noise_suppression("Suppress Noise")
+ , m_mix_mono("Mix Mono")
, m_channel_id(channel_id)
, m_menu_view("View")
, m_menu_view_settings("More _Settings", true) {
@@ -178,6 +179,11 @@ VoiceWindow::VoiceWindow(Snowflake channel_id)
Abaddon::Get().GetAudio().SetSuppressNoise(m_noise_suppression.get_active());
});
+ m_mix_mono.set_active(audio.GetMixMono());
+ m_mix_mono.signal_toggled().connect([this]() {
+ Abaddon::Get().GetAudio().SetMixMono(m_mix_mono.get_active());
+ });
+
auto *playback_renderer = Gtk::make_managed<Gtk::CellRendererText>();
m_playback_combo.set_valign(Gtk::ALIGN_END);
m_playback_combo.set_hexpand(true);
@@ -223,6 +229,7 @@ VoiceWindow::VoiceWindow(Snowflake channel_id)
m_controls.add(m_mute);
m_controls.add(m_deafen);
m_controls.add(m_noise_suppression);
+ m_controls.add(m_mix_mono);
m_main.add(m_menu_bar);
m_main.add(m_controls);
m_main.add(m_vad_value);
diff --git a/src/windows/voicewindow.hpp b/src/windows/voicewindow.hpp
index 6db2563..02e006f 100644
--- a/src/windows/voicewindow.hpp
+++ b/src/windows/voicewindow.hpp
@@ -54,6 +54,7 @@ private:
Gtk::Scale m_capture_gain;
Gtk::CheckButton m_noise_suppression;
+ Gtk::CheckButton m_mix_mono;
Gtk::ComboBoxText m_vad_combo;
Gtk::ComboBox m_playback_combo;