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]>2025-01-11 12:12:32 +1000
commit5cfecec40972f7d6f77879e1209bc10d6019625b (patch)
treeb94f3a2565f83e61821d1a8544f156cda42a4f41 /src/app/mainWindow.cpp
parente023e2eafb5dc39fe11595f343d867ac6ebe7f5b (diff)
downloadcodeine-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 <[email protected]>
Diffstat (limited to 'src/app/mainWindow.cpp')
-rw-r--r--src/app/mainWindow.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/app/mainWindow.cpp b/src/app/mainWindow.cpp
index 9409d85..5861427 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
@@ -523,7 +536,6 @@ show_toolbar:
//we aren't managed by mainWindow when at FullScreen
videoWindow()->move( 0, 0 );
videoWindow()->resize( ((TQWidget*)o)->size() );
- videoWindow()->lower();
}
if (o == m_toolbar)
@@ -580,14 +592,12 @@ MainWindow::fullScreenToggled( bool isFullScreen )
statusBar()->setHidden( isFullScreen );
setMouseTracking( isFullScreen ); /// @see mouseMoveEvent()
+ m_widgetStack->setMouseTracking(isFullScreen);
if (isFullScreen)
s_handler = new FullScreenToolBarHandler( this );
else
delete s_handler;
-
- // prevent videoWindow() moving around when mouse moves
- setCentralWidget( isFullScreen ? nullptr : videoWindow() );
}
void