Skip to content

Commit

Permalink
Merge pull request #1768 from theGreatWhiteShark/phil-fix-1751
Browse files Browse the repository at this point in the history
MidiAction: fix handleActions (#1751)
  • Loading branch information
theGreatWhiteShark authored May 11, 2023
2 parents 0f5577f + 4db5b68 commit 1bd221f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ XXXX-XX-XX the hydrogen team <hydrogen-devel@lists.sourceforge.net>
* Release 1.2.1
* Update French translation
* Bugfixes
- Fix loading of legacy drumkits. All layers but the first one
were dropped during drumkit upgrade (#1759)
- Fix MIDI input handling with "Discard MIDI messages after action
has been triggered" checked. Incoming NOTEON message were
dropped without triggering a sound (#1751)
- Fix beat and bar calculation in pattern mode (#1741)
- Fix compilation in GCC with -Werror=format-security (#1739)
- Explicit usage of Python3 in stats.py script
Expand Down
6 changes: 3 additions & 3 deletions src/core/MidiAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,12 +1228,12 @@ int MidiActionManager::getParameterNumber( const QString& sActionType ) const {

bool MidiActionManager::handleActions( std::vector<std::shared_ptr<Action>> actions ) {

bool bResult = true;
bool bResult = false;

for ( const auto& action : actions ) {
if ( action != nullptr ) {
if ( ! handleAction( action ) ) {
bResult = false;
if ( handleAction( action ) ) {
bResult = true;
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions src/core/MidiAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,19 @@ class MidiActionManager : public H2Core::Object<MidiActionManager>
* Handles multiple actions at once and calls handleAction()
* on them.
*
* \return true - in case all actions were successful, false - otherwise.
* \return true - if at least one Action was handled
* successfully. Calling functions should treat the event
* resulting in @a actions as consumed.
*/
bool handleActions( std::vector<std::shared_ptr<Action>> );
bool handleActions( std::vector<std::shared_ptr<Action>> actions );
/**
* The handleAction method is the heart of the
* MidiActionManager class. It executes the operations that
* are needed to carry the desired action.
*
* @return true - if @a action was handled successfully.
*/
bool handleAction( std::shared_ptr<Action> );
bool handleAction( std::shared_ptr<Action> action );
/**
* If #__instance equals 0, a new MidiActionManager
* singleton will be created and stored in it.
Expand Down

0 comments on commit 1bd221f

Please sign in to comment.