summaryrefslogtreecommitdiff
path: root/source
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 /source
parentf785ce3106176d56865372de566314952954fe7f (diff)
downloadsaw-60d4505e1972560b4c734004e4388cbad1b6ba0b.zip
Using multiple piano rolls
Diffstat (limited to 'source')
-rw-r--r--source/saw/main.c13
1 files changed, 11 insertions, 2 deletions
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);