summaryrefslogtreecommitdiffstats
path: root/src/app/mainWindow.cpp
diff options
context:
space:
mode:
authormio <[email protected]>2024-11-10 19:39:43 +1000
committermio <[email protected]>2024-12-21 10:32:07 +1000
commitb244f506a26fa4b009d060ec7f5d6c62f1c72a22 (patch)
tree8c82b9834f7121c68774b6c8ed81091984d530de /src/app/mainWindow.cpp
parent684ee3e2826a93cfc412b71138c1d1dd458549ce (diff)
downloadcodeine-b244f506a26fa4b009d060ec7f5d6c62f1c72a22.tar.gz
codeine-b244f506a26fa4b009d060ec7f5d6c62f1c72a22.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 <[email protected]>
Diffstat (limited to 'src/app/mainWindow.cpp')
-rw-r--r--src/app/mainWindow.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/app/mainWindow.cpp b/src/app/mainWindow.cpp
index 9409d85..ab8da70 100644
--- a/src/app/mainWindow.cpp
+++ b/src/app/mainWindow.cpp
@@ -22,11 +22,13 @@
#include <tqlayout.h> //ctor
#include <tqpopupmenu.h> //because XMLGUI is poorly designed
#include <tqobjectlist.h>
+#include <tqwidgetstack.h>
#include "../debug.h"
#include "../mxcl.library.h"
#include "actions.h"
#include "analyzer.h"
+#include "audioView.h"
#include "codeineConfig.h"
#include "extern.h" //dialog creation function definitions
#include "fullScreenAction.h"
@@ -70,8 +72,19 @@ MainWindow::MainWindow()
kapp->setMainWidget( this );
+ m_widgetStack = new TQWidgetStack(this, "m_widgetStack");
+
new VideoWindow( this );
- setCentralWidget( videoWindow() );
+
+ m_audioView = new AudioView(this, "m_audioView");
+
+ // videoWindow() will be the initial widget.
+ // m_audioView is raised when no video track is present.
+ m_widgetStack->addWidget(videoWindow());
+ m_widgetStack->addWidget(m_audioView);
+
+ setCentralWidget(m_widgetStack);
+
setFocusProxy( videoWindow() ); // essential! See VideoWindow::event(), TQEvent::FocusOut
// these have no affect beccause "KDE Knows Best" FFS