Reorder fx - Gui ?



  • Can anyone think of a way to achieve something like this in HISE , I am guessing it aint easy if at all possible.

    Switching.gif



  • This springs to mind.



  • @d-healey Ah, Indeed , so it might be possible 🙂



  • Definitely possible and actually not terribly complicated aside from the filter. You'll just need to have draggable panels underneath the effect slots and track when they intersect with each slot area. Also bear in mind that if you don't script your own filter in ScriptFX, the filter will always have to be the first in the chain.

    But with some good logic and event tracking you can achieve pretty much anything! 😉



  • @Lunacy-Audio indeed , so I could use setDraggingBounds to control the boundaries , any thougths on how I can track the movement ?
    Still a bit of a noob here but eager to learn 🙂

    Looking at the API , I can see some options to do this , having a look.



  • @Lunacy-Audio said in Reorder fx - Gui ?:

    Definitely possible and actually not terribly complicated aside from the filter. You'll just need to have draggable panels underneath the effect slots and track when they intersect with each slot area. Also bear in mind that if you don't script your own filter in ScriptFX, the filter will always have to be the first in the chain.

    But with some good logic and event tracking you can achieve pretty much anything! 😉

    Will I have problems with assigning control to the Script fx as it will be unloaded from a slot and moved to another ?
    I will have to deal with that for all fx just wondering if its different with the Script Fx ?



  • You actually don't need to track the movement. You only need to track when there is a mouseUp event. You'll need to use a panel for each draggable object and then assign a mouse callback. Whenever there is a mouseUp event, you'll need to check if the e.x and e.y intersect with the slot area.

    You can pass both objects into a function like this to check for intersection:

    inline function intersect(obj1, obj2) {
    	local rectAx1 = obj1.getGlobalPositionX();
    	local rectAy1 = obj1.getGlobalPositionY();
    	local rectAx2 = rectAx1 + obj1.getWidth();
    	local rectAy2 = rectAy1 + obj1.getHeight();
    
    	local rectBx1 = obj2.getGlobalPositionX();
    	local rectBy1 = obj2.getGlobalPositionY();
    	local rectBx2 = rectBx1 + obj2.getWidth();
    	local rectBy2 = rectBy1 + obj2.getHeight();
    
    	return rectAx1 < rectBx2 && rectAx2 > rectBx1 &&
    		rectAy1 < rectBy2 && rectAy2 > rectBy1;
    }
    

    If it does intersect, you just fill the effect slots with the new order of effects. If it doesn't intersect, you just set the draggable panel back to its original position.

    For Script FX, I'm actually not entirely sure as I haven't built something with it. Might take some tweaking but I'm sure it's doable 😀



  • @Lunacy-Audio thanks mate !


Log in to reply
 

5
Online

692
Users

2.8k
Topics

23.5k
Posts