From 267e71b738cfb04c3220e4aa6824b1c9a1c6b8d2 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 28 Apr 2017 00:16:21 -0400 Subject: Clean up the UI for lumina-mediaplayer, and disable video output (still getting gstreamer stream crashes when the video widget is not visible). --- .../desktop-utils/lumina-mediaplayer/mainUI.cpp | 16 ++-- src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h | 2 +- src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui | 95 +++++++++------------- 3 files changed, 48 insertions(+), 65 deletions(-) (limited to 'src-qt5/desktop-utils') diff --git a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp index 65fa7319..b912d784 100644 --- a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp +++ b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp @@ -21,14 +21,15 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){ ui->setupUi(this); closing = false; + DISABLE_VIDEO = true; //add a toggle in the UI for this later //Any special UI changes QWidget *spacer = new QWidget(this); spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - ui->toolBar->insertWidget(ui->actionVolDown, spacer); + ui->toolBar->insertWidget(ui->radio_local, spacer); //Setup an action group for the various modes/streams - QButtonGroup *grp = new QButtonGroup(this); - grp->addButton(ui->radio_local); - grp->addButton(ui->radio_pandora); + QActionGroup *grp = new QActionGroup(this); + grp->addAction(ui->radio_local); + grp->addAction(ui->radio_pandora); grp->setExclusive(true); ui->radio_pandora->setChecked(true); @@ -59,7 +60,7 @@ void MainUI::setupPlayer(){ ui->videoLayout->addWidget(VIDEO); //Now setup the interfaces between all these objects - PLAYER->setVideoOutput(VIDEO); + if(!DISABLE_VIDEO){ PLAYER->setVideoOutput(VIDEO); } PLAYER->setPlaylist(PLAYLIST); PLAYER->setVolume(100); //just maximize this - will be managed outside this app @@ -419,7 +420,8 @@ void MainUI::LocalListMediaRemoved(int start, int end){ }*/ void MainUI::LocalVideoAvailable(bool avail){ - //qDebug() << "Local VideoAvailable:" << avail; + qDebug() << "Local VideoAvailable:" << avail; + if(DISABLE_VIDEO){ avail = false; } //TEMPORARY DISABLE while working out gstreamer issues when video widget is hidden //if(ui->tabWidget_local->currentWidget()==ui->tab_local_playing && avail){ VIDEO->setVisible(avail); //} @@ -478,7 +480,7 @@ void MainUI::LocalStateChanged(QMediaPlayer::State state){ }else if(state == QMediaPlayer::PlayingState && !ui->tabWidget_local->isTabEnabled(0)){ ui->tabWidget_local->setTabEnabled(0,true); ui->tabWidget_local->setCurrentWidget(ui->tab_local_playing); - }else if(PLAYER->mediaStatus()== QMediaPlayer::BufferingMedia || PLAYER->mediaStatus()==QMediaPlayer::BufferedMedia){ + }else if(!DISABLE_VIDEO && (PLAYER->mediaStatus()== QMediaPlayer::BufferingMedia || PLAYER->mediaStatus()==QMediaPlayer::BufferedMedia) ){ if(VIDEO->isVisible() != PLAYER->isVideoAvailable()){ VIDEO->setVisible(PLAYER->isVideoAvailable()); } } diff --git a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h index 5856b257..cc966f4d 100644 --- a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h +++ b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h @@ -40,7 +40,7 @@ private: QVideoWidget *VIDEO; QMediaPlaylist *PLAYLIST; QSystemTrayIcon *SYSTRAY; - bool closing; + bool closing, DISABLE_VIDEO; void setupPlayer(); void setupPandora(); diff --git a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui index 385c534e..7b357b4d 100644 --- a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui +++ b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui @@ -6,8 +6,8 @@ 0 0 - 385 - 479 + 405 + 473 @@ -30,66 +30,18 @@ 0 - - - - - 1 - - - 1 - - - - - Local Files - - - true - - - false - - - Qt::ToolButtonTextBesideIcon - - - true - - - - - - - Pandora Radio - - - - :/pandora:/pandora - - - true - - - Qt::ToolButtonTextBesideIcon - - - true - - - - - - - 0 + 1 + + QTabWidget::West + 1 @@ -298,6 +250,9 @@ + + QTabWidget::West + 1 @@ -717,7 +672,7 @@ 0 0 - 385 + 405 24 @@ -763,8 +718,8 @@ - - + + @@ -864,6 +819,32 @@ Search for a new station + + + true + + + + :/pandora:/pandora + + + Pandora Radio + + + Stream from Pandora Radio + + + + + true + + + Local Files + + + Play Local Files + + -- cgit