| 138 | } |
| 139 | |
| 140 | void ModulatableSlider::mouseDown(const juce::MouseEvent& event) |
| 141 | { |
| 142 | if (onClickInAssignMode) |
| 143 | { |
| 144 | onClickInAssignMode(parameterID); |
| 145 | return; |
| 146 | } |
| 147 | // Check for Cmd+Click (macOS) or Ctrl+Click (Windows) on the handle |
| 148 | if (isModulated && (event.mods.isCommandDown() || event.mods.isCtrlDown()) && getModulationHandleBounds().contains(event.getPosition().toFloat())) |
| 149 | { |
| 150 | // If the modifier is pressed on the handle, toggle the bipolar mode |
| 151 | if (onBipolarModeToggled) |
| 152 | { |
| 153 | onBipolarModeToggled(); |
| 154 | } |
| 155 | // We don't start a drag in this case |
| 156 | } |
| 157 | else if (isMouseOverMainSlider()) |
| 158 | { |
| 159 | isDraggingMainSlider = true; |
| 160 | |
| 161 | if (onMainDragStart) |
| 162 | onMainDragStart(this); |
| 163 | |
| 164 | // CRITICAL: Only call the base class mouseDown if we intend to start a drag on the main slider |
| 165 | juce::Slider::mouseDown(event); |
| 166 | } |
| 167 | // Check if the click is on the modulation handle |
| 168 | else if (isModulated && getModulationHandleBounds().contains(event.getPosition().toFloat())) |
| 169 | { |
| 170 | isModHandleMouseDown = true; |
| 171 | initialLfoAmount = lfoAmount; |
| 172 | |
| 173 | if (onModDragStart) |
| 174 | onModDragStart(this); |
| 175 | |
| 176 | repaint(); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | void ModulatableSlider::mouseDrag(const juce::MouseEvent& event) |
| 181 | { |
nothing calls this directly
no outgoing calls
no test coverage detected