summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-29 13:36:35 +0900
committerAdam Malczewski <[email protected]>2026-06-29 13:36:35 +0900
commit5a54b683fa077b8a557ce3bd5745f3007579db07 (patch)
tree71c9af9c22e478c6824862724966dd3a4afff8e1 /src
parent7f0444bc308fef0b78b2fd4fa8aa269da619324c (diff)
downloadstudy-player-dev.tar.gz
study-player-dev.zip
docs: P8 vocabulary governance + WSL run tribal knowledgedev
- AGENTS.md §4 'Naming & vocabulary': wire to GLOSSARY.md (P8 — never coin a synonym for an existing concept; propose new terms, don't coin silently). - AGENTS.md §8 'Tribal knowledge (notes/)': establish notes/<topic>.md as the non-inferable-knowledge store with the P6 test. - Rename study_segment_seek_target -> study_portion_seek_target ('segment' was a glossary-proscribed synonym for 'speaking portion'); fix 'Section nav' / 'jump to start' comments to canonical terms (portion nav / seek). - notes/wsl-arch-razer-run.md: how to run the desktop app under WSLg on the Arch/Razer dev machine (the LIBGL_ALWAYS_INDIRECT segfault trap, required env vars, GPU driver options).
Diffstat (limited to 'src')
-rw-r--r--src/layout_editor.c6
-rw-r--r--src/study.c8
-rw-r--r--src/study.h2
-rw-r--r--src/ui.c16
4 files changed, 16 insertions, 16 deletions
diff --git a/src/layout_editor.c b/src/layout_editor.c
index 0a40c59..bffc9c9 100644
--- a/src/layout_editor.c
+++ b/src/layout_editor.c
@@ -54,7 +54,7 @@ void layout_editor_draw(const char *exePath, UILayout *layout)
Later checks overwrite earlier ones if they overlap —
priority goes to elements drawn last / on top. */
- /* 6: Section nav buttons (two circles) */
+ /* 6: Portion nav buttons (two circles) */
{
float secPrevX = layout->secNavX - 65.0f;
float secNextX = layout->secNavX + 65.0f;
@@ -167,7 +167,7 @@ void layout_editor_draw(const char *exePath, UILayout *layout)
layout->smartPlayX = mouse.x - dragOffsetX;
layout->smartPlayY = mouse.y - dragOffsetY;
break;
- case 6: /* Section nav */
+ case 6: /* Portion nav */
layout->secNavX = mouse.x - dragOffsetX;
layout->secNavY = mouse.y - dragOffsetY;
break;
@@ -253,7 +253,7 @@ void layout_editor_draw(const char *exePath, UILayout *layout)
draw_label("Play", r, f, borderColor);
}
- /* --- 6: Section nav buttons --- */
+ /* --- 6: Portion nav buttons --- */
{
Color f = (dragIndex == 6) ? highlightColor : fillColor;
float secBtnRadius = 35.0f;
diff --git a/src/study.c b/src/study.c
index 7f402bd..f88ab18 100644
--- a/src/study.c
+++ b/src/study.c
@@ -130,7 +130,7 @@ int study_total_speaking_portions(const PlayerState *state)
return state->silenceCount + 1;
}
-float study_segment_seek_target(const PlayerState *state, int portion)
+float study_portion_seek_target(const PlayerState *state, int portion)
{
float pos = study_speaking_portion_start(state, portion);
float target = pos * state->duration + (2.0f / 60.0f);
@@ -171,8 +171,8 @@ void study_auto_pause_check(PlayerState *state, bool smartPlayHeld, bool spaceHe
if (nowInSilence && !state->wasInSilence)
{
- /* Entering silence: jump to start of next speaking portion */
- float target = study_segment_seek_target(state, silIdx + 1);
+ /* Entering silence: seek to start of next speaking portion */
+ float target = study_portion_seek_target(state, silIdx + 1);
PauseMusicStream(state->music);
SeekMusicStream(state->music, target);
state->currentTime = target;
@@ -183,7 +183,7 @@ void study_auto_pause_check(PlayerState *state, bool smartPlayHeld, bool spaceHe
{
/* Exiting silence: land at start of current speaking portion */
int portion = study_current_speaking_portion(state, pos);
- float target = study_segment_seek_target(state, portion);
+ float target = study_portion_seek_target(state, portion);
PauseMusicStream(state->music);
SeekMusicStream(state->music, target);
state->currentTime = target;
diff --git a/src/study.h b/src/study.h
index 0b7b030..22ae8f8 100644
--- a/src/study.h
+++ b/src/study.h
@@ -31,7 +31,7 @@ int study_total_speaking_portions(const PlayerState *state);
/* Seek target (seconds) for jumping to a speaking portion.
* Lands 2 render-frames (~33ms) into the padding zone. */
-float study_segment_seek_target(const PlayerState *state, int portion);
+float study_portion_seek_target(const PlayerState *state, int portion);
/* Is pos inside the padding zone of the given speaking portion?
* Padding zone = [speaking_start, speaking_start + 0.25s/duration]. */
diff --git a/src/ui.c b/src/ui.c
index 600c368..5ac0de8 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -136,7 +136,7 @@ void ui_handle_input(UIState *ui, PlayerState *state, const UILayout *layout)
player_play(state);
}
- /* --- Section nav buttons --- */
+ /* --- Portion nav buttons --- */
{
float progress = (state->duration > 0.0f) ? state->currentTime / state->duration : 0.0f;
int portion = study_current_speaking_portion(state, progress) + 1;
@@ -154,7 +154,7 @@ void ui_handle_input(UIState *ui, PlayerState *state, const UILayout *layout)
bool inSil = (study_find_silence_at(state, pos) >= 0);
bool inPad = study_in_padding_zone(state, pos, p);
if ((inSil || inPad) && p > 0) p--;
- float target = study_segment_seek_target(state, p);
+ float target = study_portion_seek_target(state, p);
player_seek(state, target);
state->wasInSilence = false;
state->lastSilenceIdx = -1;
@@ -164,7 +164,7 @@ void ui_handle_input(UIState *ui, PlayerState *state, const UILayout *layout)
float pos = state->currentTime / state->duration;
int p = study_current_speaking_portion(state, pos);
if (p < total - 1) p++;
- float target = study_segment_seek_target(state, p);
+ float target = study_portion_seek_target(state, p);
player_seek(state, target);
state->wasInSilence = false;
state->lastSilenceIdx = -1;
@@ -207,7 +207,7 @@ void ui_handle_input(UIState *ui, PlayerState *state, const UILayout *layout)
{
float pos = state->currentTime / state->duration;
int portion = study_current_speaking_portion(state, pos);
- float target = study_segment_seek_target(state, portion);
+ float target = study_portion_seek_target(state, portion);
player_seek(state, target);
player_play(state);
}
@@ -223,7 +223,7 @@ void ui_handle_input(UIState *ui, PlayerState *state, const UILayout *layout)
bool inPad = study_in_padding_zone(state, pos, portion);
if ((inSil || inPad) && portion > 0)
portion--;
- float target = study_segment_seek_target(state, portion);
+ float target = study_portion_seek_target(state, portion);
player_seek(state, target);
state->wasInSilence = false;
state->lastSilenceIdx = -1;
@@ -235,7 +235,7 @@ void ui_handle_input(UIState *ui, PlayerState *state, const UILayout *layout)
int portion = study_current_speaking_portion(state, pos);
int total = study_total_speaking_portions(state);
if (portion < total - 1) portion++;
- float target = study_segment_seek_target(state, portion);
+ float target = study_portion_seek_target(state, portion);
player_seek(state, target);
state->wasInSilence = false;
state->lastSilenceIdx = -1;
@@ -378,7 +378,7 @@ void ui_render_player(const UIState *ui, const PlayerState *state,
else
draw_play_icon(ppx, layout->btnY, 50, ui->textColor);
- /* Speaking portion counter with prev/next section buttons */
+ /* Speaking portion counter with prev/next portion buttons */
{
int portion = study_current_speaking_portion(state, progress) + 1;
int total = study_total_speaking_portions(state);
@@ -394,7 +394,7 @@ void ui_render_player(const UIState *ui, const PlayerState *state,
(Vector2){ portionX, portionY },
ui->szSmall, portionSpacing, ui->mutedColor);
- /* Section nav buttons */
+ /* Portion nav buttons */
float secPrevX = layout->secNavX - 65.0f;
float secNextX = layout->secNavX + 65.0f;
float secBtnY_draw = layout->secNavY;