helgoboss / reaper-rs

Rust bindings for the REAPER C++ API
MIT License
82 stars 8 forks source link

Medium-level API: Add AudioAccessor with corresponding functions. #75

Open Levitanus opened 1 year ago

Levitanus commented 1 year ago

I'm sorry. This is a sort of duplicate, but, I hope, ready to push.

I've found the plan of making all the medium-level quite a big task, that I can't handle. Especially, in terms of psychical comfort ;)

So, since I (hope, not alone) really need to use ReaScript from rust somehow, I've built some sort of high-level on top of reaper-low (and a bit of reaper-medium). Until you introduce your rx architecture, I would like to consider this as a solution.

But, at first, it requires this particular fix of reintroducing AudioAccessor in low- and mid-levels. And, at the second, I would like to publish on crates.io, which requires all dependencies be there two. Also, when I first met reaper-rs, I also was confused a bit, until used GitHub dependency. May You also make a release on crates.io?

I'll return to my pulls as soon as possible. Hope to polish that, which already sketched until the end of the year.

Changed

AudioAccessor in ptr_wrappers.rs create_track_audio_accessor create_take_audio_accessor destroy_audio_accessor audio_accessor_state_changed audio_accessor_update audio_accessor_validate_state get_audio_accessor_end_time get_audio_accessor_start_time get_audio_accessor_samples GetAudioAccessorHash is not wrapped, as it is deprecated. Low-level API: Fixed AudioAccessor to be ReaperPointer

applied cargo fmt

Levitanus commented 1 year ago

Oh, by the way! I've found, that exiting because of the signal is, probably, normal way of exiting in Linux. So, maybe, there is a point to return Ok(()) in that case.