MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ choose_audio_bounded()

MAYAFLUX_API std::shared_ptr< Kakshya::DynamicSoundStream > MayaFlux::choose_audio_bounded ( uint64_t  max_frames = 0,
bool  truncate = false 
)

Present a native open-file dialog filtered to audio formats and load the chosen file via IOManager::load_audio_bounded().

Blocks until the user confirms or cancels. Returns nullptr on cancellation, backend error, or if Portal::System is not initialized.

Parameters
max_framesUpper bound on frame count. 0 loads five seconds.
truncateIf true, truncate files longer than max_frames.

Definition at line 204 of file Depot.cpp.

205{
206 if (!require_portal("choose_audio_bounded"))
207 return nullptr;
208
209 return Portal::System::Dialog::open_file<std::shared_ptr<Kakshya::DynamicSoundStream>>(
210 [max_frames, truncate](const fs::path& p) {
211 return get_io_manager()->load_audio_bounded(p.string(), max_frames, truncate);
212 },
213 [](Core::SystemDialogError) { },
214 k_audio_open_filters);
215}
std::shared_ptr< IO::IOManager > get_io_manager()
Retrieves the global IOManager instance for file loading and buffer management.
Definition Depot.cpp:575

References get_io_manager().

Referenced by create_sampler(), create_samplers(), and create_tap_set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: