void MidiController::sendSettings(){ sendCc(PATCH_PARAMETER_A, (uint8_t)(patches.getCurrentPatchProcessor()->getParameterValue(PARAMETER_A)*127.0) & 0x7f); sendCc(PATCH_PARAMETER_B, (uint8_t)(patches.getCurrentPatchProcessor()->getParameterValue(PARAMETER_B)*127.0) & 0x7f); sendCc(PATCH_PARAMETER_C, (uint8_t)(patches.getCurrentPatchProcessor()->getParameterValue(PARAMETER_C)*127.0) & 0x7f); sendCc(PATCH_PARAMETER_D, (uint8_t)(patches.getCurrentPatchProcessor()->getParameterValue(PARAMETER_D)*127.0) & 0x7f); sendCc(PATCH_PARAMETER_E, (uint8_t)(patches.getCurrentPatchProcessor()->getParameterValue(PARAMETER_E)*127.0) & 0x7f); sendCc(PATCH_BUTTON, isPushButtonPressed() ? 127 : 0); sendCc(LED, getLed() == NONE ? 0 : getLed() == GREEN ? 42 : 84); sendCc(PATCH_MODE, settings.patch_mode << 5); sendCc(PATCH_SLOT_GREEN, settings.patch_green); sendCc(PATCH_SLOT_RED, settings.patch_red); sendCc(ACTIVE_SLOT, patches.getActiveSlot() == GREEN ? 0 : 127); sendCc(LEFT_INPUT_GAIN, codec.getInputGainLeft()<<2); sendCc(RIGHT_INPUT_GAIN, codec.getInputGainRight()<<2); sendCc(LEFT_OUTPUT_GAIN, codec.getOutputGainLeft()); sendCc(RIGHT_OUTPUT_GAIN, codec.getOutputGainRight()); sendCc(LEFT_INPUT_MUTE, codec.getInputMuteLeft() ? 127 : 0); sendCc(RIGHT_INPUT_MUTE, codec.getInputMuteRight() ? 127 : 0); sendCc(LEFT_OUTPUT_MUTE, codec.getOutputMuteLeft() ? 127 : 0); sendCc(RIGHT_OUTPUT_MUTE, codec.getOutputMuteRight() ? 127 : 0); sendCc(BYPASS, codec.getBypass() ? 127 : 0); sendCc(SAMPLING_RATE, (codec.getSamplingRate() >> 10) + 20); sendCc(SAMPLING_BITS, (codec.getFormat() << 4) + 20); sendCc(CODEC_MASTER, codec.isMaster() ? 127 : 0); sendCc(CODEC_PROTOCOL, codec.getProtocol() == I2S_PROTOCOL_PHILIPS ? 0 : 127); sendCc(SAMPLING_SIZE, settings.audio_blocksize>>4); sendCc(LEFT_RIGHT_SWAP, codec.getSwapLeftRight()); }
// Toggle the Petduino LED void PetduinoSerial::toggleLed() { // Toggle the led Petduino::toggleLed(); // Send event cmdMessenger.sendCmd(LED_EVENT, getLed()); }
QJsonObject BigButtons::toJson() { QJsonObject obj; obj.insert("name", name); obj.insert("col",col.name()); obj.insert("patternName",patternName); obj.insert("led",getLed()); return obj; }
// Set the value of the Petduino LED void PetduinoSerial::setLed(bool value) { // Set the led Petduino::setLed(value); // Send event cmdMessenger.sendCmd(LED_EVENT, getLed()); }
void LedMatrixMAX7219Driver::shiftLed(unsigned char col, unsigned char row, unsigned char direction) { unsigned char led; if (!isOutOfBounds(col, row)) { led = getLed(col, row); setLed(col, row, (led ? LedMatrixDriver::OFF : LedMatrixDriver::ON)); if (direction == LEFT) { col--; } else if (direction == RIGHT) { col++; } else if (direction == UP) { row++; } else { row--; } setLed((col % cols), (row % rows), ( led ? LedMatrixDriver::ON : LedMatrixDriver::OFF)); } }
void updateLed(){ setLed((LedPin)patches.getActiveSlot()); midi.sendCc(LED, getLed() == GREEN ? 42 : 84); }
void LedMatrixMAX7219Driver::switchLeds(unsigned char colFrom, unsigned char rowFrom, unsigned char colTo, unsigned char rowTo) { unsigned char led = getLed(colFrom, rowFrom); setLed(colFrom, rowFrom, getLed(colTo, rowTo)); setLed(colTo, rowTo, led); }
// Get led command handler void PetduinoSerial::onGetLed() { // Send status that describes the led state manually cmdMessenger.sendCmd(LED_EVENT, getLed()); }
bool plugin::isLedValue ( const QString& channel, int lower, int upper ) { const int v = getLed ( channel ); if ( v>upper ) return false; if ( v<lower ) return false; return true; }