Skip to content

Commit

Permalink
Replace "clip matrix" with "Playtime matrix"
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Nov 28, 2024
1 parent b811dda commit 397663b
Show file tree
Hide file tree
Showing 26 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion api/src/persistence/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct Controller {
// The default_main_preset would act as fallback, as last line in the list of rules, which doesn't
// define any additional condition.
// Possible conditions:
// - Playtime clip matrix (if at least one instance is active that has a clip matrix)
// - Playtime matrix (if at least one instance is active that has a Playtime matrix)
// - Active pot unit?
// Possible effects:
// - Main preset (optional)
Expand Down
2 changes: 1 addition & 1 deletion api/src/persistence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<T> Envelope<T> {
#[derive(Serialize, Deserialize)]
#[serde(tag = "kind")]
pub enum ApiObject {
/// A Playtime clip matrix.
/// A Playtime matrix.
ClipMatrix(Envelope<Box<Option<playtime_api::persistence::FlexibleMatrix>>>),
/// Main compartment.
MainCompartment(Envelope<Box<Compartment>>),
Expand Down
4 changes: 2 additions & 2 deletions api/src/persistence/preset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub struct MainPresetMetaData {
///
/// Will be used for determining whether an auto unit should be created for a specific instance
/// or not. Example: If the required feature is "playtime" and a controller is configured with
/// this main preset but the instance doesn't contain a Playtime Clip Matrix, this instance will
/// this main preset but the instance doesn't contain a Playtime matrix, this instance will
/// not load the main preset.
#[serde(default)]
pub required_features: HashSet<String>,
Expand Down Expand Up @@ -243,6 +243,6 @@ impl VirtualControlSchemeId {

/// Known instance features.
pub mod instance_features {
/// Instance owns a Playtime Clip Matrix.
/// Instance owns a Playtime matrix.
pub const PLAYTIME: &str = "playtime";
}
2 changes: 1 addition & 1 deletion main/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ num_enum.workspace = true
crossbeam-channel.workspace = true
scopeguard.workspace = true
uuid = { version = "1.6.1", features = ["v4", "serde"] }
# New logging (for clip matrix)
# New logging (for Playtime matrix)
tracing.workspace = true
tracing-core.workspace = true
tracing-subscriber = { version = "0.3.7", features = ["env-filter"] }
Expand Down
14 changes: 7 additions & 7 deletions main/src/domain/backbone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ pub struct Backbone {
RefCell<NonCryptoHashMap<DeviceFeedbackOutput, NonCryptoHashSet<UnitId>>>,
superior_units: RefCell<NonCryptoHashSet<UnitId>>,
/// We hold pointers to all ReaLearn instances in order to let instance B
/// borrow a clip matrix which is owned by instance A. This is great because it allows us to
/// control the same clip matrix from different controllers.
/// borrow a Playtime matrix which is owned by instance A. This is great because it allows us to
/// control the same Playtime matrix from different controllers.
// TODO-high-playtime-refactoring Since the introduction of units, foreign matrices are not used in practice. Let's
// keep this for a while and remove.
instances: RefCell<NonCryptoHashMap<InstanceId, WeakInstance>>,
Expand Down Expand Up @@ -627,9 +627,9 @@ impl Backbone {
}

//
// /// Returns and - if necessary - installs an owned clip matrix.
// /// Returns and - if necessary - installs an owned Playtime matrix.
// ///
// /// If this instance already contains an owned clip matrix, returns it. If not, creates
// /// If this instance already contains an owned Playtime matrix, returns it. If not, creates
// /// and installs one, removing a possibly existing foreign matrix reference.
// pub fn get_or_insert_owned_clip_matrix(&mut self) -> &mut playtime_clip_engine::base::Matrix {
// self.create_and_install_owned_clip_matrix_if_necessary();
Expand All @@ -638,12 +638,12 @@ impl Backbone {

// TODO-high-playtime-refactoring Woah, ugly. This shouldn't be here anymore, the design involved and this dirt
// stayed. self is not used. Same with _mut.
/// Grants immutable access to the clip matrix defined for the given ReaLearn instance,
/// Grants immutable access to the Playtime matrix defined for the given ReaLearn instance,
/// if one is defined.
///
/// # Errors
///
/// Returns an error if the given instance doesn't have any clip matrix defined.
/// Returns an error if the given instance doesn't have any Playtime matrix defined.
#[cfg(feature = "playtime")]
pub fn with_clip_matrix<R>(
&self,
Expand All @@ -655,7 +655,7 @@ impl Backbone {
Ok(f(matrix))
}

/// Grants mutable access to the clip matrix defined for the given ReaLearn instance,
/// Grants mutable access to the Playtime matrix defined for the given ReaLearn instance,
/// if one is defined.
#[cfg(feature = "playtime")]
pub fn with_clip_matrix_mut<R>(
Expand Down
10 changes: 5 additions & 5 deletions main/src/domain/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ mod playtime_impl {
use reaper_high::OrCurrentProject;

impl Instance {
/// Polls the clip matrix of this ReaLearn instance, if existing and only if it's an owned one
/// Polls the Playtime matrix of this ReaLearn instance, if existing and only if it's an owned one
/// (not borrowed from another instance).
pub fn poll_owned_clip_matrix(
&mut self,
Expand Down Expand Up @@ -331,11 +331,11 @@ mod playtime_impl {
self.playtime.clip_matrix.as_mut()
}

/// Returns `Ok(true)` if it installed a clip matrix and `Ok(false)` if one was installed already.
/// Returns `Ok(true)` if it installed a Playtime matrix and `Ok(false)` if one was installed already.
///
/// # Errors
///
/// Returns an error if the clip matrix can't be created, e.g. when on the monitoring FX chain.
/// Returns an error if the Playtime matrix can't be created, e.g. when on the monitoring FX chain.
pub(crate) fn create_and_install_clip_matrix_if_necessary(
&mut self,
create_handler: impl FnOnce(
Expand Down Expand Up @@ -363,7 +363,7 @@ mod playtime_impl {

pub fn set_clip_matrix(&mut self, matrix: Option<playtime_clip_engine::base::Matrix>) {
if self.playtime.clip_matrix.is_some() {
tracing::debug!("Shutdown existing clip matrix");
tracing::debug!("Shutdown existing Playtime matrix");
self.update_real_time_clip_matrix(None);
}
self.playtime.clip_matrix = matrix;
Expand Down Expand Up @@ -474,4 +474,4 @@ pub enum PotStateChangedEvent {
}

#[cfg(feature = "playtime")]
const NO_CLIP_MATRIX_SET: &str = "no clip matrix set for this instance";
const NO_CLIP_MATRIX_SET: &str = "no Playtime matrix set for this instance";
4 changes: 2 additions & 2 deletions main/src/domain/main_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ impl<EH: DomainEventHandler> MainProcessor<EH> {
}
}

/// Processes the given clip matrix events if they are relevant to this unit.
/// Processes the given Playtime matrix events if they are relevant to this unit.
#[cfg(feature = "playtime")]
pub fn process_polled_clip_matrix_events(
&self,
Expand All @@ -796,7 +796,7 @@ impl<EH: DomainEventHandler> MainProcessor<EH> {
}
}

/// Processes the given clip matrix event if it's relevant to this instance.
/// Processes the given Playtime matrix event if it's relevant to this instance.
#[cfg(feature = "playtime")]
pub fn process_non_polled_clip_matrix_event(
&self,
Expand Down
6 changes: 3 additions & 3 deletions main/src/domain/realearn_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ impl<'a> RealTimeControlContext<'a> {
let instance = base::non_blocking_lock(&*instance, "real-time instance");
instance
.clip_matrix()
.ok_or("real-time clip matrix not yet initialized")?
.ok_or("real-time Playtime matrix not yet initialized")?
.upgrade()
.ok_or("real-time clip matrix doesn't exist anymore")
.ok_or("real-time Playtime matrix doesn't exist anymore")
}
}

Expand Down Expand Up @@ -709,7 +709,7 @@ pub enum ReaperTargetType {
// Clip row targets
PlaytimeRowAction = 52,

// Clip matrix
// Playtime matrix
PlaytimeMatrixAction = 51,
PlaytimeControlUnitScroll = 64,
PlaytimeBrowseCells = 65,
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/data/instance_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn convert_old_unit_to_instance_data(mut d: UnitData) -> InstanceData {
InstanceData {
// Migrate pot state from unit data
pot_state: d.pot_state.take().unwrap_or_default(),
// Migrate clip matrix state from unit data
// Migrate Playtime matrix state from unit data
clip_matrix: d.clip_matrix.take(),
main_unit: d,
additional_units: vec![],
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/data/preset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl FileBasedCompartmentPresetManager<MainPresetMetaData> {
.collect();
// Sort ascending by suitability
candidates.sort_unstable_by(|candidate_a, candidate_b| {
// Prefer Playtime preset if at least one instance has a Playtime clip matrix
// Prefer Playtime preset if at least one instance has a Playtime matrix
if conditions.at_least_one_instance_has_playtime_clip_matrix {
let candidate_a_requires_playtime =
candidate_a.preset.specific_meta_data.requires_playtime();
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/data/target_model_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ pub struct TargetModelData {
skip_serializing_if = "is_default"
)]
pub clip_slot: Option<PlaytimeSlotDescriptor>,
/// Clip matrix column.
/// Playtime matrix column.
///
/// For track targets, this contains the clip column from which we want to "borrow" the track.
///
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/plugin/api_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn find_first_playtime_helgobox_instance_in_project(
.or_current_project();
let instance_id = BackboneShell::get()
.find_first_playtime_helgobox_instance_in_project(project)
.context("Project doesn't contain Helgobox instance with a Playtime Clip Matrix")?;
.context("Project doesn't contain Helgobox instance with a Playtime matrix")?;
Ok(u32::from(instance_id) as _)
}

Expand Down
4 changes: 2 additions & 2 deletions main/src/infrastructure/plugin/backbone_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ impl BackboneShell {
RealearnControlSurfaceMainTaskSender(control_surface_main_task_sender);
#[cfg(feature = "playtime")]
let (clip_matrix_event_sender, clip_matrix_event_receiver) =
SenderToNormalThread::new_unbounded_channel("clip matrix events");
SenderToNormalThread::new_unbounded_channel("Playtime matrix events");
let (osc_feedback_task_sender, osc_feedback_task_receiver) =
SenderToNormalThread::new_unbounded_channel("osc feedback tasks");
let (additional_feedback_event_sender, additional_feedback_event_receiver) =
Expand Down Expand Up @@ -350,7 +350,7 @@ impl BackboneShell {
.into(),
Box::new(BackboneLicenseManagerEventHandler),
);
// This just initializes the clip engine, it doesn't add any clip matrix yet, so resource consumption is low.
// This just initializes the clip engine, it doesn't add any Playtime matrix yet, so resource consumption is low.
#[cfg(feature = "playtime")]
playtime_impl::init_clip_engine(&license_manager);
// This is the backbone representation in the domain layer, of course we need this now already.
Expand Down
10 changes: 5 additions & 5 deletions main/src/infrastructure/plugin/instance_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ impl InstanceShell {
settings: self.settings.get().borrow().clone(),
pot_state: instance.save_pot_unit(),
// TODO-medium Subject to improvement: If ReaLearn has been compiled without playtime feature, a
// potential clip matrix in the instance data will be silently discarded and disappear when saving
// potential Playtime matrix in the instance data will be silently discarded and disappear when saving
// next time. It would be better to memorize the data in the shell.
clip_matrix: {
#[cfg(feature = "playtime")]
Expand Down Expand Up @@ -513,7 +513,7 @@ impl InstanceShell {
instance
.borrow_mut()
.set_custom_data(instance_data.custom_data);
// Clip matrix
// Playtime matrix
#[cfg(feature = "playtime")]
{
if let Some(matrix_ref) = instance_data.clip_matrix {
Expand All @@ -525,7 +525,7 @@ impl InstanceShell {
.load(*m)?;
}
crate::infrastructure::data::ClipMatrixRefData::Foreign(_) => {
bail!("Referring to the clip matrix of another instance is not supported anymore!");
bail!("Referring to the Playtime matrix of another instance is not supported anymore!");
}
};
} else {
Expand Down Expand Up @@ -653,9 +653,9 @@ impl InstanceShell {
}
}

/// Returns and - if necessary - installs an owned clip matrix from/into the given instance.
/// Returns and - if necessary - installs an owned Playtime matrix from/into the given instance.
///
/// If this instance already contains an owned clip matrix, returns it. If not, creates
/// If this instance already contains an owned Playtime matrix, returns it. If not, creates
/// and installs one, removing a possibly existing foreign matrix reference.
#[cfg(feature = "playtime")]
pub fn get_or_insert_owned_clip_matrix(
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/proto/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ pub mod occasional_matrix_update {
/// should probably be refetched by the client by resubscribing to occasional matrix updates.
#[prost(string, tag = "7")]
CompletePersistentData(::prost::alloc::string::String),
/// Clip matrix history state
/// Playtime matrix history state
#[prost(message, tag = "8")]
HistoryState(super::HistoryState),
/// Click on/off
Expand Down
4 changes: 2 additions & 2 deletions main/src/infrastructure/proto/service_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,9 @@ where
let res = match value {
// Error
Err(e) => Some(Err(Status::unknown(e.to_string()))),
// Clip matrix ID matches
// Playtime matrix ID matches
Ok(value) if include(&value) => Some(Ok(create_result(value))),
// Clip matrix ID doesn't match
// Playtime matrix ID doesn't match
_ => None,
};
future::ready(res)
Expand Down
10 changes: 5 additions & 5 deletions main/src/infrastructure/ui/header_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ impl HeaderPanel {
instance
.borrow_mut()
.clip_matrix_mut()
.expect("this instance has no clip matrix")
.expect("this instance has no Playtime matrix")
.freeze()
.await;
Ok(())
Expand Down Expand Up @@ -2203,15 +2203,15 @@ impl HeaderPanel {
),
separator(),
item_with_opts(
"Export clip matrix as JSON",
"Export Playtime matrix as JSON",
ItemOpts {
enabled: cfg!(feature = "playtime"),
checked: false,
},
MenuAction::ExportClipMatrix(SerializationFormat::JsonDataObject),
),
item_with_opts(
"Export clip matrix as Lua",
"Export Playtime matrix as Lua",
ItemOpts {
enabled: cfg!(feature = "playtime"),
checked: false,
Expand Down Expand Up @@ -3149,11 +3149,11 @@ fn edit_osc_device(mut dev: OscDevice) -> Result<OscDevice, EditOscDevError> {
const COMPARTMENT_CHANGES_WARNING_TEXT: &str = "Mapping/group/parameter changes in this compartment will be lost. Consider to save them first. Do you really want to continue?";

#[cfg(feature = "playtime")]
const EMPTY_CLIP_MATRIX_LABEL: &str = "empty clip matrix";
const EMPTY_CLIP_MATRIX_LABEL: &str = "empty Playtime matrix";

#[cfg(feature = "playtime")]
fn get_clip_matrix_label(column_count: usize) -> String {
format!("clip matrix with {column_count} columns")
format!("Playtime matrix with {column_count} columns")
}

enum MainMenuAction {
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/ui/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub enum DataObject {
/// A Helgobox unit (within an instance).
#[serde(alias = "Session")]
Unit(Envelope<Box<UnitData>>),
/// A Playtime clip matrix.
/// A Playtime matrix.
ClipMatrix(Envelope<Box<Option<playtime_api::persistence::FlexibleMatrix>>>),
/// Main compartment.
MainCompartment(Envelope<Box<CompartmentModelData>>),
Expand Down
2 changes: 1 addition & 1 deletion playtime-api/src/persistence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ pub struct ColumnClipPlayAudioSettings {
/// a one-to-one relationship between a row and a scene.
///
/// The difference between row and scene is of conceptual nature: A scene represents a part of a
/// song that's played exclusively whereas a row is just a row in the clip matrix. This distinction
/// song that's played exclusively whereas a row is just a row in the Playtime matrix. This distinction
/// results in some practical differences:
///
/// - A column can be configured to not follow scenes. The clips in that column are of
Expand Down
2 changes: 1 addition & 1 deletion playtime-api/src/runtime/control_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct ControlUnit {
pub id: ControlUnitId,
/// A display name which should indicate what connected device we are talking about.
pub name: String,
/// Color in which the control unit should be visualized in the clip matrix.
/// Color in which the control unit should be visualized in the Playtime matrix.
///
/// In our case (Helgobox/ReaLearn), the color is in most usage scenarios dictated by the
/// global controller definition but should also work without using the "global controller"
Expand Down
6 changes: 3 additions & 3 deletions playtime-api/src/runtime/reaper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ use helgobox_macros::reaper_api;
reaper_api![
PlaytimeApi, PlaytimeApiPointers, PlaytimeApiSession, register_playtime_api
{
/// Finds the first Helgobox instance in the given project that contains a Playtime clip matrix.
/// Finds the first Helgobox instance in the given project that contains a Playtime matrix.
///
/// If the given project is `null`, it will look in the current project.
///
/// Returns the instance ID or -1 if none exists.
HB_FindFirstPlaytimeHelgoboxInstanceInProject(project: *mut reaper_low::raw::ReaProject) -> std::ffi::c_int;

/// Creates a new Playtime clip matrix in the given Helgobox instance.
/// Creates a new Playtime matrix in the given Helgobox instance.
HB_CreateClipMatrix(instance_id: std::ffi::c_int);

/// Shows or hides the app for the given Helgobox instance and makes sure that the app displays
/// Playtime.
///
/// If necessary, this will also start the app and create a clip matrix for the given instance.
/// If necessary, this will also start the app and create a Playtime matrix for the given instance.
HB_ShowOrHidePlaytime(instance_id: std::ffi::c_int);
}
];
2 changes: 1 addition & 1 deletion playtime-clip-engine
4 changes: 2 additions & 2 deletions resources/api/luau/playtime.luau
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ end
--- a one-to-one relationship between a row and a scene.
---
--- The difference between row and scene is of conceptual nature: A scene represents a part of a
--- song that's played exclusively whereas a row is just a row in the clip matrix. This distinction
--- song that's played exclusively whereas a row is just a row in the Playtime matrix. This distinction
--- results in some practical differences:
---
--- - A column can be configured to not follow scenes. The clips in that column are of
Expand All @@ -810,7 +810,7 @@ export type Row = {
--- a one-to-one relationship between a row and a scene.
---
--- The difference between row and scene is of conceptual nature: A scene represents a part of a
--- song that's played exclusively whereas a row is just a row in the clip matrix. This distinction
--- song that's played exclusively whereas a row is just a row in the Playtime matrix. This distinction
--- results in some practical differences:
---
--- - A column can be configured to not follow scenes. The clips in that column are of
Expand Down
Loading

0 comments on commit 397663b

Please sign in to comment.