7afdd14a4c
* Gui: ported submenu and view_dispatcher_remove_view from iButton branch * App gui-test: use backported submenu api * App subghz: initial commit * App subghz: syntax fix * App gui-test: fix submenu callback * App subghz: add subfolders to build * Gui view: c++ verison of with_view_model * Subghz app: simple spectrum settings view * Subghz app: add spectrum settings view to view manager * Subghz app: spectrum settings scene Co-authored-by: coreglitch <mail@s3f.ru>
37 lines
958 B
C++
37 lines
958 B
C++
#pragma once
|
|
#include <map>
|
|
#include <list>
|
|
#include "subghz-view-manager.h"
|
|
|
|
#include "scene/subghz-scene-start.h"
|
|
#include "scene/subghz-scene-spectrum-settings.h"
|
|
|
|
class SubghzApp {
|
|
public:
|
|
void run(void);
|
|
|
|
SubghzApp();
|
|
~SubghzApp();
|
|
|
|
enum class Scene : uint8_t {
|
|
SceneExit,
|
|
SceneStart,
|
|
SceneSpectrumSettings,
|
|
};
|
|
|
|
SubghzAppViewManager* get_view_manager();
|
|
void switch_to_next_scene(Scene index);
|
|
void search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list);
|
|
bool switch_to_previous_scene(uint8_t count = 1);
|
|
Scene get_previous_scene();
|
|
|
|
private:
|
|
std::list<Scene> previous_scenes_list = {Scene::SceneExit};
|
|
Scene current_scene = Scene::SceneStart;
|
|
SubghzAppViewManager view;
|
|
|
|
std::map<Scene, SubghzScene*> scenes = {
|
|
{Scene::SceneStart, new SubghzSceneStart()},
|
|
{Scene::SceneSpectrumSettings, new SubghzSceneSpectrumSettings()},
|
|
};
|
|
}; |