aboutsummaryrefslogtreecommitdiff
path: root/src/aomusicplayer.cpp
diff options
context:
space:
mode:
authorSalanto <62221668+Salanto@users.noreply.github.com>2022-07-30 18:42:55 +0200
committerGitHub <noreply@github.com>2022-07-30 18:42:55 +0200
commit4fa86c0174961be22e1996a472e908b36656083d (patch)
tree98f5adbfeb7a318482c69776527575284d3ef1b3 /src/aomusicplayer.cpp
parent7b88d4be954b415e069ee0d612e4df3793c61756 (diff)
Add option to disable music streaming. (#829)
* Add option to disable streamintg This one gets a unique message to prevent people forgetting they disable it and the wondering why streaming broke. * Fix code order * Fixes the music channel still playing audio when a new stream was blocked. * Update tooltip * Update tooltip to reflect the current way the feature works.
Diffstat (limited to 'src/aomusicplayer.cpp')
-rw-r--r--src/aomusicplayer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/aomusicplayer.cpp b/src/aomusicplayer.cpp
index 2cac91dd..564d9d6a 100644
--- a/src/aomusicplayer.cpp
+++ b/src/aomusicplayer.cpp
@@ -29,6 +29,12 @@ QString AOMusicPlayer::play(QString p_song, int channel, bool loop,
QString f_path = p_song;
DWORD newstream;
if (f_path.startsWith("http")) {
+
+ if (ao_app->is_streaming_disabled()) {
+ BASS_ChannelStop(m_stream_list[channel]);
+ return QObject::tr("[MISSING] Streaming disabled.");
+ }
+
if (f_path.endsWith(".opus"))
newstream = BASS_OPUS_StreamCreateURL(f_path.toStdString().c_str(), 0, streaming_flags, nullptr, 0);
else if (f_path.endsWith(".mid"))