| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2018 Rerrah |
| 3 |
* SPDX-License-Identifier: MIT |
| 4 |
*/ |
| 5 |
|
| 6 |
#include "deep_clone_instrument_command.hpp" |
| 7 |
|
| 8 |
DeepCloneInstrumentCommand::DeepCloneInstrumentCommand(std::weak_ptr<InstrumentsManager> manager, |
| 9 |
int num, int refNum) |
| 10 |
: AbstractCommand(CommandId::DeepCloneInstrument), |
| 11 |
manager_(manager), |
| 12 |
cloneInstNum_(num), |
| 13 |
refInstNum_(refNum) |
| 14 |
{ |
| 15 |
} |
| 16 |
|
| 17 |
bool DeepCloneInstrumentCommand::redo() |
| 18 |
{ |
| 19 |
manager_.lock()->deepCloneInstrument(cloneInstNum_, refInstNum_); |
| 20 |
return true; |
| 21 |
} |
| 22 |
|
| 23 |
bool DeepCloneInstrumentCommand::undo() |
| 24 |
{ |
| 25 |
manager_.lock()->removeInstrument(cloneInstNum_); |
| 26 |
return true; |
| 27 |
} |