#ifndef PROGRAMSTATE_H #define PROGRAMSTATE_H #include "constants.h" //Singleton. This is also saved and loaded. See main.c typedef struct { bool nsm; //under nsm or not //Saved ///////////////////// bool guiVisible; bool showPitchMarker; int pitchMarkerValue; bool showPortBackground; bool showPortBackgroundForUnconnected; int fadeOutMode; int fadeOutFactor; bool showConnectedPortnames; bool includeClientInPortNameDisplay; bool alwaysShowClock; bool applicationWindowVisible; int cameraCenterOnX; int cameraCenterOnY; int pitchMin; //Note Drawing Range for all modes int pitchMax; //Note Drawing Range for all modes //Layer Switches bool showBackgroundImageLayer; //or plain color bool showEffectLayer; bool showSpriteLayer; bool showDrawMode; bool showForegroundSpritesLayer; bool showForegroundEffectsLayer; //Layer Modes and Settings //char * backgroundImagePath; int drawMode; //Vertical, Grids... Color colors[VIS_PORTS+3]; //For specific modes only int meterbridge_grouping; // 127 / 1 as default -> show all notes individually. 12 would mean show activity in one octave as the same rectangle. pitchmarker is the root note. //Images and paths char * pathBackgroundImage; //in nsm this is always background.png , standalone it is an absolute file path //Not Saved ///////////////////// bool guiRedrawNeeded; bool instructedToQuit; bool transportRolling; double bpm; char* clockString; const char* connectedPortNames[VIS_PORTS]; const char * modeDescription; //48 chars per line.\n for line break. Label to describe a mode. Set by files like draw_port_grids.c etc. int portActivity[VIS_PORTS]; //0 means no activity, any other number is the number of current note-ons bool lockInput; //Prevent keypresses while in file open dialog etc. Camera2D camera; //Not saved but provided by NSM or argc ///////////////////// char * name; char * nsmDirectory; //Our directory in NSM, empty standalone. Don't use for checks, use bool programState.nsm instead char * filePath; //This is always the direct json save file. There is only one filePath per session. We do not provide "reload" or "open" } ProgramState; void initProgramState(bool nsm, const char * filePath, const char * programName); void loadStateFromFile(); void saveStateToFile(); void setColorPalette(int number); #endif // not defined PROGRAMSTATE_H