Updated docs and comments
This commit is contained in:
parent
f80da93cfc
commit
0710f90881
3 changed files with 71 additions and 14 deletions
|
|
@ -134,14 +134,57 @@ public:
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void clear();
|
void clear();
|
||||||
|
/**
|
||||||
|
* @brief Moves the filled promises to a linear storage, and checks
|
||||||
|
* said linear storage for promises that are not used anymore.
|
||||||
|
*
|
||||||
|
* This function has to be called on the audio thread.
|
||||||
|
*/
|
||||||
void cleanupPromises() noexcept;
|
void cleanupPromises() noexcept;
|
||||||
|
/**
|
||||||
|
* @brief Get a file promise
|
||||||
|
*
|
||||||
|
* @param filename the file to preload
|
||||||
|
* @return FilePromisePtr a file promise
|
||||||
|
*/
|
||||||
FilePromisePtr getFilePromise(const std::string& filename) noexcept;
|
FilePromisePtr getFilePromise(const std::string& filename) noexcept;
|
||||||
|
/**
|
||||||
|
* @brief Change the preloading size. This will trigger a full
|
||||||
|
* reload of all samples, so don't call it on the audio thread.
|
||||||
|
*
|
||||||
|
* @param preloadSize
|
||||||
|
*/
|
||||||
void setPreloadSize(uint32_t preloadSize) noexcept;
|
void setPreloadSize(uint32_t preloadSize) noexcept;
|
||||||
|
/**
|
||||||
|
* @brief Get the current preload size.
|
||||||
|
*
|
||||||
|
* @return uint32_t
|
||||||
|
*/
|
||||||
uint32_t getPreloadSize() const noexcept;
|
uint32_t getPreloadSize() const noexcept;
|
||||||
|
/**
|
||||||
|
* @brief Set the oversampling factor. This will trigger a full
|
||||||
|
* reload of all samples so don't call it on the audio thread.
|
||||||
|
*
|
||||||
|
* @param factor
|
||||||
|
*/
|
||||||
void setOversamplingFactor(Oversampling factor) noexcept;
|
void setOversamplingFactor(Oversampling factor) noexcept;
|
||||||
|
/**
|
||||||
|
* @brief Get the current oversampling factor
|
||||||
|
*
|
||||||
|
* @return Oversampling
|
||||||
|
*/
|
||||||
Oversampling getOversamplingFactor() const noexcept;
|
Oversampling getOversamplingFactor() const noexcept;
|
||||||
|
/**
|
||||||
|
* @brief Empty the file loading queues without actually loading
|
||||||
|
* the files. All promises will be unfulfilled. Don't call this
|
||||||
|
* method on the audio thread as it will spinlock.
|
||||||
|
*
|
||||||
|
*/
|
||||||
void emptyFileLoadingQueues() noexcept;
|
void emptyFileLoadingQueues() noexcept;
|
||||||
|
/**
|
||||||
|
* @brief Wait for the background loading to finish for all promises
|
||||||
|
* in the queue.
|
||||||
|
*/
|
||||||
void waitForBackgroundLoading() noexcept;
|
void waitForBackgroundLoading() noexcept;
|
||||||
private:
|
private:
|
||||||
fs::path rootDirectory;
|
fs::path rootDirectory;
|
||||||
|
|
|
||||||
|
|
@ -576,8 +576,8 @@ uint32_t sfz::Synth::getPreloadSize() const noexcept
|
||||||
void sfz::Synth::enableFreeWheeling() noexcept
|
void sfz::Synth::enableFreeWheeling() noexcept
|
||||||
{
|
{
|
||||||
if (!freeWheeling) {
|
if (!freeWheeling) {
|
||||||
freeWheeling = true;
|
freeWheeling = true;
|
||||||
DBG("Enabling freewheeling");
|
DBG("Enabling freewheeling");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void sfz::Synth::disableFreeWheeling() noexcept
|
void sfz::Synth::disableFreeWheeling() noexcept
|
||||||
|
|
|
||||||
|
|
@ -189,8 +189,8 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Send a note on event to the synth
|
* @brief Send a note on event to the synth
|
||||||
*
|
*
|
||||||
* @param delay the delay at which the event occurs; this should be lower than the size of
|
* @param delay the delay at which the event occurs; this should be lower
|
||||||
* the block in the next call to renderBlock().
|
* than the size of the block in the next call to renderBlock().
|
||||||
* @param channel the midi channel for the event
|
* @param channel the midi channel for the event
|
||||||
* @param noteNumber the midi note number
|
* @param noteNumber the midi note number
|
||||||
* @param velocity the midi note velocity
|
* @param velocity the midi note velocity
|
||||||
|
|
@ -199,8 +199,8 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Send a note off event to the synth
|
* @brief Send a note off event to the synth
|
||||||
*
|
*
|
||||||
* @param delay the delay at which the event occurs; this should be lower than the size of
|
* @param delay the delay at which the event occurs; this should be lower
|
||||||
* the block in the next call to renderBlock().
|
* than the size of the block in the next call to renderBlock().
|
||||||
* @param channel the midi channel for the event
|
* @param channel the midi channel for the event
|
||||||
* @param noteNumber the midi note number
|
* @param noteNumber the midi note number
|
||||||
* @param velocity the midi note velocity
|
* @param velocity the midi note velocity
|
||||||
|
|
@ -219,8 +219,9 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Send a pitch bend event to the synth
|
* @brief Send a pitch bend event to the synth
|
||||||
*
|
*
|
||||||
* @param delay the delay at which the event occurs; this should be lower than the size of
|
* @param delay the delay at which the event occurs; this should be lower
|
||||||
* the block in the next call to renderBlock().
|
* than the size of the block in the next call to
|
||||||
|
* renderBlock().
|
||||||
* @param channel the midi channel for the event
|
* @param channel the midi channel for the event
|
||||||
* @param pitch the pitch value
|
* @param pitch the pitch value
|
||||||
*/
|
*/
|
||||||
|
|
@ -244,12 +245,14 @@ public:
|
||||||
*/
|
*/
|
||||||
void tempo(int delay, float secondsPerQuarter) noexcept;
|
void tempo(int delay, float secondsPerQuarter) noexcept;
|
||||||
/**
|
/**
|
||||||
* @brief Render an block of audio data in the buffer. This call will reset the synth
|
* @brief Render an block of audio data in the buffer. This call will reset
|
||||||
* in its waiting state for the next batch of events. The size of the block is integrated
|
* the synth in its waiting state for the next batch of events. The size of
|
||||||
* in the AudioSpan object. You can build an AudioSpan implicitely from a large number
|
* the block is integrated in the AudioSpan object. You can build an
|
||||||
* of source objects; check the AudioSpan reference for more precision.
|
* AudioSpan implicitely from a large number of source objects; check the
|
||||||
|
* AudioSpan reference for more precision.
|
||||||
*
|
*
|
||||||
* @param buffer the buffer to write the next block into; this should be a stereo buffer.
|
* @param buffer the buffer to write the next block into; this should be a
|
||||||
|
* stereo buffer.
|
||||||
*/
|
*/
|
||||||
void renderBlock(AudioSpan<float> buffer) noexcept;
|
void renderBlock(AudioSpan<float> buffer) noexcept;
|
||||||
|
|
||||||
|
|
@ -325,7 +328,18 @@ public:
|
||||||
*/
|
*/
|
||||||
int getAllocatedBytes() const noexcept { return Buffer<float>::counter().getTotalBytes(); }
|
int getAllocatedBytes() const noexcept { return Buffer<float>::counter().getTotalBytes(); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable freewheeling on the synth. This will wait for background
|
||||||
|
* loaded files to finish loading before each render callback to ensure that
|
||||||
|
* there will be no dropouts.
|
||||||
|
*
|
||||||
|
*/
|
||||||
void enableFreeWheeling() noexcept;
|
void enableFreeWheeling() noexcept;
|
||||||
|
/**
|
||||||
|
* @brief Disable freewheeling on the synth. You should disable freewheeling
|
||||||
|
* before live use of the plugin otherwise the audio thread will lock.
|
||||||
|
*
|
||||||
|
*/
|
||||||
void disableFreeWheeling() noexcept;
|
void disableFreeWheeling() noexcept;
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue