559 |
// ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl; |
// ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl; |
560 |
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " " << pChannel->midiChannel() << endl; |
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " " << pChannel->midiChannel() << endl; |
561 |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl; |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl; |
562 |
ts << "LOAD INSTRUMENT " << pChannel->instrumentFile() << " " << pChannel->instrumentNr() << " " << iChannelID << endl; |
ts << "LOAD INSTRUMENT NON_MODAL " << pChannel->instrumentFile() << " " << pChannel->instrumentNr() << " " << iChannelID << endl; |
563 |
ts << "SET CHANNEL VOLUME " << iChannelID << " " << pChannel->volume() << endl; |
ts << "SET CHANNEL VOLUME " << iChannelID << " " << pChannel->volume() << endl; |
564 |
ts << endl; |
ts << endl; |
565 |
// Try to keep it snappy :) |
// Try to keep it snappy :) |
1525 |
|
|
1526 |
|
|
1527 |
// The LSCP client callback procedure. |
// The LSCP client callback procedure. |
1528 |
lscp_status_t qsampler_client_callback ( lscp_client_t *pClient, const char *pchBuffer, int cchBuffer, void *pvData ) |
lscp_status_t qsampler_client_callback ( lscp_client_t */*pClient*/, lscp_event_t /*event*/, const char */*pchBuffer*/, int /*cchBuffer*/, void */*pvData*/ ) |
1529 |
{ |
{ |
1530 |
qsamplerMainForm *pMainForm = (qsamplerMainForm *) pvData; |
// FIXME: DO NOT EVER call any GUI code here, |
1531 |
if (pMainForm == NULL) |
// as this is run under some other thread context. |
1532 |
return LSCP_FAILED; |
// A custom event must be posted here... |
1533 |
|
// |
1534 |
char *pszBuffer = (char *) malloc(cchBuffer + 1); |
// QApplication::postEvent((qjackctlMainForm *) pvData, new QCustomEvent(...)); |
|
if (pszBuffer == NULL) |
|
|
return LSCP_FAILED; |
|
|
|
|
|
memcpy(pszBuffer, pchBuffer, cchBuffer); |
|
|
pszBuffer[cchBuffer] = (char) 0; |
|
|
pMainForm->appendMessagesColor(pszBuffer, "#996699"); |
|
|
free(pszBuffer); |
|
1535 |
|
|
1536 |
return LSCP_OK; |
return LSCP_OK; |
1537 |
} |
} |