Skip to content

Commit

Permalink
Rename play/pause to pause/resume
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Horacek <[email protected]>
  • Loading branch information
phoracek committed Nov 1, 2023
1 parent d81b48e commit 24b5892
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ backwards compatibility.

* LED can be configured to visualize the current position within the loop.
* Allow reset of the loop position through a control input.
* Play/pause the delay line using a control input.
* Pause/resume the delay line using a control input.
* Allow configuration of the ratio between the tap interval and delay length.

## 1.2.0
Expand Down
6 changes: 3 additions & 3 deletions control/src/cache/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Configuration {
pub rewind_speed: [(usize, usize); 4],
pub default_display_page: DisplayPage,
pub position_reset_mapping: PositionResetMapping,
pub play_pause_mapping: PlayPauseMapping,
pub pause_resume_mapping: PauseResumeMapping,
pub tap_interval_denominator: usize,
}

Expand All @@ -23,7 +23,7 @@ pub enum DisplayPage {

pub type PositionResetMapping = Option<usize>;

pub type PlayPauseMapping = Option<usize>;
pub type PauseResumeMapping = Option<usize>;

impl Configuration {
pub(crate) fn rewind_speed(&self) -> [(f32, f32); 4] {
Expand All @@ -38,7 +38,7 @@ impl Default for Configuration {
// TODO: Change this to position. Make sure there is fallback set from the get go
default_display_page: DisplayPage::Heads,
position_reset_mapping: None,
play_pause_mapping: None,
pause_resume_mapping: None,
tap_interval_denominator: 1,
}
}
Expand Down
16 changes: 8 additions & 8 deletions control/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl Store {
if let Some(index) = self.cache.configuration.position_reset_mapping {
let _: Result<_, _> = controls.insert(index);
}
if let Some(index) = self.cache.configuration.play_pause_mapping {
if let Some(index) = self.cache.configuration.pause_resume_mapping {
let _: Result<_, _> = controls.insert(index);
}
}
Expand Down Expand Up @@ -238,7 +238,7 @@ impl Store {
continue;
}
}
if let Some(index) = self.cache.configuration.play_pause_mapping {
if let Some(index) = self.cache.configuration.pause_resume_mapping {
if index == *i {
continue;
}
Expand Down Expand Up @@ -437,7 +437,7 @@ impl Store {
return (draft, Some(screen));
}

if let Some(screen) = update_play_pause_mapping(&mut draft, &mut self.input.head[0].pan) {
if let Some(screen) = update_pause_resume_mapping(&mut draft, &mut self.input.head[0].pan) {
return (draft, Some(screen));
}

Expand Down Expand Up @@ -507,8 +507,8 @@ impl Store {
self.cache.requests.reset_position = false;
}

if let Some(play_pause_control_index) = self.cache.configuration.play_pause_mapping {
let control = &self.input.control[play_pause_control_index];
if let Some(pause_resume_control_index) = self.cache.configuration.pause_resume_mapping {
let control = &self.input.control[pause_resume_control_index];
if control.triggered() {
self.cache.attributes.paused_delay = !self.cache.attributes.paused_delay;
}
Expand Down Expand Up @@ -586,7 +586,7 @@ fn update_position_reset_mapping(
}
}

fn update_play_pause_mapping(
fn update_pause_resume_mapping(
draft: &mut Configuration,
pot: &mut Pot,
) -> Option<ConfigurationScreen> {
Expand All @@ -597,12 +597,12 @@ fn update_play_pause_mapping(

let pot_value = pot.value();
if pot_value < 1.0 / 5.0 {
draft.play_pause_mapping = None;
draft.pause_resume_mapping = None;
Some(ConfigurationScreen::ControlMapping(None))
} else {
let phase = (pot_value - 1.0 / 4.0) * (5.0 / 4.0);
let index = (phase * 3.999) as usize;
draft.play_pause_mapping = Some(index);
draft.pause_resume_mapping = Some(index);
Some(ConfigurationScreen::ControlMapping(Some(index)))
}
}
Expand Down
7 changes: 4 additions & 3 deletions manual/user/manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,11 @@ \subsection{Position reset trigger}
control input for this mapping. Turning it all the way to the left will disable
this mapping.

\subsection{Play/pause trigger}
\subsection{Pause/resume trigger}

Assign one of the control inputs for play/pause of the delay line. When paused,
delay retains its current position, and it won't record or play back any signal.
Assign one of the control inputs for pause/resume of the delay line. When
paused, delay retains its current position, and it won't record or play back any
signal.

While in the configuration menu, turn the first PAN knob to select a dedicated
control input for this mapping. Turning it all the way to the left will disable
Expand Down

0 comments on commit 24b5892

Please sign in to comment.