~ubuntu-branches/ubuntu/oneiric/lmms/oneiric

« back to all changes in this revision

Viewing changes to plugins/peak_controller_effect/peak_controller_effect_controls.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Артём Попов
  • Date: 2011-02-14 20:58:36 UTC
  • mfrom: (1.1.10 upstream) (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110214205836-2u41xus1d2mj8nfz
Tags: 0.4.10-1ubuntu1
* Merge from debian unstable (LP: #718801).  Remaining changes:
  - Replace build-dep on libwine-dev with wine1.2-dev to build
    against the newer Wine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * peak_controller_effect_controls.cpp - controls for PeakController effect
 
2
 * peak_controller_effect_controls.cpp - controls for peakController effect
3
3
 *
4
4
 * Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail/dot/com>
 
5
 * Copyright (c) 2009-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5
6
 * 
6
7
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
7
8
 *
36
37
        m_effect( _eff ),
37
38
        m_baseModel( 0.5, 0.0, 1.0, 0.001, this, tr( "Base value" ) ),
38
39
        m_amountModel( 1.0, -1.0, 1.0, 0.005, this, tr( "Modulation amount" ) ),
39
 
        m_decayModel( 0.1, 0.01, 5.0, 0.0001, this, tr( "Release decay" ) ),
40
 
        m_muteModel( FALSE, this, tr( "Mute output" ) )
 
40
        m_attackModel( 0, 0, 0.999, 0.001, this, tr( "Attack" ) ),
 
41
        m_decayModel( 0, 0, 0.999, 0.001, this, tr( "Release" ) ),
 
42
        m_muteModel( false, this, tr( "Mute output" ) )
41
43
{
42
44
}
43
45
 
45
47
 
46
48
void PeakControllerEffectControls::loadSettings( const QDomElement & _this )
47
49
{
48
 
        m_baseModel.setValue( _this.attribute( "base" ).toFloat() );
49
 
        m_amountModel.setValue( _this.attribute( "amount" ).toFloat() );
50
 
        m_muteModel.setValue( _this.attribute( "mute" ).toFloat() );
51
 
        
 
50
        m_baseModel.loadSettings( _this, "base" );
 
51
        m_amountModel.loadSettings( _this, "amount" );
 
52
        m_muteModel.loadSettings( _this, "mute" );
 
53
 
 
54
        m_attackModel.loadSettings( _this, "attack" );
 
55
        m_decayModel.loadSettings( _this, "decay" );
 
56
 
52
57
        int effectId = _this.attribute( "effectId" ).toInt();
53
58
        if( effectId > PeakController::s_lastEffectId )
54
59
        {
69
74
void PeakControllerEffectControls::saveSettings( QDomDocument & _doc, 
70
75
                                                        QDomElement & _this )
71
76
{
72
 
        _this.setAttribute( "base", m_baseModel.value() );
73
 
        _this.setAttribute( "amount", m_amountModel.value() );
74
 
        _this.setAttribute( "mute", m_muteModel.value() );
75
77
        _this.setAttribute( "effectId", m_effect->m_effectId );
 
78
 
 
79
        m_baseModel.saveSettings( _doc, _this, "base" );
 
80
        m_amountModel.saveSettings( _doc, _this, "amount" );
 
81
        m_muteModel.saveSettings( _doc, _this, "mute" );
 
82
 
 
83
        m_attackModel.saveSettings( _doc, _this, "attack" );
 
84
        m_decayModel.saveSettings( _doc, _this, "decay" );
76
85
}
77
86
 
78
87