SDRPlusPlus/misc_modules/scheduler/src/sched_action.h

33 lines
737 B
C
Raw Normal View History

2021-11-14 18:30:58 +01:00
#pragma once
#include <json.hpp>
#include <memory>
#include <utils/flog.h>
2021-11-14 18:30:58 +01:00
using namespace nlohmann;
namespace sched_action {
class ActionClass {
public:
virtual ~ActionClass(){};
2021-11-14 18:30:58 +01:00
virtual void trigger() = 0;
virtual void prepareEditMenu() = 0;
2021-11-15 17:15:59 +01:00
virtual bool showEditMenu(bool& valid) = 0;
2021-11-14 18:30:58 +01:00
virtual void loadFromConfig(json config) = 0;
virtual json saveToConfig() = 0;
virtual std::string getName() = 0;
2021-11-15 17:15:59 +01:00
virtual bool isValid() {
return valid;
}
bool selected = false;
2021-11-15 17:15:59 +01:00
private:
bool valid = false;
2021-11-14 18:30:58 +01:00
};
typedef std::shared_ptr<ActionClass> Action;
2021-11-14 18:30:58 +01:00
}
#include <actions/start_recorder.h>
#include <actions/tune_vfo.h>