Skip to content

Commit

Permalink
Bug fixes and update to td build 2018.27550
Browse files Browse the repository at this point in the history
  • Loading branch information
keithlostracco committed Feb 17, 2019
1 parent f7c2809 commit 78609f3
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 75 deletions.
Binary file removed project/Luminosity_0_8.80.toe
Binary file not shown.
Binary file modified project/Luminosity_0_8.toe
Binary file not shown.
147 changes: 76 additions & 71 deletions source/modules/PresetsExt.py
Expand Up @@ -24,93 +24,97 @@ class PresetsExt(object):
def __init__(self, ownerComp):
# The component to which this extension is attached
self.ownerComp = ownerComp
print('Intializing ext:', self.ownerComp)

self.callbacks = self.ownerComp.op('callbacks').module
self.ParNames = [r[0].val for r in self.ParsOP.rows()[1:]]
self.ParAttr = [c[0].val for c in self.ParsOP.cols()[1:]]
self.NumPars = len(self.ParNames)
self.PresetList = self.PresetControls.op('presetList')
self.BankList = self.PresetControls.op('bankList')
self.PresetRadio = self.Controls.op('presets/presetRadio')
self.filter = self.ownerComp.op('filter')
self.Preset = None
self.PresetIndex = None
self.LM = op.LM
self.DB = op.DATABASE
self.Node = me.fetch('NODE')
self.ControlOut = op.CONTROL_OUT

self.DefaultBankName = self.ownerComp.fetch('DefaultBankName', 'Preset Bank 1')
self.DefaultPresetName = self.ownerComp.fetch('DefaultPresetName', 'Default Preset')

if len(self.ownerComp.par.Selectbank.menuLabels) > 0:
self.BankName = self.ownerComp.par.Selectbank.menuLabels[int(self.ownerComp.par.Selectbank)]
else:
self.BankName = self.DefaultBankName
#print('Intializing ext:', self.ownerComp)
try:

self.callbacks = self.ownerComp.op('callbacks').module
self.ParNames = [r[0].val for r in self.ParsOP.rows()[1:]]
self.ParAttr = [c[0].val for c in self.ParsOP.cols()[1:]]
self.NumPars = len(self.ParNames)
self.PresetList = self.PresetControls.op('presetList')
self.BankList = self.PresetControls.op('bankList')
self.PresetRadio = self.Controls.op('presets/presetRadio')
self.filter = self.ownerComp.op('filter')
self.Preset = None
self.PresetIndex = None
self.LM = op.LM
self.DB = op.DATABASE
self.Node = me.fetch('NODE')
self.ControlOut = op.CONTROL_OUT

self.DefaultBankName = self.ownerComp.fetch('DefaultBankName', 'Preset Bank 1')
self.DefaultPresetName = self.ownerComp.fetch('DefaultPresetName', 'Default Preset')

if len(self.ownerComp.par.Selectbank.menuLabels) > 0:
self.BankName = self.ownerComp.par.Selectbank.menuLabels[int(self.ownerComp.par.Selectbank)]
else:
self.BankName = self.DefaultBankName

self.HasAnimation = self.Plugin.HasAnimation
self.HasAnimation = self.Plugin.HasAnimation

if self.HasAnimation:
self.AnimActive = self.Plugin.AnimActive
self.Animation = self.ownerComp.par.Animationcomp.eval()
self.SwitchCrossAnim = self.Animation.op('switchCross')
else:
self.AnimActive = False
if self.HasAnimation:
self.AnimActive = self.Plugin.AnimActive
self.Animation = self.ownerComp.par.Animationcomp.eval()
self.SwitchCrossAnim = self.Animation.op('switchCross')
else:
self.AnimActive = False

self.CompPresets = self.Plugin.fetch('CompPresets', {})
self.CompPresets = self.Plugin.fetch('CompPresets', {})

if self.BankName in self.CompPresets.keys():
if self.BankName in self.CompPresets.keys():

self.Presets = self.CompPresets[self.BankName]
self.StoreComp.store('CompPresets', self.CompPresets)
self.StoreComp.store('CurPresets', self.Presets)
self.Presets = self.CompPresets[self.BankName]
self.StoreComp.store('CompPresets', self.CompPresets)
self.StoreComp.store('CurPresets', self.Presets)

if 'PresetPars' in self.StoreComp.storage.keys():
self.PresetPars = self.StoreComp.fetch('PresetPars')
else:
self.PresetPars = [[parName, True, True] for parName in self.ParNames]
self.StoreComp.store('PresetPars', self.PresetPars)

if 'PresetPars' in self.StoreComp.storage.keys():
self.PresetPars = self.StoreComp.fetch('PresetPars')
else:
self.PresetPars = [[parName, True, True] for parName in self.ParNames]
self.StoreComp.store('PresetPars', self.PresetPars)

if len(self.Presets) == 0:
if len(self.Presets) == 0:

self.InitializeBank()
else:
#print('Init PresetExt')
self.GetBankNames(updateControls = False)
try:
self.GetPresetNames()
except:
pass
self.InitializeBank()
else:
#print('Init PresetExt')
self.GetBankNames(updateControls = False)
try:
self.GetPresetNames()
except:
pass



elif len(self.CompPresets.keys()) > 0:
self.SetBank(self.ownerComp.par.Selectbank.menuLabels[int(self.ownerComp.par.Selectbank)])
self.ownerComp.par.Selectbank = 0
elif len(self.CompPresets.keys()) > 0:
self.SetBank(self.ownerComp.par.Selectbank.menuLabels[int(self.ownerComp.par.Selectbank)])
self.ownerComp.par.Selectbank = 0

else:
self.Initialize()
else:
self.Initialize()

self.SetRecallMode()
self.SetMorph()
self.SetRecallMode()
self.SetMorph()

self.ownerComp.op('filter').cook(force = True)
self.ownerComp.op('filter').cook(force = True)

for r in runs:
if r.group == 'GetAllPresets':
r.kill()

#attr = self.StoreComp.fetch('CompAttr')['attr']
#pluginType = attr['type']
for r in runs:
if r.group == 'GetAllPresets':
r.kill()
#attr = self.StoreComp.fetch('CompAttr')['attr']
#pluginType = attr['type']

#if pluginType not in ['synth', 'audio', 'movie']:
#if pluginType not in ['synth', 'audio', 'movie']:

if not hasattr(self.Plugin, 'IsClip'):
if not hasattr(self.Plugin, 'IsClip'):

run("op.CUE_PLAYER.GetAllPresets()", delayFrames = 30, group = 'GetAllPresets')
run("op.CUE_PLAYER.GetAllPresets()", delayFrames = 30, group = 'GetAllPresets')

self.LastRecalled = {'bankName': copy.copy(self.BankName), 'presetIndex': copy.copy(self.PresetIndex)}
self.LastRecalled = {'bankName': copy.copy(self.BankName), 'presetIndex': copy.copy(self.PresetIndex)}

except:
pass

def InitializeBank(self):

Expand Down Expand Up @@ -190,6 +194,7 @@ def SavePresets(self):
self.StoreComp.store('CompPresets', self.CompPresets)
self.StoreComp.store('CurPresets', self.Presets)
self.SendPresets()
self.Controls.op("presets/presetRadio").par.Numpresets = len(self.PresetNames)

def RecallPreset(self, presetIndex, delayFrame = 0):
if presetIndex < len(self.Presets):
Expand Down Expand Up @@ -270,7 +275,7 @@ def Recall(self, delayFrame = 0, playAnim = True, remote = True):
if (self.Node == 'master' and self.DB.fetch('REMOTE_MODE') != 0 and self.PresetIndex != None
and self.ownerComp.path != '/Luminosity/database/cuePlayer/cueList/plugin/presets'
and remote):
print(self.ownerComp)
#print(self.ownerComp)
op.LM.SendData().SendRecallPreset(self.PresetIndex, self.ownerComp.path)


Expand Down
4 changes: 2 additions & 2 deletions source/modules/dataHandler.py
Expand Up @@ -81,7 +81,7 @@ def SendTableRow(self, dat, cells, prev):

def SendStorageKey(self, value, name, path):

print('SendStorageKey', name, path)
#print('SendStorageKey', name, path)

extOP = me.fetch('ROOTPATH')
className = 'SetData'
Expand Down Expand Up @@ -200,7 +200,7 @@ def SetAnimChannels(self, channels, path):
animCOMP.op('channels').text = mod.tableFunc.SetToType(channels)[0]

def SetRecallPreset(self, data, path):
print(data, path)
#print(data, path)
presets = op(path)
#presets.Preset = data
presets.RecallPreset(data)
Expand Down
3 changes: 2 additions & 1 deletion source/modules/extSetUI.py
Expand Up @@ -508,9 +508,10 @@ def FieldSet(self, path, value):
def DroplistSet(self, path, value):

parent = op(path)

value = int(value)
itemTable = parent.op('selectItems')
if value < itemTable.numRows:
#print(itemTable, value, itemTable.numRows)
item = itemTable[value, 0].val
else:
item = itemTable[0, 0].val
Expand Down
2 changes: 1 addition & 1 deletion source/modules/lm.py
Expand Up @@ -124,7 +124,7 @@ def ExtTimecodeToFrames(self, timecode, rate):
secs = int(timecode[2])
frames = int(timecode[3])

print(hours, mins, secs, frames)
#print(hours, mins, secs, frames)
seconds = hours * 60 * 60 + mins * 60 + secs + frames / rate

frame = int(seconds * rate)
Expand Down

0 comments on commit 78609f3

Please sign in to comment.