furnace/src/gui/gui.h

79 lines
1.7 KiB
C
Raw Normal View History

2021-12-11 07:10:09 +00:00
#include "../engine/engine.h"
2021-12-11 08:11:40 +00:00
#include "imgui.h"
#include "imgui_impl_sdl.h"
#include "imgui_impl_sdlrenderer.h"
#include <SDL.h>
2021-12-11 07:10:09 +00:00
2021-12-13 22:09:46 +00:00
enum FurnaceGUIColors {
GUI_COLOR_BACKGROUND=0,
GUI_COLOR_FRAME_BACKGROUND,
GUI_COLOR_HEADER,
GUI_COLOR_ITEM_BACKGROUND,
GUI_COLOR_ITEM_FOREGROUND,
GUI_COLOR_PATTERN_HI_1,
GUI_COLOR_PATTERN_HI_2,
GUI_COLOR_PATTERN_ROW_INDEX,
GUI_COLOR_PATTERN_ACTIVE,
GUI_COLOR_PATTERN_INACTIVE,
GUI_COLOR_PATTERN_INS,
GUI_COLOR_PATTERN_VOLUME_MAX,
GUI_COLOR_PATTERN_VOLUME_HALF,
GUI_COLOR_PATTERN_VOLUME_MIN,
GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_PITCH,
GUI_COLOR_PATTERN_EFFECT_VOLUME,
GUI_COLOR_PATTERN_EFFECT_PANNING,
GUI_COLOR_PATTERN_EFFECT_SONG,
GUI_COLOR_PATTERN_EFFECT_TIME,
GUI_COLOR_PATTERN_EFFECT_SPEED,
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY,
GUI_COLOR_PATTERN_EFFECT_MISC,
GUI_COLOR_MAX
};
2021-12-11 07:10:09 +00:00
class FurnaceGUI {
DivEngine* e;
2021-12-11 08:11:40 +00:00
SDL_Window* sdlWin;
SDL_Renderer* sdlRend;
bool quit;
int scrW, scrH;
double dpiScale;
ImFont* mainFont;
ImFont* patFont;
2021-12-13 22:09:46 +00:00
ImVec4 uiColors[GUI_COLOR_MAX];
ImVec4 volColors[128];
2021-12-11 08:11:40 +00:00
2021-12-13 22:09:46 +00:00
int curIns, curOctave, oldRow;
2021-12-11 21:44:02 +00:00
2021-12-12 23:19:43 +00:00
int arpMacroScroll;
ImVec2 macroDragStart;
ImVec2 macroDragAreaSize;
int* macroDragTarget;
int macroDragLen;
int macroDragMin, macroDragMax;
bool macroDragActive;
ImVec2 macroLoopDragStart;
ImVec2 macroLoopDragAreaSize;
signed char* macroLoopDragTarget;
int macroLoopDragLen;
bool macroLoopDragActive;
2021-12-13 22:09:46 +00:00
float nextScroll;
2021-12-11 07:10:09 +00:00
public:
2021-12-13 07:03:36 +00:00
const char* noteName(short note, short octave);
2021-12-11 07:10:09 +00:00
void bindEngine(DivEngine* eng);
2021-12-13 22:09:46 +00:00
void updateScroll(int amount);
2021-12-11 08:11:40 +00:00
bool loop();
bool init();
2021-12-11 07:10:09 +00:00
FurnaceGUI();
2021-12-11 21:44:02 +00:00
};