| 1534 | } |
| 1535 | |
| 1536 | void MidiController::ResyncControllerState() |
| 1537 | { |
| 1538 | if (mControllerPage >= 0 && mControllerPage < mListeners.size()) |
| 1539 | { |
| 1540 | for (auto i = mListeners[mControllerPage].begin(); i != mListeners[mControllerPage].end(); ++i) |
| 1541 | (*i)->ControllerPageSelected(); |
| 1542 | } |
| 1543 | for (int i = 0; i < NUM_LAYOUT_CONTROLS; ++i) |
| 1544 | { |
| 1545 | if (mLayoutControls[i].mActive) |
| 1546 | { |
| 1547 | UIControlConnection* connection = GetConnectionForControl(mLayoutControls[i].mType, mLayoutControls[i].mControl); |
| 1548 | if (connection && mLayoutControls[i].mControlCable) |
| 1549 | { |
| 1550 | mLayoutControls[i].mControlCable->SetTarget(connection->mUIControl); |
| 1551 | |
| 1552 | if (connection->mUIControl != nullptr) |
| 1553 | { |
| 1554 | if (mShouldSendControllerInfoStrings) |
| 1555 | { |
| 1556 | SendControllerInfoString(mLayoutControls[i].mControl, 0, connection->mUIControl->Path()); |
| 1557 | if (connection->mType == kControlType_SetValue || |
| 1558 | connection->mType == kControlType_SetValueOnRelease) |
| 1559 | { |
| 1560 | SendControllerInfoString(mLayoutControls[i].mControl, 1, connection->mUIControl->GetDisplayValue(connection->mValue)); |
| 1561 | } |
| 1562 | } |
| 1563 | } |
| 1564 | } |
| 1565 | } |
| 1566 | } |
| 1567 | for (auto* grid : mGrids) |
| 1568 | { |
| 1569 | if (grid->mGridControlTarget[mControllerPage] != nullptr) |
| 1570 | { |
| 1571 | //reset target |
| 1572 | GridControlTarget* target = grid->mGridControlTarget[mControllerPage]; |
| 1573 | grid->mGridCable->ClearPatchCables(); |
| 1574 | grid->mGridCable->SetTarget(target); |
| 1575 | } |
| 1576 | else |
| 1577 | { |
| 1578 | grid->mGridCable->ClearPatchCables(); |
| 1579 | } |
| 1580 | } |
| 1581 | HighlightPageControls(mControllerPage); |
| 1582 | |
| 1583 | for (auto i = mConnections.begin(); i != mConnections.end(); ++i) |
| 1584 | { |
| 1585 | (*i)->mLastControlValue = -1; |
| 1586 | } |
| 1587 | } |
| 1588 | |
| 1589 | void MidiController::SendNote(int page, int pitch, int velocity, bool forceNoteOn /*= false*/, int channel /*= -1*/) |
| 1590 | { |
nothing calls this directly
no test coverage detected