Hi there, I am struggling here with an issue that only seems to happen in Logic (Reaper, PT, Cubase and Nuendo work fine).
I created a custom XY pad in a component, where basically when the user clicks in the area, I write the X and Y position of the click to a slider using slider.setValue().
The pad works perfectly FINE in all DAWs, and automating through the DAWs also works perfectly fine, HOWEVER, when I am drawing the automation in the GUI, in logic, it completely ignores the automation.
This only happens if I automate through clicking on the pad… if I automate through logic (drawing the curves), everything works fine.
The way I am implemented the pad is as follows:
I use onMouseDown and onMouseDrag to set X and Y slider values through x_slider.setValue() and y_slider.setValue()
//if mouse is in the area
if (event.getPosition().getX() > 0
&& event.getPosition().getY() > 0
&& event.getPosition().getX() < getWidth()
&& event.getPosition().getY() < getHeight()
)
{
//get x and y positions
x_position = event.getPosition().getX();
y_position = event.getPosition().getY();
//set x slider value
if (x_slider.getValue() != x_position / (getWidth()/2)-1)
x_slider.setValue(x_position / (getWidth()/2)-1);
//set y slider value
if (y_slider.getValue() != (-y_position / (getHeight()/2)+1))
y_slider.setValue(-y_position / (getHeight()/2)+1);
//repaint pad
thumbPoint.setXY(x_position, y_position);
repaint();
Then, to reflect the changes done through automations, I have the onValueChanged method of the sliders repainting the pad.
//get x and y slider values and convert them to x and y locations
auto temp_x = (x_slider.getValue()+1)*(getWidth()/2);
auto temp_y = (1-y_slider.getValue())*(getHeight()/2);
//if positions are different from previous positions, proceed to update
if (thumbPoint.getX() != temp_x || thumbPoint.getY() != temp_y)
thumbPoint.setXY(temp_x, temp_y);
repaint();
Everything works perfectly fine, everywhere, but on Logic… any ideas?
Logic version is 10.7.