upgraded buttons

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@191 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Javier Serrano Polo
2006-07-02 21:39:43 +00:00
parent dcd6bf6b7a
commit 19924ef442
18 changed files with 110 additions and 82 deletions

View File

@@ -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" );
}

View File

@@ -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 );

View File

@@ -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,

View File

@@ -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 ); };

View File

@@ -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 );

View File

@@ -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 ); };

View File

@@ -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;