Improve videohandle and separate settings
This commit is contained in:
1 parent
edc58414a7
commit
4420d28bb7
10 files changed
+137
-92
No files matched your search
@@ -168,6 +168,16 @@ Void ModulesHandle::updateMenus()
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::readSettings()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Void ModulesHandle::writeSettings()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Void ModulesHandle::processOpt( Int index )
|
||||
{
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow *>( m_pcMdiArea->activeSubWindow() );
|
||||
|
||||
+4
-2
@@ -55,11 +55,13 @@ public:
|
||||
Void createActions();
|
||||
QMenu* createMenu();
|
||||
//QDockWidget* createDock();
|
||||
Void updateMenus( );
|
||||
Void updateMenus();
|
||||
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
|
||||
SubWindowHandle* processModuleHandlingOpt();
|
||||
|
||||
|
||||
static Void destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
static Bool applyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf, Bool isPlaying = false, Bool disableThreads = false );
|
||||
|
||||
|
||||
+32
-22
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file QualityMeasurement.cpp
|
||||
* \file QualityHandle.cpp
|
||||
* \brief Definition of the quality measurement sidebar
|
||||
*/
|
||||
|
||||
@@ -30,19 +30,19 @@
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
QualityMeasurement::QualityMeasurement( QWidget* parent, QMdiArea* mdiArea ) :
|
||||
QualityHandle::QualityHandle( QWidget* parent, QMdiArea* mdiArea ) :
|
||||
m_pcParet( parent ),
|
||||
m_pcMainWindowMdiArea( mdiArea )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QualityMeasurement::~QualityMeasurement()
|
||||
QualityHandle::~QualityHandle()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Void QualityMeasurement::createActions()
|
||||
Void QualityHandle::createActions()
|
||||
{
|
||||
m_actionGroupQualityMetric = new QActionGroup( this );
|
||||
m_actionGroupQualityMetric->setExclusive( true );
|
||||
@@ -65,7 +65,7 @@ Void QualityMeasurement::createActions()
|
||||
connect( m_arrayActions[SELECT_REF_ACT], SIGNAL( triggered() ), this, SLOT( slotSelectReference() ) );
|
||||
}
|
||||
|
||||
QMenu* QualityMeasurement::createMenu()
|
||||
QMenu* QualityHandle::createMenu()
|
||||
{
|
||||
m_pcMenuQuality = new QMenu( "Quality", this );
|
||||
QMenu* metricsSubMenu = m_pcMenuQuality->addMenu( "Quality Metrics" );
|
||||
@@ -76,38 +76,48 @@ QMenu* QualityMeasurement::createMenu()
|
||||
return m_pcMenuQuality;
|
||||
}
|
||||
|
||||
QDockWidget* QualityMeasurement::createDock()
|
||||
QDockWidget* QualityHandle::createDock()
|
||||
{
|
||||
m_pcQualityMeasurementSideBar = new QualityMeasurementSidebar( m_pcParet, m_pcMainWindowMdiArea );
|
||||
m_pcQualityMeasurementDock = new QDockWidget( tr( "Quality Measurement" ), this );
|
||||
m_pcQualityMeasurementDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
m_pcQualityMeasurementDock->setWidget( m_pcQualityMeasurementSideBar );
|
||||
m_pcQualityHandleSideBar = new QualityMeasurementSidebar( m_pcParet, m_pcMainWindowMdiArea );
|
||||
m_pcQualityHandleDock = new QDockWidget( tr( "Quality Measurement" ), this );
|
||||
m_pcQualityHandleDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
m_pcQualityHandleDock->setWidget( m_pcQualityHandleSideBar );
|
||||
|
||||
connect( m_pcQualityMeasurementSideBar, SIGNAL( signalQualityMetricChanged(int) ), this, SLOT( slotQualityMetricChanged(int) ) );
|
||||
connect( m_pcQualityHandleSideBar, SIGNAL( signalQualityMetricChanged(int) ), this, SLOT( slotQualityMetricChanged(int) ) );
|
||||
connect( m_mapperQualityMetric, SIGNAL( mapped(int) ), this, SLOT( slotQualityMetricChanged(int) ) );
|
||||
|
||||
return m_pcQualityMeasurementDock;
|
||||
return m_pcQualityHandleDock;
|
||||
}
|
||||
|
||||
Void QualityMeasurement::updateMenus()
|
||||
Void QualityHandle::updateMenus()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Void QualityMeasurement::update( VideoSubWindow* currSubWindow )
|
||||
Void QualityHandle::readSettings()
|
||||
{
|
||||
m_pcQualityMeasurementSideBar->updateSubWindowList();
|
||||
m_pcQualityMeasurementSideBar->updateCurrentWindow( currSubWindow );
|
||||
|
||||
}
|
||||
|
||||
Void QualityMeasurement::slotQualityMetricChanged( Int idx )
|
||||
Void QualityHandle::writeSettings()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Void QualityHandle::update( VideoSubWindow* currSubWindow )
|
||||
{
|
||||
m_pcQualityHandleSideBar->updateSubWindowList();
|
||||
m_pcQualityHandleSideBar->updateCurrentWindow( currSubWindow );
|
||||
}
|
||||
|
||||
Void QualityHandle::slotQualityMetricChanged( Int idx )
|
||||
{
|
||||
m_actionGroupQualityMetric->actions().at( idx )->setChecked( true );
|
||||
m_pcQualityMeasurementSideBar->updateQualityMetric( idx );
|
||||
m_pcQualityMeasurementDock->show();
|
||||
m_pcQualityHandleSideBar->updateQualityMetric( idx );
|
||||
m_pcQualityHandleDock->show();
|
||||
}
|
||||
|
||||
Void QualityMeasurement::slotSelectReference()
|
||||
Void QualityHandle::slotSelectReference()
|
||||
{
|
||||
DialogSubWindowSelector dialogWindowSelection( this, m_pcMainWindowMdiArea, 1, 1 );
|
||||
if( dialogWindowSelection.exec() == QDialog::Accepted )
|
||||
@@ -130,8 +140,8 @@ Void QualityMeasurement::slotSelectReference()
|
||||
pcVideoSubWindow = subWindowList.at( i );
|
||||
pcVideoSubWindow->setRefSubWindow( pcRefSubWindow );
|
||||
}
|
||||
m_pcQualityMeasurementSideBar->updateSidebarData();
|
||||
m_pcQualityMeasurementDock->show();
|
||||
m_pcQualityHandleSideBar->updateSidebarData();
|
||||
m_pcQualityHandleDock->show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
-6
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file QualityMeasurement.h
|
||||
* \file QualityHandle.h
|
||||
* \brief Definition of the quality measurement sidebar
|
||||
*/
|
||||
|
||||
@@ -40,18 +40,21 @@ namespace plaYUVer
|
||||
|
||||
class VideoSubWindow;
|
||||
|
||||
class QualityMeasurement: public QWidget
|
||||
class QualityHandle: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QualityMeasurement( QWidget*, QMdiArea * );
|
||||
~QualityMeasurement();
|
||||
QualityHandle( QWidget*, QMdiArea * );
|
||||
~QualityHandle();
|
||||
|
||||
Void createActions();
|
||||
QMenu* createMenu();
|
||||
QDockWidget* createDock();
|
||||
Void updateMenus();
|
||||
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
|
||||
Void update( VideoSubWindow* currSubWindow );
|
||||
|
||||
private:
|
||||
@@ -68,8 +71,8 @@ private:
|
||||
|
||||
QMenu* m_pcMenuQuality;
|
||||
|
||||
QDockWidget* m_pcQualityMeasurementDock;
|
||||
QualityMeasurementSidebar* m_pcQualityMeasurementSideBar;
|
||||
QDockWidget* m_pcQualityHandleDock;
|
||||
QualityMeasurementSidebar* m_pcQualityHandleSideBar;
|
||||
|
||||
private Q_SLOTS:
|
||||
void slotQualityMetricChanged( int );
|
||||
|
||||
@@ -73,31 +73,6 @@ Void Settings::setSelectedTool( Int tool )
|
||||
m_settings.setValue( "MainWindow/SelectedTool", tool );
|
||||
}
|
||||
|
||||
Void Settings::setDockVisibility( Bool statusStreamProperties, Bool statusFrameProperties, Bool statusQualityMeasurement )
|
||||
{
|
||||
m_settings.setValue( "Dock/StreamProperties", statusStreamProperties );
|
||||
m_settings.setValue( "Dock/FrameProperties", statusFrameProperties );
|
||||
m_settings.setValue( "Dock/QualityMeasurement", statusQualityMeasurement );
|
||||
}
|
||||
|
||||
Void Settings::getDockVisibility( Bool& statusStreamProperties, Bool& statusFrameProperties, Bool& statusQualityMeasurement )
|
||||
{
|
||||
statusStreamProperties = m_settings.value( "Dock/StreamProperties", true ).toBool();
|
||||
statusFrameProperties = m_settings.value( "Dock/FrameProperties", true ).toBool();
|
||||
statusQualityMeasurement = m_settings.value( "Dock/QualityMeasurement", true ).toBool();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - PLaying Settings - - - - - - - - - - - - - - - -
|
||||
|
||||
Bool Settings::getRepeat()
|
||||
{
|
||||
return m_settings.value( "Playing/Repeat", false ).toBool();
|
||||
}
|
||||
Void Settings::setPlayingSettings( Bool repeat)
|
||||
{
|
||||
m_settings.setValue( "Playing/Repeat", repeat );
|
||||
}
|
||||
|
||||
Void Settings::setRecentFileList( PlaYUVerStreamInfoVector recentFileList )
|
||||
{
|
||||
QVariant var;
|
||||
|
||||
@@ -53,12 +53,6 @@ public:
|
||||
Int getSelectedTool();
|
||||
Void setSelectedTool( Int);
|
||||
|
||||
Bool getRepeat();
|
||||
Void setPlayingSettings( Bool repeat );
|
||||
|
||||
Void setDockVisibility( Bool statusStreamProperties, Bool statusFrameProperties, Bool statusQualityMeasurement );
|
||||
Void getDockVisibility( Bool& statusStreamProperties, Bool& statusFrameProperties, Bool& statusQualityMeasurement );
|
||||
|
||||
// - - - - - - - - - - Recent Files Settings - - - - - - - - - - - - -
|
||||
Void setRecentFileList( PlaYUVerStreamInfoVector recentFileList );
|
||||
PlaYUVerStreamInfoVector getRecentFileList();
|
||||
|
||||
+68
-5
@@ -96,7 +96,7 @@ Void VideoHandle::createActions()
|
||||
|
||||
QMenu* VideoHandle::createMenu()
|
||||
{
|
||||
m_pcMenuVideo = new QMenu( "Video1", this );
|
||||
m_pcMenuVideo = new QMenu( "Video", this );
|
||||
m_pcMenuVideo->addAction( m_arrayActions[PLAY_ACT] );
|
||||
m_pcMenuVideo->addAction( m_arrayActions[STOP_ACT] );
|
||||
m_pcMenuVideo->addAction( m_arrayActions[VIDEO_BACKWARD_ACT] );
|
||||
@@ -138,6 +138,37 @@ QDockWidget* VideoHandle::createDock()
|
||||
return m_pcFramePropertiesDock;
|
||||
}
|
||||
|
||||
QWidget* VideoHandle::createStatusBarMessage()
|
||||
{
|
||||
QWidget* statusBarWidget = new QWidget;
|
||||
QHBoxLayout* mainlayout = new QHBoxLayout;
|
||||
|
||||
m_pcFormatCodeLabel = new QLabel;
|
||||
m_pcFormatCodeLabel->setText( " " );
|
||||
m_pcFormatCodeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
|
||||
m_pcFormatCodeLabel->setMinimumWidth( 100 );
|
||||
m_pcFormatCodeLabel->setAlignment( Qt::AlignCenter );
|
||||
|
||||
m_pcResolutionLabel = new QLabel;
|
||||
m_pcResolutionLabel->setText( " " );
|
||||
m_pcResolutionLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
|
||||
m_pcResolutionLabel->setMinimumWidth( 90 );
|
||||
m_pcResolutionLabel->setAlignment( Qt::AlignCenter );
|
||||
|
||||
m_pcColorSpace = new QLabel;
|
||||
m_pcColorSpace->setText( " " );
|
||||
m_pcColorSpace->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
|
||||
m_pcColorSpace->setMinimumWidth( 60 );
|
||||
m_pcColorSpace->setAlignment( Qt::AlignCenter );
|
||||
|
||||
mainlayout->addWidget( m_pcFormatCodeLabel );
|
||||
mainlayout->addWidget( m_pcResolutionLabel );
|
||||
mainlayout->addWidget( m_pcColorSpace );
|
||||
statusBarWidget->setLayout( mainlayout );
|
||||
|
||||
return statusBarWidget;
|
||||
}
|
||||
|
||||
Void VideoHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow *>( m_pcMainWindowMdiArea->activeSubWindow() );
|
||||
@@ -158,26 +189,58 @@ Void VideoHandle::updateMenus()
|
||||
}
|
||||
}
|
||||
|
||||
Void VideoHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
m_arrayActions[VIDEO_LOOP_ACT]->setChecked( appSettings.value( "VideoHandle/Repeat", false ).toBool() );
|
||||
if( !appSettings.value( "VideoHandle/FrameProperties", true ).toBool() )
|
||||
m_pcFramePropertiesDock->close();
|
||||
}
|
||||
|
||||
Void VideoHandle::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
appSettings.setValue( "VideoHandle/Repeat", m_arrayActions[VIDEO_LOOP_ACT]->isChecked() );
|
||||
appSettings.setValue( "VideoHandle/FrameProperties", m_pcFramePropertiesSideBar->isVisible() );
|
||||
}
|
||||
|
||||
Void VideoHandle::update()
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
PlaYUVerStream* pcStream = m_pcCurrentVideoSubWindow->getInputStream();
|
||||
PlaYUVerFrame* pcFrame = m_pcCurrentVideoSubWindow->getCurrFrame();
|
||||
|
||||
Int frame_num = 0;
|
||||
UInt64 total_frame_num = 1;
|
||||
if( m_pcCurrentVideoSubWindow->getInputStream() )
|
||||
|
||||
QString resolution;
|
||||
if( pcFrame )
|
||||
{
|
||||
frame_num = m_pcCurrentVideoSubWindow->getInputStream()->getCurrFrameNum();
|
||||
m_pcColorSpace->setText( PlaYUVerFrame::supportedPixelFormatListNames().at( pcFrame->getPelFormat() ) );
|
||||
resolution.append( QString( "%1x%2" ).arg( pcFrame->getWidth() ).arg( pcFrame->getHeight() ) );
|
||||
}
|
||||
|
||||
if( pcStream )
|
||||
{
|
||||
frame_num = pcStream->getCurrFrameNum();
|
||||
m_pcFrameNumInfo->setCurrFrameNum( frame_num );
|
||||
total_frame_num = getMaxFrameNumber();
|
||||
//m_pcStreamProperties->setData( m_pcCurrentVideoSubWindow->getInputStream() );
|
||||
|
||||
resolution.append( QString( "@%1" ).arg( pcStream->getFrameRate() ) );
|
||||
m_pcFormatCodeLabel->setText( QString( "%1 | %2" ).arg( pcStream->getFormatName() ).arg( pcStream->getCodecName() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
//m_pcStreamProperties->setData( NULL );
|
||||
m_pcFrameNumInfo->setCurrFrameNum( 0 );
|
||||
m_pcFormatCodeLabel->clear();
|
||||
}
|
||||
|
||||
m_pcFramePropertiesSideBar->setData( m_pcCurrentVideoSubWindow->getCurrFrame(), m_pcCurrentVideoSubWindow->isPlaying() );
|
||||
if( pcFrame )
|
||||
m_pcResolutionLabel->setText( resolution );
|
||||
|
||||
m_pcFramePropertiesSideBar->setData( pcFrame, m_pcCurrentVideoSubWindow->isPlaying() );
|
||||
|
||||
m_pcFrameSlider->setValue( frame_num );
|
||||
m_pcFrameSlider->setMaximum( total_frame_num - 1 );
|
||||
|
||||
+8
-1
@@ -52,11 +52,14 @@ public:
|
||||
QMenu* createMenu();
|
||||
QToolBar* createToolBar();
|
||||
QDockWidget* createDock();
|
||||
QWidget* createStatusBarMessage();
|
||||
Void updateMenus();
|
||||
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
|
||||
Void update( VideoSubWindow* currSubWindow );
|
||||
|
||||
Bool* getIsPlayingPtr() { return &m_bIsPlaying; }
|
||||
Void closeSubWindow( VideoSubWindow* currSubWindow );
|
||||
|
||||
private:
|
||||
@@ -85,6 +88,10 @@ private:
|
||||
QDockWidget* m_pcFramePropertiesDock;
|
||||
FramePropertiesSideBar* m_pcFramePropertiesSideBar;
|
||||
|
||||
QLabel* m_pcFormatCodeLabel;
|
||||
QLabel* m_pcResolutionLabel;
|
||||
QLabel* m_pcColorSpace;
|
||||
|
||||
VideoSubWindow* m_pcCurrentVideoSubWindow;
|
||||
QVector<VideoSubWindow*> m_acPlayingSubWindows;
|
||||
|
||||
|
||||
+5
-19
@@ -56,7 +56,7 @@ plaYUVerApp::plaYUVerApp()
|
||||
connect( mapperWindow, SIGNAL( mapped(QWidget*) ), this, SLOT( setActiveSubWindow(QWidget*) ) );
|
||||
|
||||
m_appModuleVideo = new VideoHandle( this, mdiArea );
|
||||
m_appModuleQuality = new QualityMeasurement( this, mdiArea );
|
||||
m_appModuleQuality = new QualityHandle( this, mdiArea );
|
||||
m_appModuleExtensions = new ModulesHandle( this, mdiArea );
|
||||
|
||||
createActions();
|
||||
@@ -1008,19 +1008,13 @@ Void plaYUVerApp::createDockWidgets()
|
||||
// Properties Dock Window
|
||||
m_arraySideBars.resize( TOTAL_DOCK );
|
||||
|
||||
m_pcStreamProperties = new StreamPropertiesSideBar( this );
|
||||
m_arraySideBars[STREAM_DOCK] = new QDockWidget( tr( "Stream Information" ), this );
|
||||
m_arraySideBars[STREAM_DOCK]->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
m_arraySideBars[STREAM_DOCK]->setWidget( m_pcStreamProperties );
|
||||
addDockWidget( Qt::RightDockWidgetArea, m_arraySideBars[STREAM_DOCK] );
|
||||
connect( m_arraySideBars[STREAM_DOCK], SIGNAL( visibilityChanged(bool) ), this, SLOT( updateStreamProperties() ) );
|
||||
|
||||
addDockWidget( Qt::RightDockWidgetArea, m_appModuleVideo->createDock() );
|
||||
addDockWidget( Qt::RightDockWidgetArea, m_appModuleQuality->createDock() );
|
||||
}
|
||||
|
||||
Void plaYUVerApp::createStatusBar()
|
||||
{
|
||||
statusBar()->addPermanentWidget( m_appModuleVideo->createStatusBarMessage() );
|
||||
statusBar()->showMessage( tr( "Ready" ) );
|
||||
}
|
||||
|
||||
@@ -1034,19 +1028,11 @@ Void plaYUVerApp::readSettings()
|
||||
m_cLastOpenPath = settings.lastOpenPath();
|
||||
m_appTool = ( ViewArea::eTool )settings.getSelectedTool();
|
||||
setTool( m_appTool );
|
||||
//m_arrayActions[VIDEO_LOOP_ACT]->setChecked( settings.getRepeat() );
|
||||
|
||||
m_aRecentFileStreamInfo = settings.getRecentFileList();
|
||||
updateRecentFileActions();
|
||||
|
||||
Bool visibleStreamProp, visibleFrameProp, visibleQualityMeasure;
|
||||
settings.getDockVisibility( visibleStreamProp, visibleFrameProp, visibleQualityMeasure );
|
||||
if( !visibleStreamProp )
|
||||
m_arraySideBars[STREAM_DOCK]->close();
|
||||
if( !visibleFrameProp )
|
||||
m_arraySideBars[FRAME_DOCK]->close();
|
||||
if( !visibleQualityMeasure )
|
||||
m_arraySideBars[QUALITY_DOCK]->close();
|
||||
m_appModuleVideo->readSettings();
|
||||
|
||||
}
|
||||
|
||||
@@ -1058,8 +1044,8 @@ Void plaYUVerApp::writeSettings()
|
||||
settings.setLastOpenPath( m_cLastOpenPath );
|
||||
settings.setSelectedTool( ( Int )m_appTool );
|
||||
settings.setRecentFileList( m_aRecentFileStreamInfo );
|
||||
//settings.setDockVisibility( m_pcStreamProperties->isVisible(), m_pcFrameProperties->isVisible(), true );
|
||||
//settings.setPlayingSettings( m_arrayActions[VIDEO_LOOP_ACT]->isChecked() );
|
||||
|
||||
m_appModuleVideo->writeSettings();
|
||||
}
|
||||
|
||||
} // NAMESPACE
|
||||
+1
-6
@@ -184,7 +184,7 @@ private:
|
||||
* Modules
|
||||
*/
|
||||
VideoHandle* m_appModuleVideo;
|
||||
QualityMeasurement* m_appModuleQuality;
|
||||
QualityHandle* m_appModuleQuality;
|
||||
ModulesHandle *m_appModuleExtensions;
|
||||
|
||||
|
||||
@@ -214,15 +214,10 @@ private:
|
||||
*/
|
||||
enum SIDEBAR_LIST
|
||||
{
|
||||
STREAM_DOCK = 0,
|
||||
FRAME_DOCK,
|
||||
QUALITY_DOCK,
|
||||
TOTAL_DOCK,
|
||||
};
|
||||
QVector<QDockWidget*> m_arraySideBars;
|
||||
|
||||
StreamPropertiesSideBar* m_pcStreamProperties;
|
||||
|
||||
/**
|
||||
* Array of tool bars for the main app
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user