sfizz/src/sfizz.hpp

642 lines
19 KiB
C++
Raw Normal View History

2020-01-25 10:04:31 +01:00
// SPDX-License-Identifier: BSD-2-Clause
2020-01-25 13:13:07 +01:00
// This code is part of the sfizz library and is licensed under a BSD 2-clause
// license. You should have receive a LICENSE.md file along with the code.
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
2020-01-25 10:04:31 +01:00
2020-04-07 18:42:41 +02:00
/**
@file
2020-09-05 16:14:51 +02:00
@brief sfizz public C++ API.
2020-04-07 18:42:41 +02:00
*/
2020-05-07 10:10:29 +02:00
#pragma once
2020-10-19 02:58:01 +02:00
#include "sfizz_message.h"
#include <string>
2020-04-08 12:57:03 +02:00
#include <utility>
#include <vector>
#include <memory>
#if defined SFIZZ_EXPORT_SYMBOLS
#if defined _WIN32
#define SFIZZ_EXPORTED_API __declspec(dllexport)
#else
#define SFIZZ_EXPORTED_API __attribute__ ((visibility ("default")))
#endif
#else
#define SFIZZ_EXPORTED_API
#endif
namespace sfz
2020-01-25 10:04:31 +01:00
{
class Synth;
2020-10-19 02:58:01 +02:00
class Client;
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Main class.
2020-04-07 18:42:41 +02:00
*/
class SFIZZ_EXPORTED_API Sfizz
{
public:
/**
2020-09-05 16:14:51 +02:00
* @brief Construct a new Sfizz object.
*
2020-09-05 16:14:51 +02:00
* The synth by default is set at 48 kHz and a block size of 1024.
* You should change these values if they are not suited to your application.
*/
Sfizz();
~Sfizz();
2020-04-07 18:42:41 +02:00
2020-06-11 13:51:37 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Processing mode.
* @since 0.4.0
2020-06-11 13:51:37 +02:00
*/
enum ProcessMode {
ProcessLive,
ProcessFreewheeling,
};
/**
* @brief Empties the current regions and load a new SFZ file into the synth.
*
* This function will disable all callbacks so it is safe to call from a
* UI thread for example, although it may generate a click. However it is
* not reentrant, so you should not call it from concurrent threads.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
2020-04-07 18:42:41 +02:00
* @param path The path to the file to load, as string.
*
* @return @false if the file was not found or no regions were loaded,
* @true otherwise.
*/
bool loadSfzFile(const std::string& path);
2020-04-07 18:42:41 +02:00
2020-05-06 19:10:35 +02:00
/**
* @brief Empties the current regions and load a new SFZ document from memory.
*
* This is similar to loadSfzFile() in functionality.
* This accepts a virtual path name for the imaginary sfz file, which is not
* required to exist on disk. The purpose of the virtual path is to locate
* samples with relative paths.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-05-06 19:10:35 +02:00
*
* @param path The virtual path of the SFZ file, as string.
* @param text The contents of the virtual SFZ file.
*
* @return @false if no regions were loaded,
* @true otherwise.
*/
bool loadSfzString(const std::string& path, const std::string& text);
2020-05-19 14:51:33 +02:00
/**
* @brief Sets the tuning from a Scala file loaded from the file system.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-05-19 14:51:33 +02:00
*
2020-09-05 16:14:51 +02:00
* @param path The path to the file in Scala format.
*
2020-05-19 14:51:33 +02:00
* @return @true when tuning scale loaded OK,
* @false if some error occurred.
*/
bool loadScalaFile(const std::string& path);
/**
* @brief Sets the tuning from a Scala file loaded from memory.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-05-19 14:51:33 +02:00
*
2020-09-05 16:14:51 +02:00
* @param text The contents of the file in Scala format.
*
2020-05-19 14:51:33 +02:00
* @return @true when tuning scale loaded OK,
* @false if some error occurred.
*/
bool loadScalaString(const std::string& text);
/**
* @brief Sets the scala root key.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-05-19 14:51:33 +02:00
*
* @param rootKey The MIDI number of the Scala root key (default 60 for C4).
*/
void setScalaRootKey(int rootKey);
/**
* @brief Gets the scala root key.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-05-19 14:51:33 +02:00
*
* @return The MIDI number of the Scala root key (default 60 for C4).
*/
int getScalaRootKey() const;
/**
* @brief Sets the reference tuning frequency.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-05-19 14:51:33 +02:00
*
* @param frequency The frequency which indicates where standard tuning A4 is (default 440 Hz).
*/
void setTuningFrequency(float frequency);
/**
* @brief Gets the reference tuning frequency.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-05-19 14:51:33 +02:00
*
* @return The frequency which indicates where standard tuning A4 is (default 440 Hz).
*/
float getTuningFrequency() const;
2020-06-11 22:22:47 +02:00
/**
* @brief Configure stretch tuning using a predefined parametric Railsback curve.
2020-09-05 16:14:51 +02:00
*
2020-06-11 22:22:47 +02:00
* A ratio 1/2 is supposed to match the average piano; 0 disables (the default).
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-06-11 22:22:47 +02:00
*
* @param ratio The parameter in domain 0-1.
*/
void loadStretchTuningByRatio(float ratio);
/**
2020-04-07 18:42:41 +02:00
* @brief Return the current number of regions loaded.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
int getNumRegions() const noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-04-07 18:42:41 +02:00
* @brief Return the current number of groups loaded.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
int getNumGroups() const noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-04-07 18:42:41 +02:00
* @brief Return the current number of masters loaded.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
int getNumMasters() const noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-04-07 18:42:41 +02:00
* @brief Return the current number of curves loaded.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
int getNumCurves() const noexcept;
2020-04-07 18:42:41 +02:00
/**
* @brief Return a list of unsupported opcodes, if any.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
2020-04-07 18:42:41 +02:00
*/
const std::vector<std::string>& getUnknownOpcodes() const noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-04-07 18:42:41 +02:00
* @brief Return the number of preloaded samples in the synth.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
size_t getNumPreloadedSamples() const noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Set the maximum size of the blocks for the callback.
*
* The actual size can be lower in each callback but should not be larger
* than this value.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
2020-04-07 18:42:41 +02:00
* @param samplesPerBlock The number of samples per block.
*/
void setSamplesPerBlock(int samplesPerBlock) noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Set the sample rate.
*
* If you do not call it it is initialized to `sfz::config::defaultSampleRate`.
* @since 0.2.0
*
2020-04-07 18:42:41 +02:00
* @param sampleRate The sample rate.
*/
void setSampleRate(float sampleRate) noexcept;
2020-04-07 18:42:41 +02:00
2020-06-11 13:51:37 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Get the default resampling quality.
*
* This is the quality setting which the engine uses when the instrument
* does not use the opcode `sample_quality`. The engine uses distinct
* default quality settings for live mode and freewheeling mode,
* which both can be accessed by the means of this function.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-06-11 13:51:37 +02:00
*
* @param[in] mode The processing mode.
*
* @return The sample quality for the given mode, in the range 1 to 10.
*/
int getSampleQuality(ProcessMode mode);
/**
2020-09-05 16:14:51 +02:00
* @brief Set the default resampling quality.
*
* This is the quality setting which the engine uses when the instrument
* does not use the opcode `sample_quality`. The engine uses distinct
* default quality settings for live mode and freewheeling mode,
* which both can be accessed by the means of this function.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-06-11 13:51:37 +02:00
*
* @param[in] mode The processing mode.
* @param[in] quality The desired sample quality, in the range 1 to 10.
*/
void setSampleQuality(ProcessMode mode, int quality);
/**
2020-04-07 18:42:41 +02:00
* @brief Return the current value for the volume, in dB.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
float getVolume() const noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Set the value for the volume.
*
* This value will be clamped within `sfz::default::volumeRange`.
* @since 0.2.0
*
2020-04-07 18:42:41 +02:00
* @param volume The new volume.
*/
void setVolume(float volume) noexcept;
/**
2020-09-05 16:14:51 +02:00
* @brief Send a note on event to the synth.
* @since 0.2.0
*
* @param delay the delay at which the event occurs; this should be lower
* than the size of the block in the next call to renderBlock().
2020-04-07 18:42:41 +02:00
* @param noteNumber the midi note number.
* @param velocity the midi note velocity.
*/
void noteOn(int delay, int noteNumber, uint8_t velocity) noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Send a note off event to the synth.
* @since 0.2.0
*
* @param delay the delay at which the event occurs; this should be lower
* than the size of the block in the next call to renderBlock().
2020-04-07 18:42:41 +02:00
* @param noteNumber the midi note number.
* @param velocity the midi note velocity.
*/
void noteOff(int delay, int noteNumber, uint8_t velocity) noexcept;
2020-04-07 18:42:41 +02:00
/**
* @brief Send a CC event to the synth
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
2020-09-05 16:14:51 +02:00
* @param delay the delay at which the event occurs; this should be lower
* than the size of the block in the next call to renderBlock().
2020-04-07 18:42:41 +02:00
* @param ccNumber the cc number.
* @param ccValue the cc value.
*/
void cc(int delay, int ccNumber, uint8_t ccValue) noexcept;
2020-04-07 18:42:41 +02:00
2020-05-17 18:06:25 +02:00
/**
* @brief Send a high precision CC event to the synth
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-05-17 18:06:25 +02:00
*
2020-09-05 16:14:51 +02:00
* @param delay the delay at which the event occurs; this should be lower
* than the size of the block in the next call to renderBlock().
2020-05-17 18:06:25 +02:00
* @param ccNumber the cc number.
* @param normValue the normalized cc value, in domain 0 to 1.
*/
void hdcc(int delay, int ccNumber, float normValue) noexcept;
/**
* @brief Send a pitch bend event to the synth
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
* @param delay the delay at which the event occurs; this should be lower
2020-09-05 16:14:51 +02:00
* than the size of the block in the next call to renderBlock().
2020-04-07 18:42:41 +02:00
* @param pitch the pitch value centered between -8192 and 8192.
*/
void pitchWheel(int delay, int pitch) noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-04-07 18:42:41 +02:00
* @brief Send a aftertouch event to the synth. (CURRENTLY UNIMPLEMENTED)
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
2020-09-05 16:14:51 +02:00
* @param delay the delay at which the event occurs; this should be lower
* than the size of the block in the next call to renderBlock().
2020-04-07 18:42:41 +02:00
* @param aftertouch the aftertouch value.
*/
void aftertouch(int delay, uint8_t aftertouch) noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-08-11 15:31:23 +02:00
* @brief Send a tempo event to the synth.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
2020-09-05 16:14:51 +02:00
* @param delay the delay at which the event occurs; this should be lower
* than the size of the block in the next call to renderBlock().
2020-08-11 15:31:23 +02:00
* @param secondsPerBeat the new period of the beat.
*/
2020-08-11 15:31:23 +02:00
void tempo(int delay, float secondsPerBeat) noexcept;
/**
2020-09-05 16:14:51 +02:00
* @brief Send the time signature.
* @since 0.5.0
2020-08-11 15:31:23 +02:00
*
2020-09-05 16:14:51 +02:00
* @param delay The delay.
* @param beatsPerBar The number of beats per bar, or time signature numerator.
* @param beatUnit The note corresponding to one beat, or time signature denominator.
2020-08-11 15:31:23 +02:00
*/
void timeSignature(int delay, int beatsPerBar, int beatUnit);
/**
2020-09-05 16:14:51 +02:00
* @brief Send the time position.
* @since 0.5.0
2020-08-11 15:31:23 +02:00
*
2020-09-05 16:14:51 +02:00
* @param delay The delay.
* @param bar The current bar.
* @param barBeat The fractional position of the current beat within the bar.
2020-08-11 15:31:23 +02:00
*/
void timePosition(int delay, int bar, float barBeat);
/**
2020-09-05 16:14:51 +02:00
* @brief Send the playback state.
* @since 0.5.0
2020-08-11 15:31:23 +02:00
*
2020-09-05 16:14:51 +02:00
* @param delay The delay.
* @param playbackState The playback state, 1 if playing, 0 if stopped.
2020-08-11 15:31:23 +02:00
*/
void playbackState(int delay, int playbackState);
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Render an block of audio data in the buffer.
*
* This call will reset the synth in its waiting state for the next batch
* of events. The buffers must be float[numSamples][numOutputs * 2].
* @since 0.2.0
*
2020-04-07 18:42:41 +02:00
* @param buffers the buffers to write the next block into.
* @param numFrames the number of stereo frames in the block.
* @param numOutputs the number of stereo outputs.
*/
2020-01-26 11:20:11 +01:00
void renderBlock(float** buffers, size_t numFrames, int numOutputs = 1) noexcept;
/**
2020-04-07 18:42:41 +02:00
* @brief Return the number of active voices.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
int getNumActiveVoices() const noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-04-07 18:42:41 +02:00
* @brief Return the total number of voices in the synth (the polyphony).
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
int getNumVoices() const noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-04-07 18:42:41 +02:00
* @brief Change the number of voices (the polyphony).
2020-09-05 16:14:51 +02:00
*
2020-05-13 22:10:02 +02:00
* This function takes a lock and disables the callback; prefer calling
* it out of the RT thread. It can also take a long time to return.
* If the new number of voices is the same as the current one, it will
* release the lock immediately and exit.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
2020-04-07 18:42:41 +02:00
* @param numVoices The number of voices.
*/
void setNumVoices(int numVoices) noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-05-13 22:10:02 +02:00
* @brief Set the oversampling factor to a new value.
2020-09-05 16:14:51 +02:00
*
2020-05-13 22:10:02 +02:00
* It will kill all the voices, and trigger a reloading of every file in
* the FilePool under the new oversampling.
*
* Increasing this value (up to x8 oversampling) improves the
* quality of the output at the expense of memory consumption and
* background loading speed. The main render path still uses the
* same linear interpolation algorithm and should not see its
* performance decrease, but the files are oversampled upon loading
* which increases the stress on the background loader and reduce
* the loading speed. You can tweak the size of the preloaded data
* to compensate for the memory increase, but the full loading will
* need to take place anyway.
*
* This function takes a lock and disables the callback; prefer calling
* it out of the RT thread. It can also take a long time to return.
* If the new oversampling factor is the same as the current one, it will
* release the lock immediately and exit.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
2020-04-07 18:42:41 +02:00
* @param factor The oversampling factor.
*
* @return @true if the factor did indeed change, @false otherwise.
*/
bool setOversamplingFactor(int factor) noexcept;
/**
2020-04-07 18:42:41 +02:00
* @brief Return the current oversampling factor.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
int getOversamplingFactor() const noexcept;
/**
2020-05-13 22:10:02 +02:00
* @brief Set the preloaded file size.
2020-09-05 16:14:51 +02:00
*
2020-05-13 22:10:02 +02:00
* This function takes a lock and disables the callback; prefer calling
* it out of the RT thread. It can also take a long time to return.
* If the new preload size is the same as the current one, it will
* release the lock immediately and exit.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
2020-04-07 18:42:41 +02:00
* @param preloadSize The preload size.
*/
void setPreloadSize(uint32_t preloadSize) noexcept;
/**
2020-04-07 18:42:41 +02:00
* @brief Return the current preloaded file size.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
uint32_t getPreloadSize() const noexcept;
/**
2020-04-07 18:42:41 +02:00
* @brief Return the number of allocated buffers.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
int getAllocatedBuffers() const noexcept;
/**
2020-04-07 18:42:41 +02:00
* @brief Return the number of bytes allocated through the buffers.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*/
int getAllocatedBytes() const noexcept;
/**
2020-09-05 16:14:51 +02:00
* @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.
* @since 0.2.0
*/
void enableFreeWheeling() noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Disable freewheeling on the synth.
*
2020-09-05 16:14:51 +02:00
* You should disable freewheeling before live use of the plugin
* otherwise the audio thread will lock.
* @since 0.2.0
*/
void disableFreeWheeling() noexcept;
2020-04-07 18:42:41 +02:00
/**
* @brief Check if the SFZ should be reloaded.
*
* Depending on the platform this can create file descriptors.
2020-09-05 16:14:51 +02:00
* @since 0.2.0
*
2020-04-07 18:42:41 +02:00
* @return @true if any included files (including the root file) have
* been modified since the sfz file was loaded, @false otherwise.
*/
bool shouldReloadFile();
2020-04-07 18:42:41 +02:00
2020-05-29 16:24:53 +02:00
/**
* @brief Check if the tuning (scala) file should be reloaded.
*
* Depending on the platform this can create file descriptors.
2020-09-05 16:14:51 +02:00
* @since 0.4.0
2020-05-29 16:24:53 +02:00
*
2020-09-05 16:14:51 +02:00
* @return @true if a scala file has been loaded and has changed, @false otherwise.
2020-05-29 16:24:53 +02:00
*/
bool shouldReloadScala();
/**
2020-09-05 16:14:51 +02:00
* @brief Enable logging of timings to sidecar CSV files.
* @since 0.3.0
*
* @note This can produce many outputs so use with caution.
*
2020-04-07 18:42:41 +02:00
* @param prefix the file prefix to use for logging.
*/
void enableLogging() noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Enable logging of timings to sidecar CSV files.
* @since 0.3.2
*
* @note This can produce many outputs so use with caution.
*
2020-04-07 18:42:41 +02:00
* @param prefix the file prefix to use for logging.
*/
void enableLogging(const std::string& prefix) noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-04-07 18:42:41 +02:00
* @brief Set the logging prefix.
2020-09-05 16:14:51 +02:00
* @since 0.3.2
*
* @param prefix
*/
void setLoggingPrefix(const std::string& prefix) noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Disable logging of timings to sidecar CSV files.
* @since 0.3.0
*/
void disableLogging() noexcept;
2020-04-07 18:42:41 +02:00
2020-03-15 23:16:40 +01:00
/**
* @brief Shuts down the current processing, clear buffers and reset the voices.
2020-09-05 16:14:51 +02:00
* @since 0.3.2
2020-03-15 23:16:40 +01:00
*/
void allSoundOff() noexcept;
2020-04-07 18:42:41 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Add external definitions prior to loading.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
*
2020-09-05 16:14:51 +02:00
* @note These do not get reset by loading or resetting the synth.
* You need to call clearExternalDefintions() to erase them.
*
* @param id The definition variable name.
* @param value The definition value.
*/
void addExternalDefinition(const std::string& id, const std::string& value);
2020-04-07 18:50:14 +02:00
/**
* @brief Clears external definitions for the next file loading.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
*/
void clearExternalDefinitions();
2020-04-07 18:50:14 +02:00
2020-04-08 12:57:03 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Get the key labels, if any.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-04-08 12:57:03 +02:00
*/
2020-04-15 18:04:02 +02:00
const std::vector<std::pair<uint8_t, std::string>>& getKeyLabels() const noexcept;
2020-09-05 16:14:51 +02:00
2020-04-08 12:57:03 +02:00
/**
2020-09-05 16:14:51 +02:00
* @brief Get the CC labels, if any.
2020-07-06 14:38:43 +02:00
* @since 0.4.0
2020-04-08 12:57:03 +02:00
*/
const std::vector<std::pair<uint16_t, std::string>>& getCCLabels() const noexcept;
2020-09-05 16:14:51 +02:00
2020-10-19 02:58:01 +02:00
/**
* @addtogroup Messaging
* @{
*/
private:
struct ClientDeleter {
void operator()(Client *client) const noexcept;
};
public:
using ClientPtr = std::unique_ptr<Client, ClientDeleter>;
/**
* @brief Create a new messaging client
* @since 0.6.0
*
* @param data The opaque data pointer which is passed to the receiver.
* @return The new client.
*/
static ClientPtr createClient(void* data);
/**
* @brief Get the client data
* @since 0.6.0
*
* @param client The client.
* @return The client data.
*/
static void* getClientData(Client& client);
/**
* @brief Set the function which receives reply messages from the synth engine.
* @since 0.6.0
*
* @param client The client.
* @param receive The pointer to the receiving function.
*/
static void setReceiveCallback(Client& client, sfizz_receive_t* receive);
/**
* @brief Send a message to the synth engine
* @since 0.6.0
*
* @param client The client sending the message.
* @param delay The delay of the message in the block, in samples.
* @param path The OSC address pattern.
* @param sig The OSC type tag string.
* @param args The OSC arguments, whose number and format is determined the type tag string.
*/
void sendMessage(Client& client, int delay, const char* path, const char* sig, const sfizz_arg_t* args);
/**
* @brief Set the function which receives broadcast messages from the synth engine.
* @since 0.6.0
*
* @param broadcast The pointer to the receiving function.
* @param data The opaque data pointer which is passed to the receiver.
*/
void setBroadcastCallback(sfizz_receive_t* broadcast, void* data);
/**
* @}
*/
private:
std::unique_ptr<sfz::Synth> synth;
};
2020-10-19 02:58:01 +02:00
using ClientPtr = Sfizz::ClientPtr;
2020-01-25 10:04:31 +01:00
}