cleaned up all the arpeggio-direction-hacks - now the values are UP (0) to RANDOM (3) at *all* places
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@514 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -69,7 +69,6 @@ class arpAndChordsTabWidget : public QWidget, public journallingObject
|
||||
public:
|
||||
enum arpDirections
|
||||
{
|
||||
OFF,
|
||||
UP,
|
||||
DOWN,
|
||||
UP_AND_DOWN,
|
||||
|
||||
@@ -635,7 +635,7 @@ bool flpImport::tryImport( trackContainer * _tc )
|
||||
const arpAndChordsTabWidget::arpDirections
|
||||
mappedArpDir[] =
|
||||
{
|
||||
arpAndChordsTabWidget::OFF,
|
||||
arpAndChordsTabWidget::UP,
|
||||
arpAndChordsTabWidget::UP,
|
||||
arpAndChordsTabWidget::DOWN,
|
||||
arpAndChordsTabWidget::UP_AND_DOWN,
|
||||
@@ -645,16 +645,14 @@ bool flpImport::tryImport( trackContainer * _tc )
|
||||
const Uint32 * p = (const Uint32 *) text;
|
||||
arpAndChordsTabWidget * actw = it->m_arpWidget;
|
||||
actw->m_arpDirectionBtnGrp->setValue(
|
||||
mappedArpDir[p[10]] - 1 );
|
||||
mappedArpDir[p[10]] );
|
||||
actw->m_arpRangeKnob->setValue( p[11] );
|
||||
actw->m_arpComboBox->setValue( p[12] );
|
||||
actw->m_arpTimeKnob->setValue( p[13] / 8.0f );
|
||||
//// 100.0f );
|
||||
actw->m_arpGateKnob->setValue( p[14] * 100.0f /
|
||||
48.0f );
|
||||
actw->m_arpGroupBox->setState(
|
||||
mappedArpDir[p[10]] !=
|
||||
arpAndChordsTabWidget::OFF );
|
||||
actw->m_arpGroupBox->setState( p[10] > 0 );
|
||||
printf( "channel params: " );
|
||||
dump_mem( text, text_len );
|
||||
//printf( "channel params: arpdir: %d range: %d time: %d gate: %d\n", p[10], p[11], p[13], p[14] );
|
||||
|
||||
@@ -386,7 +386,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget(
|
||||
m_arpDirectionBtnGrp->addButton( arp_up_and_down_btn );
|
||||
m_arpDirectionBtnGrp->addButton( arp_random_btn );
|
||||
|
||||
m_arpDirectionBtnGrp->setInitValue( UP - 1 );
|
||||
m_arpDirectionBtnGrp->setInitValue( UP );
|
||||
|
||||
|
||||
QLabel * mode_lbl = new QLabel( tr( "Mode:" ), m_arpGroupBox );
|
||||
@@ -479,7 +479,6 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
|
||||
// now follows code for arpeggio
|
||||
|
||||
if( _n->baseNote() == FALSE ||
|
||||
( m_arpDirectionBtnGrp->value() + 1) == OFF ||
|
||||
!m_arpGroupBox->isActive() ||
|
||||
( _n->released() && _n->releaseFramesDone() >=
|
||||
_n->actualReleaseFramesToDo() ) )
|
||||
@@ -553,8 +552,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
|
||||
continue;
|
||||
}
|
||||
|
||||
arpDirections dir = static_cast<arpDirections>(
|
||||
m_arpDirectionBtnGrp->value() + 1 );
|
||||
const int dir = m_arpDirectionBtnGrp->value();
|
||||
// process according to arpeggio-direction...
|
||||
if( dir == UP )
|
||||
{
|
||||
@@ -678,7 +676,7 @@ void arpAndChordsTabWidget::loadSettings( const QDomElement & _this )
|
||||
m_arpGateKnob->loadSettings( _this, "arpgate" );
|
||||
m_arpDirectionBtnGrp->loadSettings( _this, "arpdir" );
|
||||
|
||||
// Keep compatibility with version 2.1 file format
|
||||
// Keep compatibility with version 0.2.1 file format
|
||||
if( _this.hasAttribute( "arpsyncmode" ) )
|
||||
{
|
||||
m_arpTimeKnob->setSyncMode(
|
||||
|
||||
@@ -533,6 +533,12 @@ void multimediaProject::upgrade( void )
|
||||
!el.attribute( "arpdisabled" )
|
||||
.toInt() );
|
||||
}
|
||||
else if( !el.hasAttribute( "chord-enabled" ) )
|
||||
{
|
||||
el.setAttribute( "chord-enabled", TRUE );
|
||||
el.setAttribute( "arp-enabled",
|
||||
el.attribute( "arpdir" ).toInt() != 0 );
|
||||
}
|
||||
}
|
||||
|
||||
list = elementsByTagName( "channeltrack" );
|
||||
@@ -572,6 +578,26 @@ void multimediaProject::upgrade( void )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( version < "0.3.0-rc2" )
|
||||
{
|
||||
QDomNodeList list = elementsByTagName( "arpandchords" );
|
||||
for( int i = 0; !list.item( i ).isNull(); ++i )
|
||||
{
|
||||
QDomElement el = list.item( i ).toElement();
|
||||
if( el.attribute( "arpdir" ).toInt() > 0 )
|
||||
{
|
||||
el.setAttribute( "arpdir",
|
||||
el.attribute( "arpdir" ).toInt() - 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !m_head.hasAttribute( "mastervol" ) )
|
||||
{
|
||||
m_head.setAttribute( "mastervol", 100 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user