diff --git a/main/medium/src/reaper.rs b/main/medium/src/reaper.rs index 4f8f6870..76b00747 100644 --- a/main/medium/src/reaper.rs +++ b/main/medium/src/reaper.rs @@ -292,13 +292,13 @@ impl Reaper { /// # Safety /// /// REAPER can crash if you pass an invalid track. - pub unsafe fn add_project_marker( + pub unsafe fn add_project_marker<'a>( &self, project: ProjectContext, region: bool, pos: PositionInSeconds, region_end_position: PositionInSeconds, - name: ReaperStringArg, + name: impl Into>, desired_index: i32, ) -> Option where @@ -309,7 +309,7 @@ impl Reaper { region, pos.get(), region_end_position.get(), - name.as_ptr(), + name.into().as_ptr(), desired_index, ); match result { @@ -332,13 +332,13 @@ impl Reaper { /// # Safety /// /// REAPER can crash if you pass an invalid track. - pub unsafe fn add_project_marker_2( + pub unsafe fn add_project_marker_2<'a>( &self, project: ProjectContext, region: bool, pos: PositionInSeconds, region_end_position: PositionInSeconds, - name: ReaperStringArg, + name: impl Into>, desired_index: i32, color: NativeColor, ) -> Option @@ -350,7 +350,7 @@ impl Reaper { region, pos.get(), region_end_position.get(), - name.as_ptr(), + name.into().as_ptr(), desired_index, color.to_raw(), ); @@ -369,11 +369,11 @@ impl Reaper { /// commit should be true always, but adding scripts in bulk. /// In the last case — the last function call should be with /// commit=true. - pub fn add_remove_reascript( + pub fn add_remove_reascript<'a>( &self, add: bool, section_id: i32, - script_file: ReaperStringArg, + script_file: impl Into>, commit: bool, ) -> Option where @@ -382,7 +382,7 @@ impl Reaper { unsafe { let result = self.low() - .AddRemoveReaScript(add, section_id, script_file.as_ptr(), commit); + .AddRemoveReaScript(add, section_id, script_file.into().as_ptr(), commit); match result { x if (x <= 0) => None, _ => Some(result as u32), @@ -1228,7 +1228,7 @@ impl Reaper { } /// True if function name exists in the REAPER API - pub fn api_exists<'a, I: Into>>(&self, function_name: I) -> bool + pub fn api_exists<'a>(&self, function_name: impl Into>) -> bool where UsageScope: MainThreadOnly, { @@ -1247,8 +1247,11 @@ impl Reaper { /// /// If command is None — disarms. /// If section_name is empty string — arms in MainSection. - pub fn arm_command(&self, command: Option, section_name: ReaperStringArg) - where + pub fn arm_command<'a>( + &self, + command: Option, + section_name: impl Into>, + ) where UsageScope: MainThreadOnly, { let cmd: i32; @@ -1257,7 +1260,7 @@ impl Reaper { Some(id) => cmd = id.get() as i32, } unsafe { - self.low().ArmCommand(cmd, section_name.as_ptr()); + self.low().ArmCommand(cmd, section_name.into().as_ptr()); } }