示例#1
0
void MainWindow::onValueChanged()
{
    if(bridge) {
        bridge->deleteLater();
        QThread::yieldCurrentThread(); // Try and get any signals from the bridge sent sooner not later
        QCoreApplication::processEvents();
        bridge = NULL;
    }
    Settings::setLastMidiIn(ui->cmbMidiIn->currentText());
    Settings::setLastMidiOut(ui->cmbMidiOut->currentText());
    Settings::setLastSerialPort(ui->cmbSerial->currentText());
    if(!ui->chk_on->isChecked()
            || ( ui->cmbSerial->currentIndex() == 0
                    && ui->cmbMidiIn->currentIndex() == 0
                    && ui->cmbMidiOut->currentIndex() == 0 )) {
        return;
    }
    ui->lst_debug->clear();
    int midiIn =ui->cmbMidiIn->currentIndex()-1;
    int midiOut = ui->cmbMidiOut->currentIndex()-1;
    ui->lst_debug->addItem("Starting MIDI<->Serial Bridge...");
    bridge = new Bridge();
    connect(bridge, SIGNAL(debugMessage(QString)), SLOT(onDebugMessage(QString)));
    connect(bridge, SIGNAL(displayMessage(QString)), SLOT(onDisplayMessage(QString)));
    connect(bridge, SIGNAL(midiReceived()), ui->led_midiin, SLOT(blinkOn()));
    connect(bridge, SIGNAL(midiSent()), ui->led_midiout, SLOT(blinkOn()));
    connect(bridge, SIGNAL(serialTraffic()), ui->led_serial, SLOT(blinkOn()));
    bridge->attach(ui->cmbSerial->itemData(ui->cmbSerial->currentIndex()).toString(), Settings::getPortSettings(), midiIn, midiOut, workerThread);
}
示例#2
0
void drawReminder()
{	
	fb_setClipping(3,41,252, 150);
	
	fb_drawRect(0,37,255,148,textAreaFillColor);
	setFont(font_arial_9);
	setColor(textAreaTextColor);	
	setWrapToBorder();
	
	if(blinkOn())
	{
		if(isInsert())
			setCursorProperties(cursorNormalColor, 1, -1, 0);
		else
			setCursorProperties(cursorOverwriteColor, 1, -1, 0);
			
		showCursor();
		setCursorPos(getKBCursor());		
	}
	
	setFakeHighlight();
	
	fb_dispString(0,-3,reminder);
	
	setWrapNormal();
	hideCursor();
	clearHighlight();
	drawCurDay();
}