Debian Codegraph @

BambooTracker/command/instrument/add_instrument_command.hpp

raw
1 /*
2 * SPDX-FileCopyrightText: 2018 Rerrah
3 * SPDX-License-Identifier: MIT
4 */
5
6 #pragma once
7
8 #include <memory>
9 #include <string>
10 #include "../abstract_command.hpp"
11 #include "instrument.hpp"
12 #include "instruments_manager.hpp"
13
14 class AddInstrumentCommand final : public AbstractCommand
15 {
16 public:
17 AddInstrumentCommand(std::weak_ptr<InstrumentsManager> manager,
18 int num, InstrumentType type, const std::string& name);
19 AddInstrumentCommand(std::weak_ptr<InstrumentsManager> manager,
20 std::unique_ptr<AbstractInstrument> inst);
21 bool redo() override;
22 bool undo() override;
23
24 private:
25 std::weak_ptr<InstrumentsManager> manager_;
26 int num_;
27 InstrumentType type_;
28 std::string name_;
29 std::unique_ptr<AbstractInstrument> inst_;
30 };