Re: Render a View to a Bitmap - Some questions
Posted: Thu Jan 28, 2016 6:03 pm
tulamide wrote:If you want to first evaluate "stereo" before "samples", program it that way. Wait until both triggers happened, then execute your branch of code that deals with mono or stereo, depending on the stereo tigger.Code: Select all
def event i, v
if i == "samples"
@triggers = @triggers | 1
elsif i == "stereo"
@triggers = @triggers | 2
end
if @triggers & 3 == 3
#now both triggers happened, both data are available
#...do whatever code
@triggers = 0
end
That's "so" dangerous. Let say you have 3 triggers that happens at the same time (1 from data on connectors stored in the schematic, 1 from Preset Manager and 1 from AfterLoad) that sends respectively "samples" and "stereo":
loading 1: 2000 samples, stereo 2
loading 2: 3000 samples, stereo 1
loading 3: 5000 samples, stereo 2
If two "samples" trigger are invoked before any "stereo trigger", there's a problem (since there is no order/stack, that could happens).
Or also if combination of triggers happens, such as it got "sample 2000" from loading 1 and "stereo 1" from loading 2.
Of course I need to rely on how code is executed. Or at least, know how it is executed, so I need to prevent/block previous triggers before send them to Ruby (in this case).
I don't think FlowStone works with thread (else, lots of stuff will crash). I guess it works in a fixed/sequence way (as for many audio application environment). In few words, I think that once a trigger start, it go to the end, whitout any other threads during its ride. But I'm not sure of course, that's why I also ask this kind of stuff