Add wrappers

This commit is contained in:
Paul Ferrand 2020-05-29 16:24:53 +02:00
parent bd55c14782
commit fbbd3b88c6
6 changed files with 47 additions and 0 deletions

View file

@ -424,6 +424,16 @@ SFIZZ_EXPORTED_API char* sfizz_get_unknown_opcodes(sfizz_synth_t* synth);
*/
SFIZZ_EXPORTED_API bool sfizz_should_reload_file(sfizz_synth_t* synth);
/**
* @brief Check if the scala file should be reloaded.
* Depending on the platform this can create file descriptors.
*
* @param synth The synth.
*
* @return @true if the scala file has been modified since loading.
*/
SFIZZ_EXPORTED_API bool sfizz_should_reload_scala(sfizz_synth_t* synth);
/**
* @brief Enable logging of timings to sidecar CSV files. This can produce
* many outputs so use with caution.

View file

@ -350,6 +350,16 @@ public:
*/
bool shouldReloadFile();
/**
* @brief Check if the tuning (scala) file should be reloaded.
*
* Depending on the platform this can create file descriptors.
*
* @return true if a scala file has been loaded and has changed
* @return false
*/
bool shouldReloadScala();
/**
* @brief Enable logging of timings to sidecar CSV files. This can produce
* many outputs so use with caution.

View file

@ -1212,6 +1212,11 @@ bool sfz::Synth::shouldReloadFile()
return (checkModificationTime() > modificationTime);
}
bool sfz::Synth::shouldReloadScala()
{
return resources.tuning.shouldReloadScala();
}
void sfz::Synth::enableLogging(absl::string_view prefix) noexcept
{
resources.logger.enableLogging(prefix);

View file

@ -423,6 +423,17 @@ public:
* @return false
*/
bool shouldReloadFile();
/**
* @brief Check if the tuning (scala) file should be reloaded.
*
* Depending on the platform this can create file descriptors.
*
* @return true if a scala file has been loaded and has changed
* @return false
*/
bool shouldReloadScala();
/**
* @brief Enable logging of timings to sidecar CSV files. This can produce
* many outputs so use with caution.

View file

@ -221,6 +221,11 @@ bool sfz::Sfizz::shouldReloadFile()
return synth->shouldReloadFile();
}
bool sfz::Sfizz::shouldReloadScala()
{
return synth->shouldReloadScala();
}
void sfz::Sfizz::enableLogging() noexcept
{
synth->enableLogging();

View file

@ -275,6 +275,12 @@ bool sfizz_should_reload_file(sfizz_synth_t* synth)
return self->shouldReloadFile();
}
bool sfizz_should_reload_scala(sfizz_synth_t* synth)
{
auto self = reinterpret_cast<sfz::Synth*>(synth);
return self->shouldReloadScala();
}
void sfizz_enable_logging(sfizz_synth_t* synth)
{
auto self = reinterpret_cast<sfz::Synth*>(synth);