Skip to content

Commit

Permalink
Start renaming to Helgobox
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Mar 14, 2024
1 parent b53774e commit 27a0683
Show file tree
Hide file tree
Showing 20 changed files with 51 additions and 49 deletions.
2 changes: 1 addition & 1 deletion allocator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub fn start_async_deallocation_thread(
receiver: AsyncDeallocatorCommandReceiver,
) -> JoinHandle<AsyncDeallocatorCommandReceiver> {
thread::Builder::new()
.name("ReaLearn deallocator".to_string())
.name("Helgobox deallocator".to_string())
.spawn(move || {
while let Ok(cmd) = receiver.0.recv() {
match cmd {
Expand Down
2 changes: 1 addition & 1 deletion base/src/metrics_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub fn record_duration_internal(id: &'static str, delta: Duration) {
if let Some(sender) = METRICS_SENDER.get() {
let task = MetricsRecorderCommand::Histogram { id, delta };
if sender.try_send(task).is_err() {
tracing::debug!("ReaLearn metrics channel is full");
tracing::debug!("Helgobox metrics channel is full");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dialogs/src/message_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn create(context: ScopedContext, ids: &mut IdGenerator) -> Dialog {
+ NOT_WS_GROUP];
Dialog {
id: ids.named_id("ID_MESSAGE_PANEL"),
caption: "ReaLearn",
caption: "Helgobox",
rect: context.rect(0, 0, 300, 40),
styles: Styles(vec![
DS_SETFONT,
Expand Down
2 changes: 1 addition & 1 deletion dialogs/src/unit_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn create(
create_rect(386, 5 + line_spacing, 76, 14),
),
ctext(
"ReaLearn",
"Helgobox",
ids.named_id("ID_MAIN_PANEL_VERSION_TEXT"),
create_rect(text_line_left, 5 + line_spacing * 2, text_line_width, 9),
),
Expand Down
2 changes: 1 addition & 1 deletion main/src/base/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ pub fn notify_user_about_anyhow_error(e: anyhow::Error) {
pub fn alert<'a>(msg: impl Into<ReaperStringArg<'a>>) {
Reaper::get()
.medium_reaper()
.show_message_box(msg, "ReaLearn", MessageBoxType::Okay);
.show_message_box(msg, "Helgobox", MessageBoxType::Okay);
}
2 changes: 1 addition & 1 deletion main/src/domain/lua_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl AsRef<Lua> for SafeLua {

#[derive(Debug, derive_more::Display)]
enum RealearnScriptError {
#[display(fmt = "ReaLearn script took too long to execute")]
#[display(fmt = "Helgobox script took too long to execute")]
Timeout,
}

Expand Down
2 changes: 1 addition & 1 deletion main/src/domain/main_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ impl<EH: DomainEventHandler> MainProcessor<EH> {
})
.collect();
self.process_activation_effects(compartment, activation_effects, true);
// Control ("ReaLearn parameter source")
// Control ("Helgobox parameter source")
let control_payload = RealearnParameterChangePayload {
compartment,
parameter_index: compartment.to_compartment_param_index(index),
Expand Down
4 changes: 2 additions & 2 deletions main/src/domain/processor_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ fn get_containing_fx(host: &HostCallback) -> anyhow::Result<Fx> {
.fx_by_index(index)
.context("couldn't find containing FX on track FX chains")?
} else if let Some(_take) = unsafe { vst_context.request_containing_take(aeffect) } {
bail!("ReaLearn as take FX is not supported yet");
bail!("Helgobox as take FX is not supported yet");
} else {
let TrackFxLocation::InputFxChain(index) = fx_location else {
bail!("ReaLearn FX has no track but also doesn't seem to be on monitoring FX chain",);
bail!("Helgobox FX has no track but also doesn't seem to be on monitoring FX chain",);
};
Reaper::get().monitoring_fx_chain().fx_by_index(index)
.context("Couldn't find containing FX on monitoring FX chain. It's okay if this occurs during plug-in scanning.")?
Expand Down
7 changes: 4 additions & 3 deletions main/src/infrastructure/plugin/backbone_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ use crate::infrastructure::plugin::actions::ACTION_DEFS;
use crate::infrastructure::plugin::api_impl::{register_api, unregister_api};
use crate::infrastructure::plugin::debug_util::resolve_symbols_from_clipboard;
use crate::infrastructure::plugin::dynamic_toolbar::add_or_remove_toolbar_button;
use crate::infrastructure::plugin::helgobox_plugin::HELGOBOX_UNIQUE_VST_PLUGIN_ADD_STRING;
use crate::infrastructure::plugin::persistent_toolbar::add_toolbar_button_persistently;
use crate::infrastructure::plugin::shutdown_detection_panel::ShutdownDetectionPanel;
use crate::infrastructure::plugin::tracing_util::TracingHook;
Expand Down Expand Up @@ -284,7 +285,7 @@ impl BackboneShell {
context,
logger,
CrashInfo {
plugin_name: "ReaLearn".to_string(),
plugin_name: "Helgobox".to_string(),
plugin_version: BackboneShell::detailed_version_label().to_string(),
support_email_address: "[email protected]".to_string(),
},
Expand Down Expand Up @@ -679,7 +680,7 @@ impl BackboneShell {
// Start async runtime
let async_runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.thread_name("ReaLearn async runtime")
.thread_name("Helgobox async runtime")
.worker_threads(1)
.build()
.expect("couldn't start ReaLearn async runtime");
Expand Down Expand Up @@ -1663,7 +1664,7 @@ impl BackboneShell {
);
track
.normal_fx_chain()
.add_fx_by_original_name("<1751282284")
.add_fx_by_original_name(HELGOBOX_UNIQUE_VST_PLUGIN_ADD_STRING)
.context("Couldn't add Helgobox. Maybe not installed?")?
.hide_floating_window();
// The rest needs to be done async because the instance initializes itself async
Expand Down
35 changes: 19 additions & 16 deletions main/src/infrastructure/plugin/helgobox_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ use vst::host::Host;
/// Just the old term as alias for easier class search.
type _RealearnPlugin = HelgoboxPlugin;

/// In C++ this is the same like "hbrl" (= Helgoboss ReaLearn)
pub const HELGOBOX_UNIQUE_VST_PLUGIN_ID: i32 = 1751282284;

/// Can be passed to `add_fx_by_original_name`.
pub const HELGOBOX_UNIQUE_VST_PLUGIN_ADD_STRING: &str = "<1751282284";

/// The actual VST plug-in and thus main entry point.
///
/// Owns the instance shell, but not immediately. It's created as soon as the containing FX is
Expand Down Expand Up @@ -108,20 +114,17 @@ impl Plugin for HelgoboxPlugin {
}

fn get_info(&self) -> Info {
firewall(|| {
Info {
name: "ReaLearn".to_string(),
vendor: "Helgoboss".to_string(),
// In C++ this is the same like 'hbrl'
unique_id: 1751282284,
preset_chunks: true,
category: Category::Synth,
parameters: PLUGIN_PARAMETER_COUNT as i32,
f64_precision: true,
inputs: 2,
outputs: 0,
..Default::default()
}
firewall(|| Info {
name: "Helgobox (ReaLearn & Playtime)".to_string(),
vendor: "Helgoboss".to_string(),
unique_id: HELGOBOX_UNIQUE_VST_PLUGIN_ID,
preset_chunks: true,
category: Category::Synth,
parameters: PLUGIN_PARAMETER_COUNT as i32,
f64_precision: true,
inputs: 2,
outputs: 0,
..Default::default()
})
.unwrap_or_default()
}
Expand All @@ -145,10 +148,10 @@ impl Plugin for HelgoboxPlugin {
// Trick to find out whether we are only being scanned.
self.is_plugin_scan = unsafe { (*self.host.raw_effect()).reserved1 == 0 };
if self.is_plugin_scan {
tracing::debug!("ReaLearn is being scanned by REAPER");
tracing::debug!("Helgobox is being scanned by REAPER");
return;
}
tracing::debug!("ReaLearn is being opened by REAPER");
tracing::debug!("Helgobox is being opened by REAPER");
self._reaper_guard = Some(self.ensure_reaper_setup());
// At this point, REAPER cannot reliably give us the containing FX. As a
// consequence we also don't have a instance shell yet, because creating an incomplete
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/plugin/instance_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ impl InstanceShell {
Ok(d) => d,
Err(e) => {
bail!(
"ReaLearn couldn't restore this unit: {}\n\nPlease also attach the following text when reporting this: \n\n{}",
"Helgobox couldn't restore this unit: {}\n\nPlease also attach the following text when reporting this: \n\n{}",
e,
std::str::from_utf8(data).unwrap_or("UTF-8 decoding error")
)
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/plugin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod debug_util;
mod helgobox_plugin_editor;
mod tracing_util;
pub use backbone_shell::*;
mod helgobox_plugin;
pub mod helgobox_plugin;
mod instance_parameter_container;
mod instance_shell;
pub use instance_shell::*;
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ fn add_key_and_cert(ip: IpAddr) -> (String, String) {
// and https://medium.com/collaborne-engineering/self-signed-certificates-in-ios-apps-ff489bf8b96e
params.is_ca = IsCa::Ca(BasicConstraints::Unconstrained);
let mut dn = DistinguishedName::new();
dn.push(DnType::CommonName, format!("ReaLearn on {ip}"));
dn.push(DnType::CommonName, format!("Helgobox on {ip}"));
params.distinguished_name = dn;
let certificate = rcgen::Certificate::from_params(params)
.expect("couldn't create self-signed server certificate");
Expand Down
6 changes: 2 additions & 4 deletions main/src/infrastructure/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::domain::{with_fx_name, FinalSourceFeedbackValue, PLUGIN_PARAMETER_COUNT};
use crate::infrastructure::plugin::helgobox_plugin::HELGOBOX_UNIQUE_VST_PLUGIN_ADD_STRING;
use crate::infrastructure::plugin::{BackboneShell, SET_STATE_PARAM_NAME};
use approx::assert_abs_diff_eq;
use base::future_util::millis;
Expand Down Expand Up @@ -114,13 +115,10 @@ async fn setup() -> RealearnTestInstance {
let track = project.add_track().unwrap();
let fx = track
.normal_fx_chain()
.add_fx_by_original_name("ReaLearn (Helgoboss)")
.add_fx_by_original_name(HELGOBOX_UNIQUE_VST_PLUGIN_ADD_STRING)
.expect("couldn't find ReaLearn plug-in");
// Then
assert!(fx.parameter_count() >= PLUGIN_PARAMETER_COUNT + 2);
with_fx_name(&fx, |fx_name| {
assert_eq!(fx_name.as_ref(), "VSTi: ReaLearn (Helgoboss)");
});
moment().await;
let session = BackboneShell::get()
.find_session_by_containing_fx(&fx)
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/ui/dialog_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn prompt_for(caption: &str, initial_value: &str) -> Option<String> {
let captions_csv = format!("{caption},separator=|,extrawidth=200");
Reaper::get()
.medium_reaper()
.get_user_inputs("ReaLearn", 1, captions_csv, initial_value, 256)
.get_user_inputs("Helgobox", 1, captions_csv, initial_value, 256)
.map(|r| r.to_str().trim().to_owned())
}

Expand Down
18 changes: 9 additions & 9 deletions main/src/infrastructure/ui/header_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,15 +774,15 @@ impl HeaderPanel {
if app.server_is_running() {
app.stop_server_persistently();
self.view.require_window().alert(
"ReaLearn",
"Helgobox",
"Stopped projection server and permanently disabled it.",
);
} else {
match app.start_server_persistently() {
Ok(_) => {
self.view
.require_window()
.alert("ReaLearn", "Successfully started projection server and permanently enabled it.");
.alert("Helgobox", "Successfully started projection server and permanently enabled it.");
}
Err(info) => {
warn_about_failed_server_start(info);
Expand All @@ -804,9 +804,9 @@ impl HeaderPanel {
"Couldn't add firewall rule because {reason}. Please try to do it manually!",
),
};
self.view.require_window().alert("ReaLearn", msg);
self.view.require_window().alert("Helgobox", msg);
}
MainMenuAction::ChangeSessionId => self.change_session_id(),
MainMenuAction::ChangeSessionId => self.change_unit_id(),
MainMenuAction::CreateCompartmentPresetWorkspace => {
self.create_compartment_preset_workspace(false)
}
Expand Down Expand Up @@ -1895,8 +1895,8 @@ impl HeaderPanel {
}
Tagged(DataObject::Instance(Envelope { value: d, ..})) => {
if self.view.require_window().confirm(
"ReaLearn",
"Do you want to continue replacing the complete ReaLearn instance with the data in the clipboard?",
"Helgobox",
"Do you want to continue replacing the complete Helgobox instance with the data in the clipboard?",
) {
let instance_panel = self.instance_panel();
instance_panel.show_unit(None);
Expand Down Expand Up @@ -1939,7 +1939,7 @@ impl HeaderPanel {
}
};
if self.view.require_window().confirm(
"ReaLearn",
"Playtime",
format!("Do you want to replace the current {old_matrix_label} with the {new_matrix_label} in the clipboard?"),
) {
self.instance_panel().shell()?.load_clip_matrix(*value)?;
Expand Down Expand Up @@ -2323,9 +2323,9 @@ impl HeaderPanel {
Ok(())
}

fn change_session_id(&self) {
fn change_unit_id(&self) {
self.view.require_window().alert(
"ReaLearn",
"Helgobox",
"Please change the unit ID using the \"Unit data...\" button on the bottom right!",
);
}
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/ui/unit_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl UnitPanel {
self.view
.require_control(root::ID_MAIN_PANEL_VERSION_TEXT)
.set_text(format!(
"ReaLearn {}",
"Helgobox {}",
BackboneShell::detailed_version_label()
));
}
Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/ui/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ pub fn open_in_text_editor(
_ => e.to_string()
};
parent_window
.alert("ReaLearn", format!("Couldn't obtain text:\n\n{msg}"));
.alert("Helgobox", format!("Couldn't obtain text:\n\n{msg}"));
"couldn't obtain text"
})
}
Expand Down
2 changes: 1 addition & 1 deletion main/templates/companion-app-setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
<h1 class="center">ReaLearn Projection</h1>
<div class="qr-code-container" style="width: {{ qr_code_image_width }}px; height: {{ qr_code_image_height }}px;">
<img class="absolute {{ activation_class }}" src="{{ qr_code_image_uri }}"
alt="ReaLearn server QR code"/>
alt="Helgobox server QR code"/>
{% if !server_is_running %}
<div class="qr-code-overlay">
Server <br>
Expand Down
2 changes: 1 addition & 1 deletion pot/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ type ResultHandler<C, R> = Box<dyn FnOnce(&mut C, R) + Send>;
static POT_WORKER_RUNTIME: Lazy<std::io::Result<Runtime>> = Lazy::new(|| {
tokio::runtime::Builder::new_multi_thread()
.enable_time()
.thread_name("ReaLearn Pot Worker")
.thread_name("Helgobox Pot Worker")
.worker_threads(1)
.build()
});

0 comments on commit 27a0683

Please sign in to comment.