Commit 200de258 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Using newly created SettingValue

parent 609e52a3
......@@ -78,14 +78,15 @@ void SettingsManager::setValue( const QString& part , const QString& key, const
return ;
}
const QVariant& SettingsManager::getValue( const QString& part, const QString& key ) const
const SettingValue* SettingsManager::getValue( const QString& part, const QString& key ) const
{
if ( !m_data.contains( part ) )
return getValue( "default", key );
QReadLocker readLock( &m_globalLock );
QReadLocker rdLock( &m_data[part]->m_lock );
QVariant& value = m_data[part]->m_data[key]->get();
return value;
if ( m_data[part]->m_data.contains( key ) == true )
return m_data[part]->m_data[key];
return NULL;
}
void SettingsManager::saveSettings( const QString& part, QDomDocument& xmlfile, QDomElement& root )
......
......@@ -58,7 +58,7 @@ class SettingsManager : public QObject, public QSingleton<SettingsManager>
public:
// void setValues( const QString& part, SettingsPart::ConfigPair );
void setValue( const QString& part, const QString& key, const QVariant& value );
const QVariant& getValue( const QString& part, const QString& key ) const;
const SettingValue* getValue( const QString& part, const QString& key ) const;
const SettingsPart* getConfigPart( const QString& part ) const;
void saveSettings( const QString& part, QDomDocument& xmlfile, QDomElement& root );
void loadSettings( const QString& part, const QDomElement& settings );
......
......@@ -38,7 +38,7 @@ TracksRuler::TracksRuler( TracksView* tracksView, QWidget* parent )
//TODO We should really get that from the
// workflow and not directly from the settings.
SettingsManager* settings = SettingsManager::getInstance();
m_fps = qRound( settings->getValue( "VLMC", "VLMCOutPutFPS" ).toDouble() );
m_fps = qRound( settings->getValue( "VLMC", "VLMCOutPutFPS" )->get().toDouble() );
m_factor = 1;
m_scale = 3;
......
......@@ -37,7 +37,7 @@ void AudioProjectPreferences::load()
{
SettingsManager* setMan = SettingsManager::getInstance();
const QString& part = m_defaults ? "default" : m_settName;
int sampleRate = setMan->getValue( part, "AudioSampleRate" ).toInt();
int sampleRate = setMan->getValue( part, "AudioSampleRate" )->get().toInt();
m_ui.SampleRate->setValue( sampleRate );
return ;
......
......@@ -41,7 +41,7 @@ void ProjectPreferences::load()
{
SettingsManager* settMan = SettingsManager::getInstance();
const QString& part = m_defaults ? "default" : m_settName;
QString Name = settMan->getValue( part, "ProjectName" ).toString();
QString Name = settMan->getValue( part, "ProjectName" )->get().toString();
m_ui.ProjectNameLineEdit->setText( Name );
}
......
......@@ -38,8 +38,8 @@ void VLMCPreferences::load()
SettingsManager* settMan = SettingsManager::getInstance();
const QString& part = m_defaults ? "default" : m_settName;
QString outputFPS = settMan->getValue( part, "VLMCOutPutFPS" ).toString();
QString tracksNb = settMan->getValue( part, "VLMCTracksNb" ).toString();
QString outputFPS = settMan->getValue( part, "VLMCOutPutFPS" )->get().toString();
QString tracksNb = settMan->getValue( part, "VLMCTracksNb" )->get().toString();
m_ui.outputFPS->setText( outputFPS );
m_ui.tracksNb->setText( tracksNb );
......
......@@ -37,9 +37,9 @@ void VideoProjectPreferences::load()
{
SettingsManager* setMan = SettingsManager::getInstance();
const QString& part = m_defaults ? "default" : m_settName;
int projectFps = setMan->getValue( part, "VideoProjectFPS" ).toInt();
int projectHeight = setMan->getValue( part, "VideoProjectHeight" ).toInt();
int projectWidth = setMan->getValue( part, "VideoProjectWidth" ).toInt();
int projectFps = setMan->getValue( part, "VideoProjectFPS" )->get().toInt();
int projectHeight = setMan->getValue( part, "VideoProjectHeight" )->get().toInt();
int projectWidth = setMan->getValue( part, "VideoProjectWidth" )->get().toInt();
m_ui.FPSSpinBox->setValue( projectFps );
m_ui.HeightSpinBox->setValue( projectHeight );
......
......@@ -41,7 +41,7 @@ void WorkflowFileRenderer::run()
{
char buffer[256];
m_outputFps = SettingsManager::getInstance()->getValue( "VLMC", "VLMCOutPutFPS" ).toDouble();
m_outputFps = SettingsManager::getInstance()->getValue( "VLMC", "VLMCOutPutFPS" )->get().toDouble();
//Media as already been created an mainly initialized by the WorkflowRenderer
m_media->addOption( ":no-audio" );
......
......@@ -142,7 +142,7 @@ void WorkflowRenderer::startPreview()
m_isRendering = true;
m_paused = false;
m_stopping = false;
m_outputFps = SettingsManager::getInstance()->getValue( "VLMC", "VLMCOutPutFPS" ).toDouble();
m_outputFps = SettingsManager::getInstance()->getValue( "VLMC", "VLMCOutPutFPS" )->get().toDouble();
}
void WorkflowRenderer::nextFrame()
......
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