| 797 | | if ( pNote->get_instrument() == instrument |
|---|
| 798 | | && pNote->get_position() == noteOnTick ) { |
|---|
| 799 | | AudioEngine::get_instance()->lock("Sample::setnotelenght_event"); |
|---|
| 800 | | |
|---|
| 801 | | if ( ticks > patternsize ) |
|---|
| 802 | | ticks = patternsize - noteOnTick; |
|---|
| 803 | | pNote->set_lenght( ticks ); |
|---|
| 804 | | Hydrogen::get_instance()->getSong()->__is_modified = true; |
|---|
| 805 | | AudioEngine::get_instance()->unlock(); // unlock the audio engine |
|---|
| 806 | | |
|---|
| | 797 | if( !Preferences::getInstance()->__playselectedinstrument ){ |
|---|
| | 798 | if ( pNote->get_instrument() == instrument |
|---|
| | 799 | && pNote->get_position() == noteOnTick ) { |
|---|
| | 800 | AudioEngine::get_instance()->lock("Sample::setnotelenght_event"); |
|---|
| | 801 | |
|---|
| | 802 | if ( ticks > patternsize ) |
|---|
| | 803 | ticks = patternsize - noteOnTick; |
|---|
| | 804 | pNote->set_lenght( ticks ); |
|---|
| | 805 | Hydrogen::get_instance()->getSong()->__is_modified = true; |
|---|
| | 806 | AudioEngine::get_instance()->unlock(); // unlock the audio engine |
|---|
| | 807 | } |
|---|
| | 808 | }else |
|---|
| | 809 | { if ( pNote->get_instrument() == pEngine->getSong()->get_instrument_list()->get( pEngine->getSelectedInstrumentNumber()) |
|---|
| | 810 | && pNote->get_position() == noteOnTick ) { |
|---|
| | 811 | AudioEngine::get_instance()->lock("Sample::setnotelenght_event"); |
|---|
| | 812 | if ( ticks > patternsize ) |
|---|
| | 813 | ticks = patternsize - noteOnTick; |
|---|
| | 814 | pNote->set_lenght( ticks ); |
|---|
| | 815 | Hydrogen::get_instance()->getSong()->__is_modified = true; |
|---|
| | 816 | AudioEngine::get_instance()->unlock(); // unlock the audio engine |
|---|
| | 817 | |
|---|
| | 818 | |
|---|
| | 819 | } |
|---|