Skip to content

Commit

Permalink
1) Fixed showup of channels in property viewer for syncclock device
Browse files Browse the repository at this point in the history
2) Fixed minor bug in generic wrapper in case input channels were modified on test
  • Loading branch information
hkbinaurics committed Mar 5, 2024
1 parent 96338ef commit d36ee36
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,13 @@ CjvxGenericWrapperDevice::transfer_backward_ocon(jvxLinkDataTransferType tp, jvx
updateDependentVariables_lock(CjvxAudioDevice_genpcg::properties_active.inputchannelselection.globalIdx,
CjvxAudioDevice_genpcg::properties_active.inputchannelselection.category, false,
JVX_PROPERTY_CALL_PURPOSE_INTERNAL_PASS);

// Add this code extract here to transfer the new channel selection also to wrapped device!!
this->lock_settings();
rearrangeChannelMapper_noLock();
updateChannelInternal_nolock();
this->unlock_settings();

}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,4 @@ SECTION PROPERTIES
OUTPUTFILE_NAME = "genSyncClock_device";
CALLBACKS = {"set_config", "trigger_command"};

SECTION monitor
{
GENERATE_ENTRIES_CONFIG_FILE = "no"; // Defaults to "no" if not present
GENERATE_ENTRIES_LINK_OBJECTS = "yes"; // Defaults to "no" if not present
ALLOWED_STATE_MASK = {"JVX_STATE_ACTIVE", "JVX_STATE_PREPARED", "JVX_STATE_PROCESSING"};

SECTION progress_percent
{
TYPE = "JVX_DATAFORMAT_DATA";
INIT_SET = 0;
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_FULL_READ_AND_WRITE";
};

SECTION num_lost
{
TYPE = "JVX_DATAFORMAT_SIZE";
INIT_SET = 0;
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_FULL_READ_AND_WRITE";
};
};

SECTION config
{
GENERATE_ENTRIES_CONFIG_FILE = "no"; // Defaults to "no" if not present
GENERATE_ENTRIES_LINK_OBJECTS = "yes"; // Defaults to "no" if not present
ALLOWED_STATE_MASK = {"JVX_STATE_ACTIVE", "JVX_STATE_PREPARED", "JVX_STATE_PROCESSING"};

SECTION loop
{
TYPE = "JVX_DATAFORMAT_BOOL";
INIT_SET = 1;
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_FULL_READ_AND_WRITE";
CALLBACK_SET_POSTHOOK = "set_config";
};
};

SECTION command
{
GENERATE_ENTRIES_CONFIG_FILE = "no"; // Defaults to "no" if not present
GENERATE_ENTRIES_LINK_OBJECTS = "yes"; // Defaults to "no" if not present
ALLOWED_STATE_MASK = {"JVX_STATE_ACTIVE", "JVX_STATE_PREPARED", "JVX_STATE_PROCESSING"};

SECTION restart
{
TYPE = "JVX_DATAFORMAT_BOOL";
INIT_SET = 0;
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_FULL_READ_AND_WRITE";
CALLBACK_SET_POSTHOOK = "trigger_command";
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,24 @@ CjvxAudioSyncClockDevice::activate()
{
// Should all be zeroed
jvx_bitFClear(bf);
for (i = 0; i < 2; i++)
for (i = 0; i < numInChannelsMax; i++)
{
std::string nmToken = "Input Channel #" + jvx_size2String(i);
CjvxAudioDevice::properties_active.inputchannelselection.value.entries.push_back(nmToken.c_str());
jvx_bitSet(bf, i);
}
CjvxAudioDevice::properties_active.inputchannelselection.value.selection() = bf;

CjvxAudioDevice::properties_active.numberinputchannels.value = numInChannelsMax;

jvx_bitFClear(bf);
for (i = 0; i < 2; i++)
for (i = 0; i < numOutChannelsMax; i++)
{
std::string nmToken = "Output Channel #" + jvx_size2String(i);
CjvxAudioDevice::properties_active.outputchannelselection.value.entries.push_back(nmToken.c_str());
jvx_bitSet(bf, i);
}
CjvxAudioDevice::properties_active.outputchannelselection.value.selection() = bf;
CjvxAudioDevice::properties_active.numberoutputchannels.value = numOutChannelsMax;

CjvxAudioDevice::properties_active.samplerate.value = 48000;
CjvxAudioDevice::properties_active.buffersize.value = 1024;
Expand All @@ -135,6 +137,7 @@ CjvxAudioSyncClockDevice::activate()
assert(threads.cpPtr);
threads.cpPtr->initialize(this);
#endif

return JVX_NO_ERROR;
}
return res;
Expand Down Expand Up @@ -168,6 +171,28 @@ CjvxAudioSyncClockDevice::deactivate()

// ==========================================================================

jvxErrorType
CjvxAudioSyncClockDevice::set_property(jvxCallManagerProperties& callGate,
const jvx::propertyRawPointerType::IjvxRawPointerType& rawPtr,
const jvx::propertyAddress::IjvxPropertyAddress& ident,
const jvx::propertyDetail::CjvxTranferDetail& trans)
{
jvxBool report_update = false;

jvxErrorType res = CjvxAudioDevice::set_property(callGate, rawPtr, ident, trans);
if (res == JVX_NO_ERROR)
{
JVX_TRANSLATE_PROP_ADDRESS_IDX_CAT(ident, propId, category);

// Update the properties in the base class
updateDependentVariables_lock(propId, category, false);

}
return(res);
}

// ==========================================================================

jvxErrorType
CjvxAudioSyncClockDevice::test_chain_master(JVX_CONNECTION_FEEDBACK_TYPE(fdb))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ class CjvxAudioSyncClockDevice : public CjvxAudioDevice, public IjvxConfiguratio
callback_process_stop_in_lock clbk,
jvxHandle* priv_ptr)override;

// ===================================================================================

jvxErrorType set_property(jvxCallManagerProperties& callGate,
const jvx::propertyRawPointerType::IjvxRawPointerType& rawPtr,
const jvx::propertyAddress::IjvxPropertyAddress& ident,
const jvx::propertyDetail::CjvxTranferDetail& trans);

void updateDependentProperties();

// ===================================================================================

void core_buffer_run();

void timerCallback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ extern "C"
{
case JVX_COMPONENT_AUDIO_TECHNOLOGY:

#ifdef JVX_AUDIO_TECHNOLOGIES_PRE_DEFINE
JVX_AUDIO_TECHNOLOGIES_PRE_DEFINE
#endif

#ifdef JVX_USE_PORTAUDIO
if (id == cnt)
{
Expand Down Expand Up @@ -106,8 +102,12 @@ extern "C"
cnt++;
#endif

#ifdef JVX_ADDITIONAL_AUDIO_TECHNOLOGIES
JVX_ADDITIONAL_AUDIO_TECHNOLOGIES
#endif

#ifdef JVX_ADDITIONAL_TECHNOLOGIES
JVX_ADDITIONAL_TECHNOLOGIES
xyz
#endif

break;
Expand Down

0 comments on commit d36ee36

Please sign in to comment.