removed animation-functionality of groupBox as it's useless, fixed boolModel-initializations - makes filter, arpeggio and chords work again
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@642 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
11
ChangeLog
11
ChangeLog
@@ -1,3 +1,14 @@
|
||||
2008-01-04 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* include/group_box.h:
|
||||
* src/widgets/group_box.cpp:
|
||||
removed animation-functionality as it's useless
|
||||
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
* src/core/envelope_tab_widget.cpp:
|
||||
fixed boolModel-initializations - makes filter, arpeggio and chords
|
||||
work again
|
||||
|
||||
2008-01-03 Danny McRae <khjklujn/at/yahoo/dot/com>
|
||||
|
||||
* plugins/stk/mallets/mallets.h:
|
||||
|
||||
@@ -45,14 +45,9 @@ public:
|
||||
virtual void modelChanged( void );
|
||||
|
||||
|
||||
public slots:
|
||||
// void setState( bool _on, bool _anim = FALSE );
|
||||
void animate( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
|
||||
|
||||
private:
|
||||
@@ -63,9 +58,6 @@ private:
|
||||
pixmapButton * m_led;
|
||||
QString m_caption;
|
||||
|
||||
int m_origHeight;
|
||||
bool m_animating;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -181,11 +181,11 @@ const int ARP_GROUPBOX_HEIGHT = 240 - ARP_GROUPBOX_Y;
|
||||
arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
instrumentTrack * _instrument_track ) :
|
||||
QWidget( _instrument_track->tabWidgetParent() ),
|
||||
m_chordsEnabledModel( new boolModel( /* this */ ) ),
|
||||
m_chordsEnabledModel( new boolModel( FALSE, FALSE, TRUE, 1 /* this */ ) ),
|
||||
m_chordsModel( new comboBoxModel( /* this */ ) ),
|
||||
m_chordRangeModel( new floatModel( 1.0f, 1.0f, 9.0f, 1.0f
|
||||
/* this */ ) ),
|
||||
m_arpEnabledModel( new boolModel( /* this */ ) ),
|
||||
m_arpEnabledModel( new boolModel( FALSE, FALSE, TRUE, 1/* this */ ) ),
|
||||
m_arpModel( new comboBoxModel( /* this */ ) ),
|
||||
m_arpRangeModel( new floatModel( 1.0f, 1.0f, 9.0f, 1.0f
|
||||
/* this */ ) ),
|
||||
|
||||
@@ -74,7 +74,7 @@ static const QString targetNames[envelopeTabWidget::TARGET_COUNT][2] =
|
||||
envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) :
|
||||
QWidget( _instrument_track->tabWidgetParent() ),
|
||||
m_instrumentTrack( _instrument_track ),
|
||||
m_filterEnabledModel( new boolModel( /* this */ ) ),
|
||||
m_filterEnabledModel( new boolModel( FALSE, FALSE, TRUE, 1 /* this */ ) ),
|
||||
m_filterModel( new comboBoxModel( /* this */ ) ),
|
||||
m_filterCutModel( new floatModel( /* this */ ) ),
|
||||
m_filterResModel( new floatModel( /* this */ ) )
|
||||
|
||||
@@ -50,9 +50,7 @@ QPixmap * groupBox::s_ledBg = NULL;
|
||||
groupBox::groupBox( const QString & _caption, QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
autoModelView(),
|
||||
m_caption( _caption ),
|
||||
m_origHeight( height() ),
|
||||
m_animating( FALSE )
|
||||
m_caption( _caption )
|
||||
{
|
||||
if( s_ledBg == NULL )
|
||||
{
|
||||
@@ -68,9 +66,9 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent ) :
|
||||
m_led->setActiveGraphic( embed::getIconPixmap( "led_green" ) );
|
||||
m_led->setInactiveGraphic( embed::getIconPixmap( "led_off" ) );
|
||||
|
||||
setModel( new autoModel( FALSE, FALSE, TRUE, 1, NULL, FALSE ) );
|
||||
setModel( new autoModel( FALSE, FALSE, TRUE,
|
||||
autoModel::defaultRelStep(), NULL, FALSE ) );
|
||||
setAutoFillBackground( TRUE );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -90,93 +88,23 @@ void groupBox::modelChanged( void )
|
||||
|
||||
|
||||
|
||||
void groupBox::resizeEvent( QResizeEvent * )
|
||||
{
|
||||
updatePixmap();
|
||||
if( m_animating == FALSE )
|
||||
{
|
||||
m_origHeight = height();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void groupBox::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->y() > 1 && _me->y() < 13 )
|
||||
{
|
||||
//setState( !isActive(), TRUE );
|
||||
if( ( model()->value() == TRUE && height() < m_origHeight ) &&
|
||||
m_animating == FALSE )
|
||||
{
|
||||
m_animating = TRUE;
|
||||
animate();
|
||||
}
|
||||
model()->setValue( !model()->value() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
void groupBox::setState( bool _on, bool _anim )
|
||||
|
||||
void groupBox::resizeEvent( QResizeEvent * _ev )
|
||||
{
|
||||
m_led->setChecked( _on );
|
||||
emit( toggled( _on ) );
|
||||
updatePixmap();
|
||||
QWidget::resizeEvent( _ev );
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
void groupBox::animate( void )
|
||||
{
|
||||
float state = (float)( m_origHeight - height() ) /
|
||||
(float)( m_origHeight - 19 );
|
||||
int dy = static_cast<int>( 3 - 2 * cosf( state * 2 * M_PI ) );
|
||||
if( model()->value() && height() < m_origHeight )
|
||||
{
|
||||
}
|
||||
else if( !model()->value() && height() > 19 )
|
||||
{
|
||||
dy = -dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_animating = FALSE;
|
||||
return;
|
||||
}
|
||||
resize( width(), height() + dy );
|
||||
QTimer::singleShot( 10, this, SLOT( animate() ) );
|
||||
QObjectList ch = parent()->children();
|
||||
for( int i = 0; i < ch.count(); ++i )
|
||||
{
|
||||
QWidget * w = dynamic_cast<QWidget *>( ch.at( i ) );
|
||||
if( w == NULL || w->y() < y() + height() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
w->move( w->x(), w->y() + dy );
|
||||
}
|
||||
ch = children();
|
||||
for( int i = 0; i < ch.count(); ++i )
|
||||
{
|
||||
QWidget * w = dynamic_cast<QWidget *>( ch.at( i ) );
|
||||
if( w == NULL || w == m_led )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
w->move( w->x(), w->y() + dy );
|
||||
if( w->y() < 14)
|
||||
{
|
||||
w->hide();
|
||||
}
|
||||
else if( w->isHidden() == TRUE )
|
||||
{
|
||||
w->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user