diff --git a/include/group_box.h b/include/group_box.h index 9ef575f08..a9c1c4825 100644 --- a/include/group_box.h +++ b/include/group_box.h @@ -49,7 +49,7 @@ class groupBox : public QWidget, public engineObject Q_OBJECT public: groupBox( const QString & _caption, QWidget * _parent, - engine * _engine ); + engine * _engine, track * _track ); virtual ~groupBox(); bool isActive( void ) const diff --git a/include/led_checkbox.h b/include/led_checkbox.h index cefefac5b..26a695d75 100644 --- a/include/led_checkbox.h +++ b/include/led_checkbox.h @@ -41,8 +41,9 @@ public: YELLOW, GREEN, TOTAL_COLORS } ; - ledCheckBox( const QString & _txt, QWidget * _parent, engine * _engine, - ledColors _color = YELLOW ); + ledCheckBox( const QString & _txt, QWidget * _parent, + const QString & _name, engine * _engine, + track * _track, ledColors _color = YELLOW ); virtual ~ledCheckBox(); diff --git a/include/pixmap_button.h b/include/pixmap_button.h index 3208b7cd0..923dd5d29 100644 --- a/include/pixmap_button.h +++ b/include/pixmap_button.h @@ -46,7 +46,8 @@ class pixmapButton : public automatableButton { Q_OBJECT public: - pixmapButton( QWidget * _parent, engine * _engine ); + pixmapButton( QWidget * _parent, const QString & _name, + engine * _engine, track * _track ); virtual ~pixmapButton(); void setActiveGraphic( const QPixmap & _pm ); diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index dd55ae164..2cc731405 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -103,7 +103,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : } - m_openAudioFileButton = new pixmapButton( this, eng() ); + m_openAudioFileButton = new pixmapButton( this, NULL, eng(), NULL ); m_openAudioFileButton->setCursor( QCursor( Qt::PointingHandCursor ) ); m_openAudioFileButton->move( 200, 90 ); m_openAudioFileButton->setActiveGraphic( embed::getIconPixmap( @@ -128,7 +128,8 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : "are not reset, so please don't wonder if your sample " "doesn't sound like the original one..." ) ); - m_reverseButton = new pixmapButton( this, eng() ); + m_reverseButton = new pixmapButton( this, tr( "Reverse" ), eng(), + _channel_track ); m_reverseButton->setCheckable( TRUE ); m_reverseButton->move( 160, 124 ); m_reverseButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( @@ -148,7 +149,8 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : "This is useful for cool effects, e.g. a reversed " "crash." ) ); - m_loopButton = new pixmapButton( this, eng() ); + m_loopButton = new pixmapButton( this, tr( "Loop" ), eng(), + _channel_track ); m_loopButton->setCheckable( TRUE ); m_loopButton->move( 180, 124 ); m_loopButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( @@ -228,7 +230,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : "AudioFileProcessor returns if a note is longer than " "the sample between start- and end-point." ) ); - m_viewLinesPB = new pixmapButton( this, eng() ); + m_viewLinesPB = new pixmapButton( this, NULL, eng(), _channel_track ); m_viewLinesPB->move( 154, 158 ); m_viewLinesPB->setBgGraphic( getBackground( m_viewLinesPB ) ); if( m_drawMethod == sampleBuffer::LINE_CONNECT ) @@ -247,7 +249,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : "sound itself. It just gives you another view to your " "sample." ) ); - m_viewDotsPB = new pixmapButton( this, eng() ); + m_viewDotsPB = new pixmapButton( this, NULL, eng(), _channel_track ); m_viewDotsPB->move( 204, 158 ); m_viewDotsPB->setBgGraphic( getBackground( m_viewDotsPB ) ); if( m_drawMethod == sampleBuffer::DOTS ) @@ -266,7 +268,8 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : "It just gives you another view to your sample." ) ); automatableButtonGroup * view_group = new automatableButtonGroup( this, - eng() ); + tr( "Sample draw mode" ), + eng(), _channel_track ); view_group->addButton( m_viewLinesPB ); view_group->addButton( m_viewDotsPB ); @@ -301,10 +304,8 @@ void audioFileProcessor::saveSettings( QDomDocument & _doc, _this.setAttribute( "eframe", QString::number( m_sampleBuffer.endFrame() / (float)m_sampleBuffer.frames() ) ); - _this.setAttribute( "reversed", QString::number( - m_reverseButton->isChecked() ) ); - _this.setAttribute( "looped", QString::number( - m_loopButton->isChecked() ) ); + m_reverseButton->saveSettings( _doc, _this, "reversed" ); + m_loopButton->saveSettings( _doc, _this, "looped" ); m_ampKnob->saveSettings( _doc, _this, "amp" ); } @@ -323,8 +324,8 @@ void audioFileProcessor::loadSettings( const QDomElement & _this ) } setStartAndEndKnob( _this.attribute( "sframe" ).toFloat(), _this.attribute( "eframe" ).toFloat() ); - m_reverseButton->setChecked( _this.attribute( "reversed" ).toInt() ); - m_loopButton->setChecked( _this.attribute( "looped" ).toInt() ); + m_reverseButton->loadSettings( _this, "reversed" ); + m_loopButton->loadSettings( _this, "looped" ); m_ampKnob->loadSettings( _this, "amp" ); } diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 2d3d16e5b..cbfa504d2 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -110,7 +110,7 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _channel_track ) : connect( eng()->getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ), this, SLOT( changeTempo( bpm_t ) ) ); - m_openPluginButton = new pixmapButton( this, eng() ); + m_openPluginButton = new pixmapButton( this, NULL, eng(), NULL ); m_openPluginButton->setCheckable( FALSE ); m_openPluginButton->setCursor( Qt::PointingHandCursor ); m_openPluginButton->move( 200, 70 ); diff --git a/plugins/vibed/impulse_editor.cpp b/plugins/vibed/impulse_editor.cpp index e0d4e2880..b23a9c645 100644 --- a/plugins/vibed/impulse_editor.cpp +++ b/plugins/vibed/impulse_editor.cpp @@ -53,7 +53,8 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, - engine * _engine, Uint32 _len ) : + engine * _engine, track * _track, + Uint32 _len ) : QWidget( _parent/*, "impulseEditor"*/ ), engineObject( _engine ), m_sampleLength( _len ), @@ -81,7 +82,8 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, connect( m_graph, SIGNAL ( sampleChanged( void ) ), this, SLOT ( sampleChanged( void ) ) ); - m_sinWaveBtn = new pixmapButton( this, eng() ); + m_sinWaveBtn = new pixmapButton( this, tr( "Sine wave" ), eng(), + _track ); m_sinWaveBtn->move( 136, 3 ); m_sinWaveBtn->setActiveGraphic( embed::getIconPixmap( "sin_wave_active" ) ); @@ -95,7 +97,8 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, this, SLOT ( sinWaveClicked( void ) ) ); - m_triangleWaveBtn = new pixmapButton( this, eng() ); + m_triangleWaveBtn = new pixmapButton( this, tr( "Triangle wave" ), + eng(), _track ); m_triangleWaveBtn->move( 136, 20 ); m_triangleWaveBtn->setActiveGraphic( embed::getIconPixmap( "triangle_wave_active" ) ); @@ -108,7 +111,8 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, this, SLOT ( triangleWaveClicked( void ) ) ); - m_sawWaveBtn = new pixmapButton( this, eng() ); + m_sawWaveBtn = new pixmapButton( this, tr( "Saw wave" ), eng(), + _track ); m_sawWaveBtn->move( 136, 37 ); m_sawWaveBtn->setActiveGraphic( embed::getIconPixmap( "saw_wave_active" ) ); @@ -121,7 +125,8 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, this, SLOT ( sawWaveClicked( void ) ) ); - m_sqrWaveBtn = new pixmapButton( this, eng() ); + m_sqrWaveBtn = new pixmapButton( this, tr( "Square wave" ), eng(), + _track ); m_sqrWaveBtn->move( 136, 54 ); m_sqrWaveBtn->setActiveGraphic( embed::getIconPixmap( "square_wave_active" ) ); @@ -134,7 +139,8 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, this, SLOT ( sqrWaveClicked( void ) ) ); - m_whiteNoiseWaveBtn = new pixmapButton( this, eng() ); + m_whiteNoiseWaveBtn = new pixmapButton( this, tr( "White noise wave" ), + eng(), _track ); m_whiteNoiseWaveBtn->move( 136, 71 ); m_whiteNoiseWaveBtn->setActiveGraphic( embed::getIconPixmap( "white_noise_wave_active" ) ); @@ -147,7 +153,8 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, this, SLOT ( noiseWaveClicked( void ) ) ); - m_usrWaveBtn = new pixmapButton( this, eng() ); + m_usrWaveBtn = new pixmapButton( this, tr( "User defined wave" ), eng(), + _track ); m_usrWaveBtn->move( 136, 88 ); m_usrWaveBtn->setActiveGraphic( embed::getIconPixmap( "usr_wave_active" ) ); @@ -160,7 +167,7 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, this, SLOT ( usrWaveClicked( void ) ) ); - m_smoothBtn = new pixmapButton( this, eng() ); + m_smoothBtn = new pixmapButton( this, tr( "Smooth" ), eng(), _track ); m_smoothBtn->move( 3, 108 ); m_smoothBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_active" ) ); @@ -173,7 +180,8 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, this, SLOT ( smoothClicked( void ) ) ); - m_normalizeBtn = new pixmapButton( this, eng() ); + m_normalizeBtn = new pixmapButton( this, tr( "Normalize" ), eng(), + _track ); m_normalizeBtn->move( 20, 108 ); m_normalizeBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "normalize_active" ) ); @@ -186,7 +194,8 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, connect( m_normalizeBtn, SIGNAL ( clicked ( void ) ), this, SLOT ( normalizeClicked( void ) ) ); - m_state = new ledCheckBox( "", this, eng() ); + m_state = new ledCheckBox( "", this, tr( "Enable waveform" ), eng(), + _track ); m_state->move( 136, 109 ); m_state->setChecked( TRUE ); toolTip::add( m_state, diff --git a/plugins/vibed/impulse_editor.h b/plugins/vibed/impulse_editor.h index 93ebe5ade..365b10710 100644 --- a/plugins/vibed/impulse_editor.h +++ b/plugins/vibed/impulse_editor.h @@ -52,7 +52,8 @@ class impulseEditor: public QWidget, public engineObject Q_OBJECT public: impulseEditor( QWidget *parent, int _x, int _y, - engine * _engine, Uint32 _len = 128 ); + engine * _engine, track * _track, + Uint32 _len = 128 ); ~impulseEditor(); inline float * getValues() { return( m_sampleShape ); }; diff --git a/plugins/vibed/nine_button_selector.cpp b/plugins/vibed/nine_button_selector.cpp index a9468bd96..5d367fad2 100644 --- a/plugins/vibed/nine_button_selector.cpp +++ b/plugins/vibed/nine_button_selector.cpp @@ -64,7 +64,8 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, Uint8 _default, Uint32 _x, Uint32 _y, QWidget * _parent, - engine * _engine ): + engine * _engine, + track * _track ): QWidget( _parent/*, "nineButtonSelector"*/ ), engineObject( _engine ), m_selected( _default ) @@ -81,7 +82,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, setPaletteBackgroundPixmap( m_base ); #endif - m_button = new pixmapButton( this, eng() ); + m_button = new pixmapButton( this, NULL, eng(), _track ); m_button->move( 1, 1 ); m_button->setActiveGraphic( _button0_on ); m_button->setInactiveGraphic( _button0_off ); @@ -90,7 +91,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, this, SLOT ( button0Clicked( void ) ) ); m_buttons.append( m_button ); - m_button = new pixmapButton( this, eng() ); + m_button = new pixmapButton( this, NULL, eng(), _track ); m_button->move( 18, 1 ); m_button->setActiveGraphic( _button1_on ); m_button->setInactiveGraphic( _button1_off ); @@ -99,7 +100,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, this, SLOT ( button1Clicked( void ) ) ); m_buttons.append( m_button ); - m_button = new pixmapButton( this, eng() ); + m_button = new pixmapButton( this, NULL, eng(), _track ); m_button->move( 35, 1 ); m_button->setActiveGraphic( _button2_on ); m_button->setInactiveGraphic( _button2_off ); @@ -108,7 +109,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, this, SLOT ( button2Clicked( void ) ) ); m_buttons.append( m_button ); - m_button = new pixmapButton( this, eng() ); + m_button = new pixmapButton( this, NULL, eng(), _track ); m_button->move( 1, 18 ); m_button->setActiveGraphic( _button3_on ); m_button->setInactiveGraphic( _button3_off ); @@ -117,7 +118,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, this, SLOT ( button3Clicked( void ) ) ); m_buttons.append( m_button ); - m_button = new pixmapButton( this, eng() ); + m_button = new pixmapButton( this, NULL, eng(), _track ); m_button->move( 18, 18 ); m_button->setActiveGraphic( _button4_on ); m_button->setInactiveGraphic( _button4_off ); @@ -126,7 +127,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, this, SLOT ( button4Clicked( void ) ) ); m_buttons.append( m_button ); - m_button = new pixmapButton( this, eng() ); + m_button = new pixmapButton( this, NULL, eng(), _track ); m_button->move( 35, 18 ); m_button->setActiveGraphic( _button5_on ); m_button->setInactiveGraphic( _button5_off ); @@ -135,7 +136,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, this, SLOT ( button5Clicked( void ) ) ); m_buttons.append( m_button ); - m_button = new pixmapButton( this, eng() ); + m_button = new pixmapButton( this, NULL, eng(), _track ); m_button->move( 1, 35 ); m_button->setActiveGraphic( _button6_on ); m_button->setInactiveGraphic( _button6_off ); @@ -144,7 +145,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, this, SLOT ( button6Clicked( void ) ) ); m_buttons.append( m_button ); - m_button = new pixmapButton( this, eng() ); + m_button = new pixmapButton( this, NULL, eng(), _track ); m_button->move( 18, 35 ); m_button->setActiveGraphic( _button7_on ); m_button->setInactiveGraphic( _button7_off ); @@ -153,7 +154,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, this, SLOT ( button7Clicked( void ) ) ); m_buttons.append( m_button ); - m_button = new pixmapButton( this, eng() ); + m_button = new pixmapButton( this, NULL, eng(), _track ); m_button->move( 35, 35 ); m_button->setActiveGraphic( _button8_on ); m_button->setInactiveGraphic( _button8_off ); diff --git a/plugins/vibed/nine_button_selector.h b/plugins/vibed/nine_button_selector.h index 0d82eb55a..97825f7ba 100644 --- a/plugins/vibed/nine_button_selector.h +++ b/plugins/vibed/nine_button_selector.h @@ -56,7 +56,8 @@ public: Uint8 _default, Uint32 _x, Uint32 _y, QWidget * _parent, - engine * _engine ); + engine * _engine, + track * _track ); ~nineButtonSelector(); inline Uint8 getSelected() { return( m_selected ); }; diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 21920a324..105864e6a 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -95,7 +95,8 @@ vibed::vibed( instrumentTrack * _channel_track ) : for( Uint8 harm = 0; harm < 9; harm++ ) { - m_editor = new impulseEditor( this, 76, 21, eng() ); + m_editor = new impulseEditor( this, 76, 21, eng(), + _channel_track ); m_editor->setOn( FALSE ); m_editor->hide(); m_editors.append( m_editor ); @@ -267,7 +268,8 @@ vibed::vibed( instrumentTrack * _channel_track ) : "will both ring longer and sound brighter, however, they will also eat up " "more CPU cycles." ) ); - m_impulse = new ledCheckBox( "", this, eng() ); + m_impulse = new ledCheckBox( "", this, tr( "Impulse" ), eng(), + _channel_track ); m_impulse->move( 23, 94 ); m_impulse->setChecked( FALSE ); toolTip::add( m_impulse, @@ -306,7 +308,8 @@ vibed::vibed( instrumentTrack * _channel_track ) : 2, 21, 127, this, - eng() ); + eng(), + NULL ); m_harmonic->hide(); m_harmonics.append( m_harmonic ); #ifdef QT4 @@ -344,7 +347,8 @@ vibed::vibed( instrumentTrack * _channel_track ) : 0, 21, 39, this, - eng() ); + eng(), + NULL ); connect( m_stringSelector, SIGNAL( nineButtonSelection( Uint8 ) ), this, SLOT( showString( Uint8 ) ) ); #ifdef QT4 @@ -455,8 +459,7 @@ void vibed::saveSettings( QDomDocument & _doc, m_randomKnobs[i]->saveSettings( _doc, _this, name ); name = "impulse" + QString::number( i ); - _this.setAttribute( name, QString::number( - m_impulses[i]->isChecked() ) ); + m_impulses[i]->saveSettings( _doc, _this, name ); QString sampleString; base64::encode( @@ -512,8 +515,7 @@ void vibed::loadSettings( const QDomElement & _this ) m_randomKnobs[i]->loadSettings( _this, name ); name = "impulse" + QString::number( i ); - m_impulses[i]->setChecked( - _this.attribute( name ).toInt() ); + m_impulses[i]->loadSettings( _this, name ); int size = 0; float * shp = 0; diff --git a/src/core/envelope_tab_widget.cpp b/src/core/envelope_tab_widget.cpp index f9b37b327..2938c4532 100644 --- a/src/core/envelope_tab_widget.cpp +++ b/src/core/envelope_tab_widget.cpp @@ -137,7 +137,8 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) : } - m_filterGroupBox = new groupBox( tr( "FILTER" ), this, eng() ); + m_filterGroupBox = new groupBox( tr( "FILTER" ), this, eng(), + _instrument_track ); m_filterGroupBox->setGeometry( FILTER_GROUPBOX_X, FILTER_GROUPBOX_Y, FILTER_GROUPBOX_WIDTH, FILTER_GROUPBOX_HEIGHT ); diff --git a/src/core/export_project_dialog.cpp b/src/core/export_project_dialog.cpp index a2c9fe890..227bc30c3 100644 --- a/src/core/export_project_dialog.cpp +++ b/src/core/export_project_dialog.cpp @@ -192,14 +192,15 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name, QString::number( 128 ) ) ); - m_vbrCb = new ledCheckBox( tr( "variable bitrate" ), this, eng() ); + m_vbrCb = new ledCheckBox( tr( "variable bitrate" ), this, NULL, eng(), + NULL ); m_vbrCb->setGeometry( LABEL_X + LABEL_WIDTH + 3 * LABEL_MARGIN + KBPS_COMBO_WIDTH, KBPS_STUFF_Y + 3, 190, 20 ); m_vbrCb->setChecked( TRUE ); m_hqmCb = new ledCheckBox( tr( "use high-quality-mode (recommened)" ), - this, eng() ); + this, NULL, eng(), NULL ); m_hqmCb->setGeometry( LABEL_X, HQ_MODE_CB_Y + 3, HQ_MODE_CB_WIDTH, HQ_MODE_CB_HEIGHT ); m_hqmCb->setChecked( TRUE ); diff --git a/src/core/midi_tab_widget.cpp b/src/core/midi_tab_widget.cpp index 2d8d68c63..92c0d9033 100644 --- a/src/core/midi_tab_widget.cpp +++ b/src/core/midi_tab_widget.cpp @@ -96,7 +96,9 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track, m_receiveCheckBox = new ledCheckBox( tr( "Receive MIDI-events" ), - m_setupTabWidget, eng() ); + m_setupTabWidget, + tr( "Receive MIDI-events" ), + eng(), _instrument_track ); m_receiveCheckBox->move( 10, 34 ); connect( m_receiveCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( midiPortModeToggled( bool ) ) ); @@ -105,14 +107,18 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track, m_defaultVelocityInCheckBox = new ledCheckBox( tr( "Default velocity " "for all input-events" ), - m_setupTabWidget, eng() ); + m_setupTabWidget, + tr( "Default input velocity" ), + eng(), _instrument_track ); m_defaultVelocityInCheckBox->move( 28, 84 ); connect( m_defaultVelocityInCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( defaultVelInChanged( bool ) ) ); m_sendCheckBox = new ledCheckBox( tr( "Send MIDI-events" ), - m_setupTabWidget, eng() ); + m_setupTabWidget, + tr( "Send MIDI-events" ), + eng(), _instrument_track ); m_sendCheckBox->move( 10, 114 ); connect( m_sendCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( midiPortModeToggled( bool ) ) ); @@ -121,7 +127,9 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track, m_defaultVelocityOutCheckBox = new ledCheckBox( tr( "Default velocity " "for all output-events" ), - m_setupTabWidget, eng() ); + m_setupTabWidget, + tr( "Default output velocity" ), + eng(), _instrument_track ); m_defaultVelocityOutCheckBox->move( 28, 164 ); connect( m_defaultVelocityOutCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( defaultVelOutChanged( bool ) ) ); @@ -211,12 +219,10 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "inputchannel", m_inputChannelSpinBox->value() ); _this.setAttribute( "outputchannel", m_outputChannelSpinBox->value() ); - _this.setAttribute( "receive", m_receiveCheckBox->isChecked() ); - _this.setAttribute( "send", m_sendCheckBox->isChecked() ); - _this.setAttribute( "defvelin", - m_defaultVelocityInCheckBox->isChecked() ); - _this.setAttribute( "defvelout", - m_defaultVelocityOutCheckBox->isChecked() ); + m_receiveCheckBox->saveSettings( _doc, _this, "receive" ); + m_sendCheckBox->saveSettings( _doc, _this, "send" ); + m_defaultVelocityInCheckBox->saveSettings( _doc, _this, "defvelin" ); + m_defaultVelocityOutCheckBox->saveSettings( _doc, _this, "defvelout" ); if( m_readablePorts != NULL && m_receiveCheckBox->isChecked() == TRUE ) { @@ -290,12 +296,10 @@ void midiTabWidget::loadSettings( const QDomElement & _this ) ).toInt() ); m_outputChannelSpinBox->setValue( _this.attribute( "outputchannel" ).toInt() ); - m_receiveCheckBox->setChecked( _this.attribute( "receive" ).toInt() ); - m_sendCheckBox->setChecked( _this.attribute( "send" ).toInt() ); - m_defaultVelocityInCheckBox->setChecked( - _this.attribute( "defvelin" ).toInt() ); - m_defaultVelocityOutCheckBox->setChecked( - _this.attribute( "defvelout" ).toInt() ); + m_receiveCheckBox->loadSettings( _this, "receive" ); + m_sendCheckBox->loadSettings( _this, "send" ); + m_defaultVelocityInCheckBox->loadSettings( _this, "defvelin" ); + m_defaultVelocityOutCheckBox->loadSettings( _this, "defvelout" ); // restore connections diff --git a/src/core/setup_dialog.cpp b/src/core/setup_dialog.cpp index 993ca97d1..7e1fef98e 100644 --- a/src/core/setup_dialog.cpp +++ b/src/core/setup_dialog.cpp @@ -194,7 +194,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * disable_tooltips = new ledCheckBox( tr( "Disable tooltips (no spurious " "interrupts while playing)" ), - misc_tw, eng() ); + misc_tw, NULL, eng(), NULL ); disable_tooltips->move( 10, 18 ); disable_tooltips->setChecked( m_disableToolTips ); connect( disable_tooltips, SIGNAL( toggled( bool ) ), @@ -205,7 +205,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : tr( "Classical knob usability (move " "cursor around knob to change " "value)" ), - misc_tw, eng() ); + misc_tw, NULL, eng(), NULL ); classical_knob_usability->move( 10, 36 ); classical_knob_usability->setChecked( m_classicalKnobUsability ); connect( classical_knob_usability, SIGNAL( toggled( bool ) ), @@ -214,7 +214,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * gimp_like_windows = new ledCheckBox( tr( "GIMP-like windows (no MDI)" ), - misc_tw, eng() ); + misc_tw, NULL, eng(), NULL ); gimp_like_windows->move( 10, 54 ); gimp_like_windows->setChecked( m_gimpLikeWindows ); connect( gimp_like_windows, SIGNAL( toggled( bool ) ), @@ -222,8 +222,8 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * no_wizard = new ledCheckBox( - tr( "Do not show wizard after " - "up-/downgrade" ), misc_tw, eng() ); + tr( "Do not show wizard after up-/downgrade" ), + misc_tw, NULL, eng(), NULL ); no_wizard->move( 10, 72 ); no_wizard->setChecked( m_noWizard ); connect( no_wizard, SIGNAL( toggled( bool ) ), @@ -233,7 +233,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * no_msg = new ledCheckBox( tr( "Do not show message after " "closing this dialog" ), - misc_tw, eng() ); + misc_tw, NULL, eng(), NULL ); no_msg->move( 10, 90 ); no_msg->setChecked( m_noMsgAfterSetup ); connect( no_msg, SIGNAL( toggled( bool ) ), @@ -242,7 +242,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * dbv = new ledCheckBox( tr( "Display volume as dbV " ), - misc_tw, eng() ); + misc_tw, NULL, eng(), NULL ); dbv->move( 10, 108 ); dbv->setChecked( m_displaydBV ); connect( dbv, SIGNAL( toggled( bool ) ), @@ -367,7 +367,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * disable_ch_act_ind = new ledCheckBox( tr( "Disable channel activity indicators" ), - ui_fx_tw, eng() ); + ui_fx_tw, NULL, eng(), NULL ); disable_ch_act_ind->move( 10, 20 ); disable_ch_act_ind->setChecked( m_disableChActInd ); connect( disable_ch_act_ind, SIGNAL( toggled( bool ) ), @@ -376,7 +376,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * manual_ch_piano = new ledCheckBox( tr( "Only press keys on channel-piano manually" ), - ui_fx_tw, eng() ); + ui_fx_tw, NULL, eng(), NULL ); manual_ch_piano->move( 10, 40 ); manual_ch_piano->setChecked( m_manualChPiano ); connect( manual_ch_piano, SIGNAL( toggled( bool ) ), diff --git a/src/core/track.cpp b/src/core/track.cpp index 322f243cd..b04b4fd4a 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -1000,7 +1000,9 @@ trackOperationsWidget::trackOperationsWidget( trackWidget * _parent ) : toolTip::add( m_trackOps, tr( "Actions for this track" ) ); - m_muteBtn = new pixmapButton( this, m_trackWidget->getTrack()->eng() ); + m_muteBtn = new pixmapButton( this, tr( "Mute" ), + m_trackWidget->getTrack()->eng(), + m_trackWidget->getTrack() ); m_muteBtn->setActiveGraphic( embed::getIconPixmap( "mute_on" ) ); m_muteBtn->setInactiveGraphic( embed::getIconPixmap( "mute_off" ) ); m_muteBtn->setCheckable( TRUE ); diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index 7a9dcdacf..d08b5d9b6 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -58,7 +58,7 @@ QPixmap * groupBox::s_ledBg = NULL; groupBox::groupBox( const QString & _caption, QWidget * _parent, - engine * _engine ) : + engine * _engine, track * _track ) : QWidget( _parent ), engineObject( _engine ), m_caption( _caption ), @@ -77,7 +77,7 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent, updatePixmap(); - m_led = new pixmapButton( this, eng() ); + m_led = new pixmapButton( this, _caption, eng(), _track ); m_led->setCheckable( TRUE ); m_led->move( 2, 3 ); m_led->setActiveGraphic( embed::getIconPixmap( "led_green" ) ); diff --git a/src/widgets/led_checkbox.cpp b/src/widgets/led_checkbox.cpp index 0fe8f2a3d..06546f743 100644 --- a/src/widgets/led_checkbox.cpp +++ b/src/widgets/led_checkbox.cpp @@ -55,8 +55,10 @@ static const QString names[ledCheckBox::TOTAL_COLORS] = ledCheckBox::ledCheckBox( const QString & _text, QWidget * _parent, - engine * _engine, ledColors _color ) : - automatableButton( _parent, _engine ), + const QString & _name, + engine * _engine, track * _track, + ledColors _color ) : + automatableButton( _parent, _name, _engine, _track ), m_text( _text ) { setCheckable( TRUE ); diff --git a/src/widgets/pixmap_button.cpp b/src/widgets/pixmap_button.cpp index 6057fe9d4..998c5a6e4 100644 --- a/src/widgets/pixmap_button.cpp +++ b/src/widgets/pixmap_button.cpp @@ -45,8 +45,9 @@ -pixmapButton::pixmapButton( QWidget * _parent, engine * _engine ) : - automatableButton( _parent, _engine ), +pixmapButton::pixmapButton( QWidget * _parent, const QString & _name, + engine * _engine, track * _track ) : + automatableButton( _parent, _name, _engine, _track ), m_activePixmap(), m_inactivePixmap(), m_bgPixmap()