looper/backends/ui/imgui/main.h

60 lines
1.5 KiB
C
Raw Normal View History

2023-08-25 14:38:06 -07:00
#pragma once
#include "RendererBackend.h"
#include "config.h"
#include "file_browser.h"
#include "playback.h"
#include "theme.h"
#include <libintl.h>
#include <iostream>
#include <fstream>
#include <json/json.h>
#include <stdio.h>
#include <numbers>
#include <cmath>
#include <cstdlib>
#include <string>
#include <SDL.h>
#include <SDL_image.h>
#include <filesystem>
#include <SDL_video.h>
#if defined(IMGUI_IMPL_OPENGL_ES2)
#include <SDL_opengles2.h>
#else
#include <SDL_opengl.h>
#endif
#include "license.h"
#include "base85.h"
#include "IconFontCppHeaders/IconsForkAwesome.h"
#include "imgui/imgui.h"
#include "imgui/misc/cpp/imgui_stdlib.h"
2023-08-25 14:38:06 -07:00
#include "translation.h"
#ifdef __EMSCRIPTEN__
#include "../libs/emscripten/emscripten_mainloop_stub.h"
#endif
#include "../../../backend.hpp"
2023-08-25 14:38:06 -07:00
using namespace std::filesystem;
using namespace std::numbers;
using std::string;
class MainLoop : public RendererBackend {
bool show_demo_window = false;
FileBrowser fileDialog = FileBrowser(false);
std::string userdir;
float position = 0.0;
float length = 0.0;
2023-08-25 14:38:06 -07:00
bool prefs_window = false;
bool theme_editor = false;
bool about_window = false;
bool stopped = true;
std::vector<UIBackend*> backends;
UIBackend *cur_backend;
2023-08-25 14:38:06 -07:00
public:
Playback *playback;
vector<std::string> args;
void LoadFile(std::string file);
2023-08-25 14:38:06 -07:00
void Init() override;
void GuiFunction() override;
void Deinit() override;
void Drop(std::string file) override;
2023-08-25 14:38:06 -07:00
MainLoop();
};