//! [Sample Key Feature] Callback function that shall be called during each configuration change (called in onConfigurationChanged)
void Heex::Sample::sampleRecorderConfChangeCallback::onConfigurationChangedCallback()
{
// NOTE: This function allows user to run commands every time the recorder has been reconfigured, right before it starts working again.
// NOTE: In this sample, we shall get the recorder's new constant values and valueConfigurations, and print them out, but many other use cases are possible.
// Let's get the new ValueCOnfigurations and Constant Values
std::vector<ValueConfiguration*> valueConfs = this->getValueConfigurations();
std::unordered_map<std::string, std::vector<std::string>> constValues = this->getConstantValues();
// Now we print out all the ValueCOnfigurations if there are any
if (valueConfs.size() > 0)
{
HEEX_LOG(info) << "\nRecorder's value confs are: " << std::endl;
for (int i = 0; i < valueConfs.size(); i++)
{
HEEX_LOG(info) << "\nValue Configuration " << i << " :" << std::endl;
HEEX_LOG(info) << " - Name : " << valueConfs[i]->getName() << std::endl;
HEEX_LOG(info) << " - Type : " << valueConfs[i]->getType() << std::endl;
HEEX_LOG(info) << " - UUID : " << valueConfs[i]->getUuid() << std::endl;
HEEX_LOG(info) << " - IsValid? : " << valueConfs[i]->isValid() << std::endl;
}
}
// And finally we print out the Constant Values if there are any
if (constValues.size() > 0)
{
HEEX_LOG(info) << "\nRecorder's constant values are: " << std::endl;
for (auto& it : constValues)
{
HEEX_LOG(info) << " - " << it.first << " : ";
for (auto val : it.second)
{
HEEX_LOG(info) << val << " - ";
}
HEEX_LOG(info) << std::endl;
}
}
}