Commit a60e99ec authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Revert "Add the export menu"

This reverts commit 86f08902.
This breaks render to a file. Please test your changes.
parent 479ba91e
......@@ -43,7 +43,6 @@ SET(VLMC_SRCS
Gui/import/ImportController.cpp
Gui/import/ImportMediaCellView.cpp
Gui/import/ImportMediaListController.cpp
Gui/export/Export.cpp
Gui/library/ClipListViewController.cpp
Gui/library/ListViewController.cpp
Gui/library/MediaCellView.cpp
......@@ -119,8 +118,7 @@ SET (VLMC_HDRS
Gui/FileInfoListModel.h
Gui/import/ImportController.h
Gui/import/ImportMediaCellView.h
Gui/import/ImportMediaListController.h
Gui/export/Export.h
Gui/import/ImportMediaListController.h
Gui/LanguagePreferences.h
Gui/LCDTimecode.h
Gui/library/ClipListViewController.h
......@@ -185,7 +183,6 @@ SET (VLMC_HDRS
SET(VLMC_UIS
Gui/import/ui/ImportController.ui
Gui/export/ui/Export.ui
Gui/library/StackViewNavController.ui
Gui/library/ui/MediaCellView.ui
Gui/library/ui/StackViewNavController.ui
......@@ -230,7 +227,6 @@ INCLUDE_DIRECTORIES(
EffectsEngine/PluginsAPI
Gui
Gui/import
Gui/export
Gui/library
Gui/settings
Gui/timeline
......
......@@ -51,7 +51,6 @@
#include "timeline/Timeline.h"
#include "timeline/TracksView.h"
#include "ImportController.h"
#include "Export.h"
/* Settings / Preferences */
#include "ProjectManager.h"
......@@ -372,23 +371,19 @@ void MainWindow::on_actionRender_triggered()
QMessageBox::warning( NULL, "VLMC Renderer", "There is nothing to render." );
return ;
}
Export* exportMenu = new Export();
exportMenu->exec();
delete exportMenu;
// QString outputFileName =
// QFileDialog::getSaveFileName( NULL, "Enter the output file name",
// QDir::currentPath(), "Videos(*.avi *.mpg)" );
// if ( outputFileName.length() == 0 )
// return ;
// else
// {
// if ( m_renderer )
// delete m_renderer;
// m_renderer = new WorkflowFileRenderer( outputFileName );
// m_renderer->initializeRenderer();
// m_renderer->run();
// }
QString outputFileName =
QFileDialog::getSaveFileName( NULL, "Enter the output file name",
QDir::currentPath(), "Videos(*.avi *.mpg)" );
if ( outputFileName.length() == 0 )
return ;
else
{
if ( m_renderer )
delete m_renderer;
m_renderer = new WorkflowFileRenderer( outputFileName );
m_renderer->initializeRenderer();
m_renderer->run();
}
}
void MainWindow::on_actionNew_Project_triggered()
......
/*****************************************************************************
* Export.cpp: Export menu
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Geoffroy Lacarriere <geoffroylaca@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.
*****************************************************************************/
#include "ui_Export.h"
#include "Export.h"
#include "WorkflowFileRenderer.h"
#include <QDialogButtonBox>
#include <QDebug>
#include <QFileDialog>
Export::Export( QWidget *parent ) :
QDialog( parent ), m_ui( new Ui::Export ), m_renderer( NULL )
{
m_ui->setupUi( this );
m_ui->buttonBox->addButton( tr( "Export" ), QDialogButtonBox::AcceptRole );
connect( m_ui->listWidget,
SIGNAL( currentRowChanged( int ) ),
this,
SLOT( onIndexChanged( int ) ) );
}
Export::~Export()
{
delete m_ui;
delete m_renderer;
}
void
Export::accept()
{
QString outputFileName =
QFileDialog::getSaveFileName( NULL, "Enter the output file name",
QDir::currentPath(), "Videos(*.avi *.mpg)" );
if ( outputFileName.length() == 0 || m_exportParam.isEmpty() )
done( Rejected );
else
{
if ( m_renderer )
delete m_renderer;
m_exportParam += outputFileName + "\"}";
m_renderer = new WorkflowFileRenderer( outputFileName );
m_renderer->setParam( m_exportParam );
m_renderer->initializeRenderer();
m_renderer->run();
}
done( Accepted );
}
void
Export::reject()
{
done( Rejected );
}
void
Export::onIndexChanged( int index )
{
QString vcodec, vb("800"), acodec, ab("128");
switch( m_ui->listWidget->currentRow() )
{
case Video_H264_AAC:
vcodec = "h264";
acodec = "a52";
break;
case Video_Dirac_AAC:
vcodec = "drac";
acodec = "a52";
break;
case Video_Theora_Vorbis:
vcodec = "theo";
acodec = "vorb";
break;
case Video_Theora_Flac:
vcodec = "theo";
acodec = "flac";
break;
case Video_MPEG4_AAC:
vcodec = "mp4v";
acodec = "a52 ";
break;
case Video_MPEG2_MPGA:
vcodec = "mpgv";
acodec = "mpga";
break;
case Video_WMV_WMA:
vcodec = "wmv3";
acodec = "wma2";
break;
case Audio_Vorbis:
vcodec = "";
acodec = "vorb";
break;
case Audio_MP3:
vcodec = "";
acodec = "mp3";
break;
case Audio_AAC:
vcodec = "";
acodec = "a52";
break;
case Audio_FLAC:
vcodec = "";
acodec = "flac";
break;
default:
return;
}
m_exportParam = ":sout=#transcode{vcodec=" + vcodec + ",vb=" + vb +
",acodec=" + acodec + ",ab=" + ab + ",no-hurry-up}"
":standard{access=file,mux=ps,dst=\"";
}
void
Export::changeEvent( QEvent *e )
{
QDialog::changeEvent( e );
switch ( e->type() )
{
case QEvent::LanguageChange:
m_ui->retranslateUi( this );
break;
default:
break;
}
}
/*****************************************************************************
* Export.h: Export menu
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Geoffroy Lacarriere <geoffroylaca@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.
*****************************************************************************/
#ifndef EXPORT_H
#define EXPORT_H
#include <QDialog>
#include <QListWidgetItem>
class WorkflowFileRenderer;
namespace Ui
{
class Export;
}
enum Profile
{
Video_H264_AAC,
Video_Dirac_AAC,
Video_Theora_Vorbis,
Video_Theora_Flac,
Video_MPEG4_AAC,
Video_MPEG2_MPGA,
Video_WMV_WMA,
Audio_Vorbis,
Audio_MP3,
Audio_AAC,
Audio_FLAC
};
class Export : public QDialog
{
Q_OBJECT
public:
Export( QWidget *parent = 0 );
~Export();
const QString& exportParam() const { return m_exportParam; }
protected:
void changeEvent( QEvent *e );
void accept();
void reject();
private:
Ui::Export *m_ui;
QString m_exportParam;
WorkflowFileRenderer *m_renderer;
public slots:
void onIndexChanged( int index );
};
#endif // EXPORT_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Export</class>
<widget class="QDialog" name="Export">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>398</width>
<height>284</height>
</rect>
</property>
<property name="windowTitle">
<string>Export</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel</set>
</property>
</widget>
</item>
<item row="0" column="0" rowspan="2" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Profile</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QListWidget" name="listWidget">
<item>
<property name="text">
<string>Video_H264_AAC</string>
</property>
</item>
<item>
<property name="text">
<string>Video_Dirac_AAC</string>
</property>
</item>
<item>
<property name="text">
<string>Video_Theora_Vorbis</string>
</property>
</item>
<item>
<property name="text">
<string>Video_Theora_Flac</string>
</property>
</item>
<item>
<property name="text">
<string>Video_MPEG4_AAC</string>
</property>
</item>
<item>
<property name="text">
<string>Video_MPEG2_MPGA</string>
</property>
</item>
<item>
<property name="text">
<string>Video_WMV_WMA</string>
</property>
</item>
<item>
<property name="text">
<string>Audio_Vorbis</string>
</property>
</item>
<item>
<property name="text">
<string>Audio_MP3</string>
</property>
</item>
<item>
<property name="text">
<string>Audio_AAC</string>
</property>
</item>
<item>
<property name="text">
<string>Audio_FLAC</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Export</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Export</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
......@@ -282,7 +282,7 @@ ImportController::reject()
m_mediaListController->cleanAll();
Library::getInstance()->deleteTemporaryMedias();
collapseAllButCurrentPath();
done( Rejected );
}
void
......
......@@ -55,15 +55,11 @@ void WorkflowFileRenderer::run()
m_outputFps = SettingsManager::getInstance()->getValue( "VLMC", "VLMCOutPutFPS" )->get().toDouble();
//Media as already been created an mainly initialized by the WorkflowRenderer
if ( m_transcodeStr.isEmpty() )
{
QString transcodeStr = ":sout=#transcode{vcodec=h264,vb=800,acodec=a52,ab=128,no-hurry-up}"
":standard{access=file,mux=ps,dst=\""
+ m_outputFileName + "\"}";
m_media->addOption( transcodeStr.toStdString().c_str() );
}
else
m_media->addOption( m_transcodeStr.toStdString().c_str() );
QString transcodeStr = ":sout=#transcode{vcodec=h264,vb=800,acodec=a52,ab=128,no-hurry-up}"
":standard{access=file,mux=ps,dst=\""
+ m_outputFileName + "\"}";
m_media->addOption( transcodeStr.toStdString().c_str() );
// sprintf( buffer, ":sout-transcode-fps=%f", m_outputFps );
// m_media->addOption( buffer );
......
......@@ -45,15 +45,11 @@ public:
void run();
virtual float getFps() const;
void setParam( QString param ) { m_transcodeStr = param; }
private:
const QString m_outputFileName;
WorkflowFileRendererDialog* m_dialog;
QImage* m_image;
QTime m_time;
QString m_transcodeStr;
protected:
virtual void* getLockCallback();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment