This commit is contained in:
SatyrDiamond 2023-07-10 21:01:50 -04:00
parent b04e59499c
commit 4b5dcff878
3 changed files with 21 additions and 26 deletions

View file

@ -138,6 +138,7 @@ if 'cakewalk' in dawlist:
vst_isSynth = winreg.QueryValueEx(registry_key, 'isSynth')[0]
vst_numInputs = winreg.QueryValueEx(registry_key, 'numInputs')[0]
vst_numOutputs = winreg.QueryValueEx(registry_key, 'numOutputs')[0]
vst_numParams = winreg.QueryValueEx(registry_key, 'numParams')[0]
if vst_is_v2 == 1:
db_plugins.execute("INSERT OR IGNORE INTO vst2 (id) VALUES (?)", (vst_uniqueId,))
@ -149,6 +150,7 @@ if 'cakewalk' in dawlist:
if vst_Vendor != None: db_plugins.execute("UPDATE vst2 SET creator = ? WHERE id = ?", (vst_Vendor, vst_uniqueId,))
db_plugins.execute("UPDATE vst2 SET audio_num_inputs = ? WHERE id = ?", (vst_numInputs, vst_uniqueId,))
db_plugins.execute("UPDATE vst2 SET audio_num_outputs = ? WHERE id = ?", (vst_numOutputs, vst_uniqueId,))
db_plugins.execute("UPDATE vst2 SET num_params = ? WHERE id = ?", (vst_numParams, vst_uniqueId,))
if vst_is_v3 == 1:
vst_clsidPlug = uuid.UUID(winreg.QueryValueEx(registry_key, 'clsidPlug')[0]).hex.upper()
@ -161,6 +163,7 @@ if 'cakewalk' in dawlist:
if vst_Vendor != None: db_plugins.execute("UPDATE vst3 SET creator = ? WHERE id = ?", (vst_Vendor, vst_clsidPlug,))
db_plugins.execute("UPDATE vst3 SET audio_num_inputs = ? WHERE id = ?", (vst_numInputs, vst_clsidPlug,))
db_plugins.execute("UPDATE vst3 SET audio_num_outputs = ? WHERE id = ?", (vst_numOutputs, vst_clsidPlug,))
db_plugins.execute("UPDATE vst3 SET num_params = ? WHERE id = ?", (vst_numParams, vst_clsidPlug,))
# ------------------------------------- CakeWalk -------------------------------------
if 'flstudio' in dawlist:

View file

@ -44,11 +44,12 @@ def add_plug_fxdata(cvpj_l, pluginid, i_enabled, i_wet):
if i_wet != None: data_values.nested_dict_add_value(cvpj_l, ['plugins', pluginid, 'wet'], i_wet)
def get_plug_fxdata(cvpj_l, pluginid):
outdata = {}
enabled = data_values.nested_dict_get_value(cvpj_l, ['plugins', pluginid, 'enabled'])
wet = data_values.nested_dict_get_value(cvpj_l, ['plugins', pluginid, 'wet'])
if enabled == None: enabled = True
if wet == None: wet = 1
return enabled, wet
if enabled != None: outdata['enabled'] = enabled
if wet != None: outdata['wet'] = wet
return outdata
def add_plug_fxvisual(cvpj_l, pluginid, v_name, v_color):
if v_name != None: data_values.nested_dict_add_value(cvpj_l, ['plugins', pluginid, 'name'], v_name)

View file

@ -187,7 +187,7 @@ def asdrlfo(pluginid, xmlobj, asdrtype, xmltype):
elmodX.set('lspd', str(lfospeed))
elmodX.set('lshp', str(lfoshape[l_shape]))
def get_plugin_param(pluginautoid, xmltag, xmlname, pluginid, paramname, fallback):
def get_plugin_param(pluginautoid, xmltag, xmlname, pluginid, paramname, fallback, **kwargs):
pluginparam = plugins.get_plug_param(cvpj_l, pluginid, paramname, fallback)
aid_id, aid_data = tracks.autoid_out_get(['plugin', pluginid, paramname])
@ -205,10 +205,12 @@ def get_plugin_param(pluginautoid, xmltag, xmlname, pluginid, paramname, fallbac
autovarX.set('value', str(outparam))
autovarX.set('scale_type', 'linear')
autovarX.set('id', str(aid_id))
return autovarX
else:
xmltag.set(xmlname, str(outparam))
def lmms_encode_plugin(xmltag, trkJ, trackid, trackname, trkX_insttr):
instJ = trkJ['instdata']
xml_instrumentpreplugin = ET.SubElement(xmltag, "instrument")
@ -699,9 +701,10 @@ def lmms_encode_effectplugin(pluginid, fxslotX):
ladspa_file = data_values.get_value(cvpj_plugindata, 'path', '')
if ladspa_file != None:
if ladspa_file != '':
ladspa_plugin = data_values.get_value(cvpj_plugindata, 'plugin', '')
ladspa_sep_chan = notemod_conv= data_values.get_value(cvpj_plugindata, 'seperated_channels', False)
ladspa_sep_chan = data_values.get_value(cvpj_plugindata, 'seperated_channels', False)
ladspa_numparams = data_values.get_value(cvpj_plugindata, 'numparams', '1')
xml_ladspa = ET.SubElement(fxslotX, 'ladspacontrols')
xml_ladspa_key = ET.SubElement(fxslotX, 'key')
@ -719,25 +722,13 @@ def lmms_encode_effectplugin(pluginid, fxslotX):
paramchan = '0'
if len(paramspl) == 2: paramchan = paramspl[1]
print(paramnum, paramchan)
#if ladspa_sep_chan == False:
# xml_ladspa.set('link', '1')
# for param in cvpj_params:
# xml_param = ET.SubElement(xml_ladspa, 'port0'+param)
# add_auto_placements(cvpj_params[param], None, pluginautoid, 'ladspa_param_0_'+param, param, 'ladspa_param_0_'+param, xml_param, 'data', 'LADSPA', '#'+param)
# xml_param.set('link', '1')
# xml_param = ET.SubElement(xml_ladspa, 'port1'+param)
# add_auto_placements(cvpj_params[param], None, pluginautoid, 'ladspa_param_1_'+param, param, 'ladspa_param_1_'+param, xml_param, 'data', 'LADSPA', '#'+param)
#else:
# xml_ladspa.set('link', '0')
# for param in cvpj_params['0']:
# xml_param = ET.SubElement(xml_ladspa, 'port0'+param)
# add_auto_placements(cvpj_params['0'][param], None, pluginautoid, 'ladspa_param_0_'+param, param, 'ladspa_param_0_'+param, xml_param, 'data', 'LADSPA', 'L #'+param)
# xml_param.set('link', '0')
# for param in cvpj_params['1']:
# xml_param = ET.SubElement(xml_ladspa, 'port1'+param)
# add_auto_placements(cvpj_params['1'][param], None, pluginautoid, 'ladspa_param_1_'+param, param, 'ladspa_param_1_'+param, xml_param, 'data', 'LADSPA', 'R #'+param)
if ladspa_sep_chan == False: xml_ladspa.set('link', '1')
else: xml_ladspa.set('link', '0')
for param in range(ladspa_numparams):
paramxml = get_plugin_param(pluginautoid, xml_ladspa, 'port0'+str(param), pluginid, 'ladspa_param_'+str(param), 0)
get_plugin_param(pluginautoid, xml_ladspa, 'port1'+str(param), pluginid, 'ladspa_param_'+str(param)+'_1', 0)
else:
fxslotX.set('name', 'stereomatrix')
xml_lmmsnat = ET.SubElement(fxslotX, 'stereomatrixcontrols')
@ -751,8 +742,8 @@ def lmms_encode_effectslot(pluginid, fxcX):
fxslotX = ET.SubElement(fxcX, "effect")
pluginautoid = tracks.autoid_out_getlist(['slot', pluginid])
fxdata = plugins.get_plug_fxdata(cvpj_l, pluginid)
add_auto_placements(1, None, ['slot', pluginid], 'enabled', fxdata, 'enabled', fxslotX, 'on', 'Slot', 'On')
add_auto_placements(1, None, ['slot', pluginid], 'wet', fxdata, 'wet', fxslotX, 'wet', 'Slot', 'Wet')