From 5cfecec40972f7d6f77879e1209bc10d6019625b Mon Sep 17 00:00:00 2001 From: mio Date: Sun, 10 Nov 2024 19:39:43 +1000 Subject: 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 --- src/app/stateChange.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/app/stateChange.cpp') 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 #include #include +#include +#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); } -- cgit v1.2.3