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

◆ create_sampler() [2/2]

MAYAFLUX_API std::shared_ptr< Kriya::SamplingPipeline > MayaFlux::create_sampler ( uint32_t  num_samples = 48000 *5,
bool  truncate = true,
uint32_t  channel = 0,
uint64_t  max_dur_ms = 0 
)

Construct a built SamplingPipeline from a file picked in a dialog.

Same as the path form, with the file chosen in a native open-file dialog.

auto sampler = MayaFlux::create_sampler();
std::shared_ptr< Kriya::SamplingPipeline > create_sampler(const std::string &filepath, uint32_t num_samples, bool truncate, uint32_t channel, uint64_t max_dur_ms)
Construct a built SamplingPipeline from an audio file.
Definition Rigs.cpp:20
Returns
Built SamplingPipeline, or nullptr if nothing was chosen or loaded.

Definition at line 92 of file Rigs.cpp.

94{
95 auto stream = choose_audio_bounded(num_samples, truncate);
96
97 if (!stream) {
98 MF_ERROR(Journal::Component::API, Journal::Context::FileIO,
99 "create_sampler: no file chosen");
100 return nullptr;
101 }
102
103 return create_sampler_from_stream(std::move(stream), channel, max_dur_ms);
104}
#define MF_ERROR(comp, ctx,...)
Core::GlobalStreamInfo stream
Definition Config.cpp:40
std::shared_ptr< Kakshya::DynamicSoundStream > choose_audio_bounded(uint64_t max_frames, bool truncate)
Present a native open-file dialog filtered to audio formats and load the chosen file via IOManager::l...
Definition Depot.cpp:204

References MayaFlux::Journal::API, choose_audio_bounded(), create_sampler_from_stream(), MayaFlux::Journal::FileIO, MF_ERROR, and stream.

+ Here is the call graph for this function: