2 |
// |
// |
3 |
// ui.h extension file, included from the uic-generated form implementation. |
// ui.h extension file, included from the uic-generated form implementation. |
4 |
/**************************************************************************** |
/**************************************************************************** |
5 |
Copyright (C) 2004, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2005, rncbc aka Rui Nuno Capela. All rights reserved. |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
44 |
|
|
45 |
#include "config.h" |
#include "config.h" |
46 |
|
|
47 |
|
#ifdef HAVE_SIGNAL_H |
48 |
|
#include <signal.h> |
49 |
|
#endif |
50 |
|
|
51 |
// Timer constant stuff. |
// Timer constant stuff. |
52 |
#define QSAMPLER_TIMER_MSECS 200 |
#define QSAMPLER_TIMER_MSECS 200 |
119 |
|
|
120 |
m_iTimerSlot = 0; |
m_iTimerSlot = 0; |
121 |
|
|
122 |
|
#ifdef HAVE_SIGNAL_H |
123 |
|
// Set to ignore any fatal "Broken pipe" signals. |
124 |
|
::signal(SIGPIPE, SIG_IGN); |
125 |
|
#endif |
126 |
|
|
127 |
// Make it an MDI workspace. |
// Make it an MDI workspace. |
128 |
m_pWorkspace = new QWorkspace(this); |
m_pWorkspace = new QWorkspace(this); |
129 |
m_pWorkspace->setScrollBarsEnabled(true); |
m_pWorkspace->setScrollBarsEnabled(true); |
556 |
if (piChannelIDs == NULL) { |
if (piChannelIDs == NULL) { |
557 |
appendMessagesClient("lscp_list_channels"); |
appendMessagesClient("lscp_list_channels"); |
558 |
appendMessagesError(tr("Could not get current list of channels.\n\nSorry.")); |
appendMessagesError(tr("Could not get current list of channels.\n\nSorry.")); |
559 |
} |
} else { |
560 |
|
// Try to (re)create each channel. |
561 |
// Try to (re)create each channel. |
m_pWorkspace->setUpdatesEnabled(false); |
562 |
m_pWorkspace->setUpdatesEnabled(false); |
for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) { |
563 |
for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) { |
createChannelStrip(new qsamplerChannel(this, piChannelIDs[iChannel])); |
564 |
createChannelStrip(new qsamplerChannel(this, piChannelIDs[iChannel])); |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
565 |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
} |
566 |
} |
m_pWorkspace->setUpdatesEnabled(true); |
567 |
m_pWorkspace->setUpdatesEnabled(true); |
} |
568 |
|
|
569 |
// Save as default session directory. |
// Save as default session directory. |
570 |
if (m_pOptions) |
if (m_pOptions) |
622 |
ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl; |
ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl; |
623 |
ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl; |
ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl; |
624 |
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " "; |
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " "; |
625 |
if (pChannel->midiChannel() > 0) |
if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL) |
|
ts << pChannel->midiChannel(); |
|
|
else |
|
626 |
ts << "ALL"; |
ts << "ALL"; |
627 |
|
else |
628 |
|
ts << pChannel->midiChannel(); |
629 |
ts << endl; |
ts << endl; |
630 |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl; |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl; |
631 |
ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannelID << endl; |
ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannelID << endl; |