Skip to content

Commit

Permalink
#160 Fix broken integration test (since 28e8238)
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Mar 9, 2021
1 parent dba888e commit 2eec7ad
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions main/src/domain/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ impl MainMapping {
RealTimeMapping {
core: self.core.clone(),
is_active: self.is_active(),
target_type: self.unresolved_target.as_ref().map(|t| match t {
UnresolvedCompoundMappingTarget::Reaper(_) => UnresolvedTargetType::Reaper,
UnresolvedCompoundMappingTarget::Virtual(_) => UnresolvedTargetType::Virtual,
}),
lifecycle_midi_data: self
.extension
.lifecycle_midi_data
Expand Down Expand Up @@ -403,9 +407,16 @@ impl MainMapping {
pub struct RealTimeMapping {
core: MappingCore,
is_active: bool,
target_type: Option<UnresolvedTargetType>,
lifecycle_midi_data: LifecycleMidiData,
}

#[derive(Debug)]
pub enum UnresolvedTargetType {
Reaper,
Virtual,
}

#[derive(Copy, Clone, Debug)]
pub enum LifecyclePhase {
Activation,
Expand Down Expand Up @@ -483,11 +494,11 @@ impl RealTimeMapping {
}

pub fn has_virtual_target(&self) -> bool {
matches!(&self.core.target, Some(CompoundMappingTarget::Virtual(_)))
matches!(self.target_type, Some(UnresolvedTargetType::Virtual))
}

pub fn has_reaper_target(&self) -> bool {
matches!(&self.core.target, Some(CompoundMappingTarget::Reaper(_)))
matches!(self.target_type, Some(UnresolvedTargetType::Reaper))
}

pub fn consumes(&self, msg: RawShortMessage) -> bool {
Expand Down

0 comments on commit 2eec7ad

Please sign in to comment.