1 |
// qsamplerMainForm.cpp |
// qsamplerMainForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2013, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007, 2008 Christian Schoenebeck |
Copyright (C) 2007, 2008 Christian Schoenebeck |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
35 |
#include "qsamplerOptionsForm.h" |
#include "qsamplerOptionsForm.h" |
36 |
#include "qsamplerDeviceStatusForm.h" |
#include "qsamplerDeviceStatusForm.h" |
37 |
|
|
38 |
|
#include <QMdiArea> |
39 |
|
#include <QMdiSubWindow> |
40 |
|
|
41 |
#include <QApplication> |
#include <QApplication> |
|
#include <QWorkspace> |
|
42 |
#include <QProcess> |
#include <QProcess> |
43 |
#include <QMessageBox> |
#include <QMessageBox> |
44 |
|
|
58 |
#include <QTimer> |
#include <QTimer> |
59 |
#include <QDateTime> |
#include <QDateTime> |
60 |
|
|
61 |
|
#if QT_VERSION >= 0x050000 |
62 |
|
#include <QMimeData> |
63 |
|
#endif |
64 |
|
|
65 |
|
#if QT_VERSION < 0x040500 |
66 |
|
namespace Qt { |
67 |
|
const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000); |
68 |
|
} |
69 |
|
#endif |
70 |
|
|
71 |
#ifdef HAVE_SIGNAL_H |
#ifdef HAVE_SIGNAL_H |
72 |
#include <signal.h> |
#include <signal.h> |
96 |
#endif |
#endif |
97 |
|
|
98 |
|
|
99 |
|
//------------------------------------------------------------------------- |
100 |
|
// LADISH Level 1 support stuff. |
101 |
|
|
102 |
|
#if defined(HAVE_SIGNAL_H) && defined(HAVE_SYS_SOCKET_H) |
103 |
|
|
104 |
|
#include <QSocketNotifier> |
105 |
|
|
106 |
|
#include <sys/types.h> |
107 |
|
#include <sys/socket.h> |
108 |
|
|
109 |
|
#include <signal.h> |
110 |
|
|
111 |
|
// File descriptor for SIGUSR1 notifier. |
112 |
|
static int g_fdUsr1[2]; |
113 |
|
|
114 |
|
// Unix SIGUSR1 signal handler. |
115 |
|
static void qsampler_sigusr1_handler ( int /* signo */ ) |
116 |
|
{ |
117 |
|
char c = 1; |
118 |
|
|
119 |
|
(::write(g_fdUsr1[0], &c, sizeof(c)) > 0); |
120 |
|
} |
121 |
|
|
122 |
|
#endif // HAVE_SIGNAL_H |
123 |
|
|
124 |
|
|
125 |
|
//------------------------------------------------------------------------- |
126 |
|
// qsampler -- namespace |
127 |
|
|
128 |
|
|
129 |
namespace QSampler { |
namespace QSampler { |
130 |
|
|
131 |
// Timer constant stuff. |
// Timer constant stuff. |
138 |
#define QSAMPLER_STATUS_SESSION 3 // Current session modification state. |
#define QSAMPLER_STATUS_SESSION 3 // Current session modification state. |
139 |
|
|
140 |
|
|
141 |
|
// Specialties for thread-callback comunication. |
142 |
|
#define QSAMPLER_LSCP_EVENT QEvent::Type(QEvent::User + 1) |
143 |
|
|
144 |
|
|
145 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
146 |
// CustomEvent -- specialty for callback comunication. |
// LscpEvent -- specialty for LSCP callback comunication. |
147 |
|
|
|
#define QSAMPLER_CUSTOM_EVENT QEvent::Type(QEvent::User + 0) |
|
148 |
|
|
149 |
class CustomEvent : public QEvent |
class LscpEvent : public QEvent |
150 |
{ |
{ |
151 |
public: |
public: |
152 |
|
|
153 |
// Constructor. |
// Constructor. |
154 |
CustomEvent(lscp_event_t event, const char *pchData, int cchData) |
LscpEvent(lscp_event_t event, const char *pchData, int cchData) |
155 |
: QEvent(QSAMPLER_CUSTOM_EVENT) |
: QEvent(QSAMPLER_LSCP_EVENT) |
156 |
{ |
{ |
157 |
m_event = event; |
m_event = event; |
158 |
m_data = QString::fromUtf8(pchData, cchData); |
m_data = QString::fromUtf8(pchData, cchData); |
205 |
|
|
206 |
m_iTimerSlot = 0; |
m_iTimerSlot = 0; |
207 |
|
|
208 |
#ifdef HAVE_SIGNAL_H |
#if defined(HAVE_SIGNAL_H) && defined(HAVE_SYS_SOCKET_H) |
209 |
|
|
210 |
// Set to ignore any fatal "Broken pipe" signals. |
// Set to ignore any fatal "Broken pipe" signals. |
211 |
::signal(SIGPIPE, SIG_IGN); |
::signal(SIGPIPE, SIG_IGN); |
212 |
#endif |
|
213 |
|
// LADISH Level 1 suport. |
214 |
|
|
215 |
|
// Initialize file descriptors for SIGUSR1 socket notifier. |
216 |
|
::socketpair(AF_UNIX, SOCK_STREAM, 0, g_fdUsr1); |
217 |
|
m_pUsr1Notifier |
218 |
|
= new QSocketNotifier(g_fdUsr1[1], QSocketNotifier::Read, this); |
219 |
|
|
220 |
|
QObject::connect(m_pUsr1Notifier, |
221 |
|
SIGNAL(activated(int)), |
222 |
|
SLOT(handle_sigusr1())); |
223 |
|
|
224 |
|
// Install SIGUSR1 signal handler. |
225 |
|
struct sigaction usr1; |
226 |
|
usr1.sa_handler = qsampler_sigusr1_handler; |
227 |
|
sigemptyset(&usr1.sa_mask); |
228 |
|
usr1.sa_flags = 0; |
229 |
|
usr1.sa_flags |= SA_RESTART; |
230 |
|
::sigaction(SIGUSR1, &usr1, NULL); |
231 |
|
|
232 |
|
#else // HAVE_SIGNAL_H |
233 |
|
|
234 |
|
m_pUsr1Notifier = NULL; |
235 |
|
|
236 |
|
#endif // !HAVE_SIGNAL_H |
237 |
|
|
238 |
#ifdef CONFIG_VOLUME |
#ifdef CONFIG_VOLUME |
239 |
// Make some extras into the toolbar... |
// Make some extras into the toolbar... |
272 |
#endif |
#endif |
273 |
|
|
274 |
// Make it an MDI workspace. |
// Make it an MDI workspace. |
275 |
m_pWorkspace = new QWorkspace(this); |
m_pWorkspace = new QMdiArea(this); |
276 |
m_pWorkspace->setScrollBarsEnabled(true); |
m_pWorkspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
277 |
|
m_pWorkspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
278 |
// Set the activation connection. |
// Set the activation connection. |
279 |
QObject::connect(m_pWorkspace, |
QObject::connect(m_pWorkspace, |
280 |
SIGNAL(windowActivated(QWidget *)), |
SIGNAL(subWindowActivated(QMdiSubWindow *)), |
281 |
SLOT(activateStrip(QWidget *))); |
SLOT(activateStrip(QMdiSubWindow *))); |
282 |
// Make it shine :-) |
// Make it shine :-) |
283 |
setCentralWidget(m_pWorkspace); |
setCentralWidget(m_pWorkspace); |
284 |
|
|
407 |
WSACleanup(); |
WSACleanup(); |
408 |
#endif |
#endif |
409 |
|
|
410 |
|
#if defined(HAVE_SIGNAL_H) && defined(HAVE_SYS_SOCKET_H) |
411 |
|
if (m_pUsr1Notifier) |
412 |
|
delete m_pUsr1Notifier; |
413 |
|
#endif |
414 |
|
|
415 |
// Finally drop any widgets around... |
// Finally drop any widgets around... |
416 |
if (m_pDeviceForm) |
if (m_pDeviceForm) |
417 |
delete m_pDeviceForm; |
delete m_pDeviceForm; |
450 |
|
|
451 |
// What style do we create these forms? |
// What style do we create these forms? |
452 |
Qt::WindowFlags wflags = Qt::Window |
Qt::WindowFlags wflags = Qt::Window |
|
#if QT_VERSION >= 0x040200 |
|
453 |
| Qt::CustomizeWindowHint |
| Qt::CustomizeWindowHint |
|
#endif |
|
454 |
| Qt::WindowTitleHint |
| Qt::WindowTitleHint |
455 |
| Qt::WindowSystemMenuHint |
| Qt::WindowSystemMenuHint |
456 |
| Qt::WindowMinMaxButtonsHint; |
| Qt::WindowMinMaxButtonsHint |
457 |
|
| Qt::WindowCloseButtonHint; |
458 |
if (m_pOptions->bKeepOnTop) |
if (m_pOptions->bKeepOnTop) |
459 |
wflags |= Qt::Tool; |
wflags |= Qt::Tool; |
460 |
|
|
461 |
// Some child forms are to be created right now. |
// Some child forms are to be created right now. |
462 |
m_pMessages = new Messages(this); |
m_pMessages = new Messages(this); |
463 |
m_pDeviceForm = new DeviceForm(this, wflags); |
m_pDeviceForm = new DeviceForm(this, wflags); |
464 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
465 |
m_pInstrumentListForm = new InstrumentListForm(this, wflags); |
m_pInstrumentListForm = new InstrumentListForm(this, wflags); |
466 |
#else |
#else |
467 |
viewInstrumentsAction->setEnabled(false); |
m_ui.viewInstrumentsAction->setEnabled(false); |
468 |
#endif |
#endif |
469 |
|
|
470 |
|
// Setup messages logging appropriately... |
471 |
|
m_pMessages->setLogging( |
472 |
|
m_pOptions->bMessagesLog, |
473 |
|
m_pOptions->sMessagesLogPath); |
474 |
|
|
475 |
// Set message defaults... |
// Set message defaults... |
476 |
updateMessagesFont(); |
updateMessagesFont(); |
477 |
updateMessagesLimit(); |
updateMessagesLimit(); |
502 |
} |
} |
503 |
|
|
504 |
// Try to restore old window positioning and initial visibility. |
// Try to restore old window positioning and initial visibility. |
505 |
m_pOptions->loadWidgetGeometry(this); |
m_pOptions->loadWidgetGeometry(this, true); |
506 |
m_pOptions->loadWidgetGeometry(m_pInstrumentListForm); |
m_pOptions->loadWidgetGeometry(m_pInstrumentListForm); |
507 |
m_pOptions->loadWidgetGeometry(m_pDeviceForm); |
m_pOptions->loadWidgetGeometry(m_pDeviceForm); |
508 |
|
|
546 |
// And the children, and the main windows state,. |
// And the children, and the main windows state,. |
547 |
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
548 |
m_pOptions->saveWidgetGeometry(m_pInstrumentListForm); |
m_pOptions->saveWidgetGeometry(m_pInstrumentListForm); |
549 |
m_pOptions->saveWidgetGeometry(this); |
m_pOptions->saveWidgetGeometry(this, true); |
550 |
// Close popup widgets. |
// Close popup widgets. |
551 |
if (m_pInstrumentListForm) |
if (m_pInstrumentListForm) |
552 |
m_pInstrumentListForm->close(); |
m_pInstrumentListForm->close(); |
595 |
QListIterator<QUrl> iter(pMimeData->urls()); |
QListIterator<QUrl> iter(pMimeData->urls()); |
596 |
while (iter.hasNext()) { |
while (iter.hasNext()) { |
597 |
const QString& sPath = iter.next().toLocalFile(); |
const QString& sPath = iter.next().toLocalFile(); |
598 |
if (Channel::isInstrumentFile(sPath)) { |
// if (Channel::isDlsInstrumentFile(sPath)) { |
599 |
|
if (QFileInfo(sPath).exists()) { |
600 |
// Try to create a new channel from instrument file... |
// Try to create a new channel from instrument file... |
601 |
Channel *pChannel = new Channel(); |
Channel *pChannel = new Channel(); |
602 |
if (pChannel == NULL) |
if (pChannel == NULL) |
630 |
|
|
631 |
|
|
632 |
// Custome event handler. |
// Custome event handler. |
633 |
void MainForm::customEvent(QEvent* pCustomEvent) |
void MainForm::customEvent ( QEvent* pEvent ) |
634 |
{ |
{ |
635 |
// For the time being, just pump it to messages. |
// For the time being, just pump it to messages. |
636 |
if (pCustomEvent->type() == QSAMPLER_CUSTOM_EVENT) { |
if (pEvent->type() == QSAMPLER_LSCP_EVENT) { |
637 |
CustomEvent *pEvent = static_cast<CustomEvent *> (pCustomEvent); |
LscpEvent *pLscpEvent = static_cast<LscpEvent *> (pEvent); |
638 |
switch (pEvent->event()) { |
switch (pLscpEvent->event()) { |
639 |
case LSCP_EVENT_CHANNEL_COUNT: |
case LSCP_EVENT_CHANNEL_COUNT: |
640 |
updateAllChannelStrips(true); |
updateAllChannelStrips(true); |
641 |
break; |
break; |
642 |
case LSCP_EVENT_CHANNEL_INFO: { |
case LSCP_EVENT_CHANNEL_INFO: { |
643 |
int iChannelID = pEvent->data().toInt(); |
int iChannelID = pLscpEvent->data().toInt(); |
644 |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
645 |
if (pChannelStrip) |
if (pChannelStrip) |
646 |
channelStripChanged(pChannelStrip); |
channelStripChanged(pChannelStrip); |
653 |
break; |
break; |
654 |
case LSCP_EVENT_MIDI_INPUT_DEVICE_INFO: { |
case LSCP_EVENT_MIDI_INPUT_DEVICE_INFO: { |
655 |
if (m_pDeviceForm) m_pDeviceForm->refreshDevices(); |
if (m_pDeviceForm) m_pDeviceForm->refreshDevices(); |
656 |
const int iDeviceID = pEvent->data().section(' ', 0, 0).toInt(); |
const int iDeviceID = pLscpEvent->data().section(' ', 0, 0).toInt(); |
657 |
DeviceStatusForm::onDeviceChanged(iDeviceID); |
DeviceStatusForm::onDeviceChanged(iDeviceID); |
658 |
break; |
break; |
659 |
} |
} |
663 |
case LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO: |
case LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO: |
664 |
if (m_pDeviceForm) m_pDeviceForm->refreshDevices(); |
if (m_pDeviceForm) m_pDeviceForm->refreshDevices(); |
665 |
break; |
break; |
666 |
#if CONFIG_LSCP_CHANNEL_MIDI |
#if CONFIG_EVENT_CHANNEL_MIDI |
667 |
case LSCP_EVENT_CHANNEL_MIDI: { |
case LSCP_EVENT_CHANNEL_MIDI: { |
668 |
const int iChannelID = pEvent->data().section(' ', 0, 0).toInt(); |
const int iChannelID = pLscpEvent->data().section(' ', 0, 0).toInt(); |
669 |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
670 |
if (pChannelStrip) |
if (pChannelStrip) |
671 |
pChannelStrip->midiArrived(); |
pChannelStrip->midiActivityLedOn(); |
672 |
break; |
break; |
673 |
} |
} |
674 |
#endif |
#endif |
675 |
#if CONFIG_LSCP_DEVICE_MIDI |
#if CONFIG_EVENT_DEVICE_MIDI |
676 |
case LSCP_EVENT_DEVICE_MIDI: { |
case LSCP_EVENT_DEVICE_MIDI: { |
677 |
const int iDeviceID = pEvent->data().section(' ', 0, 0).toInt(); |
const int iDeviceID = pLscpEvent->data().section(' ', 0, 0).toInt(); |
678 |
const int iPortID = pEvent->data().section(' ', 1, 1).toInt(); |
const int iPortID = pLscpEvent->data().section(' ', 1, 1).toInt(); |
679 |
DeviceStatusForm* pDeviceStatusForm = |
DeviceStatusForm *pDeviceStatusForm |
680 |
DeviceStatusForm::getInstance(iDeviceID); |
= DeviceStatusForm::getInstance(iDeviceID); |
681 |
if (pDeviceStatusForm) |
if (pDeviceStatusForm) |
682 |
pDeviceStatusForm->midiArrived(iPortID); |
pDeviceStatusForm->midiArrived(iPortID); |
683 |
break; |
break; |
684 |
} |
} |
685 |
#endif |
#endif |
686 |
default: |
default: |
687 |
appendMessagesColor(tr("Notify event: %1 data: %2") |
appendMessagesColor(tr("LSCP Event: %1 data: %2") |
688 |
.arg(::lscp_event_to_text(pEvent->event())) |
.arg(::lscp_event_to_text(pLscpEvent->event())) |
689 |
.arg(pEvent->data()), "#996699"); |
.arg(pLscpEvent->data()), "#996699"); |
690 |
} |
} |
691 |
} |
} |
692 |
} |
} |
693 |
|
|
694 |
void MainForm::updateViewMidiDeviceStatusMenu() { |
|
695 |
|
// LADISH Level 1 -- SIGUSR1 signal handler. |
696 |
|
void MainForm::handle_sigusr1 (void) |
697 |
|
{ |
698 |
|
#if defined(HAVE_SIGNAL_H) && defined(HAVE_SYS_SOCKET_H) |
699 |
|
|
700 |
|
char c; |
701 |
|
|
702 |
|
if (::read(g_fdUsr1[1], &c, sizeof(c)) > 0) |
703 |
|
saveSession(false); |
704 |
|
|
705 |
|
#endif |
706 |
|
} |
707 |
|
|
708 |
|
|
709 |
|
void MainForm::updateViewMidiDeviceStatusMenu (void) |
710 |
|
{ |
711 |
m_ui.viewMidiDeviceStatusMenu->clear(); |
m_ui.viewMidiDeviceStatusMenu->clear(); |
712 |
const std::map<int, DeviceStatusForm*> statusForms = |
const std::map<int, DeviceStatusForm *> statusForms |
713 |
DeviceStatusForm::getInstances(); |
= DeviceStatusForm::getInstances(); |
714 |
for ( |
std::map<int, DeviceStatusForm *>::const_iterator iter |
715 |
std::map<int, DeviceStatusForm*>::const_iterator iter = statusForms.begin(); |
= statusForms.begin(); |
716 |
iter != statusForms.end(); ++iter |
for ( ; iter != statusForms.end(); ++iter) { |
717 |
) { |
DeviceStatusForm *pStatusForm = iter->second; |
|
DeviceStatusForm* pForm = iter->second; |
|
718 |
m_ui.viewMidiDeviceStatusMenu->addAction( |
m_ui.viewMidiDeviceStatusMenu->addAction( |
719 |
pForm->visibleAction() |
pStatusForm->visibleAction()); |
|
); |
|
720 |
} |
} |
721 |
} |
} |
722 |
|
|
723 |
|
|
724 |
// Context menu event handler. |
// Context menu event handler. |
725 |
void MainForm::contextMenuEvent( QContextMenuEvent *pEvent ) |
void MainForm::contextMenuEvent( QContextMenuEvent *pEvent ) |
726 |
{ |
{ |
852 |
"\"%1\"\n\n" |
"\"%1\"\n\n" |
853 |
"Do you want to replace it?") |
"Do you want to replace it?") |
854 |
.arg(sFilename), |
.arg(sFilename), |
855 |
tr("Replace"), tr("Cancel")) > 0) |
QMessageBox::Yes | QMessageBox::No) |
856 |
|
== QMessageBox::No) |
857 |
return false; |
return false; |
858 |
} |
} |
859 |
} |
} |
876 |
"\"%1\"\n\n" |
"\"%1\"\n\n" |
877 |
"Do you want to save the changes?") |
"Do you want to save the changes?") |
878 |
.arg(sessionName(m_sFilename)), |
.arg(sessionName(m_sFilename)), |
879 |
tr("Save"), tr("Discard"), tr("Cancel"))) { |
QMessageBox::Save | |
880 |
case 0: // Save... |
QMessageBox::Discard | |
881 |
|
QMessageBox::Cancel)) { |
882 |
|
case QMessageBox::Save: |
883 |
bClose = saveSession(false); |
bClose = saveSession(false); |
884 |
// Fall thru.... |
// Fall thru.... |
885 |
case 1: // Discard |
case QMessageBox::Discard: |
886 |
break; |
break; |
887 |
default: // Cancel. |
default: // Cancel. |
888 |
bClose = false; |
bClose = false; |
894 |
if (bClose) { |
if (bClose) { |
895 |
// Remove all channel strips from sight... |
// Remove all channel strips from sight... |
896 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
897 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
898 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
899 |
ChannelStrip *pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
900 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
901 |
|
if (pMdiSubWindow) |
902 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
903 |
if (pChannelStrip) { |
if (pChannelStrip) { |
904 |
Channel *pChannel = pChannelStrip->channel(); |
Channel *pChannel = pChannelStrip->channel(); |
905 |
if (bForce && pChannel) |
if (bForce && pChannel) |
906 |
pChannel->removeChannel(); |
pChannel->removeChannel(); |
907 |
delete pChannelStrip; |
delete pChannelStrip; |
908 |
} |
} |
909 |
|
if (pMdiSubWindow) |
910 |
|
delete pMdiSubWindow; |
911 |
} |
} |
912 |
m_pWorkspace->setUpdatesEnabled(true); |
m_pWorkspace->setUpdatesEnabled(true); |
913 |
// We're now clean, for sure. |
// We're now clean, for sure. |
1198 |
#endif // CONFIG_MIDI_INSTRUMENT |
#endif // CONFIG_MIDI_INSTRUMENT |
1199 |
|
|
1200 |
// Sampler channel mapping. |
// Sampler channel mapping. |
1201 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
1202 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
1203 |
ChannelStrip* pChannelStrip |
ChannelStrip *pChannelStrip = NULL; |
1204 |
= static_cast<ChannelStrip *> (wlist.at(iChannel)); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
1205 |
|
if (pMdiSubWindow) |
1206 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
1207 |
if (pChannelStrip) { |
if (pChannelStrip) { |
1208 |
Channel *pChannel = pChannelStrip->channel(); |
Channel *pChannel = pChannelStrip->channel(); |
1209 |
if (pChannel) { |
if (pChannel) { |
1251 |
ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl; |
ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl; |
1252 |
if (pChannel->channelSolo()) |
if (pChannel->channelSolo()) |
1253 |
ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl; |
ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl; |
1254 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
1255 |
if (pChannel->midiMap() >= 0) { |
if (pChannel->midiMap() >= 0) { |
1256 |
ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel |
ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel |
1257 |
<< " " << midiInstrumentMap[pChannel->midiMap()] << endl; |
<< " " << midiInstrumentMap[pChannel->midiMap()] << endl; |
1258 |
} |
} |
1259 |
#endif |
#endif |
1260 |
#ifdef CONFIG_FXSEND |
#ifdef CONFIG_FXSEND |
1261 |
int iChannelID = pChannel->channelID(); |
int iChannelID = pChannel->channelID(); |
1262 |
int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID); |
int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID); |
1263 |
for (int iFxSend = 0; |
for (int iFxSend = 0; |
1281 |
<< " " << iAudioSrc |
<< " " << iAudioSrc |
1282 |
<< " " << piRouting[iAudioSrc] << endl; |
<< " " << piRouting[iAudioSrc] << endl; |
1283 |
} |
} |
1284 |
#ifdef CONFIG_FXSEND_LEVEL |
#ifdef CONFIG_FXSEND_LEVEL |
1285 |
ts << "SET FX_SEND LEVEL " << iChannel |
ts << "SET FX_SEND LEVEL " << iChannel |
1286 |
<< " " << iFxSend |
<< " " << iFxSend |
1287 |
<< " " << pFxSendInfo->level << endl; |
<< " " << pFxSendInfo->level << endl; |
1288 |
#endif |
#endif |
1289 |
} // Check for errors... |
} // Check for errors... |
1290 |
else if (::lscp_client_get_errno(m_pClient)) { |
else if (::lscp_client_get_errno(m_pClient)) { |
1291 |
appendMessagesClient("lscp_get_fxsend_info"); |
appendMessagesClient("lscp_get_fxsend_info"); |
1292 |
iErrors++; |
iErrors++; |
1293 |
} |
} |
1294 |
} |
} |
1295 |
#endif |
#endif |
1296 |
ts << endl; |
ts << endl; |
1297 |
} |
} |
1298 |
} |
} |
1410 |
"Please note that this operation may cause\n" |
"Please note that this operation may cause\n" |
1411 |
"temporary MIDI and Audio disruption.\n\n" |
"temporary MIDI and Audio disruption.\n\n" |
1412 |
"Do you want to reset the sampler engine now?"), |
"Do you want to reset the sampler engine now?"), |
1413 |
tr("Reset"), tr("Cancel")) > 0) |
QMessageBox::Ok | QMessageBox::Cancel) |
1414 |
|
== QMessageBox::Cancel) |
1415 |
return; |
return; |
1416 |
|
|
1417 |
// Trye closing the current session, first... |
// Trye closing the current session, first... |
1452 |
"Please note that this operation may cause\n" |
"Please note that this operation may cause\n" |
1453 |
"temporary MIDI and Audio disruption.\n\n" |
"temporary MIDI and Audio disruption.\n\n" |
1454 |
"Do you want to restart the connection now?"), |
"Do you want to restart the connection now?"), |
1455 |
tr("Restart"), tr("Cancel")) == 0); |
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok); |
1456 |
} |
} |
1457 |
|
|
1458 |
// Are we still for it? |
// Are we still for it? |
1517 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1518 |
return; |
return; |
1519 |
|
|
1520 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1521 |
if (pChannelStrip == NULL) |
if (pChannelStrip == NULL) |
1522 |
return; |
return; |
1523 |
|
|
1533 |
"%1\n\n" |
"%1\n\n" |
1534 |
"Are you sure?") |
"Are you sure?") |
1535 |
.arg(pChannelStrip->windowTitle()), |
.arg(pChannelStrip->windowTitle()), |
1536 |
tr("OK"), tr("Cancel")) > 0) |
QMessageBox::Ok | QMessageBox::Cancel) |
1537 |
|
== QMessageBox::Cancel) |
1538 |
return; |
return; |
1539 |
} |
} |
1540 |
|
|
1542 |
if (!pChannel->removeChannel()) |
if (!pChannel->removeChannel()) |
1543 |
return; |
return; |
1544 |
|
|
|
// Just delete the channel strip. |
|
|
delete pChannelStrip; |
|
|
|
|
|
// Do we auto-arrange? |
|
|
if (m_pOptions && m_pOptions->bAutoArrange) |
|
|
channelsArrange(); |
|
|
|
|
1545 |
// We'll be dirty, for sure... |
// We'll be dirty, for sure... |
1546 |
m_iDirtyCount++; |
m_iDirtyCount++; |
1547 |
stabilizeForm(); |
|
1548 |
|
// Just delete the channel strip. |
1549 |
|
destroyChannelStrip(pChannelStrip); |
1550 |
} |
} |
1551 |
|
|
1552 |
|
|
1556 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1557 |
return; |
return; |
1558 |
|
|
1559 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1560 |
if (pChannelStrip == NULL) |
if (pChannelStrip == NULL) |
1561 |
return; |
return; |
1562 |
|
|
1571 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1572 |
return; |
return; |
1573 |
|
|
1574 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1575 |
if (pChannelStrip == NULL) |
if (pChannelStrip == NULL) |
1576 |
return; |
return; |
1577 |
|
|
1586 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1587 |
return; |
return; |
1588 |
|
|
1589 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1590 |
if (pChannelStrip == NULL) |
if (pChannelStrip == NULL) |
1591 |
return; |
return; |
1592 |
|
|
1604 |
// Invoque the channel strip procedure, |
// Invoque the channel strip procedure, |
1605 |
// for all channels out there... |
// for all channels out there... |
1606 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
1607 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
1608 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
1609 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
1610 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
1611 |
|
if (pMdiSubWindow) |
1612 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
1613 |
if (pChannelStrip) |
if (pChannelStrip) |
1614 |
pChannelStrip->channelReset(); |
pChannelStrip->channelReset(); |
1615 |
} |
} |
1712 |
OptionsForm* pOptionsForm = new OptionsForm(this); |
OptionsForm* pOptionsForm = new OptionsForm(this); |
1713 |
if (pOptionsForm) { |
if (pOptionsForm) { |
1714 |
// Check out some initial nullities(tm)... |
// Check out some initial nullities(tm)... |
1715 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1716 |
if (m_pOptions->sDisplayFont.isEmpty() && pChannelStrip) |
if (m_pOptions->sDisplayFont.isEmpty() && pChannelStrip) |
1717 |
m_pOptions->sDisplayFont = pChannelStrip->displayFont().toString(); |
m_pOptions->sDisplayFont = pChannelStrip->displayFont().toString(); |
1718 |
if (m_pOptions->sMessagesFont.isEmpty() && m_pMessages) |
if (m_pOptions->sMessagesFont.isEmpty() && m_pMessages) |
1723 |
int iOldServerTimeout = m_pOptions->iServerTimeout; |
int iOldServerTimeout = m_pOptions->iServerTimeout; |
1724 |
bool bOldServerStart = m_pOptions->bServerStart; |
bool bOldServerStart = m_pOptions->bServerStart; |
1725 |
QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
1726 |
|
bool bOldMessagesLog = m_pOptions->bMessagesLog; |
1727 |
|
QString sOldMessagesLogPath = m_pOptions->sMessagesLogPath; |
1728 |
QString sOldDisplayFont = m_pOptions->sDisplayFont; |
QString sOldDisplayFont = m_pOptions->sDisplayFont; |
1729 |
bool bOldDisplayEffect = m_pOptions->bDisplayEffect; |
bool bOldDisplayEffect = m_pOptions->bDisplayEffect; |
1730 |
int iOldMaxVolume = m_pOptions->iMaxVolume; |
int iOldMaxVolume = m_pOptions->iMaxVolume; |
1736 |
bool bOldCompletePath = m_pOptions->bCompletePath; |
bool bOldCompletePath = m_pOptions->bCompletePath; |
1737 |
bool bOldInstrumentNames = m_pOptions->bInstrumentNames; |
bool bOldInstrumentNames = m_pOptions->bInstrumentNames; |
1738 |
int iOldMaxRecentFiles = m_pOptions->iMaxRecentFiles; |
int iOldMaxRecentFiles = m_pOptions->iMaxRecentFiles; |
1739 |
|
int iOldBaseFontSize = m_pOptions->iBaseFontSize; |
1740 |
// Load the current setup settings. |
// Load the current setup settings. |
1741 |
pOptionsForm->setup(m_pOptions); |
pOptionsForm->setup(m_pOptions); |
1742 |
// Show the setup dialog... |
// Show the setup dialog... |
1745 |
if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) || |
if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) || |
1746 |
(!bOldStdoutCapture && m_pOptions->bStdoutCapture) || |
(!bOldStdoutCapture && m_pOptions->bStdoutCapture) || |
1747 |
( bOldKeepOnTop && !m_pOptions->bKeepOnTop) || |
( bOldKeepOnTop && !m_pOptions->bKeepOnTop) || |
1748 |
(!bOldKeepOnTop && m_pOptions->bKeepOnTop)) { |
(!bOldKeepOnTop && m_pOptions->bKeepOnTop) || |
1749 |
|
(iOldBaseFontSize != m_pOptions->iBaseFontSize)) { |
1750 |
QMessageBox::information(this, |
QMessageBox::information(this, |
1751 |
QSAMPLER_TITLE ": " + tr("Information"), |
QSAMPLER_TITLE ": " + tr("Information"), |
1752 |
tr("Some settings may be only effective\n" |
tr("Some settings may be only effective\n" |
1753 |
"next time you start this program."), tr("OK")); |
"next time you start this program.")); |
1754 |
updateMessagesCapture(); |
updateMessagesCapture(); |
1755 |
} |
} |
1756 |
// Check wheather something immediate has changed. |
// Check wheather something immediate has changed. |
1757 |
|
if (( bOldMessagesLog && !m_pOptions->bMessagesLog) || |
1758 |
|
(!bOldMessagesLog && m_pOptions->bMessagesLog) || |
1759 |
|
(sOldMessagesLogPath != m_pOptions->sMessagesLogPath)) |
1760 |
|
m_pMessages->setLogging( |
1761 |
|
m_pOptions->bMessagesLog, m_pOptions->sMessagesLogPath); |
1762 |
if (( bOldCompletePath && !m_pOptions->bCompletePath) || |
if (( bOldCompletePath && !m_pOptions->bCompletePath) || |
1763 |
(!bOldCompletePath && m_pOptions->bCompletePath) || |
(!bOldCompletePath && m_pOptions->bCompletePath) || |
1764 |
(iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles)) |
(iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles)) |
1805 |
void MainForm::channelsArrange (void) |
void MainForm::channelsArrange (void) |
1806 |
{ |
{ |
1807 |
// Full width vertical tiling |
// Full width vertical tiling |
1808 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
1809 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
1810 |
return; |
return; |
1811 |
|
|
1812 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
1813 |
int y = 0; |
int y = 0; |
1814 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
1815 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
1816 |
/* if (pChannelStrip->testWState(WState_Maximized | WState_Minimized)) { |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
1817 |
// Prevent flicker... |
if (pMdiSubWindow) |
1818 |
pChannelStrip->hide(); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
1819 |
pChannelStrip->showNormal(); |
if (pChannelStrip) { |
1820 |
} */ |
/* if (pChannelStrip->testWState(WState_Maximized | WState_Minimized)) { |
1821 |
pChannelStrip->adjustSize(); |
// Prevent flicker... |
1822 |
int iWidth = m_pWorkspace->width(); |
pChannelStrip->hide(); |
1823 |
if (iWidth < pChannelStrip->width()) |
pChannelStrip->showNormal(); |
1824 |
iWidth = pChannelStrip->width(); |
} */ |
1825 |
// int iHeight = pChannelStrip->height() |
pChannelStrip->adjustSize(); |
1826 |
// + pChannelStrip->parentWidget()->baseSize().height(); |
int iWidth = m_pWorkspace->width(); |
1827 |
int iHeight = pChannelStrip->parentWidget()->frameGeometry().height(); |
if (iWidth < pChannelStrip->width()) |
1828 |
pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight); |
iWidth = pChannelStrip->width(); |
1829 |
y += iHeight; |
// int iHeight = pChannelStrip->height() |
1830 |
|
// + pChannelStrip->parentWidget()->baseSize().height(); |
1831 |
|
int iHeight = pChannelStrip->parentWidget()->frameGeometry().height(); |
1832 |
|
pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight); |
1833 |
|
y += iHeight; |
1834 |
|
} |
1835 |
} |
} |
1836 |
m_pWorkspace->setUpdatesEnabled(true); |
m_pWorkspace->setUpdatesEnabled(true); |
1837 |
|
|
1918 |
sText += tr("Instrument editing support disabled."); |
sText += tr("Instrument editing support disabled."); |
1919 |
sText += "</font></small><br />"; |
sText += "</font></small><br />"; |
1920 |
#endif |
#endif |
1921 |
|
#ifndef CONFIG_EVENT_CHANNEL_MIDI |
1922 |
|
sText += "<small><font color=\"red\">"; |
1923 |
|
sText += tr("Channel MIDI event support disabled."); |
1924 |
|
sText += "</font></small><br />"; |
1925 |
|
#endif |
1926 |
|
#ifndef CONFIG_EVENT_DEVICE_MIDI |
1927 |
|
sText += "<small><font color=\"red\">"; |
1928 |
|
sText += tr("Device MIDI event support disabled."); |
1929 |
|
sText += "</font></small><br />"; |
1930 |
|
#endif |
1931 |
|
#ifndef CONFIG_MAX_VOICES |
1932 |
|
sText += "<small><font color=\"red\">"; |
1933 |
|
sText += tr("Runtime max. voices / disk streams support disabled."); |
1934 |
|
sText += "</font></small><br />"; |
1935 |
|
#endif |
1936 |
sText += "<br />\n"; |
sText += "<br />\n"; |
1937 |
sText += tr("Using") + ": "; |
sText += tr("Using") + ": "; |
1938 |
sText += ::lscp_client_package(); |
sText += ::lscp_client_package(); |
1973 |
setWindowTitle(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName)); |
setWindowTitle(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName)); |
1974 |
|
|
1975 |
// Update the main menu state... |
// Update the main menu state... |
1976 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1977 |
bool bHasClient = (m_pOptions != NULL && m_pClient != NULL); |
bool bHasClient = (m_pOptions != NULL && m_pClient != NULL); |
1978 |
bool bHasChannel = (bHasClient && pChannelStrip != NULL); |
bool bHasChannel = (bHasClient && pChannelStrip != NULL); |
1979 |
|
bool bHasChannels = (bHasClient && m_pWorkspace->subWindowList().count() > 0); |
1980 |
m_ui.fileNewAction->setEnabled(bHasClient); |
m_ui.fileNewAction->setEnabled(bHasClient); |
1981 |
m_ui.fileOpenAction->setEnabled(bHasClient); |
m_ui.fileOpenAction->setEnabled(bHasClient); |
1982 |
m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0); |
m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0); |
1992 |
m_ui.editEditChannelAction->setEnabled(false); |
m_ui.editEditChannelAction->setEnabled(false); |
1993 |
#endif |
#endif |
1994 |
m_ui.editResetChannelAction->setEnabled(bHasChannel); |
m_ui.editResetChannelAction->setEnabled(bHasChannel); |
1995 |
m_ui.editResetAllChannelsAction->setEnabled(bHasChannel); |
m_ui.editResetAllChannelsAction->setEnabled(bHasChannels); |
1996 |
m_ui.viewMessagesAction->setChecked(m_pMessages && m_pMessages->isVisible()); |
m_ui.viewMessagesAction->setChecked(m_pMessages && m_pMessages->isVisible()); |
1997 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
1998 |
m_ui.viewInstrumentsAction->setChecked(m_pInstrumentListForm |
m_ui.viewInstrumentsAction->setChecked(m_pInstrumentListForm |
2004 |
m_ui.viewDevicesAction->setChecked(m_pDeviceForm |
m_ui.viewDevicesAction->setChecked(m_pDeviceForm |
2005 |
&& m_pDeviceForm->isVisible()); |
&& m_pDeviceForm->isVisible()); |
2006 |
m_ui.viewDevicesAction->setEnabled(bHasClient); |
m_ui.viewDevicesAction->setEnabled(bHasClient); |
2007 |
m_ui.channelsArrangeAction->setEnabled(bHasChannel); |
m_ui.viewMidiDeviceStatusMenu->setEnabled( |
2008 |
|
DeviceStatusForm::getInstances().size() > 0); |
2009 |
|
m_ui.channelsArrangeAction->setEnabled(bHasChannels); |
2010 |
|
|
2011 |
#ifdef CONFIG_VOLUME |
#ifdef CONFIG_VOLUME |
2012 |
// Toolbar widgets are also affected... |
// Toolbar widgets are also affected... |
2072 |
|
|
2073 |
|
|
2074 |
// Channel change receiver slot. |
// Channel change receiver slot. |
2075 |
void MainForm::channelStripChanged(ChannelStrip* pChannelStrip) |
void MainForm::channelStripChanged ( ChannelStrip *pChannelStrip ) |
2076 |
{ |
{ |
2077 |
// Add this strip to the changed list... |
// Add this strip to the changed list... |
2078 |
if (!m_changedStrips.contains(pChannelStrip)) { |
if (!m_changedStrips.contains(pChannelStrip)) { |
2123 |
m_pDeviceForm->refreshDevices(); |
m_pDeviceForm->refreshDevices(); |
2124 |
} |
} |
2125 |
|
|
2126 |
void MainForm::updateAllChannelStrips(bool bRemoveDeadStrips) { |
|
2127 |
|
void MainForm::updateAllChannelStrips ( bool bRemoveDeadStrips ) |
2128 |
|
{ |
2129 |
// Retrieve the current channel list. |
// Retrieve the current channel list. |
2130 |
int *piChannelIDs = ::lscp_list_channels(m_pClient); |
int *piChannelIDs = ::lscp_list_channels(m_pClient); |
2131 |
if (piChannelIDs == NULL) { |
if (piChannelIDs == NULL) { |
2137 |
} else { |
} else { |
2138 |
// Try to (re)create each channel. |
// Try to (re)create each channel. |
2139 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2140 |
for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) { |
for (int iChannel = 0; piChannelIDs[iChannel] >= 0; ++iChannel) { |
2141 |
// Check if theres already a channel strip for this one... |
// Check if theres already a channel strip for this one... |
2142 |
if (!channelStrip(piChannelIDs[iChannel])) |
if (!channelStrip(piChannelIDs[iChannel])) |
2143 |
createChannelStrip(new Channel(piChannelIDs[iChannel])); |
createChannelStrip(new Channel(piChannelIDs[iChannel])); |
2144 |
} |
} |
|
|
|
2145 |
// Do we auto-arrange? |
// Do we auto-arrange? |
2146 |
if (m_pOptions && m_pOptions->bAutoArrange) |
if (m_pOptions && m_pOptions->bAutoArrange) |
2147 |
channelsArrange(); |
channelsArrange(); |
|
|
|
|
stabilizeForm(); |
|
|
|
|
2148 |
// remove dead channel strips |
// remove dead channel strips |
2149 |
if (bRemoveDeadStrips) { |
if (bRemoveDeadStrips) { |
2150 |
for (int i = 0; channelStripAt(i); ++i) { |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2151 |
ChannelStrip* pChannelStrip = channelStripAt(i); |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2152 |
bool bExists = false; |
ChannelStrip *pChannelStrip = NULL; |
2153 |
for (int j = 0; piChannelIDs[j] >= 0; ++j) { |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2154 |
if (!pChannelStrip->channel()) break; |
if (pMdiSubWindow) |
2155 |
if (piChannelIDs[j] == pChannelStrip->channel()->channelID()) { |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2156 |
// strip exists, don't touch it |
if (pChannelStrip) { |
2157 |
bExists = true; |
bool bExists = false; |
2158 |
break; |
for (int j = 0; piChannelIDs[j] >= 0; ++j) { |
2159 |
|
if (!pChannelStrip->channel()) |
2160 |
|
break; |
2161 |
|
if (piChannelIDs[j] == pChannelStrip->channel()->channelID()) { |
2162 |
|
// strip exists, don't touch it |
2163 |
|
bExists = true; |
2164 |
|
break; |
2165 |
|
} |
2166 |
} |
} |
2167 |
|
if (!bExists) |
2168 |
|
destroyChannelStrip(pChannelStrip); |
2169 |
} |
} |
|
if (!bExists) destroyChannelStrip(pChannelStrip); |
|
2170 |
} |
} |
2171 |
} |
} |
2172 |
m_pWorkspace->setUpdatesEnabled(true); |
m_pWorkspace->setUpdatesEnabled(true); |
2173 |
} |
} |
2174 |
|
|
2175 |
|
stabilizeForm(); |
2176 |
} |
} |
2177 |
|
|
2178 |
|
|
2179 |
// Update the recent files list and menu. |
// Update the recent files list and menu. |
2180 |
void MainForm::updateRecentFiles ( const QString& sFilename ) |
void MainForm::updateRecentFiles ( const QString& sFilename ) |
2181 |
{ |
{ |
2222 |
void MainForm::updateInstrumentNames (void) |
void MainForm::updateInstrumentNames (void) |
2223 |
{ |
{ |
2224 |
// Full channel list update... |
// Full channel list update... |
2225 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2226 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2227 |
return; |
return; |
2228 |
|
|
2229 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2230 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2231 |
ChannelStrip *pChannelStrip = (ChannelStrip *) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = (ChannelStrip *) wlist.at(iChannel); |
2232 |
if (pChannelStrip) |
if (pChannelStrip) |
2233 |
pChannelStrip->updateInstrumentName(true); |
pChannelStrip->updateInstrumentName(true); |
2251 |
return; |
return; |
2252 |
|
|
2253 |
// Full channel list update... |
// Full channel list update... |
2254 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2255 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2256 |
return; |
return; |
2257 |
|
|
2258 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2259 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2260 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
2261 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2262 |
|
if (pMdiSubWindow) |
2263 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2264 |
if (pChannelStrip) |
if (pChannelStrip) |
2265 |
pChannelStrip->setDisplayFont(font); |
pChannelStrip->setDisplayFont(font); |
2266 |
} |
} |
2272 |
void MainForm::updateDisplayEffect (void) |
void MainForm::updateDisplayEffect (void) |
2273 |
{ |
{ |
2274 |
// Full channel list update... |
// Full channel list update... |
2275 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2276 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2277 |
return; |
return; |
2278 |
|
|
2279 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2280 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2281 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
2282 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2283 |
|
if (pMdiSubWindow) |
2284 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2285 |
if (pChannelStrip) |
if (pChannelStrip) |
2286 |
pChannelStrip->setDisplayEffect(m_pOptions->bDisplayEffect); |
pChannelStrip->setDisplayEffect(m_pOptions->bDisplayEffect); |
2287 |
} |
} |
2303 |
#endif |
#endif |
2304 |
|
|
2305 |
// Full channel list update... |
// Full channel list update... |
2306 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2307 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2308 |
return; |
return; |
2309 |
|
|
2310 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2311 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2312 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
2313 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2314 |
|
if (pMdiSubWindow) |
2315 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2316 |
if (pChannelStrip) |
if (pChannelStrip) |
2317 |
pChannelStrip->setMaxVolume(m_pOptions->iMaxVolume); |
pChannelStrip->setMaxVolume(m_pOptions->iMaxVolume); |
2318 |
} |
} |
2357 |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
2358 |
|
|
2359 |
QMessageBox::critical(this, |
QMessageBox::critical(this, |
2360 |
QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel")); |
QSAMPLER_TITLE ": " + tr("Error"), s, QMessageBox::Cancel); |
2361 |
} |
} |
2362 |
|
|
2363 |
|
|
2420 |
// qsamplerMainForm -- MDI channel strip management. |
// qsamplerMainForm -- MDI channel strip management. |
2421 |
|
|
2422 |
// The channel strip creation executive. |
// The channel strip creation executive. |
2423 |
ChannelStrip* MainForm::createChannelStrip ( Channel *pChannel ) |
ChannelStrip *MainForm::createChannelStrip ( Channel *pChannel ) |
2424 |
{ |
{ |
2425 |
if (m_pClient == NULL || pChannel == NULL) |
if (m_pClient == NULL || pChannel == NULL) |
2426 |
return NULL; |
return NULL; |
2443 |
} |
} |
2444 |
|
|
2445 |
// Add it to workspace... |
// Add it to workspace... |
2446 |
m_pWorkspace->addWindow(pChannelStrip, Qt::FramelessWindowHint); |
m_pWorkspace->addSubWindow(pChannelStrip, |
2447 |
|
Qt::SubWindow | Qt::FramelessWindowHint); |
2448 |
|
|
2449 |
// Actual channel strip setup... |
// Actual channel strip setup... |
2450 |
pChannelStrip->setup(pChannel); |
pChannelStrip->setup(pChannel); |
2451 |
|
|
2452 |
QObject::connect(pChannelStrip, |
QObject::connect(pChannelStrip, |
2453 |
SIGNAL(channelChanged(ChannelStrip*)), |
SIGNAL(channelChanged(ChannelStrip *)), |
2454 |
SLOT(channelStripChanged(ChannelStrip*))); |
SLOT(channelStripChanged(ChannelStrip *))); |
2455 |
|
|
2456 |
// Now we show up us to the world. |
// Now we show up us to the world. |
2457 |
pChannelStrip->show(); |
pChannelStrip->show(); |
2463 |
return pChannelStrip; |
return pChannelStrip; |
2464 |
} |
} |
2465 |
|
|
2466 |
void MainForm::destroyChannelStrip(ChannelStrip* pChannelStrip) { |
|
2467 |
|
void MainForm::destroyChannelStrip ( ChannelStrip *pChannelStrip ) |
2468 |
|
{ |
2469 |
|
QMdiSubWindow *pMdiSubWindow |
2470 |
|
= static_cast<QMdiSubWindow *> (pChannelStrip->parentWidget()); |
2471 |
|
if (pMdiSubWindow == NULL) |
2472 |
|
return; |
2473 |
|
|
2474 |
// Just delete the channel strip. |
// Just delete the channel strip. |
2475 |
delete pChannelStrip; |
delete pChannelStrip; |
2476 |
|
delete pMdiSubWindow; |
2477 |
|
|
2478 |
// Do we auto-arrange? |
// Do we auto-arrange? |
2479 |
if (m_pOptions && m_pOptions->bAutoArrange) |
if (m_pOptions && m_pOptions->bAutoArrange) |
2482 |
stabilizeForm(); |
stabilizeForm(); |
2483 |
} |
} |
2484 |
|
|
2485 |
|
|
2486 |
// Retrieve the active channel strip. |
// Retrieve the active channel strip. |
2487 |
ChannelStrip* MainForm::activeChannelStrip (void) |
ChannelStrip *MainForm::activeChannelStrip (void) |
2488 |
{ |
{ |
2489 |
return static_cast<ChannelStrip *> (m_pWorkspace->activeWindow()); |
QMdiSubWindow *pMdiSubWindow = m_pWorkspace->activeSubWindow(); |
2490 |
|
if (pMdiSubWindow) |
2491 |
|
return static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2492 |
|
else |
2493 |
|
return NULL; |
2494 |
} |
} |
2495 |
|
|
2496 |
|
|
2497 |
// Retrieve a channel strip by index. |
// Retrieve a channel strip by index. |
2498 |
ChannelStrip* MainForm::channelStripAt ( int iChannel ) |
ChannelStrip *MainForm::channelStripAt ( int iChannel ) |
2499 |
{ |
{ |
2500 |
if (!m_pWorkspace) return NULL; |
if (!m_pWorkspace) return NULL; |
2501 |
|
|
2502 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2503 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2504 |
return NULL; |
return NULL; |
2505 |
|
|
2506 |
if (iChannel < 0 || iChannel >= wlist.size()) |
if (iChannel < 0 || iChannel >= wlist.size()) |
2507 |
return NULL; |
return NULL; |
2508 |
|
|
2509 |
return dynamic_cast<ChannelStrip *> (wlist.at(iChannel)); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2510 |
|
if (pMdiSubWindow) |
2511 |
|
return static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2512 |
|
else |
2513 |
|
return NULL; |
2514 |
} |
} |
2515 |
|
|
2516 |
|
|
2517 |
// Retrieve a channel strip by sampler channel id. |
// Retrieve a channel strip by sampler channel id. |
2518 |
ChannelStrip* MainForm::channelStrip ( int iChannelID ) |
ChannelStrip *MainForm::channelStrip ( int iChannelID ) |
2519 |
{ |
{ |
2520 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2521 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2522 |
return NULL; |
return NULL; |
2523 |
|
|
2524 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2525 |
ChannelStrip* pChannelStrip |
ChannelStrip *pChannelStrip = NULL; |
2526 |
= static_cast<ChannelStrip*> (wlist.at(iChannel)); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2527 |
|
if (pMdiSubWindow) |
2528 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2529 |
if (pChannelStrip) { |
if (pChannelStrip) { |
2530 |
Channel *pChannel = pChannelStrip->channel(); |
Channel *pChannel = pChannelStrip->channel(); |
2531 |
if (pChannel && pChannel->channelID() == iChannelID) |
if (pChannel && pChannel->channelID() == iChannelID) |
2545 |
m_ui.channelsMenu->addAction(m_ui.channelsArrangeAction); |
m_ui.channelsMenu->addAction(m_ui.channelsArrangeAction); |
2546 |
m_ui.channelsMenu->addAction(m_ui.channelsAutoArrangeAction); |
m_ui.channelsMenu->addAction(m_ui.channelsAutoArrangeAction); |
2547 |
|
|
2548 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2549 |
if (!wlist.isEmpty()) { |
if (!wlist.isEmpty()) { |
2550 |
m_ui.channelsMenu->addSeparator(); |
m_ui.channelsMenu->addSeparator(); |
2551 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2552 |
ChannelStrip* pChannelStrip |
ChannelStrip *pChannelStrip = NULL; |
2553 |
= static_cast<ChannelStrip*> (wlist.at(iChannel)); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2554 |
|
if (pMdiSubWindow) |
2555 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2556 |
if (pChannelStrip) { |
if (pChannelStrip) { |
2557 |
QAction *pAction = m_ui.channelsMenu->addAction( |
QAction *pAction = m_ui.channelsMenu->addAction( |
2558 |
pChannelStrip->windowTitle(), |
pChannelStrip->windowTitle(), |
2574 |
if (pAction == NULL) |
if (pAction == NULL) |
2575 |
return; |
return; |
2576 |
|
|
2577 |
ChannelStrip* pChannelStrip = channelStripAt(pAction->data().toInt()); |
ChannelStrip *pChannelStrip = channelStripAt(pAction->data().toInt()); |
2578 |
if (pChannelStrip) { |
if (pChannelStrip) { |
2579 |
pChannelStrip->showNormal(); |
pChannelStrip->showNormal(); |
2580 |
pChannelStrip->setFocus(); |
pChannelStrip->setFocus(); |
2635 |
if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime) { |
if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime) { |
2636 |
m_iTimerSlot = 0; |
m_iTimerSlot = 0; |
2637 |
// Update the channel stream usage for each strip... |
// Update the channel stream usage for each strip... |
2638 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2639 |
for (int iChannel = 0; |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2640 |
iChannel < (int) wlist.count(); iChannel++) { |
ChannelStrip *pChannelStrip = NULL; |
2641 |
ChannelStrip* pChannelStrip |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2642 |
= (ChannelStrip*) wlist.at(iChannel); |
if (pMdiSubWindow) |
2643 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2644 |
if (pChannelStrip && pChannelStrip->isVisible()) |
if (pChannelStrip && pChannelStrip->isVisible()) |
2645 |
pChannelStrip->updateChannelUsage(); |
pChannelStrip->updateChannelUsage(); |
2646 |
} |
} |
2668 |
|
|
2669 |
// Is the server process instance still here? |
// Is the server process instance still here? |
2670 |
if (m_pServer) { |
if (m_pServer) { |
2671 |
switch (QMessageBox::warning(this, |
if (QMessageBox::warning(this, |
2672 |
QSAMPLER_TITLE ": " + tr("Warning"), |
QSAMPLER_TITLE ": " + tr("Warning"), |
2673 |
tr("Could not start the LinuxSampler server.\n\n" |
tr("Could not start the LinuxSampler server.\n\n" |
2674 |
"Maybe it is already started."), |
"Maybe it is already started."), |
2675 |
tr("Stop"), tr("Kill"), tr("Cancel"))) { |
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) { |
|
case 0: |
|
2676 |
m_pServer->terminate(); |
m_pServer->terminate(); |
|
break; |
|
|
case 1: |
|
2677 |
m_pServer->kill(); |
m_pServer->kill(); |
|
break; |
|
2678 |
} |
} |
2679 |
return; |
return; |
2680 |
} |
} |
2692 |
|
|
2693 |
// Setup stdout/stderr capture... |
// Setup stdout/stderr capture... |
2694 |
// if (m_pOptions->bStdoutCapture) { |
// if (m_pOptions->bStdoutCapture) { |
|
#if QT_VERSION >= 0x040200 |
|
2695 |
m_pServer->setProcessChannelMode(QProcess::ForwardedChannels); |
m_pServer->setProcessChannelMode(QProcess::ForwardedChannels); |
|
#endif |
|
2696 |
QObject::connect(m_pServer, |
QObject::connect(m_pServer, |
2697 |
SIGNAL(readyReadStandardOutput()), |
SIGNAL(readyReadStandardOutput()), |
2698 |
SLOT(readServerStdout())); |
SLOT(readServerStdout())); |
2746 |
"running in the background. The sampler would continue to work\n" |
"running in the background. The sampler would continue to work\n" |
2747 |
"according to your current sampler session and you could alter the\n" |
"according to your current sampler session and you could alter the\n" |
2748 |
"sampler session at any time by relaunching QSampler.\n\n" |
"sampler session at any time by relaunching QSampler.\n\n" |
2749 |
"Do you want LinuxSampler to stop or to keep running in\n" |
"Do you want LinuxSampler to stop?"), |
2750 |
"the background?"), |
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) |
|
tr("Stop"), tr("Keep Running")) == 1) |
|
2751 |
{ |
{ |
2752 |
bForceServerStop = false; |
bForceServerStop = false; |
2753 |
} |
} |
2757 |
if (m_pServer && bForceServerStop) { |
if (m_pServer && bForceServerStop) { |
2758 |
appendMessages(tr("Server is stopping...")); |
appendMessages(tr("Server is stopping...")); |
2759 |
if (m_pServer->state() == QProcess::Running) { |
if (m_pServer->state() == QProcess::Running) { |
2760 |
#if defined(WIN32) |
#if defined(WIN32) |
2761 |
// Try harder... |
// Try harder... |
2762 |
m_pServer->kill(); |
m_pServer->kill(); |
2763 |
#else |
#else |
2764 |
// Try softly... |
// Try softly... |
2765 |
m_pServer->terminate(); |
m_pServer->terminate(); |
2766 |
#endif |
#endif |
2767 |
} |
} |
2768 |
} // Do final processing anyway. |
} // Do final processing anyway. |
2769 |
else processServerExit(); |
else processServerExit(); |
2833 |
// as this is run under some other thread context. |
// as this is run under some other thread context. |
2834 |
// A custom event must be posted here... |
// A custom event must be posted here... |
2835 |
QApplication::postEvent(pMainForm, |
QApplication::postEvent(pMainForm, |
2836 |
new CustomEvent(event, pchData, cchData)); |
new LscpEvent(event, pchData, cchData)); |
2837 |
|
|
2838 |
return LSCP_OK; |
return LSCP_OK; |
2839 |
} |
} |
2894 |
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO) != LSCP_OK) |
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO) != LSCP_OK) |
2895 |
appendMessagesClient("lscp_client_subscribe(AUDIO_OUTPUT_DEVICE_INFO)"); |
appendMessagesClient("lscp_client_subscribe(AUDIO_OUTPUT_DEVICE_INFO)"); |
2896 |
|
|
2897 |
#if CONFIG_LSCP_CHANNEL_MIDI |
#if CONFIG_EVENT_CHANNEL_MIDI |
2898 |
// Subscribe to channel MIDI data notifications... |
// Subscribe to channel MIDI data notifications... |
2899 |
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI) != LSCP_OK) |
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI) != LSCP_OK) |
2900 |
appendMessagesClient("lscp_client_subscribe(CHANNEL_MIDI)"); |
appendMessagesClient("lscp_client_subscribe(CHANNEL_MIDI)"); |
2901 |
#endif |
#endif |
2902 |
|
|
2903 |
#if CONFIG_LSCP_DEVICE_MIDI |
#if CONFIG_EVENT_DEVICE_MIDI |
2904 |
// Subscribe to channel MIDI data notifications... |
// Subscribe to channel MIDI data notifications... |
2905 |
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI) != LSCP_OK) |
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI) != LSCP_OK) |
2906 |
appendMessagesClient("lscp_client_subscribe(DEVICE_MIDI)"); |
appendMessagesClient("lscp_client_subscribe(DEVICE_MIDI)"); |
2931 |
} |
} |
2932 |
} |
} |
2933 |
|
|
2934 |
|
// send the current / loaded fine tuning settings to the sampler |
2935 |
|
m_pOptions->sendFineTuningSettings(); |
2936 |
|
|
2937 |
// Make a new session |
// Make a new session |
2938 |
return newSession(); |
return newSession(); |
2939 |
} |
} |
2961 |
closeSession(false); |
closeSession(false); |
2962 |
|
|
2963 |
// Close us as a client... |
// Close us as a client... |
2964 |
#if CONFIG_LSCP_DEVICE_MIDI |
#if CONFIG_EVENT_DEVICE_MIDI |
2965 |
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI); |
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI); |
2966 |
#endif |
#endif |
2967 |
#if CONFIG_LSCP_CHANNEL_MIDI |
#if CONFIG_EVENT_CHANNEL_MIDI |
2968 |
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI); |
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI); |
2969 |
#endif |
#endif |
2970 |
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO); |
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO); |
2992 |
|
|
2993 |
|
|
2994 |
// Channel strip activation/selection. |
// Channel strip activation/selection. |
2995 |
void MainForm::activateStrip ( QWidget *pWidget ) |
void MainForm::activateStrip ( QMdiSubWindow *pMdiSubWindow ) |
2996 |
{ |
{ |
2997 |
ChannelStrip *pChannelStrip |
ChannelStrip *pChannelStrip = NULL; |
2998 |
= static_cast<ChannelStrip *> (pWidget); |
if (pMdiSubWindow) |
2999 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
3000 |
if (pChannelStrip) |
if (pChannelStrip) |
3001 |
pChannelStrip->setSelected(true); |
pChannelStrip->setSelected(true); |
3002 |
|
|