| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2020 Rerrah |
| 3 |
* SPDX-License-Identifier: MIT |
| 4 |
*/ |
| 5 |
|
| 6 |
#pragma once |
| 7 |
|
| 8 |
#include <memory> |
| 9 |
#include "../abstract_command.hpp" |
| 10 |
#include "instruments_manager.hpp" |
| 11 |
#include "module.hpp" |
| 12 |
|
| 13 |
class SwapInstrumentsCommand final : public AbstractCommand |
| 14 |
{ |
| 15 |
public: |
| 16 |
SwapInstrumentsCommand(std::weak_ptr<InstrumentsManager> manager, std::weak_ptr<Module> mod, |
| 17 |
int inst1, int inst2, int song, bool patternChange); |
| 18 |
bool redo() override; |
| 19 |
bool undo() override; |
| 20 |
|
| 21 |
private: |
| 22 |
std::weak_ptr<InstrumentsManager> manager_; |
| 23 |
std::weak_ptr<Module> mod_; |
| 24 |
int inst1Num_, inst2Num_; |
| 25 |
int songNum_; |
| 26 |
bool patternChange_; |
| 27 |
|
| 28 |
void swapInstrumentsInPatterns(); |
| 29 |
}; |