AudioProjectPreferences.cpp 2.11 KB
Newer Older
1 2 3
/*****************************************************************************
 * AudioProjectPreferences.cpp: VLMC Audio project preferences class
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * 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.
 *****************************************************************************/

Ludovic Fauvet's avatar
Ludovic Fauvet committed
23 24
#include <QDebug>

25 26
#include "AudioProjectPreferences.h"

27
AudioProjectPreferences::AudioProjectPreferences( QWidget *parent )
28
    : PreferenceWidget( parent ),
29
    m_type( SettingsManager::Project )
30
{
31
    m_ui.setupUi( this );
32
    VLMC_CREATE_PROJECT_VAR( "project/AudioSampleRate", 0, "The project audio samplerate" );
33 34 35 36
}

AudioProjectPreferences::~AudioProjectPreferences() { }

37
void    AudioProjectPreferences::load()
38
{
39
    int sampleRate = VLMC_GET_INT( "project/AudioSampleRate" );
40
    m_ui.SampleRate->setValue( sampleRate );
41
    return ;
42 43
}

44
void    AudioProjectPreferences::save()
45
{
46 47
    SettingsManager* setMan = SettingsManager::getInstance();
    QVariant    sampleRate( m_ui.SampleRate->value() );
48
    setMan->setImmediateValue( "project/AudioSampleRate", sampleRate, m_type );
49
    return ;
50
}
51 52 53 54 55 56 57 58 59 60 61 62 63

void AudioProjectPreferences::changeEvent( QEvent *e )
{
    QWidget::changeEvent( e );
    switch ( e->type() )
    {
    case QEvent::LanguageChange:
        m_ui.retranslateUi( this );
        break;
    default:
        break;
    }
}