looper/backends/ui/imgui/main.h
Zachary Hall b886e6a585
Some checks failed
Build / build-gentoo (push) Failing after 2m4s
Build / download-system-deps (push) Successful in 4m1s
Build / get-source-code (push) Successful in 12m47s
Build / build-appimage (push) Successful in 4m11s
Build / build-android (push) Failing after 3m1s
Build / build-windows (push) Failing after 7m25s
Add Fluidsynth backend and stop using SDL Mixer X for that.
2024-12-11 12:56:17 -08:00

72 lines
1.9 KiB
C++

#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 <cmath>
#include <cstdlib>
#include <string>
#include <map>
#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.hpp>
#include "base85.h"
#include "IconFontCppHeaders/IconsForkAwesome.h"
#include "imgui/imgui.h"
#include "imgui/misc/cpp/imgui_stdlib.h"
#include <translation.hpp>
#ifdef __EMSCRIPTEN__
#include "emscripten_mainloop_stub.h"
#endif
#include "../../../backend.hpp"
#include "ui_backend.hpp"
using namespace std::filesystem;
using std::string;
#define IMGUI_FRONTEND
class MainLoop : public RendererBackend {
bool show_demo_window = false;
FileBrowser fileDialog = FileBrowser(false);
std::string userdir;
float position = 0.0;
float length = 0.0;
bool prefs_window = false;
bool theme_editor = false;
bool about_window = false;
bool debug_mode = false;
bool property_editor = false;
bool restart_needed = false;
bool stopped = true;
std::vector<UIBackend*> backends;
UIBackend *cur_backend;
friend class ImGuiUIBackend;
std::atomic_bool exit_flag;
std::map<std::string, bool> boolean_properties;
std::map<std::string, double> double_properties;
std::map<std::string, int> int_properties;
std::map<std::string, std::string> string_properties;
std::vector<Property> properties;
std::vector<PlaybackStream> streams;
public:
Playback *playback;
vector<std::string> args;
void FileLoaded();
void LoadFile(std::string file);
void Init() override;
void GuiFunction() override;
void Deinit() override;
void Drop(std::string file) override;
MainLoop();
};