diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 7eccdda..b7dd61c 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -71,6 +71,7 @@ set(plaYUVer_App_SRCS ConfigureFormatDialog.cpp DialogSubWindowSelector.cpp ProgressBar.cpp + SeekStreamDialog.cpp # Widgets HistogramWidget.cpp WidgetFrameNumber.cpp diff --git a/app/ModulesHandleOptDialog.cpp b/app/ModulesHandleOptDialog.cpp index 17e3ad3..1814f8d 100644 --- a/app/ModulesHandleOptDialog.cpp +++ b/app/ModulesHandleOptDialog.cpp @@ -70,7 +70,6 @@ ModulesHandleOptDialog::ModulesHandleOptDialog( QWidget *parent, PlaYUVerAppModu { resize( 400, 10 ); setWindowTitle( "Select module parameters" ); - setWindowIcon( QIcon( ":/images/configureformat.png" ) ); const Options::OptionsList& moduleOptions = m_pcCurrModuleIf->m_pcModule->m_cModuleOptions.getOptionList(); diff --git a/app/VideoHandle.cpp b/app/VideoHandle.cpp index 7d53411..98fbdb3 100644 --- a/app/VideoHandle.cpp +++ b/app/VideoHandle.cpp @@ -27,6 +27,7 @@ #include "VideoSubWindow.h" #include "PlaYUVerSubWindowHandle.h" #include "DialogSubWindowSelector.h" +#include "SeekStreamDialog.h" #include "FramePropertiesDock.h" #include "WidgetFrameNumber.h" #include @@ -90,6 +91,10 @@ Void VideoHandle::createActions() connect( m_arrayActions[VIDEO_FORWARD_ACT], SIGNAL( triggered() ), m_mapperVideoSeek, SLOT( map() ) ); m_mapperVideoSeek->setMapping( m_arrayActions[VIDEO_FORWARD_ACT], 1 ); + m_arrayActions[VIDEO_GOTO_ACT] = new QAction( "Go to", this ); + m_arrayActions[VIDEO_GOTO_ACT]->setShortcut( tr( "Ctrl+G" ) ); + connect( m_arrayActions[VIDEO_GOTO_ACT], SIGNAL( triggered() ), this, SLOT( seekVideo() ) ); + m_arrayActions[VIDEO_LOOP_ACT] = new QAction( "Repeat", this ); m_arrayActions[VIDEO_LOOP_ACT]->setCheckable( true ); m_arrayActions[VIDEO_LOOP_ACT]->setChecked( false ); @@ -117,6 +122,8 @@ QMenu* VideoHandle::createMenu() m_pcMenuVideo->addAction( m_arrayActions[STOP_ACT] ); m_pcMenuVideo->addAction( m_arrayActions[VIDEO_BACKWARD_ACT] ); m_pcMenuVideo->addAction( m_arrayActions[VIDEO_FORWARD_ACT] ); + m_pcMenuVideo->addAction( m_arrayActions[VIDEO_GOTO_ACT] ); + m_pcMenuVideo->addSeparator(); m_pcMenuVideo->addAction( m_arrayActions[VIDEO_LOOP_ACT] ); m_pcMenuVideo->addAction( m_arrayActions[VIDEO_ZOOM_LOCK_ACT] ); m_pcMenuVideo->addAction( m_arrayActions[VIDEO_LOCK_SELECTION_ACT] ); @@ -562,6 +569,33 @@ Void VideoHandle::seekEvent( Int direction ) } } +Void VideoHandle::seekVideo() +{ + if( m_pcCurrentVideoSubWindow ) + { + if( m_pcCurrentVideoSubWindow->getInputStream() ) + { + SeekStreamDialog* dialogSeekVideo = new SeekStreamDialog( m_pcCurrentVideoSubWindow->getInputStream(), this ); + Int newFrameNum = dialogSeekVideo->runDialog(); + if( newFrameNum >= 0 ) + { + if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) ) + { + for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + { + m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( ( UInt )newFrameNum ); + } + } + else + { + m_pcCurrentVideoSubWindow->seekAbsoluteEvent( ( UInt )newFrameNum ); + } + emit changed(); + } + } + } +} + Void VideoHandle::seekSliderEvent( Int new_frame_num ) { if( m_pcCurrentVideoSubWindow ) diff --git a/app/VideoHandle.h b/app/VideoHandle.h index 60d6c90..94e01dd 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -79,6 +79,7 @@ private: STOP_ACT, VIDEO_FORWARD_ACT, VIDEO_BACKWARD_ACT, + VIDEO_GOTO_ACT, VIDEO_LOOP_ACT, VIDEO_ZOOM_LOCK_ACT, VIDEO_LOCK_ACT, @@ -129,6 +130,7 @@ private Q_SLOTS: void playEvent(); void seekSliderEvent( int new_frame_num ); void seekEvent( int direction ); + void seekVideo(); void videoSelectionButtonEvent(); }; diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 9a51129..bedf3d7 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -201,6 +201,7 @@ Void VideoSubWindow::refreshSubWindow() { refreshFrame(); } + updateVideoWindowInfo(); } Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog ) @@ -497,7 +498,6 @@ Void VideoSubWindow::setCurrFrame( PlaYUVerFrame* pcCurrFrame ) { m_pcCurrFrame = pcCurrFrame; m_cViewArea->setImage( m_pcCurrFrame ); - //updateVideoWindowInfo(); } }