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 @@
*****************************************************************************/
#include "AudioProjectPreferences.h"
#include "SettingsManager.h"
#include "QDebug"
......@@ -32,13 +33,17 @@
AudioProjectPreferences::~AudioProjectPreferences() { }
bool AudioProjectPreferences::load()
void AudioProjectPreferences::load()
{
qDebug() << "Loading AudioProjectPreferences values";
return true;
qDebug() << "Loading preferences : Audio";
int sampleRate = SettingsManager::getInstance()->getValue( "AudioSampleRate" ).toInt();
m_ui.SampleRate->setValue( sampleRate );
return ;
}
void AudioProjectPreferences::save( QHash<QString, QVariant>& settings )
{
settings.insert( "AudioSampleRate", m_ui.SampleRate->value() );
return ;
}
......@@ -34,7 +34,7 @@ class AudioProjectPreferences : public PreferenceWidget
public:
AudioProjectPreferences( QWidget *parent = 0 );
~AudioProjectPreferences();
bool load();
void load();
void save( QHash<QString, QVariant>& settings );
private:
Ui::AudioProjectPreferences m_ui;
......
......@@ -31,6 +31,7 @@
#include <QDesktopServices>
#include <QUrl>
#include <QSettings>
#include <QStringList>
#include "MainWindow.h"
#include "MediaListWidget.h"
......@@ -59,6 +60,7 @@ MainWindow::MainWindow( QWidget *parent ) :
initializeDockWidgets();
createStatusBar();
createGlobalPreferences();
createProjectPreferences();
// Translations
connect( this, SIGNAL( translateDockWidgetTitle() ),
......@@ -162,6 +164,13 @@ void MainWindow::on_actionSave_triggered()
else
{
//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 );
pm->saveProject();
}
......@@ -170,7 +179,7 @@ void MainWindow::on_actionSave_triggered()
void MainWindow::on_actionLoad_Project_triggered()
{
QString outputFileName =
QFileDialog::getSaveFileName( NULL, "Enter the output file name",
QFileDialog::getOpenFileName( NULL, "Enter the output file name",
QString(), "VLMC project file(*.vlmc)" );
if ( outputFileName.length() == 0 )
return ;
......@@ -285,6 +294,24 @@ void MainWindow::createGlobalPreferences()
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
void MainWindow::on_actionQuit_triggered()
......@@ -334,21 +361,8 @@ void MainWindow::on_actionNew_Project_triggered()
{
//TODO : clear the library, the timeline, and show the configuration box
//of the newly created project
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();
m_projectPreferences->exec();
m_projectPreferences->show();
}
void MainWindow::on_actionHelp_triggered()
......@@ -402,3 +416,8 @@ void MainWindow::on_actionBypass_effects_engine_toggled(bool toggled)
ee->disable();
return ;
}
void MainWindow::on_actionProject_Preferences_triggered()
{
m_projectPreferences->show();
}
......@@ -65,7 +65,7 @@ private:
void setupLibrary();
void createStatusBar();
void createGlobalPreferences();
void createProjectPreferences();
Ui::MainWindow m_ui;
MetaDataManager* m_metaDataManager;
......@@ -89,6 +89,7 @@ private slots:
void on_actionLoad_Project_triggered();
void on_actionSave_triggered();
void on_actionHelp_triggered();
void on_actionProject_Preferences_triggered();
void mediaListItemDoubleClicked( QListWidgetItem* );
void toolButtonClicked( int id );
......
......@@ -36,7 +36,7 @@ class PreferenceWidget : public QWidget
PreferenceWidget( QWidget* parent = 0 );
virtual ~PreferenceWidget() {}
virtual bool load() = 0;
virtual void load() = 0;
virtual void save( QHash<QString, QVariant>& settings ) = 0;
};
......
......@@ -27,6 +27,7 @@
#include "ui_ProjectPreferences.h"
#include "ProjectPreferences.h"
#include "PreferenceWidget.h"
#include "SettingsManager.h"
ProjectPreferences::ProjectPreferences( QWidget* parent )
......@@ -37,10 +38,14 @@
ProjectPreferences::~ProjectPreferences() { }
bool ProjectPreferences::load()
void ProjectPreferences::load()
{
qDebug() << "Loading ProjectPreferences values";
return true;
qDebug() << "Loading preferences : Project";
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 )
......
......@@ -35,7 +35,7 @@ class ProjectPreferences : public PreferenceWidget
public:
ProjectPreferences( QWidget* parent = 0 );
virtual ~ProjectPreferences();
bool load();
void load();
void save( QHash<QString, QVariant>& settings );
private:
Ui::ProjectPreferences m_ui;
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#include "VLMCPreferences.h"
#include "SettingsManager.h"
#include "QDebug"
......@@ -32,10 +33,17 @@ VLMCPreferences::VLMCPreferences( QWidget *parent )
VLMCPreferences::~VLMCPreferences() { }
bool VLMCPreferences::load()
void VLMCPreferences::load()
{
qDebug() << "Loading VLMCPreferences values";
return true;
qDebug() << "Loading Prefs : VLMC";
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 )
......
......@@ -34,7 +34,7 @@ class VLMCPreferences : public PreferenceWidget
public:
VLMCPreferences( QWidget *parent = 0 );
~VLMCPreferences();
bool load();
void load();
void save( QHash<QString, QVariant>& settings );
private:
Ui::VLMCPreferences m_ui;
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#include "VideoProjectPreferences.h"
#include "SettingsManager.h"
#include "QDebug"
......@@ -32,10 +33,16 @@ VideoProjectPreferences::VideoProjectPreferences( QWidget *parent )
VideoProjectPreferences::~VideoProjectPreferences() { }
bool VideoProjectPreferences::load()
void VideoProjectPreferences::load()
{
qDebug() << "Loading VideoProjectPreferences values";
return true;
qDebug() << "Loading Prefs : VideoProject";
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 )
......@@ -43,4 +50,5 @@ void VideoProjectPreferences::save( QHash<QString, QVariant>& settings )
settings.insert( "VideoProjectFPS", QVariant( m_ui.FPSSpinBox->value() ) );
settings.insert( "VideoProjectHeight", QVariant( m_ui.HeightSpinBox->value() ) );
settings.insert( "VideoProjectWidth", QVariant( m_ui.WidthSpinBox->value() ));
return ;
}
......@@ -34,7 +34,7 @@ class VideoProjectPreferences : public PreferenceWidget
public:
VideoProjectPreferences( QWidget *parent = 0 );
~VideoProjectPreferences();
bool load();
void load();
void save( QHash<QString, QVariant>& settings );
private:
Ui::VideoProjectPreferences m_ui;
......
......@@ -27,7 +27,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>26</height>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
......@@ -45,6 +45,7 @@
<string>Edit</string>
</property>
<addaction name="actionPreferences"/>
<addaction name="actionProject_Preferences"/>
</widget>
<widget class="QMenu" name="menuView">
<property name="title">
......@@ -189,6 +190,11 @@
<string>Enable effects engine</string>
</property>
</action>
<action name="actionProject_Preferences">
<property name="text">
<string>Project Preferences</string>
</property>
</action>
</widget>
<resources>
<include location="../../../ressources.qrc"/>
......
......@@ -40,7 +40,7 @@ Media::~Media()
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);
}
......
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