Skip to content

Commit

Permalink
#184 Make discrete processing a general mode property instead of just…
Browse files Browse the repository at this point in the history
… an absolute mode

because it doesn't just affect absolute processing but target value interpretation
in general (percentages vs. discrete values)
  • Loading branch information
helgoboss committed May 23, 2021
1 parent 68d62c3 commit 8a74240
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main/lib/helgoboss-learn
4 changes: 3 additions & 1 deletion main/src/application/mapping_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ impl MappingModel {
pub fn base_mode_applicability_check_input(&self) -> ModeApplicabilityCheckInput {
ModeApplicabilityCheckInput {
target_is_virtual: self.target_model.is_virtual(),
// TODO-high discrete
target_supports_discrete_values: false,
is_feedback: false,
make_absolute: self.mode_model.make_absolute.get(),
// Any is okay, will be overwritten.
Expand Down Expand Up @@ -325,7 +327,7 @@ impl<'a> MappingModelWithContext<'a> {
Normal(MomentaryButton) | Normal(ToggleButton) => {
let target = self.target_with_context().resolve_first()?;
match mode_type {
AbsoluteMode::Normal | AbsoluteMode::Discrete | AbsoluteMode::ToggleButtons => {
AbsoluteMode::Normal | AbsoluteMode::ToggleButtons => {
!target.control_type().is_relative()
}
AbsoluteMode::IncrementalButtons => {
Expand Down
2 changes: 2 additions & 0 deletions main/src/application/mode_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ impl ModeModel {
discrete_current_absolute_value: 0,
previous_absolute_control_value: None,
discrete_previous_absolute_control_value: None,
// TODO-high discrete
use_discrete_processing: false,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions main/src/infrastructure/ui/mapping_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,8 @@ impl<'a> ImmutableMappingPanel<'a> {
) -> (Option<&str>, Option<&str>) {
let base_input = ModeApplicabilityCheckInput {
target_is_virtual: self.mapping.target_model.is_virtual(),
// TODO-high discrete
target_supports_discrete_values: false,
is_feedback: false,
make_absolute: self.mapping.mode_model.make_absolute.get(),
source_character,
Expand Down

0 comments on commit 8a74240

Please sign in to comment.