/
Main_Window.h
116 lines (95 loc) · 2.45 KB
/
Main_Window.h
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#pragma once
#include "SDL.h"
#include "globals.h"
#include <math.h>
#include "sdl_dblclick.h"
#include "Colors.h"
#include "platform.h"
#include "Render.h"
#include "gme/player/Music_Player.h"
#include "Experience.h"
#include "gui/Context_Menu.h"
#include "gui/Slider/Slider.h"
#include "gui/Tab.h"
#include "globals.h"
#include "shared/gui/Text_Edit_Rect.h"
#include "Samples.h"
#include "Instruments.h"
#include "Pattern.h"
#include "PatLenWidget.h"
#include "BpmSpdAddWidget.h"
#include "InstrumentEditor.h"
#include "SampleEditor.h"
#include "SongSettings.h"
struct Tracker;
struct Main_Window : public Experience
{
char tmpbuf[100];
Text song_title_label;
Text_Edit_Rect song_title;
struct Gain
{
~Gain() { if (slider) delete slider; }
Slider<double> *slider=NULL;
static int change(void *dblnewgain);
} gain;
enum modes
{
MODE_NAV=0,
MODE_EDIT_MOUSE_HEXDUMP,
MODE_EDIT_APU_PORT,
MODE_EDIT_TIME
};
Main_Window(int &argc, char **argv, Tracker *tracker);
void run();
void check_quit(SDL_Event &ev);
int receive_event(SDL_Event &ev);
void draw();
void one_time_draw();
void draw_memory_outline();
void draw_pattern_table_outline();
void draw_pattern();
void draw_voices_pitchs();
void draw_voices_volumes();
void draw_main_volume();
void draw_echo_volume();
// external deps
// How to package this as an entity?
uint16_t dir;
void draw_track_tag();
int mode=MODE_NAV;
bool is_onetime_draw_necessary=true;
int tmp=0, i=0;
SDL_Rect tmprect;
Uint32 time_last=0, time_cur=0;
bool is_first_run=true;
/* Handle to the tracker to access core components (instrument and
* pattern data */
Tracker *tracker;
Sample_Panel samplepanel;
Instrument_Panel instrpanel;
PatSeqPanel patseqpanel;
PatLenWidget plwidget;
PatternEditorPanel pateditpanel;
BpmSpdAddWidget bsawidget;
////////////// AUX PANELS //////////////////////////
enum AuxPanels {
INSTREDITOR = 0,
SAMPLEDITOR,
SONGSETTINGS,
};
uint8_t active_aux_panel = 0;
// INSTRUMENT EDITOR STUFF
InstrumentEditor instreditor;
Button instreditor_btn;
static int toggle_instreditor(void *m);
// SAMPLE EDITOR STUFF
SampleEditor sample_editor;
Button sample_editor_btn;
static int toggle_sample_editor(void *m);
// Song Settings STUFF
SongSettingsPanel songsettings_panel;
Button songsettings_btn;
static int toggle_songsettings(void *m);
///////////// END AUX PANELS /////////////////////
};