MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / MouseMoved

Method MouseMoved

Source/MidiController.cpp:1431–1468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1429}
1430
1431bool MidiController::MouseMoved(float x, float y)
1432{
1433 IDrawableModule::MouseMoved(x, y);
1434
1435 mHoveredLayoutElement = -1;
1436
1437 if (mMappingDisplayMode == kLayout)
1438 {
1439 for (int i = 0; i < NUM_LAYOUT_CONTROLS; ++i)
1440 {
1441 ControlLayoutElement& control = mLayoutControls[i];
1442 if (control.mActive)
1443 {
1444 ofRectangle controlRect(control.mPosition.x, control.mPosition.y, control.mDimensions.x, control.mDimensions.y);
1445 if (controlRect.contains(x, y))
1446 {
1447 mHoveredLayoutElement = i;
1448 control.mControlCable->SetPatchCableDrawMode(kPatchCableDrawMode_Normal);
1449 }
1450 else
1451 {
1452 control.mControlCable->SetPatchCableDrawMode(kPatchCableDrawMode_SourceOnHoverOnly);
1453 }
1454 }
1455 }
1456
1457 int i = 0;
1458 for (auto* grid : mGrids)
1459 {
1460 ofRectangle controlRect(grid->mPosition.x - 5, grid->mPosition.y - 5, 10, 10);
1461 if (controlRect.contains(x, y))
1462 mHoveredLayoutElement = i + kHoveredLayoutElement_GridOffset;
1463 ++i;
1464 }
1465 }
1466
1467 return false;
1468}
1469
1470bool MidiController::IsInputConnected(bool immediate)
1471{

Callers

nothing calls this directly

Calls 2

containsMethod · 0.80
SetPatchCableDrawModeMethod · 0.80

Tested by

no test coverage detected