Commit 9b1badd1 authored by Vincent Carrubba's avatar Vincent Carrubba

Merge branch 'master' into boubak-effects-engine

Conflicts:
	src/GUI/MainWindow.cpp
	src/GUI/ui/MainWindow.ui
parents d9a62340 daf161ad
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
*****************************************************************************/ *****************************************************************************/
#include "AudioProjectPreferences.h" #include "AudioProjectPreferences.h"
#include "SettingsManager.h"
#include "QDebug" #include "QDebug"
...@@ -32,13 +33,17 @@ ...@@ -32,13 +33,17 @@
AudioProjectPreferences::~AudioProjectPreferences() { } AudioProjectPreferences::~AudioProjectPreferences() { }
bool AudioProjectPreferences::load() void AudioProjectPreferences::load()
{ {
qDebug() << "Loading AudioProjectPreferences values"; qDebug() << "Loading preferences : Audio";
return true; int sampleRate = SettingsManager::getInstance()->getValue( "AudioSampleRate" ).toInt();
m_ui.SampleRate->setValue( sampleRate );
return ;
} }
void AudioProjectPreferences::save( QHash<QString, QVariant>& settings ) void AudioProjectPreferences::save( QHash<QString, QVariant>& settings )
{ {
settings.insert( "AudioSampleRate", m_ui.SampleRate->value() ); settings.insert( "AudioSampleRate", m_ui.SampleRate->value() );
return ;
} }
...@@ -34,7 +34,7 @@ class AudioProjectPreferences : public PreferenceWidget ...@@ -34,7 +34,7 @@ class AudioProjectPreferences : public PreferenceWidget
public: public:
AudioProjectPreferences( QWidget *parent = 0 ); AudioProjectPreferences( QWidget *parent = 0 );
~AudioProjectPreferences(); ~AudioProjectPreferences();
bool load(); void load();
void save( QHash<QString, QVariant>& settings ); void save( QHash<QString, QVariant>& settings );
private: private:
Ui::AudioProjectPreferences m_ui; Ui::AudioProjectPreferences m_ui;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <QDesktopServices> #include <QDesktopServices>
#include <QUrl> #include <QUrl>
#include <QSettings> #include <QSettings>
#include <QStringList>
#include "MainWindow.h" #include "MainWindow.h"
#include "MediaListWidget.h" #include "MediaListWidget.h"
...@@ -59,6 +60,7 @@ MainWindow::MainWindow( QWidget *parent ) : ...@@ -59,6 +60,7 @@ MainWindow::MainWindow( QWidget *parent ) :
initializeDockWidgets(); initializeDockWidgets();
createStatusBar(); createStatusBar();
createGlobalPreferences(); createGlobalPreferences();
createProjectPreferences();
// Translations // Translations
connect( this, SIGNAL( translateDockWidgetTitle() ), connect( this, SIGNAL( translateDockWidgetTitle() ),
...@@ -162,6 +164,13 @@ void MainWindow::on_actionSave_triggered() ...@@ -162,6 +164,13 @@ void MainWindow::on_actionSave_triggered()
else else
{ {
//Project manager will destroy itself. //Project manager will destroy itself.
QStringList list = outputFileName.split( "." );
if ( list.at( list.size() - 1 ) != "vlmc" )
{
list.append( "vlmc" );
outputFileName = list.join(".");
}
ProjectManager* pm = new ProjectManager( outputFileName ); ProjectManager* pm = new ProjectManager( outputFileName );
pm->saveProject(); pm->saveProject();
} }
...@@ -170,7 +179,7 @@ void MainWindow::on_actionSave_triggered() ...@@ -170,7 +179,7 @@ void MainWindow::on_actionSave_triggered()
void MainWindow::on_actionLoad_Project_triggered() void MainWindow::on_actionLoad_Project_triggered()
{ {
QString outputFileName = QString outputFileName =
QFileDialog::getSaveFileName( NULL, "Enter the output file name", QFileDialog::getOpenFileName( NULL, "Enter the output file name",
QString(), "VLMC project file(*.vlmc)" ); QString(), "VLMC project file(*.vlmc)" );
if ( outputFileName.length() == 0 ) if ( outputFileName.length() == 0 )
return ; return ;
...@@ -285,6 +294,24 @@ void MainWindow::createGlobalPreferences() ...@@ -285,6 +294,24 @@ void MainWindow::createGlobalPreferences()
m_globalPreferences->build(); m_globalPreferences->build();
} }
void MainWindow::createProjectPreferences()
{
m_projectPreferences = new Settings( );
m_projectPreferences->addWidget("Project",
new ProjectPreferences,
"../images/vlmc.png",
"Project settings");
m_projectPreferences->addWidget("Video",
new VideoProjectPreferences,
"../images/scalable/video.svg",
"Video settings");
m_projectPreferences->addWidget("Audio",
new AudioProjectPreferences,
"../images/scalable/audio.svg",
"Audio settings");
m_projectPreferences->build();
}
//Private slots definition //Private slots definition
void MainWindow::on_actionQuit_triggered() void MainWindow::on_actionQuit_triggered()
...@@ -334,21 +361,8 @@ void MainWindow::on_actionNew_Project_triggered() ...@@ -334,21 +361,8 @@ void MainWindow::on_actionNew_Project_triggered()
{ {
//TODO : clear the library, the timeline, and show the configuration box //TODO : clear the library, the timeline, and show the configuration box
//of the newly created project //of the newly created project
m_projectPreferences = new Settings( );
m_projectPreferences->addWidget("Project", m_projectPreferences->show();
new ProjectPreferences,
"../images/vlmc.png",
"Project settings");
m_projectPreferences->addWidget("Video",
new VideoProjectPreferences,
"../images/scalable/video.svg",
"Video settings");
m_projectPreferences->addWidget("Audio",
new AudioProjectPreferences,
"../images/scalable/audio.svg",
"Audio settings");
m_projectPreferences->build();
m_projectPreferences->exec();
} }
void MainWindow::on_actionHelp_triggered() void MainWindow::on_actionHelp_triggered()
...@@ -402,3 +416,8 @@ void MainWindow::on_actionBypass_effects_engine_toggled(bool toggled) ...@@ -402,3 +416,8 @@ void MainWindow::on_actionBypass_effects_engine_toggled(bool toggled)
ee->disable(); ee->disable();
return ; return ;
} }
void MainWindow::on_actionProject_Preferences_triggered()
{
m_projectPreferences->show();
}
...@@ -65,7 +65,7 @@ private: ...@@ -65,7 +65,7 @@ private:
void setupLibrary(); void setupLibrary();
void createStatusBar(); void createStatusBar();
void createGlobalPreferences(); void createGlobalPreferences();
void createProjectPreferences();
Ui::MainWindow m_ui; Ui::MainWindow m_ui;
MetaDataManager* m_metaDataManager; MetaDataManager* m_metaDataManager;
...@@ -89,6 +89,7 @@ private slots: ...@@ -89,6 +89,7 @@ private slots:
void on_actionLoad_Project_triggered(); void on_actionLoad_Project_triggered();
void on_actionSave_triggered(); void on_actionSave_triggered();
void on_actionHelp_triggered(); void on_actionHelp_triggered();
void on_actionProject_Preferences_triggered();
void mediaListItemDoubleClicked( QListWidgetItem* ); void mediaListItemDoubleClicked( QListWidgetItem* );
void toolButtonClicked( int id ); void toolButtonClicked( int id );
......
...@@ -36,7 +36,7 @@ class PreferenceWidget : public QWidget ...@@ -36,7 +36,7 @@ class PreferenceWidget : public QWidget
PreferenceWidget( QWidget* parent = 0 ); PreferenceWidget( QWidget* parent = 0 );
virtual ~PreferenceWidget() {} virtual ~PreferenceWidget() {}
virtual bool load() = 0; virtual void load() = 0;
virtual void save( QHash<QString, QVariant>& settings ) = 0; virtual void save( QHash<QString, QVariant>& settings ) = 0;
}; };
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "ui_ProjectPreferences.h" #include "ui_ProjectPreferences.h"
#include "ProjectPreferences.h" #include "ProjectPreferences.h"
#include "PreferenceWidget.h" #include "PreferenceWidget.h"
#include "SettingsManager.h"
ProjectPreferences::ProjectPreferences( QWidget* parent ) ProjectPreferences::ProjectPreferences( QWidget* parent )
...@@ -37,14 +38,18 @@ ...@@ -37,14 +38,18 @@
ProjectPreferences::~ProjectPreferences() { } ProjectPreferences::~ProjectPreferences() { }
bool ProjectPreferences::load() void ProjectPreferences::load()
{ {
qDebug() << "Loading ProjectPreferences values"; qDebug() << "Loading preferences : Project";
return true; QString Name = SettingsManager::getInstance()->getValue( "ProjectName" ).toString();
QString Dir = SettingsManager::getInstance()->getValue( "ProjectDirectory" ).toString();
m_ui.ProjectNameLineEdit->setText( Name );
m_ui.ProjectDirectoryLineEdit->setText( Dir );
} }
void ProjectPreferences::save( QHash<QString, QVariant>& settings ) void ProjectPreferences::save( QHash<QString, QVariant>& settings )
{ {
settings.insert( "ProjectName", QVariant( m_ui.ProjectNameLineEdit->text() ) ); settings.insert( "ProjectName", QVariant( m_ui.ProjectNameLineEdit->text() ) );
settings.insert( "ProjectDirectory", QVariant( m_ui.ProjectDirectoryLineEdit->text() ) ); settings.insert( "ProjectDirectory", QVariant( m_ui.ProjectDirectoryLineEdit->text() ) );
} }
...@@ -35,7 +35,7 @@ class ProjectPreferences : public PreferenceWidget ...@@ -35,7 +35,7 @@ class ProjectPreferences : public PreferenceWidget
public: public:
ProjectPreferences( QWidget* parent = 0 ); ProjectPreferences( QWidget* parent = 0 );
virtual ~ProjectPreferences(); virtual ~ProjectPreferences();
bool load(); void load();
void save( QHash<QString, QVariant>& settings ); void save( QHash<QString, QVariant>& settings );
private: private:
Ui::ProjectPreferences m_ui; Ui::ProjectPreferences m_ui;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
*****************************************************************************/ *****************************************************************************/
#include "VLMCPreferences.h" #include "VLMCPreferences.h"
#include "SettingsManager.h"
#include "QDebug" #include "QDebug"
...@@ -32,10 +33,17 @@ VLMCPreferences::VLMCPreferences( QWidget *parent ) ...@@ -32,10 +33,17 @@ VLMCPreferences::VLMCPreferences( QWidget *parent )
VLMCPreferences::~VLMCPreferences() { } VLMCPreferences::~VLMCPreferences() { }
bool VLMCPreferences::load() void VLMCPreferences::load()
{ {
qDebug() << "Loading VLMCPreferences values"; qDebug() << "Loading Prefs : VLMC";
return true; QString outputFPS = SettingsManager::getInstance()->getValue( "VLMCOutPutFPS" ).toString();
QString previewFPS = SettingsManager::getInstance()->getValue( "VLMCPreviewFPS" ).toString();
QString tracksNb = SettingsManager::getInstance()->getValue( "VLMCTracksNb" ).toString();
m_ui.outputFPS->setText( outputFPS );
m_ui.previewFPS->setText( previewFPS );
m_ui.tracksNb->setText( tracksNb );
} }
void VLMCPreferences::save( QHash<QString, QVariant>& settings ) void VLMCPreferences::save( QHash<QString, QVariant>& settings )
......
...@@ -34,7 +34,7 @@ class VLMCPreferences : public PreferenceWidget ...@@ -34,7 +34,7 @@ class VLMCPreferences : public PreferenceWidget
public: public:
VLMCPreferences( QWidget *parent = 0 ); VLMCPreferences( QWidget *parent = 0 );
~VLMCPreferences(); ~VLMCPreferences();
bool load(); void load();
void save( QHash<QString, QVariant>& settings ); void save( QHash<QString, QVariant>& settings );
private: private:
Ui::VLMCPreferences m_ui; Ui::VLMCPreferences m_ui;
......
...@@ -21,26 +21,34 @@ ...@@ -21,26 +21,34 @@
*****************************************************************************/ *****************************************************************************/
#include "VideoProjectPreferences.h" #include "VideoProjectPreferences.h"
#include "SettingsManager.h"
#include "QDebug" #include "QDebug"
VideoProjectPreferences::VideoProjectPreferences( QWidget *parent ) VideoProjectPreferences::VideoProjectPreferences( QWidget *parent )
: PreferenceWidget( parent ) : PreferenceWidget( parent )
{ {
m_ui.setupUi( this ); m_ui.setupUi( this );
} }
VideoProjectPreferences::~VideoProjectPreferences() { } VideoProjectPreferences::~VideoProjectPreferences() { }
bool VideoProjectPreferences::load() void VideoProjectPreferences::load()
{ {
qDebug() << "Loading VideoProjectPreferences values"; qDebug() << "Loading Prefs : VideoProject";
return true; int projectFps = SettingsManager::getInstance()->getValue( "VideoProjectFPS" ).toInt();
int projectHeight = SettingsManager::getInstance()->getValue( "VideoProjectHeight" ).toInt();
int projectWidth = SettingsManager::getInstance()->getValue( "VideoProjectWidth" ).toInt();
m_ui.FPSSpinBox->setValue( projectFps );
m_ui.HeightSpinBox->setValue( projectHeight );
m_ui.WidthSpinBox->setValue( projectWidth );
} }
void VideoProjectPreferences::save( QHash<QString, QVariant>& settings ) void VideoProjectPreferences::save( QHash<QString, QVariant>& settings )
{ {
settings.insert( "VideoProjectFPS", QVariant( m_ui.FPSSpinBox->value() ) ); settings.insert( "VideoProjectFPS", QVariant( m_ui.FPSSpinBox->value() ) );
settings.insert( "VideoProjectHeight", QVariant( m_ui.HeightSpinBox->value() ) ); settings.insert( "VideoProjectHeight", QVariant( m_ui.HeightSpinBox->value() ) );
settings.insert( "VideoProjectWidth", QVariant( m_ui.WidthSpinBox->value() )); settings.insert( "VideoProjectWidth", QVariant( m_ui.WidthSpinBox->value() ));
return ;
} }
...@@ -34,7 +34,7 @@ class VideoProjectPreferences : public PreferenceWidget ...@@ -34,7 +34,7 @@ class VideoProjectPreferences : public PreferenceWidget
public: public:
VideoProjectPreferences( QWidget *parent = 0 ); VideoProjectPreferences( QWidget *parent = 0 );
~VideoProjectPreferences(); ~VideoProjectPreferences();
bool load(); void load();
void save( QHash<QString, QVariant>& settings ); void save( QHash<QString, QVariant>& settings );
private: private:
Ui::VideoProjectPreferences m_ui; Ui::VideoProjectPreferences m_ui;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>800</width>
<height>26</height> <height>24</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<string>Edit</string> <string>Edit</string>
</property> </property>
<addaction name="actionPreferences"/> <addaction name="actionPreferences"/>
<addaction name="actionProject_Preferences"/>
</widget> </widget>
<widget class="QMenu" name="menuView"> <widget class="QMenu" name="menuView">
<property name="title"> <property name="title">
...@@ -179,16 +180,21 @@ ...@@ -179,16 +180,21 @@
</property> </property>
</action> </action>
<action name="actionBypass_effects_engine"> <action name="actionBypass_effects_engine">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Enable effects engine</string> <string>Enable effects engine</string>
</property> </property>
</action> </action>
<action name="actionProject_Preferences">
<property name="text">
<string>Project Preferences</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="../../../ressources.qrc"/> <include location="../../../ressources.qrc"/>
......
...@@ -40,7 +40,7 @@ Media::~Media() ...@@ -40,7 +40,7 @@ Media::~Media()
void Media::addOption( const char* opt ) void Media::addOption( const char* opt )
{ {
libvlc_media_add_option_flag( m_internalPtr, opt, libvlc_media_option_trusted, m_ex); libvlc_media_add_option_flag( m_internalPtr, opt, libvlc_media_option_trusted);
CheckVlcppException(m_ex); CheckVlcppException(m_ex);
} }
......
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