Skip to content

Commit

Permalink
Adding a pattern now adds after the currently selected pattern (issue h…
Browse files Browse the repository at this point in the history
  • Loading branch information
pvint committed Apr 7, 2018
1 parent ede4d3e commit bfd2137
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/src/MainForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ void MainForm::action_file_openPattern()
Hydrogen *pEngine = Hydrogen::get_instance();
Song *pSong = pEngine->getSong();
PatternList *pPatternList = pSong->get_pattern_list();
int selectedPatternPosition = pEngine->getSelectedPatternNumber();

Instrument *instr = pSong->get_instrument_list()->get ( 0 );
assert ( instr );
Expand Down Expand Up @@ -793,7 +794,8 @@ void MainForm::action_file_openPattern()
pNewPattern->set_name( pPatternList->find_unused_pattern_name( pNewPattern->get_name() ) );
}

pPatternList->add ( pNewPattern );
pPatternList->insert( selectedPatternPosition + 1, pNewPattern );
pEngine->setSelectedPatternNumber( selectedPatternPosition + 1 );
pSong->set_is_modified( true );
EventQueue::get_instance()->push_event( EVENT_SONG_MODIFIED, -1 );
}
Expand Down

0 comments on commit bfd2137

Please sign in to comment.