diff options
author | mio <stigma@disroot.org> | 2024-11-10 19:39:43 +1000 |
---|---|---|
committer | mio <stigma@disroot.org> | 2025-01-11 12:12:32 +1000 |
commit | 5cfecec40972f7d6f77879e1209bc10d6019625b (patch) | |
tree | b94f3a2565f83e61821d1a8544f156cda42a4f41 /src/app/stateChange.cpp | |
parent | e023e2eafb5dc39fe11595f343d867ac6ebe7f5b (diff) | |
download | codeine-5cfecec40972f7d6f77879e1209bc10d6019625b.tar.gz codeine-5cfecec40972f7d6f77879e1209bc10d6019625b.zip |
Create a AudioView widget for audio-only streams
Currently Codeine will show a blank area when playing an audio-only
file, such as music. This patch adds a new widget that contains an
instance of the Analyzer::Block class, so instead of a blank area it
contains a "visualizer" of sorts.
Signed-off-by: mio <stigma@disroot.org>
Diffstat (limited to 'src/app/stateChange.cpp')
-rw-r--r-- | src/app/stateChange.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/app/stateChange.cpp b/src/app/stateChange.cpp index 49adc55..73f77d0 100644 --- a/src/app/stateChange.cpp +++ b/src/app/stateChange.cpp @@ -13,6 +13,8 @@ #include <tqlabel.h> #include <tqpopupmenu.h> #include <tqslider.h> +#include <tqwidgetstack.h> +#include "audioView.h" #include "theStream.h" #include "videoSettings.h" //FIXME unfortunate #include "xineEngine.h" @@ -104,8 +106,18 @@ MainWindow::engineStateChanged( Engine::State state ) /// update statusBar { using namespace Engine; - m_analyzer->setShown( state & (Playing | Paused) && TheStream::hasAudio() ); - m_timeLabel->setShown( state & (Playing | Paused) ); + m_analyzer->setShown(state & (Playing | Paused) && (TheStream::hasVideo() && TheStream::hasAudio())); + m_timeLabel->setShown(state & (Playing | Paused)); + } + + // Update the current widget shown. + if (TheStream::hasVideo() || (state & (Engine::Empty))) + { + m_widgetStack->raiseWidget(videoWindow()); + } + else if (TheStream::hasAudio()) + { + m_widgetStack->raiseWidget(m_audioView); } |