Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature/Improvement] Store list of intervals in ephemeral database #19

Closed
a-mabe opened this issue Oct 25, 2024 · 0 comments · Fixed by #23
Closed

[Feature/Improvement] Store list of intervals in ephemeral database #19

a-mabe opened this issue Oct 25, 2024 · 0 comments · Fixed by #23
Assignees
Labels
enhancement New feature or request

Comments

@a-mabe
Copy link
Owner

a-mabe commented Oct 25, 2024

Purpose: The background timer currently has preset logic for the intervals based on the current interval "type" (work, rest, cooldown, etc.). For example, the rest interval always comes after the work interval, and warmup can only appear once at the start of the workout. Instead of having this preset logic based on the timer configuration, allow for a set of intervals that the timer goes through. The only order that matters is the index of the interval, interval type is not considered.

More details:

The timer should store an ephemeral database of the list of intervals. An interval should look something like:

IntervalType(
      id: "0000-1111-2222",
      workoutId: "1",
      time: 10,
      name: "Get ready",
      color: 0,
      intervalIndex: 0,
      sound: "",
      halfwaySound: "",
      countdownSound: "countdown-beep",
      endSound: "",
    ),

Where:

  • id is the UUID of the interval.
  • workoutId is the UUID of which workout this interval is associated with. Each interval in the same workout will have the same workoutId.
  • time is the amount of seconds in the interval.
  • name is the title of the interval, e.g. "work" or "rest".
  • color color that should be used in the UI when the interval is active.
  • intervalIndex order in which this interval should be active, 0 being the first interval in the workout.
  • sound sound that plays when the interval begins. Overrides endSound if there was an interval before this one.
  • halfwaySound sound that plays at the halfway mark (time/2) of the interval.
  • countdownSound sound that plays at the 3, 2 ,1 seconds marks to signify the interval is ending.
  • endSound sound that plays at the end of the interval. Does not play if the next interval has sound set as there is not enough time between intervals to play the end sound for one and the begin sound for the next. Thus, sound will take priority.

The background timer will read from the database and simply iterate through these intervals.

Acceptance criteria:

  • List of intervals is saved to the database.
  • The background timer reads the list of intervals from the database and iterates over the list to play intervals.
  • There is no longer a predetermined order the intervals are active based on their name. Instead, order in the list is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant