pub struct Project { /* private fields */ }

Implementations

New object from the project context.

It will never hold pseudo-context of CURRENT_PROJECT, but hold real pointer. So, for example, project, returned from Reaper::current_project will not always remain the project in the active project tab, if the tab changes.

Note

It is better to get all opened projects in once by Reaper::iter_projects.

Get opened project with a given name, if any.

Note

This operation, probably, of O(n³) complexity in the worst case, do not use a lot.

Get reaper_medium::ProjectContext to use with rea-rs crates.

Activate project tab with the project.

If the project tab is active.

Whether project is dirty (i.e. needing save).

Mark project dirty (i.e. needing save).

Direct way to simulate pause button hit.

Direct way to simulate play button hit.

Hit record button.

Note

This is sugar on top of the cation invocation.

Direct way to simulate stop button hit.

Close the project.

Get time signature and tempo (BPM) at given position.

Create new marker and return its index.

Return ReaperError::Unexpected if reaper can’t add marker.

If it is possible, the index will be the same as desired, but if it is busy, new index will be returned.

If a marker with the same position and name exists, no new marker will be created, and existing index will be returned.

index is not an enum index, but user-index.

Create new region and return its index.

Return ReaperError::Unexpected if reaper can’t add marker.

If it is possible, the index will be the same as desired, but if it is busy, new index will be returned.

If a marker with the same position and name exists, no new marker will be created, and existing index will be returned.

index is not an enum index, but user-index.

Set marker or region from info.

Get iterator through all project markers and regions.

Since markers and regions are messed up in indexes and API, it’s better to work with them through iteration.

Example
let project = Project::new(ProjectContext::CurrentProject);
assert_eq!(
    project
    .iter_markers_and_regions()
    .find(|info| !info.is_region && info.user_index == 2)
    .unwrap()
    .position
    .as_duration()
    .as_secs_f64(),
4.0
);

Glue items (action shortcut).

Verbose way to make undo.

Safety

Project::end_undo_block has to be called after.

Verbose way to make undo: name is the name shown in undo list.

Safety

Project::begin_undo_block has to be called before.

Call function in undo block with given name.

Note

Probably, it’s better to use UndoFlags.all() by default.

Try to undo last action.

Try to redo last undone action.

Position of next audio block being processed.

Project::play_position

Latency-compensated actual-what-you-hear position.

Project::next_buffer_position

Bypass (true) or un-bypass (false) FX on all tracks.

Get the name of the next action in redo queue, if any.

Get the name of the next action in undo queue, if any.

Edit cursor position.

Set edit cursor position.

Disarm record on all tracks.

Check if there is any FX window in focus.

Returns enough data for getting Fx by yourself, as it will be easier, than conquer borrow checker or force you to pass closure inside.

FocusedFxResult

Overwrite default size of string buffer, used to set and get string values:

Project::get_info_string Project::set_info_string

Example
use rea_rs::{Reaper, Project};
let mut pr = Reaper::get().current_project();
let directory = match pr.get_render_directory(){
    Err(_) => {
                pr.set_string_param_size(2048);
                pr.get_render_directory()
                    .expect("another reason of error")
            },
    Ok(dir) => dir,
};

title field from Project Settings/Notes dialog

title field from Project Settings/Notes dialog

author field from Project Settings/Notes dialog

author field from Project Settings/Notes dialog

Project path.

render file name (may contain wildcards)

render file name (may contain wildcards)

base64-encoded sink configuration (see project files, etc).

Set secondary_format to true, if you want the secondary render section format.

base64-encoded secondary sink configuration.

Set secondary_format to true, if you want the secondary render section format.

Callers can also pass a simple 4-byte string (non-base64-encoded), e.g. “evaw” or “l3pm”, to use default settings for that sink type.

Typical formats

“wave” “aiff” “caff” “iso “ “ddp “ “flac” “mp3l” “oggv” “OggS”

Filenames, that will be rendered.

Will return PlayRate::from(1.0) in normal conditions.

If None — then sample rate from Reaper settings used.

If None — then sample rate from Reaper settings used.

If None — then project sample rate used.

If None — then project sample rate used.

Get in tuple (start, end)

Valid only when Project::get_render_bounds_mode is BoundsMode::Custom

Trait Implementations

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Get underlying ReaperPointer.
Get underlying ReaperPointer with validity check.
Turn validity checks off.
Turn validity checks on.
State of validity checks.
Return ReaperError::NullPtr if check failed. Read more
Return ReaperError::NullPtr if check failed. Read more
Perform function with only one validity check. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.