1 |
// qsamplerMainForm.cpp |
// qsamplerMainForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2010, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2014, 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 |
#if QT_VERSION < 0x040500 |
66 |
namespace Qt { |
namespace Qt { |
67 |
const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000); |
const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000); |
|
#if QT_VERSION < 0x040200 |
|
|
const WindowFlags CustomizeWindowHint = WindowFlags(0x02000000); |
|
|
#endif |
|
68 |
} |
} |
69 |
#endif |
#endif |
70 |
|
|
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. |
140 |
|
|
141 |
// Specialties for thread-callback comunication. |
// Specialties for thread-callback comunication. |
142 |
#define QSAMPLER_LSCP_EVENT QEvent::Type(QEvent::User + 1) |
#define QSAMPLER_LSCP_EVENT QEvent::Type(QEvent::User + 1) |
|
#define QSAMPLER_SAVE_EVENT QEvent::Type(QEvent::User + 2) |
|
143 |
|
|
144 |
|
|
145 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
172 |
|
|
173 |
|
|
174 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
|
// LADISH Level 1 support stuff. |
|
|
|
|
|
void qsampler_on_sigusr1 ( int /*signo*/ ) |
|
|
{ |
|
|
QApplication::postEvent( |
|
|
MainForm::getInstance(), |
|
|
new QEvent(QSAMPLER_SAVE_EVENT)); |
|
|
} |
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------- |
|
175 |
// qsamplerMainForm -- Main window form implementation. |
// qsamplerMainForm -- Main window form implementation. |
176 |
|
|
177 |
// Kind of singleton reference. |
// Kind of singleton reference. |
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 |
|
|
213 |
// LADISH Level 1 suport. |
// LADISH Level 1 suport. |
214 |
::signal(SIGUSR1, qsampler_on_sigusr1); |
|
215 |
#endif |
// 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... |
254 |
QObject::connect(m_pVolumeSlider, |
QObject::connect(m_pVolumeSlider, |
255 |
SIGNAL(valueChanged(int)), |
SIGNAL(valueChanged(int)), |
256 |
SLOT(volumeChanged(int))); |
SLOT(volumeChanged(int))); |
|
//m_ui.channelsToolbar->setHorizontallyStretchable(true); |
|
|
//m_ui.channelsToolbar->setStretchableWidget(m_pVolumeSlider); |
|
257 |
m_ui.channelsToolbar->addWidget(m_pVolumeSlider); |
m_ui.channelsToolbar->addWidget(m_pVolumeSlider); |
258 |
// Volume spin-box |
// Volume spin-box |
259 |
m_ui.channelsToolbar->addSeparator(); |
m_ui.channelsToolbar->addSeparator(); |
260 |
m_pVolumeSpinBox = new QSpinBox(m_ui.channelsToolbar); |
m_pVolumeSpinBox = new QSpinBox(m_ui.channelsToolbar); |
|
m_pVolumeSpinBox->setMaximumHeight(24); |
|
261 |
m_pVolumeSpinBox->setSuffix(" %"); |
m_pVolumeSpinBox->setSuffix(" %"); |
262 |
m_pVolumeSpinBox->setMinimum(0); |
m_pVolumeSpinBox->setMinimum(0); |
263 |
m_pVolumeSpinBox->setMaximum(100); |
m_pVolumeSpinBox->setMaximum(100); |
269 |
#endif |
#endif |
270 |
|
|
271 |
// Make it an MDI workspace. |
// Make it an MDI workspace. |
272 |
m_pWorkspace = new QWorkspace(this); |
m_pWorkspace = new QMdiArea(this); |
273 |
m_pWorkspace->setScrollBarsEnabled(true); |
m_pWorkspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
274 |
|
m_pWorkspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
275 |
// Set the activation connection. |
// Set the activation connection. |
276 |
QObject::connect(m_pWorkspace, |
QObject::connect(m_pWorkspace, |
277 |
SIGNAL(windowActivated(QWidget *)), |
SIGNAL(subWindowActivated(QMdiSubWindow *)), |
278 |
SLOT(activateStrip(QWidget *))); |
SLOT(activateStrip(QMdiSubWindow *))); |
279 |
// Make it shine :-) |
// Make it shine :-) |
280 |
setCentralWidget(m_pWorkspace); |
setCentralWidget(m_pWorkspace); |
281 |
|
|
392 |
QObject::connect(m_ui.channelsMenu, |
QObject::connect(m_ui.channelsMenu, |
393 |
SIGNAL(aboutToShow()), |
SIGNAL(aboutToShow()), |
394 |
SLOT(channelsMenuAboutToShow())); |
SLOT(channelsMenuAboutToShow())); |
395 |
|
#ifdef CONFIG_VOLUME |
396 |
|
QObject::connect(m_ui.channelsToolbar, |
397 |
|
SIGNAL(orientationChanged(Qt::Orientation)), |
398 |
|
SLOT(channelsToolbarOrientation(Qt::Orientation))); |
399 |
|
#endif |
400 |
} |
} |
401 |
|
|
402 |
// Destructor. |
// Destructor. |
409 |
WSACleanup(); |
WSACleanup(); |
410 |
#endif |
#endif |
411 |
|
|
412 |
|
#if defined(HAVE_SIGNAL_H) && defined(HAVE_SYS_SOCKET_H) |
413 |
|
if (m_pUsr1Notifier) |
414 |
|
delete m_pUsr1Notifier; |
415 |
|
#endif |
416 |
|
|
417 |
// Finally drop any widgets around... |
// Finally drop any widgets around... |
418 |
if (m_pDeviceForm) |
if (m_pDeviceForm) |
419 |
delete m_pDeviceForm; |
delete m_pDeviceForm; |
504 |
} |
} |
505 |
|
|
506 |
// Try to restore old window positioning and initial visibility. |
// Try to restore old window positioning and initial visibility. |
507 |
m_pOptions->loadWidgetGeometry(this); |
m_pOptions->loadWidgetGeometry(this, true); |
508 |
m_pOptions->loadWidgetGeometry(m_pInstrumentListForm); |
m_pOptions->loadWidgetGeometry(m_pInstrumentListForm); |
509 |
m_pOptions->loadWidgetGeometry(m_pDeviceForm); |
m_pOptions->loadWidgetGeometry(m_pDeviceForm); |
510 |
|
|
548 |
// And the children, and the main windows state,. |
// And the children, and the main windows state,. |
549 |
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
550 |
m_pOptions->saveWidgetGeometry(m_pInstrumentListForm); |
m_pOptions->saveWidgetGeometry(m_pInstrumentListForm); |
551 |
m_pOptions->saveWidgetGeometry(this); |
m_pOptions->saveWidgetGeometry(this, true); |
552 |
// Close popup widgets. |
// Close popup widgets. |
553 |
if (m_pInstrumentListForm) |
if (m_pInstrumentListForm) |
554 |
m_pInstrumentListForm->close(); |
m_pInstrumentListForm->close(); |
597 |
QListIterator<QUrl> iter(pMimeData->urls()); |
QListIterator<QUrl> iter(pMimeData->urls()); |
598 |
while (iter.hasNext()) { |
while (iter.hasNext()) { |
599 |
const QString& sPath = iter.next().toLocalFile(); |
const QString& sPath = iter.next().toLocalFile(); |
600 |
if (Channel::isInstrumentFile(sPath)) { |
// if (Channel::isDlsInstrumentFile(sPath)) { |
601 |
|
if (QFileInfo(sPath).exists()) { |
602 |
// Try to create a new channel from instrument file... |
// Try to create a new channel from instrument file... |
603 |
Channel *pChannel = new Channel(); |
Channel *pChannel = new Channel(); |
604 |
if (pChannel == NULL) |
if (pChannel == NULL) |
690 |
.arg(::lscp_event_to_text(pLscpEvent->event())) |
.arg(::lscp_event_to_text(pLscpEvent->event())) |
691 |
.arg(pLscpEvent->data()), "#996699"); |
.arg(pLscpEvent->data()), "#996699"); |
692 |
} |
} |
693 |
} // LADISH1 Level 1 support... |
} |
694 |
else if (pEvent->type() == QSAMPLER_SAVE_EVENT) |
} |
695 |
|
|
696 |
|
|
697 |
|
// LADISH Level 1 -- SIGUSR1 signal handler. |
698 |
|
void MainForm::handle_sigusr1 (void) |
699 |
|
{ |
700 |
|
#if defined(HAVE_SIGNAL_H) && defined(HAVE_SYS_SOCKET_H) |
701 |
|
|
702 |
|
char c; |
703 |
|
|
704 |
|
if (::read(g_fdUsr1[1], &c, sizeof(c)) > 0) |
705 |
saveSession(false); |
saveSession(false); |
706 |
|
|
707 |
|
#endif |
708 |
} |
} |
709 |
|
|
710 |
|
|
896 |
if (bClose) { |
if (bClose) { |
897 |
// Remove all channel strips from sight... |
// Remove all channel strips from sight... |
898 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
899 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
900 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
901 |
ChannelStrip *pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
902 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
903 |
|
if (pMdiSubWindow) |
904 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
905 |
if (pChannelStrip) { |
if (pChannelStrip) { |
906 |
Channel *pChannel = pChannelStrip->channel(); |
Channel *pChannel = pChannelStrip->channel(); |
907 |
if (bForce && pChannel) |
if (bForce && pChannel) |
908 |
pChannel->removeChannel(); |
pChannel->removeChannel(); |
909 |
delete pChannelStrip; |
delete pChannelStrip; |
910 |
} |
} |
911 |
|
if (pMdiSubWindow) |
912 |
|
delete pMdiSubWindow; |
913 |
} |
} |
914 |
m_pWorkspace->setUpdatesEnabled(true); |
m_pWorkspace->setUpdatesEnabled(true); |
915 |
// We're now clean, for sure. |
// We're now clean, for sure. |
1200 |
#endif // CONFIG_MIDI_INSTRUMENT |
#endif // CONFIG_MIDI_INSTRUMENT |
1201 |
|
|
1202 |
// Sampler channel mapping. |
// Sampler channel mapping. |
1203 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
1204 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
1205 |
ChannelStrip* pChannelStrip |
ChannelStrip *pChannelStrip = NULL; |
1206 |
= static_cast<ChannelStrip *> (wlist.at(iChannel)); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
1207 |
|
if (pMdiSubWindow) |
1208 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
1209 |
if (pChannelStrip) { |
if (pChannelStrip) { |
1210 |
Channel *pChannel = pChannelStrip->channel(); |
Channel *pChannel = pChannelStrip->channel(); |
1211 |
if (pChannel) { |
if (pChannel) { |
1253 |
ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl; |
ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl; |
1254 |
if (pChannel->channelSolo()) |
if (pChannel->channelSolo()) |
1255 |
ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl; |
ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl; |
1256 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
1257 |
if (pChannel->midiMap() >= 0) { |
if (pChannel->midiMap() >= 0) { |
1258 |
ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel |
ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel |
1259 |
<< " " << midiInstrumentMap[pChannel->midiMap()] << endl; |
<< " " << midiInstrumentMap[pChannel->midiMap()] << endl; |
1260 |
} |
} |
1261 |
#endif |
#endif |
1262 |
#ifdef CONFIG_FXSEND |
#ifdef CONFIG_FXSEND |
1263 |
int iChannelID = pChannel->channelID(); |
int iChannelID = pChannel->channelID(); |
1264 |
int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID); |
int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID); |
1265 |
for (int iFxSend = 0; |
for (int iFxSend = 0; |
1283 |
<< " " << iAudioSrc |
<< " " << iAudioSrc |
1284 |
<< " " << piRouting[iAudioSrc] << endl; |
<< " " << piRouting[iAudioSrc] << endl; |
1285 |
} |
} |
1286 |
#ifdef CONFIG_FXSEND_LEVEL |
#ifdef CONFIG_FXSEND_LEVEL |
1287 |
ts << "SET FX_SEND LEVEL " << iChannel |
ts << "SET FX_SEND LEVEL " << iChannel |
1288 |
<< " " << iFxSend |
<< " " << iFxSend |
1289 |
<< " " << pFxSendInfo->level << endl; |
<< " " << pFxSendInfo->level << endl; |
1290 |
#endif |
#endif |
1291 |
} // Check for errors... |
} // Check for errors... |
1292 |
else if (::lscp_client_get_errno(m_pClient)) { |
else if (::lscp_client_get_errno(m_pClient)) { |
1293 |
appendMessagesClient("lscp_get_fxsend_info"); |
appendMessagesClient("lscp_get_fxsend_info"); |
1294 |
iErrors++; |
iErrors++; |
1295 |
} |
} |
1296 |
} |
} |
1297 |
#endif |
#endif |
1298 |
ts << endl; |
ts << endl; |
1299 |
} |
} |
1300 |
} |
} |
1519 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1520 |
return; |
return; |
1521 |
|
|
1522 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1523 |
if (pChannelStrip == NULL) |
if (pChannelStrip == NULL) |
1524 |
return; |
return; |
1525 |
|
|
1544 |
if (!pChannel->removeChannel()) |
if (!pChannel->removeChannel()) |
1545 |
return; |
return; |
1546 |
|
|
|
// Just delete the channel strip. |
|
|
delete pChannelStrip; |
|
|
|
|
|
// Do we auto-arrange? |
|
|
if (m_pOptions && m_pOptions->bAutoArrange) |
|
|
channelsArrange(); |
|
|
|
|
1547 |
// We'll be dirty, for sure... |
// We'll be dirty, for sure... |
1548 |
m_iDirtyCount++; |
m_iDirtyCount++; |
1549 |
stabilizeForm(); |
|
1550 |
|
// Just delete the channel strip. |
1551 |
|
destroyChannelStrip(pChannelStrip); |
1552 |
} |
} |
1553 |
|
|
1554 |
|
|
1558 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1559 |
return; |
return; |
1560 |
|
|
1561 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1562 |
if (pChannelStrip == NULL) |
if (pChannelStrip == NULL) |
1563 |
return; |
return; |
1564 |
|
|
1573 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1574 |
return; |
return; |
1575 |
|
|
1576 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1577 |
if (pChannelStrip == NULL) |
if (pChannelStrip == NULL) |
1578 |
return; |
return; |
1579 |
|
|
1588 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1589 |
return; |
return; |
1590 |
|
|
1591 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1592 |
if (pChannelStrip == NULL) |
if (pChannelStrip == NULL) |
1593 |
return; |
return; |
1594 |
|
|
1606 |
// Invoque the channel strip procedure, |
// Invoque the channel strip procedure, |
1607 |
// for all channels out there... |
// for all channels out there... |
1608 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
1609 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
1610 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
1611 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
1612 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
1613 |
|
if (pMdiSubWindow) |
1614 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
1615 |
if (pChannelStrip) |
if (pChannelStrip) |
1616 |
pChannelStrip->channelReset(); |
pChannelStrip->channelReset(); |
1617 |
} |
} |
1714 |
OptionsForm* pOptionsForm = new OptionsForm(this); |
OptionsForm* pOptionsForm = new OptionsForm(this); |
1715 |
if (pOptionsForm) { |
if (pOptionsForm) { |
1716 |
// Check out some initial nullities(tm)... |
// Check out some initial nullities(tm)... |
1717 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1718 |
if (m_pOptions->sDisplayFont.isEmpty() && pChannelStrip) |
if (m_pOptions->sDisplayFont.isEmpty() && pChannelStrip) |
1719 |
m_pOptions->sDisplayFont = pChannelStrip->displayFont().toString(); |
m_pOptions->sDisplayFont = pChannelStrip->displayFont().toString(); |
1720 |
if (m_pOptions->sMessagesFont.isEmpty() && m_pMessages) |
if (m_pOptions->sMessagesFont.isEmpty() && m_pMessages) |
1807 |
void MainForm::channelsArrange (void) |
void MainForm::channelsArrange (void) |
1808 |
{ |
{ |
1809 |
// Full width vertical tiling |
// Full width vertical tiling |
1810 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
1811 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
1812 |
return; |
return; |
1813 |
|
|
1814 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
1815 |
int y = 0; |
int y = 0; |
1816 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
1817 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
1818 |
/* if (pChannelStrip->testWState(WState_Maximized | WState_Minimized)) { |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
1819 |
// Prevent flicker... |
if (pMdiSubWindow) |
1820 |
pChannelStrip->hide(); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
1821 |
pChannelStrip->showNormal(); |
if (pChannelStrip) { |
1822 |
} */ |
/* if (pChannelStrip->testWState(WState_Maximized | WState_Minimized)) { |
1823 |
pChannelStrip->adjustSize(); |
// Prevent flicker... |
1824 |
int iWidth = m_pWorkspace->width(); |
pChannelStrip->hide(); |
1825 |
if (iWidth < pChannelStrip->width()) |
pChannelStrip->showNormal(); |
1826 |
iWidth = pChannelStrip->width(); |
} */ |
1827 |
// int iHeight = pChannelStrip->height() |
pChannelStrip->adjustSize(); |
1828 |
// + pChannelStrip->parentWidget()->baseSize().height(); |
int iWidth = m_pWorkspace->width(); |
1829 |
int iHeight = pChannelStrip->parentWidget()->frameGeometry().height(); |
if (iWidth < pChannelStrip->width()) |
1830 |
pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight); |
iWidth = pChannelStrip->width(); |
1831 |
y += iHeight; |
// int iHeight = pChannelStrip->height() |
1832 |
|
// + pChannelStrip->parentWidget()->baseSize().height(); |
1833 |
|
int iHeight = pChannelStrip->parentWidget()->frameGeometry().height(); |
1834 |
|
pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight); |
1835 |
|
y += iHeight; |
1836 |
|
} |
1837 |
} |
} |
1838 |
m_pWorkspace->setUpdatesEnabled(true); |
m_pWorkspace->setUpdatesEnabled(true); |
1839 |
|
|
1978 |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1979 |
bool bHasClient = (m_pOptions != NULL && m_pClient != NULL); |
bool bHasClient = (m_pOptions != NULL && m_pClient != NULL); |
1980 |
bool bHasChannel = (bHasClient && pChannelStrip != NULL); |
bool bHasChannel = (bHasClient && pChannelStrip != NULL); |
1981 |
bool bHasChannels = (bHasClient && m_pWorkspace->windowList().count() > 0); |
bool bHasChannels = (bHasClient && m_pWorkspace->subWindowList().count() > 0); |
1982 |
m_ui.fileNewAction->setEnabled(bHasClient); |
m_ui.fileNewAction->setEnabled(bHasClient); |
1983 |
m_ui.fileOpenAction->setEnabled(bHasClient); |
m_ui.fileOpenAction->setEnabled(bHasClient); |
1984 |
m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0); |
m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0); |
2074 |
|
|
2075 |
|
|
2076 |
// Channel change receiver slot. |
// Channel change receiver slot. |
2077 |
void MainForm::channelStripChanged(ChannelStrip* pChannelStrip) |
void MainForm::channelStripChanged ( ChannelStrip *pChannelStrip ) |
2078 |
{ |
{ |
2079 |
// Add this strip to the changed list... |
// Add this strip to the changed list... |
2080 |
if (!m_changedStrips.contains(pChannelStrip)) { |
if (!m_changedStrips.contains(pChannelStrip)) { |
2125 |
m_pDeviceForm->refreshDevices(); |
m_pDeviceForm->refreshDevices(); |
2126 |
} |
} |
2127 |
|
|
2128 |
void MainForm::updateAllChannelStrips(bool bRemoveDeadStrips) { |
|
2129 |
|
void MainForm::updateAllChannelStrips ( bool bRemoveDeadStrips ) |
2130 |
|
{ |
2131 |
// Retrieve the current channel list. |
// Retrieve the current channel list. |
2132 |
int *piChannelIDs = ::lscp_list_channels(m_pClient); |
int *piChannelIDs = ::lscp_list_channels(m_pClient); |
2133 |
if (piChannelIDs == NULL) { |
if (piChannelIDs == NULL) { |
2139 |
} else { |
} else { |
2140 |
// Try to (re)create each channel. |
// Try to (re)create each channel. |
2141 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2142 |
for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) { |
for (int iChannel = 0; piChannelIDs[iChannel] >= 0; ++iChannel) { |
2143 |
// Check if theres already a channel strip for this one... |
// Check if theres already a channel strip for this one... |
2144 |
if (!channelStrip(piChannelIDs[iChannel])) |
if (!channelStrip(piChannelIDs[iChannel])) |
2145 |
createChannelStrip(new Channel(piChannelIDs[iChannel])); |
createChannelStrip(new Channel(piChannelIDs[iChannel])); |
2146 |
} |
} |
|
|
|
2147 |
// Do we auto-arrange? |
// Do we auto-arrange? |
2148 |
if (m_pOptions && m_pOptions->bAutoArrange) |
if (m_pOptions && m_pOptions->bAutoArrange) |
2149 |
channelsArrange(); |
channelsArrange(); |
|
|
|
|
stabilizeForm(); |
|
|
|
|
2150 |
// remove dead channel strips |
// remove dead channel strips |
2151 |
if (bRemoveDeadStrips) { |
if (bRemoveDeadStrips) { |
2152 |
for (int i = 0; channelStripAt(i); ++i) { |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2153 |
ChannelStrip* pChannelStrip = channelStripAt(i); |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2154 |
bool bExists = false; |
ChannelStrip *pChannelStrip = NULL; |
2155 |
for (int j = 0; piChannelIDs[j] >= 0; ++j) { |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2156 |
if (!pChannelStrip->channel()) break; |
if (pMdiSubWindow) |
2157 |
if (piChannelIDs[j] == pChannelStrip->channel()->channelID()) { |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2158 |
// strip exists, don't touch it |
if (pChannelStrip) { |
2159 |
bExists = true; |
bool bExists = false; |
2160 |
break; |
for (int j = 0; piChannelIDs[j] >= 0; ++j) { |
2161 |
|
if (!pChannelStrip->channel()) |
2162 |
|
break; |
2163 |
|
if (piChannelIDs[j] == pChannelStrip->channel()->channelID()) { |
2164 |
|
// strip exists, don't touch it |
2165 |
|
bExists = true; |
2166 |
|
break; |
2167 |
|
} |
2168 |
} |
} |
2169 |
|
if (!bExists) |
2170 |
|
destroyChannelStrip(pChannelStrip); |
2171 |
} |
} |
|
if (!bExists) destroyChannelStrip(pChannelStrip); |
|
2172 |
} |
} |
2173 |
} |
} |
2174 |
m_pWorkspace->setUpdatesEnabled(true); |
m_pWorkspace->setUpdatesEnabled(true); |
2175 |
} |
} |
2176 |
|
|
2177 |
|
stabilizeForm(); |
2178 |
} |
} |
2179 |
|
|
2180 |
|
|
2181 |
// Update the recent files list and menu. |
// Update the recent files list and menu. |
2182 |
void MainForm::updateRecentFiles ( const QString& sFilename ) |
void MainForm::updateRecentFiles ( const QString& sFilename ) |
2183 |
{ |
{ |
2224 |
void MainForm::updateInstrumentNames (void) |
void MainForm::updateInstrumentNames (void) |
2225 |
{ |
{ |
2226 |
// Full channel list update... |
// Full channel list update... |
2227 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2228 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2229 |
return; |
return; |
2230 |
|
|
2231 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2232 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2233 |
ChannelStrip *pChannelStrip = (ChannelStrip *) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = (ChannelStrip *) wlist.at(iChannel); |
2234 |
if (pChannelStrip) |
if (pChannelStrip) |
2235 |
pChannelStrip->updateInstrumentName(true); |
pChannelStrip->updateInstrumentName(true); |
2253 |
return; |
return; |
2254 |
|
|
2255 |
// Full channel list update... |
// Full channel list update... |
2256 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2257 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2258 |
return; |
return; |
2259 |
|
|
2260 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2261 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2262 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
2263 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2264 |
|
if (pMdiSubWindow) |
2265 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2266 |
if (pChannelStrip) |
if (pChannelStrip) |
2267 |
pChannelStrip->setDisplayFont(font); |
pChannelStrip->setDisplayFont(font); |
2268 |
} |
} |
2274 |
void MainForm::updateDisplayEffect (void) |
void MainForm::updateDisplayEffect (void) |
2275 |
{ |
{ |
2276 |
// Full channel list update... |
// Full channel list update... |
2277 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2278 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2279 |
return; |
return; |
2280 |
|
|
2281 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2282 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2283 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
2284 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2285 |
|
if (pMdiSubWindow) |
2286 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2287 |
if (pChannelStrip) |
if (pChannelStrip) |
2288 |
pChannelStrip->setDisplayEffect(m_pOptions->bDisplayEffect); |
pChannelStrip->setDisplayEffect(m_pOptions->bDisplayEffect); |
2289 |
} |
} |
2305 |
#endif |
#endif |
2306 |
|
|
2307 |
// Full channel list update... |
// Full channel list update... |
2308 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2309 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2310 |
return; |
return; |
2311 |
|
|
2312 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2313 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2314 |
ChannelStrip* pChannelStrip = (ChannelStrip*) wlist.at(iChannel); |
ChannelStrip *pChannelStrip = NULL; |
2315 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2316 |
|
if (pMdiSubWindow) |
2317 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2318 |
if (pChannelStrip) |
if (pChannelStrip) |
2319 |
pChannelStrip->setMaxVolume(m_pOptions->iMaxVolume); |
pChannelStrip->setMaxVolume(m_pOptions->iMaxVolume); |
2320 |
} |
} |
2422 |
// qsamplerMainForm -- MDI channel strip management. |
// qsamplerMainForm -- MDI channel strip management. |
2423 |
|
|
2424 |
// The channel strip creation executive. |
// The channel strip creation executive. |
2425 |
ChannelStrip* MainForm::createChannelStrip ( Channel *pChannel ) |
ChannelStrip *MainForm::createChannelStrip ( Channel *pChannel ) |
2426 |
{ |
{ |
2427 |
if (m_pClient == NULL || pChannel == NULL) |
if (m_pClient == NULL || pChannel == NULL) |
2428 |
return NULL; |
return NULL; |
2445 |
} |
} |
2446 |
|
|
2447 |
// Add it to workspace... |
// Add it to workspace... |
2448 |
m_pWorkspace->addWindow(pChannelStrip, Qt::FramelessWindowHint); |
m_pWorkspace->addSubWindow(pChannelStrip, |
2449 |
|
Qt::SubWindow | Qt::FramelessWindowHint); |
2450 |
|
|
2451 |
// Actual channel strip setup... |
// Actual channel strip setup... |
2452 |
pChannelStrip->setup(pChannel); |
pChannelStrip->setup(pChannel); |
2453 |
|
|
2454 |
QObject::connect(pChannelStrip, |
QObject::connect(pChannelStrip, |
2455 |
SIGNAL(channelChanged(ChannelStrip*)), |
SIGNAL(channelChanged(ChannelStrip *)), |
2456 |
SLOT(channelStripChanged(ChannelStrip*))); |
SLOT(channelStripChanged(ChannelStrip *))); |
2457 |
|
|
2458 |
// Now we show up us to the world. |
// Now we show up us to the world. |
2459 |
pChannelStrip->show(); |
pChannelStrip->show(); |
2465 |
return pChannelStrip; |
return pChannelStrip; |
2466 |
} |
} |
2467 |
|
|
2468 |
void MainForm::destroyChannelStrip(ChannelStrip* pChannelStrip) { |
|
2469 |
|
void MainForm::destroyChannelStrip ( ChannelStrip *pChannelStrip ) |
2470 |
|
{ |
2471 |
|
QMdiSubWindow *pMdiSubWindow |
2472 |
|
= static_cast<QMdiSubWindow *> (pChannelStrip->parentWidget()); |
2473 |
|
if (pMdiSubWindow == NULL) |
2474 |
|
return; |
2475 |
|
|
2476 |
// Just delete the channel strip. |
// Just delete the channel strip. |
2477 |
delete pChannelStrip; |
delete pChannelStrip; |
2478 |
|
delete pMdiSubWindow; |
2479 |
|
|
2480 |
// Do we auto-arrange? |
// Do we auto-arrange? |
2481 |
if (m_pOptions && m_pOptions->bAutoArrange) |
if (m_pOptions && m_pOptions->bAutoArrange) |
2484 |
stabilizeForm(); |
stabilizeForm(); |
2485 |
} |
} |
2486 |
|
|
2487 |
|
|
2488 |
// Retrieve the active channel strip. |
// Retrieve the active channel strip. |
2489 |
ChannelStrip* MainForm::activeChannelStrip (void) |
ChannelStrip *MainForm::activeChannelStrip (void) |
2490 |
{ |
{ |
2491 |
return static_cast<ChannelStrip *> (m_pWorkspace->activeWindow()); |
QMdiSubWindow *pMdiSubWindow = m_pWorkspace->activeSubWindow(); |
2492 |
|
if (pMdiSubWindow) |
2493 |
|
return static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2494 |
|
else |
2495 |
|
return NULL; |
2496 |
} |
} |
2497 |
|
|
2498 |
|
|
2499 |
// Retrieve a channel strip by index. |
// Retrieve a channel strip by index. |
2500 |
ChannelStrip* MainForm::channelStripAt ( int iChannel ) |
ChannelStrip *MainForm::channelStripAt ( int iChannel ) |
2501 |
{ |
{ |
2502 |
if (!m_pWorkspace) return NULL; |
if (!m_pWorkspace) return NULL; |
2503 |
|
|
2504 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2505 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2506 |
return NULL; |
return NULL; |
2507 |
|
|
2508 |
if (iChannel < 0 || iChannel >= wlist.size()) |
if (iChannel < 0 || iChannel >= wlist.size()) |
2509 |
return NULL; |
return NULL; |
2510 |
|
|
2511 |
return dynamic_cast<ChannelStrip *> (wlist.at(iChannel)); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2512 |
|
if (pMdiSubWindow) |
2513 |
|
return static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2514 |
|
else |
2515 |
|
return NULL; |
2516 |
} |
} |
2517 |
|
|
2518 |
|
|
2519 |
// Retrieve a channel strip by sampler channel id. |
// Retrieve a channel strip by sampler channel id. |
2520 |
ChannelStrip* MainForm::channelStrip ( int iChannelID ) |
ChannelStrip *MainForm::channelStrip ( int iChannelID ) |
2521 |
{ |
{ |
2522 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2523 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2524 |
return NULL; |
return NULL; |
2525 |
|
|
2526 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2527 |
ChannelStrip* pChannelStrip |
ChannelStrip *pChannelStrip = NULL; |
2528 |
= static_cast<ChannelStrip*> (wlist.at(iChannel)); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2529 |
|
if (pMdiSubWindow) |
2530 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2531 |
if (pChannelStrip) { |
if (pChannelStrip) { |
2532 |
Channel *pChannel = pChannelStrip->channel(); |
Channel *pChannel = pChannelStrip->channel(); |
2533 |
if (pChannel && pChannel->channelID() == iChannelID) |
if (pChannel && pChannel->channelID() == iChannelID) |
2547 |
m_ui.channelsMenu->addAction(m_ui.channelsArrangeAction); |
m_ui.channelsMenu->addAction(m_ui.channelsArrangeAction); |
2548 |
m_ui.channelsMenu->addAction(m_ui.channelsAutoArrangeAction); |
m_ui.channelsMenu->addAction(m_ui.channelsAutoArrangeAction); |
2549 |
|
|
2550 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2551 |
if (!wlist.isEmpty()) { |
if (!wlist.isEmpty()) { |
2552 |
m_ui.channelsMenu->addSeparator(); |
m_ui.channelsMenu->addSeparator(); |
2553 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2554 |
ChannelStrip* pChannelStrip |
ChannelStrip *pChannelStrip = NULL; |
2555 |
= static_cast<ChannelStrip*> (wlist.at(iChannel)); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2556 |
|
if (pMdiSubWindow) |
2557 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2558 |
if (pChannelStrip) { |
if (pChannelStrip) { |
2559 |
QAction *pAction = m_ui.channelsMenu->addAction( |
QAction *pAction = m_ui.channelsMenu->addAction( |
2560 |
pChannelStrip->windowTitle(), |
pChannelStrip->windowTitle(), |
2576 |
if (pAction == NULL) |
if (pAction == NULL) |
2577 |
return; |
return; |
2578 |
|
|
2579 |
ChannelStrip* pChannelStrip = channelStripAt(pAction->data().toInt()); |
ChannelStrip *pChannelStrip = channelStripAt(pAction->data().toInt()); |
2580 |
if (pChannelStrip) { |
if (pChannelStrip) { |
2581 |
pChannelStrip->showNormal(); |
pChannelStrip->showNormal(); |
2582 |
pChannelStrip->setFocus(); |
pChannelStrip->setFocus(); |
2637 |
if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime) { |
if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime) { |
2638 |
m_iTimerSlot = 0; |
m_iTimerSlot = 0; |
2639 |
// Update the channel stream usage for each strip... |
// Update the channel stream usage for each strip... |
2640 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
2641 |
for (int iChannel = 0; |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
2642 |
iChannel < (int) wlist.count(); iChannel++) { |
ChannelStrip *pChannelStrip = NULL; |
2643 |
ChannelStrip* pChannelStrip |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
2644 |
= (ChannelStrip*) wlist.at(iChannel); |
if (pMdiSubWindow) |
2645 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2646 |
if (pChannelStrip && pChannelStrip->isVisible()) |
if (pChannelStrip && pChannelStrip->isVisible()) |
2647 |
pChannelStrip->updateChannelUsage(); |
pChannelStrip->updateChannelUsage(); |
2648 |
} |
} |
2694 |
|
|
2695 |
// Setup stdout/stderr capture... |
// Setup stdout/stderr capture... |
2696 |
// if (m_pOptions->bStdoutCapture) { |
// if (m_pOptions->bStdoutCapture) { |
|
#if QT_VERSION >= 0x040200 |
|
2697 |
m_pServer->setProcessChannelMode(QProcess::ForwardedChannels); |
m_pServer->setProcessChannelMode(QProcess::ForwardedChannels); |
|
#endif |
|
2698 |
QObject::connect(m_pServer, |
QObject::connect(m_pServer, |
2699 |
SIGNAL(readyReadStandardOutput()), |
SIGNAL(readyReadStandardOutput()), |
2700 |
SLOT(readServerStdout())); |
SLOT(readServerStdout())); |
2759 |
if (m_pServer && bForceServerStop) { |
if (m_pServer && bForceServerStop) { |
2760 |
appendMessages(tr("Server is stopping...")); |
appendMessages(tr("Server is stopping...")); |
2761 |
if (m_pServer->state() == QProcess::Running) { |
if (m_pServer->state() == QProcess::Running) { |
2762 |
#if defined(WIN32) |
#if defined(WIN32) |
2763 |
// Try harder... |
// Try harder... |
2764 |
m_pServer->kill(); |
m_pServer->kill(); |
2765 |
#else |
#else |
2766 |
// Try softly... |
// Try softly... |
2767 |
m_pServer->terminate(); |
m_pServer->terminate(); |
2768 |
#endif |
#endif |
2769 |
} |
} |
2770 |
} // Do final processing anyway. |
} // Do final processing anyway. |
2771 |
else processServerExit(); |
else processServerExit(); |
2994 |
|
|
2995 |
|
|
2996 |
// Channel strip activation/selection. |
// Channel strip activation/selection. |
2997 |
void MainForm::activateStrip ( QWidget *pWidget ) |
void MainForm::activateStrip ( QMdiSubWindow *pMdiSubWindow ) |
2998 |
{ |
{ |
2999 |
ChannelStrip *pChannelStrip |
ChannelStrip *pChannelStrip = NULL; |
3000 |
= static_cast<ChannelStrip *> (pWidget); |
if (pMdiSubWindow) |
3001 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
3002 |
if (pChannelStrip) |
if (pChannelStrip) |
3003 |
pChannelStrip->setSelected(true); |
pChannelStrip->setSelected(true); |
3004 |
|
|
3006 |
} |
} |
3007 |
|
|
3008 |
|
|
3009 |
|
// Channel toolbar orientation change. |
3010 |
|
void MainForm::channelsToolbarOrientation ( Qt::Orientation orientation ) |
3011 |
|
{ |
3012 |
|
#ifdef CONFIG_VOLUME |
3013 |
|
m_pVolumeSlider->setOrientation(orientation); |
3014 |
|
if (orientation == Qt::Horizontal) { |
3015 |
|
m_pVolumeSlider->setMinimumHeight(24); |
3016 |
|
m_pVolumeSlider->setMaximumHeight(32); |
3017 |
|
m_pVolumeSlider->setMinimumWidth(120); |
3018 |
|
m_pVolumeSlider->setMaximumWidth(640); |
3019 |
|
m_pVolumeSpinBox->setMaximumWidth(64); |
3020 |
|
m_pVolumeSpinBox->setButtonSymbols(QSpinBox::UpDownArrows); |
3021 |
|
} else { |
3022 |
|
m_pVolumeSlider->setMinimumHeight(120); |
3023 |
|
m_pVolumeSlider->setMaximumHeight(480); |
3024 |
|
m_pVolumeSlider->setMinimumWidth(24); |
3025 |
|
m_pVolumeSlider->setMaximumWidth(32); |
3026 |
|
m_pVolumeSpinBox->setMaximumWidth(32); |
3027 |
|
m_pVolumeSpinBox->setButtonSymbols(QSpinBox::NoButtons); |
3028 |
|
} |
3029 |
|
#endif |
3030 |
|
} |
3031 |
|
|
3032 |
|
|
3033 |
} // namespace QSampler |
} // namespace QSampler |
3034 |
|
|
3035 |
|
|