-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complain when attempting to add Playtime matrix to Helgobox instance …
…if REAPER version too old
- Loading branch information
Showing
2 changed files
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,7 +268,9 @@ impl Instance { | |
#[cfg(feature = "playtime")] | ||
mod playtime_impl { | ||
use crate::domain::instance::NO_CLIP_MATRIX_SET; | ||
use crate::domain::{Instance, QualifiedClipMatrixEvent}; | ||
use crate::domain::{ | ||
err_if_reaper_version_too_low_for_playtime, Instance, QualifiedClipMatrixEvent, | ||
}; | ||
use anyhow::Context; | ||
use base::NamedChannelSender; | ||
use reaper_high::OrCurrentProject; | ||
|
@@ -346,6 +348,7 @@ mod playtime_impl { | |
if self.playtime.clip_matrix.is_some() { | ||
return Ok(false); | ||
} | ||
err_if_reaper_version_too_low_for_playtime()?; | ||
let track = self.processor_context.track() | ||
.context("Sorry, Playtime is not intended to be used from the monitoring FX chain! If you have a really good use case for that, please write to [email protected] and we will see what we can do.")?; | ||
let matrix = | ||
|
@@ -475,3 +478,12 @@ pub enum PotStateChangedEvent { | |
|
||
#[cfg(feature = "playtime")] | ||
const NO_CLIP_MATRIX_SET: &str = "no Playtime matrix set for this instance"; | ||
|
||
#[cfg(feature = "playtime")] | ||
pub fn err_if_reaper_version_too_low_for_playtime() -> anyhow::Result<()> { | ||
const MIN_REAPER_VERSION: &str = "7"; | ||
if reaper_high::Reaper::get().version().revision() < MIN_REAPER_VERSION { | ||
anyhow::bail!("Please update REAPER to version {MIN_REAPER_VERSION} to access Playtime!"); | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters