-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.hpp
More file actions
60 lines (49 loc) · 1.55 KB
/
Copy pathapp.hpp
File metadata and controls
60 lines (49 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
// Windows-specific definitions
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include <memory>
#include <string>
#include <chrono>
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include "audio_processor.hpp"
#include "config.hpp"
class EarPerkApp {
public:
EarPerkApp();
~EarPerkApp();
// Delete copy constructor and assignment operator
EarPerkApp(const EarPerkApp&) = delete;
EarPerkApp& operator=(const EarPerkApp&) = delete;
bool Initialize();
void Run();
private:
void RenderUI();
void SetupImGuiStyle();
void DrawVolumeMeters();
void DrawStatusIndicators();
void DrawAudioDeviceSelection();
void DrawConfigurationPanel();
void UpdateThresholds(float differential, float volume, float excessive);
void SaveConfiguration();
void DrawStatusText();
void SetWindowIcon();
GLFWwindow* window;
std::unique_ptr<AudioProcessor> audioProcessor;
Config config;
// Window settings
const int WINDOW_WIDTH = 800;
const int WINDOW_HEIGHT = 600;
const char* WINDOW_TITLE = "EarPerk OSC";
bool wasMinimized = false;
std::string statusMessage;
std::chrono::steady_clock::time_point statusMessageTime;
// Cache for device enumeration to prevent UI flickering
std::vector<AudioProcessor::AudioDevice> cachedDevices;
std::chrono::steady_clock::time_point lastDeviceRefresh;
static void WindowFocusCallback(GLFWwindow* window, int focused);
static void WindowIconifyCallback(GLFWwindow* window, int iconified);
};