Files
breeze/apps/practice/practice.zi
T
waozi f6defa6b84 Add the 7-Minute Workout and tabs for every practice on Practice
The 7-Minute Workout runs the classic circuit: ten seconds to get ready,
then jumping jacks, wall sit, push-ups, crunches, step-ups, squats,
triceps dips, plank, high knees, lunges, push-up and rotation and side
plank, thirty seconds each with ten-second rests. The flat Jade woman of
Tai Chi shows each exercise live, drawn by the same flat painter from a
skeleton the workout poses and solves, with a bench and a wall where an
exercise needs them. The screen shows the exercise, what comes next, a
form tip, a countdown ring, twelve progress bars and Pause; a bell starts
and ends each exercise and English narration speaks each change. Names,
tips and spoken lines are translated in every locale; the banners were
made in Google Flow.

Practice now opens on tabs for Meditation, Yoga, Martial arts and Workout,
each listing every practice of its kind. A practice that is not ready
offers Install with its size, Unlock with its price or Cancel on its own
card, and a downloaded one can be uninstalled there after one question.
Manage practices is gone. Wim Hof, Meditation, Breathing Patterns, Astral
Projection and the workout ship with Practices and are always ready; Sun
Salutation and Tai Chi download. Every practice's banners ship with
Practices so its card looks right before a download.

The workout is practice 6 and screen 28, so the host interface is 23 and
Practices needs it. Tests cover the clock, every pose's bone lengths and
floor contact, the side switch, all twelve languages, the tabs on a narrow
phone in English and Russian, and the downloads.
2026-10-20 01:04:57 -03:00

73 lines
3.0 KiB
Ziran

// The live practice clocks run in this bundle; the unified host performs
// audio, notification, session-save and mobile lifecycle effects.
#import, file "../../src/cells/practice_types.zi";
#import, file "../../src/core/breath_timing.zi";
#import, file "../../src/practices/meditation/meditation_timing.zi";
#import, file "../../src/practices/patterns/patterns_clock.zi";
#import, file "../../src/cells/module_types.zi";
#import "apps/node_types"
#import, file "../../src/core/types.zi";
#import, file "../../src/practices/sun_salutation/sun_salutation_rules.zi";
host_api :: #system_library "host_api";
ReadPracticeHost :: () -> PracticeMessage #foreign host_api;
WritePracticeHost :: (message: PracticeMessage) #foreign host_api;
SunSalutationStoredFrame :: (timeline_frame: s32) -> s32 #foreign host_api;
PracticeApply :: (message: PracticeMessage) -> PracticeMessage {
message.succeeded = true
if message.action == PRACTICE_ROUTE {
message.succeeded = message.screen == ScreenStart || message.screen == ScreenSession ||
message.screen == ScreenMeditation || message.screen == ScreenSunSalutation ||
message.screen == ScreenPatterns || message.screen == ScreenTaiChi || message.screen == ScreenAstralProjection ||
message.screen == ScreenWorkout ||
message.screen == ScreenResults || message.screen == ScreenPracticeConfig ||
message.screen == ScreenManual
return message
}
if message.paused {
return message
}
if message.action == PRACTICE_BREATH_STEP {
message.breathing = BreathSessionStep(message.breathing)
message.completed = message.breathing.completed != 0
} else if message.action == PRACTICE_MEDITATION_STEP {
next := AdvanceMeditationTime(message.remaining_seconds,
message.remainder_ms, message.elapsed_ms)
message.remaining_seconds = next.remaining_seconds
message.remainder_ms = next.remainder_ms
message.elapsed_seconds = next.elapsed_seconds
message.completed = next.completed
} else if message.action == PRACTICE_SALUTATION_STEP {
next := SalutationAdvance(message.salutation, message.elapsed)
message.salutation = next.state
message.completed = next.completed != 0
} else if message.action == PRACTICE_PATTERNS_STEP {
next := PatternsAdvance(message.patterns)
message.patterns = next.state
message.cue = next.cue
message.completed = next.completed
} else {
message.succeeded = false
}
return message
}
#program_export "PracticeMain"
Main :: () -> s32 {
message := ReadPracticeHost()
if message.abi != MODULE_ABI {
return -1
}
if message.action == MODULE_IDENTIFY {
// The smaller frame inventory needs the wrapper's frame mapping.
// Older wrappers reject this required capability before replacing
// their working package.
if SunSalutationStoredFrame(0) != 0 {
return -1
}
return MODULE_PRACTICE
}
WritePracticeHost(PracticeApply(message))
return 0
}