Start implementation of a method to save the entire stream

This commit is contained in:
jfmcarreira committed 2018-01-05 17:27:16 +00:00
1 parent 7e44308626
commit bc5258a94d
4 files changed
+50 -3

No files matched your search

+36 -2
View File
@@ -312,7 +312,34 @@ Void PlaYUVerApp::openRecent()
loadFile( recentFile.m_cFilename, &recentFile );
}
Void PlaYUVerApp::save()
Void PlaYUVerApp::saveFrame()
{
if( m_pcCurrentVideoSubWindow )
{
VideoSubWindow* saveWindow = m_pcCurrentVideoSubWindow;
QStringList fileNames = showFileDialog( false );
if( fileNames.size() == 1 )
{
QString fileName = fileNames[0];
m_cLastOpenPath = QFileInfo( fileName ).path();
try
{
saveWindow->save( fileName );
}
catch( PlaYUVerFailure& e )
{
QApplication::restoreOverrideCursor();
QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
printMessage( warningMsg, LOG_ERROR );
return;
}
}
}
}
Void PlaYUVerApp::saveStream()
{
if( m_pcCurrentVideoSubWindow )
{
@@ -612,7 +639,13 @@ Void PlaYUVerApp::createActions()
m_arrayActions[SAVE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogSaveButton ) );
m_arrayActions[SAVE_ACT]->setShortcuts( QKeySequence::SaveAs );
m_arrayActions[SAVE_ACT]->setStatusTip( tr( "Save current frame" ) );
connect( m_arrayActions[SAVE_ACT], SIGNAL( triggered() ), this, SLOT( save() ) );
connect( m_arrayActions[SAVE_ACT], SIGNAL( triggered() ), this, SLOT( saveFrame() ) );
m_arrayActions[SAVE_STREAM_ACT] = new QAction( QIcon( ":/images/save.png" ), tr( "&Save Stream" ), this );
m_arrayActions[SAVE_STREAM_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogSaveButton ) );
m_arrayActions[SAVE_STREAM_ACT]->setShortcuts( QKeySequence::SaveAs );
m_arrayActions[SAVE_STREAM_ACT]->setStatusTip( tr( "Save current stream" ) );
connect( m_arrayActions[SAVE_ACT], SIGNAL( triggered() ), this, SLOT( saveStream() ) );
m_arrayActions[FORMAT_ACT] = new QAction( tr( "&Format" ), this );
m_arrayActions[FORMAT_ACT]->setIcon( QIcon::fromTheme( "transform-scale", QIcon( ":/images/configuredialog.png" ) ) );
@@ -722,6 +755,7 @@ Void PlaYUVerApp::createMenus()
}
m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[SAVE_ACT] );
// m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[SAVE_STREAM_ACT] );
m_arrayMenu[FILE_MENU]->addSeparator();
m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[FORMAT_ACT] );
m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[RELOAD_ACT] );
+3 -1
View File
@@ -91,7 +91,8 @@ private Q_SLOTS:
void open();
// void openDevice();
void openRecent();
void save();
void saveFrame();
void saveStream();
void format();
void reload();
void reloadAll();
@@ -210,6 +211,7 @@ private:
OPEN_ACT = 0,
OPEN_DEVICE_ACT,
SAVE_ACT,
SAVE_STREAM_ACT,
FORMAT_ACT,
RELOAD_ACT,
RELOAD_ALL_ACT,
+10
View File
@@ -700,6 +700,16 @@ Bool VideoSubWindow::save( QString filename )
return iRet;
}
Bool VideoSubWindow::saveStream( QString filename )
{
Bool iRet = false;
QApplication::setOverrideCursor( Qt::WaitCursor );
// TODO: implement this
QApplication::restoreOverrideCursor();
return iRet;
}
Bool VideoSubWindow::play()
{
if( m_pCurrStream && m_pCurrStream->getFrameNum() > 1 )
+1
View File
@@ -113,6 +113,7 @@ public:
Bool loadFile( PlaYUVerStreamInfo* streamInfo );
Void loadAll();
Bool save( QString filename );
Bool saveStream( QString filename );
Void refreshSubWindow();
Void refreshFrame( Bool bThreaded = false );