summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-27 06:38:26 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-27 06:38:26 +0200
commit60d4505e1972560b4c734004e4388cbad1b6ba0b (patch)
tree0f0295fe6ae989d7e799d91bd9ead15f8a88dac4
parentf785ce3106176d56865372de566314952954fe7f (diff)
downloadsaw-60d4505e1972560b4c734004e4388cbad1b6ba0b.zip
Using multiple piano rolls
-rw-r--r--TODO4
-rw-r--r--source/saw/main.c13
2 files changed, 14 insertions, 3 deletions
diff --git a/TODO b/TODO
index 29c4301..d5f1e74 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,5 @@
To-Do list
-- UI: Text rendering
- UI: Volume control
- UI: Instrument settings
- Sound: Buffering
@@ -20,6 +19,8 @@ To-Do list
- Improve X11 startup time
- Custom OpenGL loader
- Use OpenGL ES on all platforms
+- UI: Panning and scaling
+- Sound: Track looping
Done
@@ -28,3 +29,4 @@ Done
- Build: Faster recompilation
- UI: Piano roll
- UI: Playback control
+- UI: Text rendering
diff --git a/source/saw/main.c b/source/saw/main.c
index 723fa92..ad00874 100644
--- a/source/saw/main.c
+++ b/source/saw/main.c
@@ -208,6 +208,15 @@ static void saw_ui_roll(saw_roll_t *roll, i64 x0, i64 y0, i64 width,
nvgFillColor(saw_nvg, nvgRGBA(100, 80, 70, 160));
nvgFill(saw_nvg);
+ nvgBeginPath(saw_nvg);
+ nvgFontSize(saw_nvg, text_height);
+ nvgFontFaceId(saw_nvg, saw_font);
+ nvgFillColor(saw_nvg, nvgRGBA(255, 255, 255, 255));
+ nvgText(saw_nvg, x0 + roll_border,
+ frame_height - y0 - height + text_height - roll_border * 2,
+ title.values, title.values + title.size);
+ nvgFill(saw_nvg);
+
// Piano roll
//
@@ -483,9 +492,9 @@ static void saw_frame(void) {
nvgBeginFrame(saw_nvg, frame_width, frame_height, sapp_dpi_scale());
saw_ui_roll(saw_rolls, 0, 10, frame_width, frame_height / 2 - 20,
- SZ(""));
+ SZ("Track 1"));
saw_ui_roll(saw_rolls + 1, 0, frame_height / 2 + 10, frame_width,
- frame_height / 2 - 20, SZ(""));
+ frame_height / 2 - 20, SZ("Track 2"));
nvgEndFrame(saw_nvg);