Skip to content

Commit

Permalink
Why snake case?
Browse files Browse the repository at this point in the history
  • Loading branch information
ryze312 committed Jun 3, 2024
1 parent cb44e05 commit 030f5da
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/abaddon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,15 +504,15 @@ void Abaddon::ShowVoiceWindow() {
m_discord.SetVoiceMuted(is_mute);
m_audio.GetVoice().GetCapture().SetActive(!is_mute);

auto sound = is_mute ? SystemSound::VOICE_MUTED : SystemSound::VOICE_UNMUTED;
auto sound = is_mute ? SystemSound::VoiceMuted : SystemSound::VoiceUnmuted;
m_audio.GetSystem().PlaySound(sound);
});

wnd->signal_deafen().connect([this](bool is_deaf) {
m_discord.SetVoiceDeafened(is_deaf);
m_audio.GetVoice().GetPlayback().SetActive(!is_deaf);

auto sound = is_deaf ? SystemSound::VOICE_DEAFENED : SystemSound::VOICE_UNDEAFENED;
auto sound = is_deaf ? SystemSound::VoiceDeafened : SystemSound::VoiceUndeafened;
m_audio.GetSystem().PlaySound(sound);
});

Expand Down
18 changes: 9 additions & 9 deletions src/audio/system/system_audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ SystemAudio::SystemAudio(Context &context) noexcept :
std::string_view SystemAudio::GetSoundPath(SystemSound sound) noexcept {
switch (sound) {
#ifdef ENABLE_NOTIFICATION_SOUNDS
case SystemSound::NOTIFICATION_SOUND: {
case SystemSound::Notification: {
return "/sound/message.mp3";
}
#endif

#ifdef WITH_VOICE
case SystemSound::VOICE_CONNECTED: {
case SystemSound::VoiceConnected: {
return "/sound/voice_connected.mp3";
}
case SystemSound::VOICE_DISCONNECTED: {
case SystemSound::VoiceDisconnected: {
return "/sound/voice_disconnected.mp3";
}
case SystemSound::VOICE_MUTED: {
case SystemSound::VoiceMuted: {
return "/sound/voice_muted.mp3";
}
case SystemSound::VOICE_UNMUTED: {
case SystemSound::VoiceUnmuted: {
return "/sound/voice_unmuted.mp3";
}
case SystemSound::VOICE_DEAFENED: {
case SystemSound::VoiceDeafened: {
return "/sound/voice_deafened.mp3";
}
case SystemSound::VOICE_UNDEAFENED: {
case SystemSound::VoiceUndeafened: {
return "/sound/voice_undeafened.mp3";
}
#endif
Expand All @@ -54,11 +54,11 @@ void SystemAudio::BindToVoice(DiscordClient &discord) noexcept {
}

void SystemAudio::OnVoiceUserConnect(Snowflake user_id, Snowflake channel_id) noexcept {
PlaySound(SystemSound::VOICE_CONNECTED);
PlaySound(SystemSound::VoiceConnected);
}

void SystemAudio::OnVoiceUserDisconnect(Snowflake user_id, Snowflake channel_id) noexcept {
PlaySound(SystemSound::VOICE_DISCONNECTED);
PlaySound(SystemSound::VoiceDisconnected);
}

#endif
Expand Down
14 changes: 7 additions & 7 deletions src/audio/system/system_audio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ class SystemAudio : public sigc::trackable {
public:
enum SystemSound {
#ifdef ENABLE_NOTIFICATION_SOUNDS
NOTIFICATION_SOUND,
Notification,
#endif

#ifdef WITH_VOICE
VOICE_CONNECTED,
VOICE_DISCONNECTED,
VOICE_MUTED,
VOICE_UNMUTED,
VOICE_DEAFENED,
VOICE_UNDEAFENED,
VoiceConnected,
VoiceDisconnected,
VoiceMuted,
VoiceUnmuted,
VoiceDeafened,
VoiceUndeafened,
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion src/notifications/notifier_fallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void Notifier::Notify(const Glib::ustring &id, const Glib::ustring &title, const

auto& abaddon = Abaddon::Get();
if (abaddon.GetSettings().NotificationsPlaySound) {
abaddon.GetAudio().GetSystem().PlaySound(SystemSound::NOTIFICATION_SOUND);
abaddon.GetAudio().GetSystem().PlaySound(SystemSound::Notification);
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/notifications/notifier_gio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void Notifier::Notify(const Glib::ustring &id, const Glib::ustring &title, const

auto& abaddon = Abaddon::Get();
if (abaddon.GetSettings().NotificationsPlaySound) {
abaddon.GetAudio().GetSystem().PlaySound(SystemSound::NOTIFICATION_SOUND);
abaddon.GetAudio().GetSystem().PlaySound(SystemSound::Notification);
}
#endif
}
Expand Down

0 comments on commit 030f5da

Please sign in to comment.