-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
961 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 46 additions & 19 deletions
65
Platformio/hardware/windows_linux/preferencesStorage_hal_windows_linux.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,58 @@ | ||
#include <string> | ||
|
||
std::string currentScene; | ||
std::string currentGUIname; | ||
enum GUIlists { | ||
// MAIN_GUI_LIST: we are in the main_gui_list (with the scene selector as first gui), either if a scene is active or not | ||
// SCENE_GUI_LIST: a scene is active and we are not in the main_gui_list. In that case, we try to use the scene specific gui list, if the scene defined one. | ||
MAIN_GUI_LIST, | ||
SCENE_GUI_LIST | ||
}; | ||
|
||
/* | ||
Possible example: | ||
main_gui_list : "Scene selection", "Smart Home", "Settings", "IR Receiver"}; | ||
"Off" : | ||
"TV" : "Numpad" | ||
"Fire TV" : "Numpad", "Settings" | ||
"Chromecast" : | ||
"Apple TV" : "Apple TV", "Settings", "IR Receiver" | ||
*/ | ||
std::string activeScene; | ||
std::string activeGUIname; | ||
int activeGUIlist; | ||
int lastActiveGUIlistIndex; | ||
|
||
void init_preferences_HAL(void) { | ||
// set some values for tests | ||
activeScene = ""; // "Off", "TV", "Fire TV", "Chromecast", "Apple TV"; | ||
activeGUIname = ""; // "Scene selection", "Smart Home", "Settings", "IR Receiver" // "Numpad", "Apple TV" | ||
activeGUIlist = MAIN_GUI_LIST; // MAIN_GUI_LIST, SCENE_GUI_LIST; | ||
lastActiveGUIlistIndex = 0; | ||
} | ||
void save_preferences_HAL(void) { | ||
} | ||
|
||
std::string get_currentScene_HAL() { | ||
// if (currentScene == "") { | ||
// // set here something if you need it for a test at startup | ||
// return "Apple TV"; | ||
// } else | ||
{return currentScene;} | ||
|
||
std::string get_activeScene_HAL() { | ||
return activeScene; | ||
} | ||
void set_activeScene_HAL(std::string anActiveScene) { | ||
activeScene = anActiveScene; | ||
} | ||
std::string get_activeGUIname_HAL(){ | ||
return activeGUIname; | ||
} | ||
void set_activeGUIname_HAL(std::string anActiveGUIname) { | ||
activeGUIname = anActiveGUIname; | ||
} | ||
int get_activeGUIlist_HAL() { | ||
return activeGUIlist; | ||
} | ||
void set_currentScene_HAL(std::string aCurrentScene) { | ||
currentScene = aCurrentScene; | ||
void set_activeGUIlist_HAL(int anActiveGUIlist) { | ||
activeGUIlist = anActiveGUIlist; | ||
} | ||
std::string get_currentGUIname_HAL(){ | ||
// if (currentGUIname == "") { | ||
// // set here something if you need it for a test at startup | ||
// return "IR Receiver"; // "Numpad"; // "Apple TV"; | ||
// } else | ||
{return currentGUIname;} | ||
int get_lastActiveGUIlistIndex_HAL() { | ||
return lastActiveGUIlistIndex; | ||
} | ||
void set_currentGUIname_HAL(std::string aCurrentGUIname) { | ||
currentGUIname = aCurrentGUIname; | ||
void set_lastActiveGUIlistIndex_HAL(int aGUIlistIndex) { | ||
lastActiveGUIlistIndex = aGUIlistIndex; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.