From 681e8c0d6b6498a1867fabedda64e54d3c877a97 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 9 May 2014 05:21:04 +0100 Subject: [PATCH 1/3] Add function to return the max number of frames of the sequences in the display list --- source/app/plaYUVerApp.cpp | 15 +++++++++++++-- source/app/plaYUVerApp.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index c574d69..6905c5a 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -296,6 +296,18 @@ void plaYUVerApp::updatePropertiesSelectedArea( QRect area ) // ----------------------- Playing Functions -------------------- +UInt plaYUVerApp::getMaxFrameNumber() +{ + UInt currFrames; + UInt maxFrames = INT_MAX; + for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + { + currFrames = m_acPlayingSubWindows.at( i )->getInputStream()->getFrameNum(); + if( currFrames < maxFrames ) + maxFrames = currFrames; + } + return maxFrames; +} Void plaYUVerApp::setTimerStatus() { Bool status = false; @@ -337,7 +349,7 @@ void plaYUVerApp::play() m_acPlayingSubWindows.append( m_pcCurrentSubWindow ); m_pcCurrentSubWindow->seekAbsoluteEvent( m_acPlayingSubWindows.at( 0 )->getInputStream()->getCurrFrameNum() ); m_pcCurrentSubWindow->play(); - m_pcFrameSlider->setMaximum( qMin( m_pcFrameSlider->maximum(), ( Int )m_pcCurrentSubWindow->getInputStream()->getFrameNum() - 1 ) ); + m_pcFrameSlider->setMaximum( getMaxFrameNumber() - 1 ); } } else @@ -543,7 +555,6 @@ Void plaYUVerApp::zoomToFitAll() } } - void plaYUVerApp::scaleFrame( int ratio ) { if( activeSubWindow() ) diff --git a/source/app/plaYUVerApp.h b/source/app/plaYUVerApp.h index 4aa9bab..aa1cfe8 100644 --- a/source/app/plaYUVerApp.h +++ b/source/app/plaYUVerApp.h @@ -121,6 +121,7 @@ private: Void zoomToFitAll(); //! Playing functions + UInt getMaxFrameNumber(); Void setTimerStatus(); Void updateCurrFrameNum(); Void updateTotalFrameNum( UInt total_frame_num = 0 ); From b96bf3722733e132cd0025d59c1d73ca14c9ef44 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 9 May 2014 05:28:27 +0100 Subject: [PATCH 2/3] Add repeat and video lock to settings --- source/app/PlaYUVerSettings.cpp | 22 +++++++++++++++++++--- source/app/PlaYUVerSettings.h | 24 ++++++++++++++---------- source/app/plaYUVerApp.cpp | 3 +++ 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/source/app/PlaYUVerSettings.cpp b/source/app/PlaYUVerSettings.cpp index bebc09a..a89127b 100755 --- a/source/app/PlaYUVerSettings.cpp +++ b/source/app/PlaYUVerSettings.cpp @@ -38,7 +38,7 @@ QPoint PlaYUVerSettings::mainWindowPos() return m_settings.value( "MainWindow/pos", QPoint( 200, 200 ) ).toPoint(); } -void PlaYUVerSettings::setMainWindowPos( const QPoint & pos ) +Void PlaYUVerSettings::setMainWindowPos( const QPoint & pos ) { m_settings.setValue( "MainWindow/pos", pos ); } @@ -48,7 +48,7 @@ QSize PlaYUVerSettings::mainWindowSize() return m_settings.value( "MainWindow/size", QSize( 500, 400 ) ).toSize(); } -void PlaYUVerSettings::setMainWindowSize( const QSize & size ) +Void PlaYUVerSettings::setMainWindowSize( const QSize & size ) { m_settings.setValue( "MainWindow/size", size ); } @@ -58,11 +58,27 @@ QString PlaYUVerSettings::lastOpenPath() return m_settings.value( "MainWindow/lastOpenPath", QDir::homePath() ).toString(); } -void PlaYUVerSettings::setLastOpenPath( const QString & path ) +Void PlaYUVerSettings::setLastOpenPath( const QString & path ) { m_settings.setValue( "MainWindow/lastOpenPath", path ); } +// - - - - - - - - - - - - PLaying Settings - - - - - - - - - - - - - - - - + +Bool PlaYUVerSettings::getRepeat() +{ + return m_settings.value( "PLaying/Repeat", false ).toBool(); +} +Bool PlaYUVerSettings::getVideoLock() +{ + return m_settings.value( "PLaying/VideoLock", false ).toBool(); +} +Void PlaYUVerSettings::setPlayingSettings( Bool repeat, Bool lock ) +{ + m_settings.setValue( "PLaying/Repeat", repeat ); + m_settings.setValue( "PLaying/VideoLock", lock ); +} + // - - - - - - - - - - - - - - Grid Settings - - - - - - - - - - - - - - - - - - GridManager::Style PlaYUVerSettings::gridStyle() diff --git a/source/app/PlaYUVerSettings.h b/source/app/PlaYUVerSettings.h index d370150..d093142 100755 --- a/source/app/PlaYUVerSettings.h +++ b/source/app/PlaYUVerSettings.h @@ -28,7 +28,7 @@ #include "config.h" #include - +#include "TypeDef.h" #include "GridManager.h" namespace plaYUVer @@ -42,26 +42,30 @@ public: // - - - - - - - - - - Main Window Settings - - - - - - - - - - - - - QPoint mainWindowPos(); - void setMainWindowPos( const QPoint &v ); + Void setMainWindowPos( const QPoint &v ); QSize mainWindowSize(); - void setMainWindowSize( const QSize &v ); + Void setMainWindowSize( const QSize &v ); QString lastOpenPath(); - void setLastOpenPath( const QString &v ); + Void setLastOpenPath( const QString &v ); + + Bool getRepeat(); + Bool getVideoLock(); + Void setPlayingSettings( Bool repeat, Bool lock ); // - - - - - - - - - - - - Grid Settings - - - - - - - - - - - - - - - GridManager::Style gridStyle(); - void setGridStyle( GridManager::Style v ); + Void setGridStyle( GridManager::Style v ); QColor gridColor(); - void setGridColor( const QColor &v ); + Void setGridColor( const QColor &v ); - int gridHSpacing(); - void setGridHSpacing( int v ); + Int gridHSpacing(); + Void setGridHSpacing( int v ); - int gridVSpacing(); - void setGridVSpacing( int v ); + Int gridVSpacing(); + Void setGridVSpacing( int v ); private: QSettings m_settings; diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index 6905c5a..36594be 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -1073,6 +1073,8 @@ Void plaYUVerApp::readSettings() move( pos ); resize( size ); m_cLastOpenPath = settings.lastOpenPath(); + m_arrayActions[VIDEO_LOOP_ACT]->setChecked( settings.getRepeat() ); + m_arrayActions[VIDEO_LOCK_ACT]->setChecked( settings.getVideoLock() ); } Void plaYUVerApp::writeSettings() @@ -1081,6 +1083,7 @@ Void plaYUVerApp::writeSettings() settings.setMainWindowPos( pos() ); settings.setMainWindowSize( size() ); settings.setLastOpenPath( m_cLastOpenPath ); + settings.setPlayingSettings( m_arrayActions[VIDEO_LOOP_ACT]->isChecked(), m_arrayActions[VIDEO_LOCK_ACT]->isChecked() ); } } // NAMESPACE From a868442c1f9eec13842854bea23aff6514585ad0 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 9 May 2014 05:33:24 +0100 Subject: [PATCH 3/3] merge dialog box to select sub windows into master --- resources/icons/windowscascade.png | Bin 0 -> 624 bytes resources/icons/windowstile.png | Bin 0 -> 547 bytes resources/playuver.qrc | 3 + source/app/DialogSubWindowSelector.cpp | 155 +++++++++++++++++++++++++ source/app/DialogSubWindowSelector.h | 81 +++++++++++++ source/app/SubWindowHandle.h | 4 + source/app/plaYUVerApp.cpp | 70 ++++++++--- source/app/plaYUVerApp.h | 3 + 8 files changed, 302 insertions(+), 14 deletions(-) create mode 100644 resources/icons/windowscascade.png create mode 100644 resources/icons/windowstile.png create mode 100755 source/app/DialogSubWindowSelector.cpp create mode 100755 source/app/DialogSubWindowSelector.h diff --git a/resources/icons/windowscascade.png b/resources/icons/windowscascade.png new file mode 100644 index 0000000000000000000000000000000000000000..02511b783941c63f26b518944309689d61cdd4a9 GIT binary patch literal 624 zcmV-$0+0QPP)jG>HG301Z<2_xC@Be}94W z&(941etlX15I~GBb6@;-Hxg&~`HO+!=MM&kA3uTk2NZv2VE7KCzki2fWHu58sfBy| z`zMCKpLQ_-1P}`+8w3%>Ip_fB*gu)(46!kOhB#{byLbj)?&vfLQq185kVo zNRJ$lAt1y4{R4*WzyDwi;{W>jpJCq-CI)~2Vj?G1;4&1(1}OjtASQ-?|H(A;KUPB_ zd#i*e+Ga6BHG2ME@QyzVq|%M z03yo8nBn;kN7y20fB+(BFs?|#9fAKq{$l_LAiP0=OCvF<0w92Jx)@m#E|+4HgEO6n|qM5+}0R{k;%`Vnl=fmLu0000< KMNUMnLSTZbF9x~* literal 0 HcmV?d00001 diff --git a/resources/icons/windowstile.png b/resources/icons/windowstile.png new file mode 100644 index 0000000000000000000000000000000000000000..dec58e3bc44c503fc7051915e8c1e34f3cda83c3 GIT binary patch literal 547 zcmV+;0^I$HP)bmCtGvK@i4&^C!v5f=VtT z0TF!zK?!>C<|PlYPoi((Rl$oVK?oi^c=F%_c*!PQS#4fCU{`Swi`K($TR3*Vjf-{1P_!NUP{53JSNc4uqNNoRN?)-f{pH+)j zPwvq=XjiamVYN!$K(m6TNuK8oSP4$xBB<<`7R5QZuZ#NDeofngbDet!-X{+b0>qd+ z%PsRuYF2v`>{H*~6EE%$8$y7PKtkp|&;1a+7cqh)B#2IY_*7EgIe?cBuD^`eAI~^B zKH}NKInc3`gqdL`%!DLdE53a%DgS3GHi7mz5+ybbcmUNXXt#z^lYx5xy8)0!zom9*ok*1Hgg0%>>)WKzKVY*Pu^E$M3{(lO zwkW(0T|?{!JX)t!{ucDMT(+qHo-{QLpw2k}il=XW>d|3E^pO~17kwD=5V5?LqQ&8) l>vs05q1e?wuiObLZ~=c2v>+_bJO=;(002ovPDHLkV1iPO`BeY_ literal 0 HcmV?d00001 diff --git a/resources/playuver.qrc b/resources/playuver.qrc index 9ae553b..7a54937 100755 --- a/resources/playuver.qrc +++ b/resources/playuver.qrc @@ -7,6 +7,9 @@ icons/exit.png icons/configuredialog.png + icons/windowstile.png + icons/windowscascade.png + icons/zoomin.png icons/zoomout.png icons/zoomtonormal.png diff --git a/source/app/DialogSubWindowSelector.cpp b/source/app/DialogSubWindowSelector.cpp new file mode 100755 index 0000000..d1e5ef6 --- /dev/null +++ b/source/app/DialogSubWindowSelector.cpp @@ -0,0 +1,155 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file DialogSubWindowSelector.cpp + * \brief Dialog box to select sub windows + */ + +#include "DialogSubWindowSelector.h" +#include "SubWindowHandle.h" +//#include "PlaYUVerFrame.h" +//#include "InputStream.h" + +namespace plaYUVer +{ + +DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, QMdiArea *mdiArea ) : + QDialog( parent ) +{ + QFont titleFont, menusFont; + + // Set variables + m_pcMainWindowMdiArea = mdiArea; + + titleFont.setPointSize( 14 ); + titleFont.setBold( true ); + titleFont.setWeight( 75 ); + + menusFont.setBold( true ); + menusFont.setWeight( 75 ); + + QSize windowSize( 350, 80 ); + resize( windowSize ); + setWindowTitle( "Sub Windows Selection" ); + + QHBoxLayout* MainLayout = new QHBoxLayout( this ); + + // Window list and add button + m_comboBoxWindowList = new QComboBox(); + QSizePolicy sizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); + sizePolicy.setHorizontalStretch( 0 ); + sizePolicy.setVerticalStretch( 0 ); + sizePolicy.setHeightForWidth( m_comboBoxWindowList->sizePolicy().hasHeightForWidth() ); + m_comboBoxWindowList->setSizePolicy( sizePolicy ); + m_comboBoxWindowList->setAcceptDrops( true ); + + updateSubWindowList(); + + m_pushButtonAdd = new QPushButton( "Add", this ); + m_pushButtonRemove = new QPushButton( "Remove", this ); + + // Selected Sub Window List + m_listSelectedWindows = new QListWidget( this ); + + // Confirmation buttons + QDialogButtonBox* dialogButtonOkCancel = new QDialogButtonBox(); + dialogButtonOkCancel->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok ); + dialogButtonOkCancel->setOrientation( Qt::Vertical ); + dialogButtonOkCancel->setCenterButtons( false ); + + // Create Layouts + QVBoxLayout* LeftVLayout = new QVBoxLayout(); + LeftVLayout->addWidget( m_comboBoxWindowList ); + //LeftVLayout->addItem( new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + LeftVLayout->addWidget( m_listSelectedWindows ); + + QVBoxLayout* RightVLayout = new QVBoxLayout(); + RightVLayout->addWidget( m_pushButtonAdd ); + RightVLayout->addWidget( m_pushButtonRemove ); + RightVLayout->addItem( new QSpacerItem( 40, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + RightVLayout->addWidget( dialogButtonOkCancel ); + + // Add components + //MainLayout->addItem( new QSpacerItem( 10, 5, QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + MainLayout->addLayout( LeftVLayout ); + MainLayout->addLayout( RightVLayout ); + + setLayout( MainLayout ); + + // Create actions + connect( dialogButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) ); + connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) ); + connect( m_pushButtonAdd, SIGNAL( clicked() ), this, SLOT( addSubWindow() ) ); + connect( m_pushButtonRemove, SIGNAL( clicked() ), this, SLOT( removeSubWindow() ) ); + QMetaObject::connectSlotsByName( this ); +} + +Void DialogSubWindowSelector::updateSubWindowList() +{ + SubWindowHandle *subWindow; + QString currSubWindowName; + m_pcWindowListNames.clear(); + for( Int i = 0; i < m_pcMainWindowMdiArea->subWindowList().size(); i++ ) + { + subWindow = qobject_cast( m_pcMainWindowMdiArea->subWindowList().at( i ) ); + currSubWindowName = subWindow->getWindowName(); + if( !m_pcSelectedWindowListNames.contains( currSubWindowName ) ) + m_pcWindowListNames.append( currSubWindowName ); + } + m_comboBoxWindowList->clear(); + m_comboBoxWindowList->insertItems( 0, m_pcWindowListNames ); + m_comboBoxWindowList->setCurrentIndex( -1 ); +} + +// ----------------------- Slot Functions ----------------------- + +void DialogSubWindowSelector::addSubWindow() +{ + Int iSelectedIdx = m_comboBoxWindowList->currentIndex(); + if( iSelectedIdx >= 0 ) + { + m_pcSelectedWindowListNames.append( m_pcWindowListNames.at( iSelectedIdx ) ); + m_listSelectedWindows->clear(); + m_listSelectedWindows->insertItems( 0, m_pcSelectedWindowListNames ); + updateSubWindowList(); + } +} + +void DialogSubWindowSelector::removeSubWindow() +{ + QList selectedWindows = m_listSelectedWindows->selectedItems(); + if( selectedWindows.size() ) + { + for( Int i = 0; i < selectedWindows.size(); i++ ) + { + QString currName = selectedWindows.at( i )->text(); + qDebug( ) << currName; + Int indexCurrName = m_pcSelectedWindowListNames.indexOf( currName ); + qDebug( ) << indexCurrName; + m_pcSelectedWindowListNames.removeAt( indexCurrName ); + m_listSelectedWindows->removeItemWidget( selectedWindows[i] ); + } + m_listSelectedWindows->clear(); + m_listSelectedWindows->insertItems( 0, m_pcSelectedWindowListNames ); + updateSubWindowList(); + } +} + +} // Namespace SCode diff --git a/source/app/DialogSubWindowSelector.h b/source/app/DialogSubWindowSelector.h new file mode 100755 index 0000000..efacf4c --- /dev/null +++ b/source/app/DialogSubWindowSelector.h @@ -0,0 +1,81 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file DialogSubWindowSelector.h + * \brief Dialog box to select sub windows + */ + +#ifndef __DIALOGSUBWINDOWSELECTOR_H__ +#define __DIALOGSUBWINDOWSELECTOR_H__ + +#include "config.h" + +#if( QT_VERSION_PLAYUVER == 5 ) +#include +#elif( QT_VERSION_PLAYUVER == 4 ) +#include +#endif +#include + +#include "TypeDef.h" + +class QPixmap; +class QColor; + +namespace plaYUVer +{ + +/** + * Class to define the dialog box to select sub windows + * This class enable the selection of several group of windows + */ +class DialogSubWindowSelector: public QDialog +{ +Q_OBJECT + +public: + DialogSubWindowSelector( QWidget *parent = 0, QMdiArea *mdiArea = 0 ); + QStringList getSelectedWindows() + { + return m_pcSelectedWindowListNames; + } +private: + QMdiArea* m_pcMainWindowMdiArea; + QStringList m_pcWindowListNames; + QStringList m_pcSelectedWindowListNames; + + QComboBox* m_comboBoxWindowList; + QPushButton* m_pushButtonAdd; + QPushButton* m_pushButtonRemove; + QListWidget* m_listSelectedWindows; + + Void updateSubWindowList(); + + + +private Q_SLOTS: + void addSubWindow(); + void removeSubWindow(); + +}; + +} // NAMESPACE + +#endif // __DIALOGSUBWINDOWSELECTOR_H__ diff --git a/source/app/SubWindowHandle.h b/source/app/SubWindowHandle.h index 6f3e708..4ed8df4 100644 --- a/source/app/SubWindowHandle.h +++ b/source/app/SubWindowHandle.h @@ -156,6 +156,10 @@ public: m_cWindowName = name; setWindowTitle( m_cWindowName ); } + QString getWindowName() + { + return m_cWindowName; + } QString userFriendlyCurrentFile() { diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index 36594be..5e3f1ce 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -25,6 +25,7 @@ #include "plaYUVerApp.h" #include "SubWindowHandle.h" #include "InputStream.h" +#include "DialogSubWindowSelector.h" #if( QT_VERSION_PLAYUVER == 5 ) #include @@ -325,6 +326,20 @@ Void plaYUVerApp::setTimerStatus() } } +Void plaYUVerApp::startPlay() +{ + if( !m_bIsPlaying ) + { + UInt frameRate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate(); + UInt timeInterval = ( UInt )( 1000.0 / frameRate + 0.5 ); + qDebug( ) << "Desired frame rate: " + << QString::number( 1000 / timeInterval ) + << " fps"; + playingTimer->start( timeInterval ); + m_cTimer.start(); + } +} + void plaYUVerApp::play() { if( !m_pcCurrentSubWindow ) @@ -361,17 +376,7 @@ void plaYUVerApp::play() m_uiAveragePlayInterval = 0; m_bIsPlaying = false; } - if( !m_bIsPlaying ) - { - UInt frameRate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate(); - UInt timeInterval = ( UInt )( 1000.0 / frameRate + 0.5 ); - qDebug( ) << "Desired frame rate: " - << QString::number( 1000 / timeInterval ) - << " fps"; - playingTimer->start( timeInterval ); - m_cTimer.start(); - } - + startPlay(); } void plaYUVerApp::pause() @@ -531,6 +536,33 @@ void plaYUVerApp::lockButtonEvent() } } +void plaYUVerApp::videoSelectionButtonEvent() +{ + DialogSubWindowSelector dialogWindowsSelection( this, mdiArea ); + if( dialogWindowsSelection.exec() == QDialog::Accepted ) + { + QStringList selectedWindows = dialogWindowsSelection.getSelectedWindows(); + m_acPlayingSubWindows.clear(); + SubWindowHandle *subWindow; + QString windowName; + for( Int i = 0; i < mdiArea->subWindowList().size(); i++ ) + { + subWindow = qobject_cast( mdiArea->subWindowList().at( i ) ); + windowName = subWindow->getWindowName(); + if( selectedWindows.contains( windowName ) ) + { + m_acPlayingSubWindows.append( subWindow ); + subWindow->seekAbsoluteEvent( m_acPlayingSubWindows.at( 0 )->getInputStream()->getCurrFrameNum() ); + subWindow->play(); + m_pcFrameSlider->setMaximum( qMin( m_pcFrameSlider->maximum(), ( Int )subWindow->getInputStream()->getFrameNum() - 1 ) ); + } + } + m_arrayActions[VIDEO_LOCK_ACT]->setChecked( true ); + startPlay(); + return; + } +} + // ----------------------- Zoom Functions ----------------------- void plaYUVerApp::normalSize() @@ -871,11 +903,12 @@ Void plaYUVerApp::createActions() mapperSeekVideo = new QSignalMapper( this ); connect( mapperSeekVideo, SIGNAL( mapped(int) ), this, SLOT( seekEvent(int) ) ); - m_arrayActions[VIDEO_BACKWARD_ACT] = new QAction( "VideoBackward", this ); + m_arrayActions[VIDEO_BACKWARD_ACT] = new QAction( "Video Backward", this ); m_arrayActions[VIDEO_BACKWARD_ACT]->setIcon( QIcon( style()->standardIcon( QStyle::SP_MediaSeekBackward ) ) ); connect( m_arrayActions[VIDEO_BACKWARD_ACT], SIGNAL( triggered() ), mapperSeekVideo, SLOT( map() ) ); mapperSeekVideo->setMapping( m_arrayActions[VIDEO_BACKWARD_ACT], 0 ); - m_arrayActions[VIDEO_FORWARD_ACT] = new QAction( "VideoForward", this ); + + m_arrayActions[VIDEO_FORWARD_ACT] = new QAction( "Video Forward", this ); m_arrayActions[VIDEO_FORWARD_ACT]->setIcon( QIcon( style()->standardIcon( QStyle::SP_MediaSeekForward ) ) ); connect( m_arrayActions[VIDEO_FORWARD_ACT], SIGNAL( triggered() ), mapperSeekVideo, SLOT( map() ) ); mapperSeekVideo->setMapping( m_arrayActions[VIDEO_FORWARD_ACT], 1 ); @@ -884,11 +917,15 @@ Void plaYUVerApp::createActions() m_arrayActions[VIDEO_LOOP_ACT]->setCheckable( true ); m_arrayActions[VIDEO_LOOP_ACT]->setChecked( false ); - m_arrayActions[VIDEO_LOCK_ACT] = new QAction( "VideoLock", this ); + m_arrayActions[VIDEO_LOCK_ACT] = new QAction( "Video Lock", this ); m_arrayActions[VIDEO_LOCK_ACT]->setCheckable( true ); m_arrayActions[VIDEO_LOCK_ACT]->setChecked( false ); connect( m_arrayActions[VIDEO_LOCK_ACT], SIGNAL( triggered() ), this, SLOT( lockButtonEvent() ) ); + m_arrayActions[VIDEO_LOCK_SELECTION_ACT] = new QAction( "Video Lock Window Selection", this ); + m_arrayActions[VIDEO_FORWARD_ACT]->setIcon( QIcon( style()->standardIcon( QStyle::SP_MediaSeekForward ) ) ); + connect( m_arrayActions[VIDEO_LOCK_SELECTION_ACT], SIGNAL( triggered() ), this, SLOT( videoSelectionButtonEvent() ) ); + m_pcFrameSlider = new QSlider; m_pcFrameSlider->setOrientation( Qt::Horizontal ); m_pcFrameSlider->setMaximumWidth( 100 ); @@ -918,20 +955,24 @@ Void plaYUVerApp::createActions() // ------------ Window ------------ m_arrayActions[TILE_WINDOWS_ACT] = new QAction( tr( "&Tile" ), this ); + m_arrayActions[TILE_WINDOWS_ACT]->setIcon( QIcon( ":images/windowstile.png" ) ); m_arrayActions[TILE_WINDOWS_ACT]->setStatusTip( tr( "Tile the windows" ) ); connect( m_arrayActions[TILE_WINDOWS_ACT], SIGNAL( triggered() ), mdiArea, SLOT( tileSubWindows() ) ); m_arrayActions[CASCADE_WINDOWS_ACT] = new QAction( tr( "&Cascade" ), this ); + m_arrayActions[CASCADE_WINDOWS_ACT]->setIcon( QIcon( ":images/windowscascade.png" ) ); m_arrayActions[CASCADE_WINDOWS_ACT]->setStatusTip( tr( "Cascade the windows" ) ); connect( m_arrayActions[CASCADE_WINDOWS_ACT], SIGNAL( triggered() ), mdiArea, SLOT( cascadeSubWindows() ) ); m_arrayActions[NEXT_WINDOWS_ACT] = new QAction( tr( "Ne&xt" ), this ); m_arrayActions[NEXT_WINDOWS_ACT]->setShortcuts( QKeySequence::NextChild ); + m_arrayActions[NEXT_WINDOWS_ACT]->setIcon( QIcon( style()->standardIcon( QStyle::SP_ArrowRight ) ) ); m_arrayActions[NEXT_WINDOWS_ACT]->setStatusTip( tr( "Move the focus to the next window" ) ); connect( m_arrayActions[NEXT_WINDOWS_ACT], SIGNAL( triggered() ), mdiArea, SLOT( activateNextSubWindow() ) ); m_arrayActions[PREVIOUS_WINDOWS_ACT] = new QAction( tr( "Pre&vious" ), this ); m_arrayActions[PREVIOUS_WINDOWS_ACT]->setShortcuts( QKeySequence::PreviousChild ); + m_arrayActions[PREVIOUS_WINDOWS_ACT]->setIcon( QIcon( style()->standardIcon( QStyle::SP_ArrowLeft ) ) ); m_arrayActions[PREVIOUS_WINDOWS_ACT]->setStatusTip( tr( "Move the focus to the previous window" ) ); connect( m_arrayActions[PREVIOUS_WINDOWS_ACT], SIGNAL( triggered() ), mdiArea, SLOT( activatePreviousSubWindow() ) ); @@ -991,6 +1032,7 @@ Void plaYUVerApp::createMenus() m_arrayMenu[VIDEO_MENU]->addAction( m_arrayActions[VIDEO_FORWARD_ACT] ); m_arrayMenu[VIDEO_MENU]->addAction( m_arrayActions[VIDEO_LOOP_ACT] ); m_arrayMenu[VIDEO_MENU]->addAction( m_arrayActions[VIDEO_LOCK_ACT] ); + m_arrayMenu[VIDEO_MENU]->addAction( m_arrayActions[VIDEO_LOCK_SELECTION_ACT] ); QMenu* modules_menu = m_pcModulesHandle->createMenus( menuBar() ); connect( modules_menu, SIGNAL( triggered(QAction *) ), this, SLOT( selectModule(QAction *) ) ); diff --git a/source/app/plaYUVerApp.h b/source/app/plaYUVerApp.h index aa1cfe8..5dbdd97 100644 --- a/source/app/plaYUVerApp.h +++ b/source/app/plaYUVerApp.h @@ -72,6 +72,7 @@ private Q_SLOTS: void seekSliderEvent( int new_frame_num ); void seekEvent( int direction ); void lockButtonEvent(); + void videoSelectionButtonEvent(); void selectModule( QAction * ); @@ -122,6 +123,7 @@ private: //! Playing functions UInt getMaxFrameNumber(); + Void startPlay(); Void setTimerStatus(); Void updateCurrFrameNum(); Void updateTotalFrameNum( UInt total_frame_num = 0 ); @@ -206,6 +208,7 @@ private: VIDEO_BACKWARD_ACT, VIDEO_LOOP_ACT, VIDEO_LOCK_ACT, + VIDEO_LOCK_SELECTION_ACT, NAVIGATION_TOOL_ACT, SELECTION_TOOL_ACT, TILE_WINDOWS_ACT,