summaryrefslogtreecommitdiffstats
path: root/src/app/stateChange.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/stateChange.cpp')
-rw-r--r--src/app/stateChange.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/app/stateChange.cpp b/src/app/stateChange.cpp
index 9322a13..e8b501f 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,22 @@ 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());
+ videoWindow()->setUpdatesEnabled(true);
+ m_audioView->setUpdatesEnabled(false);
+ }
+ else if (TheStream::hasAudio())
+ {
+ m_widgetStack->raiseWidget(m_audioView);
+ m_audioView->setUpdatesEnabled(true);
+ videoWindow()->setUpdatesEnabled(false);
}