1 |
// qsamplerMainForm.cpp |
// qsamplerMainForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2008, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2010, 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 |
56 |
#include <QTimer> |
#include <QTimer> |
57 |
#include <QDateTime> |
#include <QDateTime> |
58 |
|
|
59 |
|
#if QT_VERSION < 0x040500 |
60 |
|
namespace Qt { |
61 |
|
const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000); |
62 |
|
#if QT_VERSION < 0x040200 |
63 |
|
const WindowFlags CustomizeWindowHint = WindowFlags(0x02000000); |
64 |
|
#endif |
65 |
|
} |
66 |
|
#endif |
67 |
|
|
68 |
#ifdef HAVE_SIGNAL_H |
#ifdef HAVE_SIGNAL_H |
69 |
#include <signal.h> |
#include <signal.h> |
105 |
#define QSAMPLER_STATUS_SESSION 3 // Current session modification state. |
#define QSAMPLER_STATUS_SESSION 3 // Current session modification state. |
106 |
|
|
107 |
|
|
108 |
|
// Specialties for thread-callback comunication. |
109 |
|
#define QSAMPLER_LSCP_EVENT QEvent::Type(QEvent::User + 1) |
110 |
|
#define QSAMPLER_SAVE_EVENT QEvent::Type(QEvent::User + 2) |
111 |
|
|
112 |
|
|
113 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
114 |
// CustomEvent -- specialty for callback comunication. |
// LscpEvent -- specialty for LSCP callback comunication. |
115 |
|
|
|
#define QSAMPLER_CUSTOM_EVENT QEvent::Type(QEvent::User + 0) |
|
116 |
|
|
117 |
class CustomEvent : public QEvent |
class LscpEvent : public QEvent |
118 |
{ |
{ |
119 |
public: |
public: |
120 |
|
|
121 |
// Constructor. |
// Constructor. |
122 |
CustomEvent(lscp_event_t event, const char *pchData, int cchData) |
LscpEvent(lscp_event_t event, const char *pchData, int cchData) |
123 |
: QEvent(QSAMPLER_CUSTOM_EVENT) |
: QEvent(QSAMPLER_LSCP_EVENT) |
124 |
{ |
{ |
125 |
m_event = event; |
m_event = event; |
126 |
m_data = QString::fromUtf8(pchData, cchData); |
m_data = QString::fromUtf8(pchData, cchData); |
140 |
|
|
141 |
|
|
142 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
143 |
|
// LADISH Level 1 support stuff. |
144 |
|
|
145 |
|
void qsampler_on_sigusr1 ( int /*signo*/ ) |
146 |
|
{ |
147 |
|
QApplication::postEvent( |
148 |
|
MainForm::getInstance(), |
149 |
|
new QEvent(QSAMPLER_SAVE_EVENT)); |
150 |
|
} |
151 |
|
|
152 |
|
|
153 |
|
//------------------------------------------------------------------------- |
154 |
// qsamplerMainForm -- Main window form implementation. |
// qsamplerMainForm -- Main window form implementation. |
155 |
|
|
156 |
// Kind of singleton reference. |
// Kind of singleton reference. |
187 |
#ifdef HAVE_SIGNAL_H |
#ifdef HAVE_SIGNAL_H |
188 |
// Set to ignore any fatal "Broken pipe" signals. |
// Set to ignore any fatal "Broken pipe" signals. |
189 |
::signal(SIGPIPE, SIG_IGN); |
::signal(SIGPIPE, SIG_IGN); |
190 |
|
// LADISH Level 1 suport. |
191 |
|
::signal(SIGUSR1, qsampler_on_sigusr1); |
192 |
#endif |
#endif |
193 |
|
|
194 |
#ifdef CONFIG_VOLUME |
#ifdef CONFIG_VOLUME |
400 |
|
|
401 |
// What style do we create these forms? |
// What style do we create these forms? |
402 |
Qt::WindowFlags wflags = Qt::Window |
Qt::WindowFlags wflags = Qt::Window |
|
#if QT_VERSION >= 0x040200 |
|
403 |
| Qt::CustomizeWindowHint |
| Qt::CustomizeWindowHint |
|
#endif |
|
404 |
| Qt::WindowTitleHint |
| Qt::WindowTitleHint |
405 |
| Qt::WindowSystemMenuHint |
| Qt::WindowSystemMenuHint |
406 |
| Qt::WindowMinMaxButtonsHint; |
| Qt::WindowMinMaxButtonsHint |
407 |
|
| Qt::WindowCloseButtonHint; |
408 |
if (m_pOptions->bKeepOnTop) |
if (m_pOptions->bKeepOnTop) |
409 |
wflags |= Qt::Tool; |
wflags |= Qt::Tool; |
410 |
|
|
411 |
// Some child forms are to be created right now. |
// Some child forms are to be created right now. |
412 |
m_pMessages = new Messages(this); |
m_pMessages = new Messages(this); |
413 |
m_pDeviceForm = new DeviceForm(this, wflags); |
m_pDeviceForm = new DeviceForm(this, wflags); |
414 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
415 |
m_pInstrumentListForm = new InstrumentListForm(this, wflags); |
m_pInstrumentListForm = new InstrumentListForm(this, wflags); |
416 |
#else |
#else |
417 |
viewInstrumentsAction->setEnabled(false); |
m_ui.viewInstrumentsAction->setEnabled(false); |
418 |
#endif |
#endif |
419 |
|
|
420 |
// Setup messages logging appropriately... |
// Setup messages logging appropriately... |
421 |
m_pMessages->setLogging( |
m_pMessages->setLogging( |
422 |
m_pOptions->bMessagesLog, |
m_pOptions->bMessagesLog, |
423 |
m_pOptions->sMessagesLogPath); |
m_pOptions->sMessagesLogPath); |
424 |
|
|
425 |
// Set message defaults... |
// Set message defaults... |
426 |
updateMessagesFont(); |
updateMessagesFont(); |
427 |
updateMessagesLimit(); |
updateMessagesLimit(); |
452 |
} |
} |
453 |
|
|
454 |
// Try to restore old window positioning and initial visibility. |
// Try to restore old window positioning and initial visibility. |
455 |
m_pOptions->loadWidgetGeometry(this); |
m_pOptions->loadWidgetGeometry(this, true); |
456 |
m_pOptions->loadWidgetGeometry(m_pInstrumentListForm); |
m_pOptions->loadWidgetGeometry(m_pInstrumentListForm); |
457 |
m_pOptions->loadWidgetGeometry(m_pDeviceForm); |
m_pOptions->loadWidgetGeometry(m_pDeviceForm); |
458 |
|
|
496 |
// And the children, and the main windows state,. |
// And the children, and the main windows state,. |
497 |
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
498 |
m_pOptions->saveWidgetGeometry(m_pInstrumentListForm); |
m_pOptions->saveWidgetGeometry(m_pInstrumentListForm); |
499 |
m_pOptions->saveWidgetGeometry(this); |
m_pOptions->saveWidgetGeometry(this, true); |
500 |
// Close popup widgets. |
// Close popup widgets. |
501 |
if (m_pInstrumentListForm) |
if (m_pInstrumentListForm) |
502 |
m_pInstrumentListForm->close(); |
m_pInstrumentListForm->close(); |
545 |
QListIterator<QUrl> iter(pMimeData->urls()); |
QListIterator<QUrl> iter(pMimeData->urls()); |
546 |
while (iter.hasNext()) { |
while (iter.hasNext()) { |
547 |
const QString& sPath = iter.next().toLocalFile(); |
const QString& sPath = iter.next().toLocalFile(); |
548 |
if (Channel::isInstrumentFile(sPath)) { |
// if (Channel::isDlsInstrumentFile(sPath)) { |
549 |
|
if (QFileInfo(sPath).exists()) { |
550 |
// Try to create a new channel from instrument file... |
// Try to create a new channel from instrument file... |
551 |
Channel *pChannel = new Channel(); |
Channel *pChannel = new Channel(); |
552 |
if (pChannel == NULL) |
if (pChannel == NULL) |
580 |
|
|
581 |
|
|
582 |
// Custome event handler. |
// Custome event handler. |
583 |
void MainForm::customEvent(QEvent* pCustomEvent) |
void MainForm::customEvent ( QEvent* pEvent ) |
584 |
{ |
{ |
585 |
// For the time being, just pump it to messages. |
// For the time being, just pump it to messages. |
586 |
if (pCustomEvent->type() == QSAMPLER_CUSTOM_EVENT) { |
if (pEvent->type() == QSAMPLER_LSCP_EVENT) { |
587 |
CustomEvent *pEvent = static_cast<CustomEvent *> (pCustomEvent); |
LscpEvent *pLscpEvent = static_cast<LscpEvent *> (pEvent); |
588 |
switch (pEvent->event()) { |
switch (pLscpEvent->event()) { |
589 |
case LSCP_EVENT_CHANNEL_COUNT: |
case LSCP_EVENT_CHANNEL_COUNT: |
590 |
updateAllChannelStrips(true); |
updateAllChannelStrips(true); |
591 |
break; |
break; |
592 |
case LSCP_EVENT_CHANNEL_INFO: { |
case LSCP_EVENT_CHANNEL_INFO: { |
593 |
int iChannelID = pEvent->data().toInt(); |
int iChannelID = pLscpEvent->data().toInt(); |
594 |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
595 |
if (pChannelStrip) |
if (pChannelStrip) |
596 |
channelStripChanged(pChannelStrip); |
channelStripChanged(pChannelStrip); |
603 |
break; |
break; |
604 |
case LSCP_EVENT_MIDI_INPUT_DEVICE_INFO: { |
case LSCP_EVENT_MIDI_INPUT_DEVICE_INFO: { |
605 |
if (m_pDeviceForm) m_pDeviceForm->refreshDevices(); |
if (m_pDeviceForm) m_pDeviceForm->refreshDevices(); |
606 |
const int iDeviceID = pEvent->data().section(' ', 0, 0).toInt(); |
const int iDeviceID = pLscpEvent->data().section(' ', 0, 0).toInt(); |
607 |
DeviceStatusForm::onDeviceChanged(iDeviceID); |
DeviceStatusForm::onDeviceChanged(iDeviceID); |
608 |
break; |
break; |
609 |
} |
} |
613 |
case LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO: |
case LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO: |
614 |
if (m_pDeviceForm) m_pDeviceForm->refreshDevices(); |
if (m_pDeviceForm) m_pDeviceForm->refreshDevices(); |
615 |
break; |
break; |
616 |
#if CONFIG_EVENT_CHANNEL_MIDI |
#if CONFIG_EVENT_CHANNEL_MIDI |
617 |
case LSCP_EVENT_CHANNEL_MIDI: { |
case LSCP_EVENT_CHANNEL_MIDI: { |
618 |
const int iChannelID = pEvent->data().section(' ', 0, 0).toInt(); |
const int iChannelID = pLscpEvent->data().section(' ', 0, 0).toInt(); |
619 |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
620 |
if (pChannelStrip) |
if (pChannelStrip) |
621 |
pChannelStrip->midiArrived(); |
pChannelStrip->midiActivityLedOn(); |
622 |
break; |
break; |
623 |
} |
} |
624 |
#endif |
#endif |
625 |
#if CONFIG_EVENT_DEVICE_MIDI |
#if CONFIG_EVENT_DEVICE_MIDI |
626 |
case LSCP_EVENT_DEVICE_MIDI: { |
case LSCP_EVENT_DEVICE_MIDI: { |
627 |
const int iDeviceID = pEvent->data().section(' ', 0, 0).toInt(); |
const int iDeviceID = pLscpEvent->data().section(' ', 0, 0).toInt(); |
628 |
const int iPortID = pEvent->data().section(' ', 1, 1).toInt(); |
const int iPortID = pLscpEvent->data().section(' ', 1, 1).toInt(); |
629 |
DeviceStatusForm* pDeviceStatusForm = |
DeviceStatusForm *pDeviceStatusForm |
630 |
DeviceStatusForm::getInstance(iDeviceID); |
= DeviceStatusForm::getInstance(iDeviceID); |
631 |
if (pDeviceStatusForm) |
if (pDeviceStatusForm) |
632 |
pDeviceStatusForm->midiArrived(iPortID); |
pDeviceStatusForm->midiArrived(iPortID); |
633 |
break; |
break; |
634 |
} |
} |
635 |
#endif |
#endif |
636 |
default: |
default: |
637 |
appendMessagesColor(tr("Notify event: %1 data: %2") |
appendMessagesColor(tr("LSCP Event: %1 data: %2") |
638 |
.arg(::lscp_event_to_text(pEvent->event())) |
.arg(::lscp_event_to_text(pLscpEvent->event())) |
639 |
.arg(pEvent->data()), "#996699"); |
.arg(pLscpEvent->data()), "#996699"); |
640 |
} |
} |
641 |
} |
} // LADISH1 Level 1 support... |
642 |
|
else if (pEvent->type() == QSAMPLER_SAVE_EVENT) |
643 |
|
saveSession(false); |
644 |
} |
} |
645 |
|
|
646 |
void MainForm::updateViewMidiDeviceStatusMenu() { |
|
647 |
|
void MainForm::updateViewMidiDeviceStatusMenu (void) |
648 |
|
{ |
649 |
m_ui.viewMidiDeviceStatusMenu->clear(); |
m_ui.viewMidiDeviceStatusMenu->clear(); |
650 |
const std::map<int, DeviceStatusForm*> statusForms = |
const std::map<int, DeviceStatusForm *> statusForms |
651 |
DeviceStatusForm::getInstances(); |
= DeviceStatusForm::getInstances(); |
652 |
for ( |
std::map<int, DeviceStatusForm *>::const_iterator iter |
653 |
std::map<int, DeviceStatusForm*>::const_iterator iter = statusForms.begin(); |
= statusForms.begin(); |
654 |
iter != statusForms.end(); ++iter |
for ( ; iter != statusForms.end(); ++iter) { |
655 |
) { |
DeviceStatusForm *pStatusForm = iter->second; |
|
DeviceStatusForm* pForm = iter->second; |
|
656 |
m_ui.viewMidiDeviceStatusMenu->addAction( |
m_ui.viewMidiDeviceStatusMenu->addAction( |
657 |
pForm->visibleAction() |
pStatusForm->visibleAction()); |
|
); |
|
658 |
} |
} |
659 |
} |
} |
660 |
|
|
661 |
|
|
662 |
// Context menu event handler. |
// Context menu event handler. |
663 |
void MainForm::contextMenuEvent( QContextMenuEvent *pEvent ) |
void MainForm::contextMenuEvent( QContextMenuEvent *pEvent ) |
664 |
{ |
{ |
790 |
"\"%1\"\n\n" |
"\"%1\"\n\n" |
791 |
"Do you want to replace it?") |
"Do you want to replace it?") |
792 |
.arg(sFilename), |
.arg(sFilename), |
793 |
tr("Replace"), tr("Cancel")) > 0) |
QMessageBox::Yes | QMessageBox::No) |
794 |
|
== QMessageBox::No) |
795 |
return false; |
return false; |
796 |
} |
} |
797 |
} |
} |
814 |
"\"%1\"\n\n" |
"\"%1\"\n\n" |
815 |
"Do you want to save the changes?") |
"Do you want to save the changes?") |
816 |
.arg(sessionName(m_sFilename)), |
.arg(sessionName(m_sFilename)), |
817 |
tr("Save"), tr("Discard"), tr("Cancel"))) { |
QMessageBox::Save | |
818 |
case 0: // Save... |
QMessageBox::Discard | |
819 |
|
QMessageBox::Cancel)) { |
820 |
|
case QMessageBox::Save: |
821 |
bClose = saveSession(false); |
bClose = saveSession(false); |
822 |
// Fall thru.... |
// Fall thru.... |
823 |
case 1: // Discard |
case QMessageBox::Discard: |
824 |
break; |
break; |
825 |
default: // Cancel. |
default: // Cancel. |
826 |
bClose = false; |
bClose = false; |
1341 |
"Please note that this operation may cause\n" |
"Please note that this operation may cause\n" |
1342 |
"temporary MIDI and Audio disruption.\n\n" |
"temporary MIDI and Audio disruption.\n\n" |
1343 |
"Do you want to reset the sampler engine now?"), |
"Do you want to reset the sampler engine now?"), |
1344 |
tr("Reset"), tr("Cancel")) > 0) |
QMessageBox::Ok | QMessageBox::Cancel) |
1345 |
|
== QMessageBox::Cancel) |
1346 |
return; |
return; |
1347 |
|
|
1348 |
// Trye closing the current session, first... |
// Trye closing the current session, first... |
1383 |
"Please note that this operation may cause\n" |
"Please note that this operation may cause\n" |
1384 |
"temporary MIDI and Audio disruption.\n\n" |
"temporary MIDI and Audio disruption.\n\n" |
1385 |
"Do you want to restart the connection now?"), |
"Do you want to restart the connection now?"), |
1386 |
tr("Restart"), tr("Cancel")) == 0); |
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok); |
1387 |
} |
} |
1388 |
|
|
1389 |
// Are we still for it? |
// Are we still for it? |
1464 |
"%1\n\n" |
"%1\n\n" |
1465 |
"Are you sure?") |
"Are you sure?") |
1466 |
.arg(pChannelStrip->windowTitle()), |
.arg(pChannelStrip->windowTitle()), |
1467 |
tr("OK"), tr("Cancel")) > 0) |
QMessageBox::Ok | QMessageBox::Cancel) |
1468 |
|
== QMessageBox::Cancel) |
1469 |
return; |
return; |
1470 |
} |
} |
1471 |
|
|
1683 |
QMessageBox::information(this, |
QMessageBox::information(this, |
1684 |
QSAMPLER_TITLE ": " + tr("Information"), |
QSAMPLER_TITLE ": " + tr("Information"), |
1685 |
tr("Some settings may be only effective\n" |
tr("Some settings may be only effective\n" |
1686 |
"next time you start this program."), tr("OK")); |
"next time you start this program.")); |
1687 |
updateMessagesCapture(); |
updateMessagesCapture(); |
1688 |
} |
} |
1689 |
// Check wheather something immediate has changed. |
// Check wheather something immediate has changed. |
1846 |
sText += tr("Instrument editing support disabled."); |
sText += tr("Instrument editing support disabled."); |
1847 |
sText += "</font></small><br />"; |
sText += "</font></small><br />"; |
1848 |
#endif |
#endif |
1849 |
|
#ifndef CONFIG_EVENT_CHANNEL_MIDI |
1850 |
|
sText += "<small><font color=\"red\">"; |
1851 |
|
sText += tr("Channel MIDI event support disabled."); |
1852 |
|
sText += "</font></small><br />"; |
1853 |
|
#endif |
1854 |
|
#ifndef CONFIG_EVENT_DEVICE_MIDI |
1855 |
|
sText += "<small><font color=\"red\">"; |
1856 |
|
sText += tr("Device MIDI event support disabled."); |
1857 |
|
sText += "</font></small><br />"; |
1858 |
|
#endif |
1859 |
|
#ifndef CONFIG_MAX_VOICES |
1860 |
|
sText += "<small><font color=\"red\">"; |
1861 |
|
sText += tr("Runtime max. voices / disk streams support disabled."); |
1862 |
|
sText += "</font></small><br />"; |
1863 |
|
#endif |
1864 |
sText += "<br />\n"; |
sText += "<br />\n"; |
1865 |
sText += tr("Using") + ": "; |
sText += tr("Using") + ": "; |
1866 |
sText += ::lscp_client_package(); |
sText += ::lscp_client_package(); |
1901 |
setWindowTitle(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName)); |
setWindowTitle(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName)); |
1902 |
|
|
1903 |
// Update the main menu state... |
// Update the main menu state... |
1904 |
ChannelStrip* pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
1905 |
bool bHasClient = (m_pOptions != NULL && m_pClient != NULL); |
bool bHasClient = (m_pOptions != NULL && m_pClient != NULL); |
1906 |
bool bHasChannel = (bHasClient && pChannelStrip != NULL); |
bool bHasChannel = (bHasClient && pChannelStrip != NULL); |
1907 |
|
bool bHasChannels = (bHasClient && m_pWorkspace->windowList().count() > 0); |
1908 |
m_ui.fileNewAction->setEnabled(bHasClient); |
m_ui.fileNewAction->setEnabled(bHasClient); |
1909 |
m_ui.fileOpenAction->setEnabled(bHasClient); |
m_ui.fileOpenAction->setEnabled(bHasClient); |
1910 |
m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0); |
m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0); |
1920 |
m_ui.editEditChannelAction->setEnabled(false); |
m_ui.editEditChannelAction->setEnabled(false); |
1921 |
#endif |
#endif |
1922 |
m_ui.editResetChannelAction->setEnabled(bHasChannel); |
m_ui.editResetChannelAction->setEnabled(bHasChannel); |
1923 |
m_ui.editResetAllChannelsAction->setEnabled(bHasChannel); |
m_ui.editResetAllChannelsAction->setEnabled(bHasChannels); |
1924 |
m_ui.viewMessagesAction->setChecked(m_pMessages && m_pMessages->isVisible()); |
m_ui.viewMessagesAction->setChecked(m_pMessages && m_pMessages->isVisible()); |
1925 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
1926 |
m_ui.viewInstrumentsAction->setChecked(m_pInstrumentListForm |
m_ui.viewInstrumentsAction->setChecked(m_pInstrumentListForm |
1932 |
m_ui.viewDevicesAction->setChecked(m_pDeviceForm |
m_ui.viewDevicesAction->setChecked(m_pDeviceForm |
1933 |
&& m_pDeviceForm->isVisible()); |
&& m_pDeviceForm->isVisible()); |
1934 |
m_ui.viewDevicesAction->setEnabled(bHasClient); |
m_ui.viewDevicesAction->setEnabled(bHasClient); |
1935 |
m_ui.channelsArrangeAction->setEnabled(bHasChannel); |
m_ui.viewMidiDeviceStatusMenu->setEnabled( |
1936 |
|
DeviceStatusForm::getInstances().size() > 0); |
1937 |
|
m_ui.channelsArrangeAction->setEnabled(bHasChannels); |
1938 |
|
|
1939 |
#ifdef CONFIG_VOLUME |
#ifdef CONFIG_VOLUME |
1940 |
// Toolbar widgets are also affected... |
// Toolbar widgets are also affected... |
2267 |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
2268 |
|
|
2269 |
QMessageBox::critical(this, |
QMessageBox::critical(this, |
2270 |
QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel")); |
QSAMPLER_TITLE ": " + tr("Error"), s, QMessageBox::Cancel); |
2271 |
} |
} |
2272 |
|
|
2273 |
|
|
2555 |
|
|
2556 |
// Is the server process instance still here? |
// Is the server process instance still here? |
2557 |
if (m_pServer) { |
if (m_pServer) { |
2558 |
switch (QMessageBox::warning(this, |
if (QMessageBox::warning(this, |
2559 |
QSAMPLER_TITLE ": " + tr("Warning"), |
QSAMPLER_TITLE ": " + tr("Warning"), |
2560 |
tr("Could not start the LinuxSampler server.\n\n" |
tr("Could not start the LinuxSampler server.\n\n" |
2561 |
"Maybe it is already started."), |
"Maybe it is already started."), |
2562 |
tr("Stop"), tr("Kill"), tr("Cancel"))) { |
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) { |
|
case 0: |
|
2563 |
m_pServer->terminate(); |
m_pServer->terminate(); |
|
break; |
|
|
case 1: |
|
2564 |
m_pServer->kill(); |
m_pServer->kill(); |
|
break; |
|
2565 |
} |
} |
2566 |
return; |
return; |
2567 |
} |
} |
2635 |
"running in the background. The sampler would continue to work\n" |
"running in the background. The sampler would continue to work\n" |
2636 |
"according to your current sampler session and you could alter the\n" |
"according to your current sampler session and you could alter the\n" |
2637 |
"sampler session at any time by relaunching QSampler.\n\n" |
"sampler session at any time by relaunching QSampler.\n\n" |
2638 |
"Do you want LinuxSampler to stop or to keep running in\n" |
"Do you want LinuxSampler to stop?"), |
2639 |
"the background?"), |
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) |
|
tr("Stop"), tr("Keep Running")) == 1) |
|
2640 |
{ |
{ |
2641 |
bForceServerStop = false; |
bForceServerStop = false; |
2642 |
} |
} |
2722 |
// as this is run under some other thread context. |
// as this is run under some other thread context. |
2723 |
// A custom event must be posted here... |
// A custom event must be posted here... |
2724 |
QApplication::postEvent(pMainForm, |
QApplication::postEvent(pMainForm, |
2725 |
new CustomEvent(event, pchData, cchData)); |
new LscpEvent(event, pchData, cchData)); |
2726 |
|
|
2727 |
return LSCP_OK; |
return LSCP_OK; |
2728 |
} |
} |