| 44 | } |
| 45 | |
| 46 | QList<int> ActionManager::commitActionSet() |
| 47 | { |
| 48 | if (_currentActions.empty()) |
| 49 | return QList<int>(); // Nothing to do |
| 50 | |
| 51 | // Separate the actions per soundfont |
| 52 | QMap<int, QList<Action *> > actionsPerSoundfont; |
| 53 | while (!_currentActions.isEmpty()) |
| 54 | { |
| 55 | Action * action = _currentActions.takeFirst(); |
| 56 | actionsPerSoundfont[action->id.indexSf2] << action; |
| 57 | } |
| 58 | |
| 59 | // Add the new sets of actions |
| 60 | foreach (int sf2Index, actionsPerSoundfont.keys()) |
| 61 | { |
| 62 | if (!_actionSets.contains(sf2Index)) |
| 63 | { |
| 64 | _actionSets[sf2Index] = new ActionSet(); |
| 65 | connect(_actionSets[sf2Index], SIGNAL(dropId(EltID)), this, SIGNAL(dropId(EltID))); |
| 66 | } |
| 67 | _actionSets[sf2Index]->addActions(actionsPerSoundfont[sf2Index]); |
| 68 | } |
| 69 | |
| 70 | return actionsPerSoundfont.keys(); |
| 71 | } |
| 72 | |
| 73 | void ActionManager::clearCurrentActionSet() |
| 74 | { |