/[svn]/qsampler/trunk/src/qsamplerMainForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerMainForm.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1738 by capela, Wed May 14 15:24:22 2008 UTC revision 2077 by capela, Wed Mar 31 09:07:30 2010 UTC
# Line 1  Line 1 
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
# Line 56  Line 56 
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>
# Line 97  namespace QSampler { Line 105  namespace QSampler {
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);
# Line 128  private: Line 140  private:
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.
# Line 164  MainForm::MainForm ( QWidget *pParent ) Line 187  MainForm::MainForm ( QWidget *pParent )
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
# Line 375  void MainForm::setup ( Options *pOptions Line 400  void MainForm::setup ( Options *pOptions
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          // Setup appropriately...  
420          m_pMessages->setLogging(m_pOptions->bMessagesLog, m_pOptions->sMessagesLogPath);          // Setup messages logging appropriately...
421            m_pMessages->setLogging(
422                    m_pOptions->bMessagesLog,
423                    m_pOptions->sMessagesLogPath);
424    
425          // Set message defaults...          // Set message defaults...
426          updateMessagesFont();          updateMessagesFont();
427          updateMessagesLimit();          updateMessagesLimit();
# Line 423  void MainForm::setup ( Options *pOptions Line 452  void MainForm::setup ( Options *pOptions
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    
# Line 467  bool MainForm::queryClose (void) Line 496  bool MainForm::queryClose (void)
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();
# Line 550  void MainForm::dropEvent ( QDropEvent* p Line 579  void MainForm::dropEvent ( QDropEvent* p
579    
580    
581  // Custome event handler.  // Custome event handler.
582  void MainForm::customEvent(QEvent* pCustomEvent)  void MainForm::customEvent ( QEvent* pEvent )
583  {  {
584          // For the time being, just pump it to messages.          // For the time being, just pump it to messages.
585          if (pCustomEvent->type() == QSAMPLER_CUSTOM_EVENT) {          if (pEvent->type() == QSAMPLER_LSCP_EVENT) {
586                  CustomEvent *pEvent = static_cast<CustomEvent *> (pCustomEvent);                  LscpEvent *pLscpEvent = static_cast<LscpEvent *> (pEvent);
587                  switch (pEvent->event()) {                  switch (pLscpEvent->event()) {
588                          case LSCP_EVENT_CHANNEL_COUNT:                          case LSCP_EVENT_CHANNEL_COUNT:
589                                  updateAllChannelStrips(true);                                  updateAllChannelStrips(true);
590                                  break;                                  break;
591                          case LSCP_EVENT_CHANNEL_INFO: {                          case LSCP_EVENT_CHANNEL_INFO: {
592                                  int iChannelID = pEvent->data().toInt();                                  int iChannelID = pLscpEvent->data().toInt();
593                                  ChannelStrip *pChannelStrip = channelStrip(iChannelID);                                  ChannelStrip *pChannelStrip = channelStrip(iChannelID);
594                                  if (pChannelStrip)                                  if (pChannelStrip)
595                                          channelStripChanged(pChannelStrip);                                          channelStripChanged(pChannelStrip);
# Line 573  void MainForm::customEvent(QEvent* pCust Line 602  void MainForm::customEvent(QEvent* pCust
602                                  break;                                  break;
603                          case LSCP_EVENT_MIDI_INPUT_DEVICE_INFO: {                          case LSCP_EVENT_MIDI_INPUT_DEVICE_INFO: {
604                                  if (m_pDeviceForm) m_pDeviceForm->refreshDevices();                                  if (m_pDeviceForm) m_pDeviceForm->refreshDevices();
605                                  const int iDeviceID = pEvent->data().section(' ', 0, 0).toInt();                                  const int iDeviceID = pLscpEvent->data().section(' ', 0, 0).toInt();
606                                  DeviceStatusForm::onDeviceChanged(iDeviceID);                                  DeviceStatusForm::onDeviceChanged(iDeviceID);
607                                  break;                                  break;
608                          }                          }
# Line 583  void MainForm::customEvent(QEvent* pCust Line 612  void MainForm::customEvent(QEvent* pCust
612                          case LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO:                          case LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO:
613                                  if (m_pDeviceForm) m_pDeviceForm->refreshDevices();                                  if (m_pDeviceForm) m_pDeviceForm->refreshDevices();
614                                  break;                                  break;
615  #if CONFIG_EVENT_CHANNEL_MIDI                  #if CONFIG_EVENT_CHANNEL_MIDI
616                          case LSCP_EVENT_CHANNEL_MIDI: {                          case LSCP_EVENT_CHANNEL_MIDI: {
617                                  const int iChannelID = pEvent->data().section(' ', 0, 0).toInt();                                  const int iChannelID = pLscpEvent->data().section(' ', 0, 0).toInt();
618                                  ChannelStrip *pChannelStrip = channelStrip(iChannelID);                                  ChannelStrip *pChannelStrip = channelStrip(iChannelID);
619                                  if (pChannelStrip)                                  if (pChannelStrip)
620                                          pChannelStrip->midiArrived();                                          pChannelStrip->midiActivityLedOn();
621                                  break;                                  break;
622                          }                          }
623  #endif                  #endif
624  #if CONFIG_EVENT_DEVICE_MIDI                  #if CONFIG_EVENT_DEVICE_MIDI
625                          case LSCP_EVENT_DEVICE_MIDI: {                          case LSCP_EVENT_DEVICE_MIDI: {
626                                  const int iDeviceID = pEvent->data().section(' ', 0, 0).toInt();                                  const int iDeviceID = pLscpEvent->data().section(' ', 0, 0).toInt();
627                                  const int iPortID   = pEvent->data().section(' ', 1, 1).toInt();                                  const int iPortID   = pLscpEvent->data().section(' ', 1, 1).toInt();
628                                  DeviceStatusForm* pDeviceStatusForm =                                  DeviceStatusForm *pDeviceStatusForm
629                                          DeviceStatusForm::getInstance(iDeviceID);                                          = DeviceStatusForm::getInstance(iDeviceID);
630                                  if (pDeviceStatusForm)                                  if (pDeviceStatusForm)
631                                          pDeviceStatusForm->midiArrived(iPortID);                                          pDeviceStatusForm->midiArrived(iPortID);
632                                  break;                                  break;
633                          }                          }
634  #endif                  #endif
635                          default:                          default:
636                                  appendMessagesColor(tr("Notify event: %1 data: %2")                                  appendMessagesColor(tr("LSCP Event: %1 data: %2")
637                                          .arg(::lscp_event_to_text(pEvent->event()))                                          .arg(::lscp_event_to_text(pLscpEvent->event()))
638                                          .arg(pEvent->data()), "#996699");                                          .arg(pLscpEvent->data()), "#996699");
639                  }                  }
640          }          }       // LADISH1 Level 1 support...
641            else if (pEvent->type() == QSAMPLER_SAVE_EVENT)
642                    saveSession(false);
643  }  }
644    
645  void MainForm::updateViewMidiDeviceStatusMenu() {  
646    void MainForm::updateViewMidiDeviceStatusMenu (void)
647    {
648          m_ui.viewMidiDeviceStatusMenu->clear();          m_ui.viewMidiDeviceStatusMenu->clear();
649          const std::map<int, DeviceStatusForm*> statusForms =          const std::map<int, DeviceStatusForm *> statusForms
650                  DeviceStatusForm::getInstances();                  = DeviceStatusForm::getInstances();
651          for (          std::map<int, DeviceStatusForm *>::const_iterator iter
652                  std::map<int, DeviceStatusForm*>::const_iterator iter = statusForms.begin();                  = statusForms.begin();
653                  iter != statusForms.end(); ++iter          for ( ; iter != statusForms.end(); ++iter) {
654          ) {                  DeviceStatusForm *pStatusForm = iter->second;
                 DeviceStatusForm* pForm = iter->second;  
655                  m_ui.viewMidiDeviceStatusMenu->addAction(                  m_ui.viewMidiDeviceStatusMenu->addAction(
656                          pForm->visibleAction()                          pStatusForm->visibleAction());
                 );  
657          }          }
658  }  }
659    
660    
661  // Context menu event handler.  // Context menu event handler.
662  void MainForm::contextMenuEvent( QContextMenuEvent *pEvent )  void MainForm::contextMenuEvent( QContextMenuEvent *pEvent )
663  {  {
# Line 757  bool MainForm::saveSession ( bool bPromp Line 789  bool MainForm::saveSession ( bool bPromp
789                                  "\"%1\"\n\n"                                  "\"%1\"\n\n"
790                                  "Do you want to replace it?")                                  "Do you want to replace it?")
791                                  .arg(sFilename),                                  .arg(sFilename),
792                                  tr("Replace"), tr("Cancel")) > 0)                                  QMessageBox::Yes | QMessageBox::No)
793                                    == QMessageBox::No)
794                                  return false;                                  return false;
795                  }                  }
796          }          }
# Line 780  bool MainForm::closeSession ( bool bForc Line 813  bool MainForm::closeSession ( bool bForc
813                          "\"%1\"\n\n"                          "\"%1\"\n\n"
814                          "Do you want to save the changes?")                          "Do you want to save the changes?")
815                          .arg(sessionName(m_sFilename)),                          .arg(sessionName(m_sFilename)),
816                          tr("Save"), tr("Discard"), tr("Cancel"))) {                          QMessageBox::Save |
817                  case 0:     // Save...                          QMessageBox::Discard |
818                            QMessageBox::Cancel)) {
819                    case QMessageBox::Save:
820                          bClose = saveSession(false);                          bClose = saveSession(false);
821                          // Fall thru....                          // Fall thru....
822                  case 1:     // Discard                  case QMessageBox::Discard:
823                          break;                          break;
824                  default:    // Cancel.                  default:    // Cancel.
825                          bClose = false;                          bClose = false;
# Line 1305  void MainForm::fileReset (void) Line 1340  void MainForm::fileReset (void)
1340                  "Please note that this operation may cause\n"                  "Please note that this operation may cause\n"
1341                  "temporary MIDI and Audio disruption.\n\n"                  "temporary MIDI and Audio disruption.\n\n"
1342                  "Do you want to reset the sampler engine now?"),                  "Do you want to reset the sampler engine now?"),
1343                  tr("Reset"), tr("Cancel")) > 0)                  QMessageBox::Ok | QMessageBox::Cancel)
1344                    == QMessageBox::Cancel)
1345                  return;                  return;
1346    
1347          // Trye closing the current session, first...          // Trye closing the current session, first...
# Line 1346  void MainForm::fileRestart (void) Line 1382  void MainForm::fileRestart (void)
1382                          "Please note that this operation may cause\n"                          "Please note that this operation may cause\n"
1383                          "temporary MIDI and Audio disruption.\n\n"                          "temporary MIDI and Audio disruption.\n\n"
1384                          "Do you want to restart the connection now?"),                          "Do you want to restart the connection now?"),
1385                          tr("Restart"), tr("Cancel")) == 0);                          QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok);
1386          }          }
1387    
1388          // Are we still for it?          // Are we still for it?
# Line 1427  void MainForm::editRemoveChannel (void) Line 1463  void MainForm::editRemoveChannel (void)
1463                          "%1\n\n"                          "%1\n\n"
1464                          "Are you sure?")                          "Are you sure?")
1465                          .arg(pChannelStrip->windowTitle()),                          .arg(pChannelStrip->windowTitle()),
1466                          tr("OK"), tr("Cancel")) > 0)                          QMessageBox::Ok | QMessageBox::Cancel)
1467                            == QMessageBox::Cancel)
1468                          return;                          return;
1469          }          }
1470    
# Line 1618  void MainForm::viewOptions (void) Line 1655  void MainForm::viewOptions (void)
1655                  int     iOldServerTimeout   = m_pOptions->iServerTimeout;                  int     iOldServerTimeout   = m_pOptions->iServerTimeout;
1656                  bool    bOldServerStart     = m_pOptions->bServerStart;                  bool    bOldServerStart     = m_pOptions->bServerStart;
1657                  QString sOldServerCmdLine   = m_pOptions->sServerCmdLine;                  QString sOldServerCmdLine   = m_pOptions->sServerCmdLine;
1658                  bool    bOldMessagesLog     = m_pOptions->bMessagesLog;                  bool    bOldMessagesLog     = m_pOptions->bMessagesLog;
1659                  QString sOldMessagesLogPath = m_pOptions->sMessagesLogPath;                  QString sOldMessagesLogPath = m_pOptions->sMessagesLogPath;
1660                  QString sOldDisplayFont     = m_pOptions->sDisplayFont;                  QString sOldDisplayFont     = m_pOptions->sDisplayFont;
1661                  bool    bOldDisplayEffect   = m_pOptions->bDisplayEffect;                  bool    bOldDisplayEffect   = m_pOptions->bDisplayEffect;
# Line 1631  void MainForm::viewOptions (void) Line 1668  void MainForm::viewOptions (void)
1668                  bool    bOldCompletePath    = m_pOptions->bCompletePath;                  bool    bOldCompletePath    = m_pOptions->bCompletePath;
1669                  bool    bOldInstrumentNames = m_pOptions->bInstrumentNames;                  bool    bOldInstrumentNames = m_pOptions->bInstrumentNames;
1670                  int     iOldMaxRecentFiles  = m_pOptions->iMaxRecentFiles;                  int     iOldMaxRecentFiles  = m_pOptions->iMaxRecentFiles;
1671                    int     iOldBaseFontSize    = m_pOptions->iBaseFontSize;
1672                  // Load the current setup settings.                  // Load the current setup settings.
1673                  pOptionsForm->setup(m_pOptions);                  pOptionsForm->setup(m_pOptions);
1674                  // Show the setup dialog...                  // Show the setup dialog...
# Line 1639  void MainForm::viewOptions (void) Line 1677  void MainForm::viewOptions (void)
1677                          if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) ||                          if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) ||
1678                                  (!bOldStdoutCapture &&  m_pOptions->bStdoutCapture) ||                                  (!bOldStdoutCapture &&  m_pOptions->bStdoutCapture) ||
1679                                  ( bOldKeepOnTop     && !m_pOptions->bKeepOnTop)     ||                                  ( bOldKeepOnTop     && !m_pOptions->bKeepOnTop)     ||
1680                                  (!bOldKeepOnTop     &&  m_pOptions->bKeepOnTop)) {                                  (!bOldKeepOnTop     &&  m_pOptions->bKeepOnTop)     ||
1681                                    (iOldBaseFontSize   !=  m_pOptions->iBaseFontSize)) {
1682                                  QMessageBox::information(this,                                  QMessageBox::information(this,
1683                                          QSAMPLER_TITLE ": " + tr("Information"),                                          QSAMPLER_TITLE ": " + tr("Information"),
1684                                          tr("Some settings may be only effective\n"                                          tr("Some settings may be only effective\n"
1685                                          "next time you start this program."), tr("OK"));                                          "next time you start this program."));
1686                                  updateMessagesCapture();                                  updateMessagesCapture();
1687                          }                          }
1688                          // Check wheather something immediate has changed.                          // Check wheather something immediate has changed.
# Line 1806  void MainForm::helpAbout (void) Line 1845  void MainForm::helpAbout (void)
1845          sText += tr("Instrument editing support disabled.");          sText += tr("Instrument editing support disabled.");
1846          sText += "</font></small><br />";          sText += "</font></small><br />";
1847  #endif  #endif
1848    #ifndef CONFIG_EVENT_CHANNEL_MIDI
1849            sText += "<small><font color=\"red\">";
1850            sText += tr("Channel MIDI event support disabled.");
1851            sText += "</font></small><br />";
1852    #endif
1853    #ifndef CONFIG_EVENT_DEVICE_MIDI
1854            sText += "<small><font color=\"red\">";
1855            sText += tr("Device MIDI event support disabled.");
1856            sText += "</font></small><br />";
1857    #endif
1858    #ifndef CONFIG_MAX_VOICES
1859            sText += "<small><font color=\"red\">";
1860            sText += tr("Runtime max. voices / disk streams support disabled.");
1861            sText += "</font></small><br />";
1862    #endif
1863          sText += "<br />\n";          sText += "<br />\n";
1864          sText += tr("Using") + ": ";          sText += tr("Using") + ": ";
1865          sText += ::lscp_client_package();          sText += ::lscp_client_package();
# Line 1846  void MainForm::stabilizeForm (void) Line 1900  void MainForm::stabilizeForm (void)
1900          setWindowTitle(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName));          setWindowTitle(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName));
1901    
1902          // Update the main menu state...          // Update the main menu state...
1903          ChannelStrip* pChannelStrip = activeChannelStrip();          ChannelStrip *pChannelStrip = activeChannelStrip();
1904          bool bHasClient  = (m_pOptions != NULL && m_pClient != NULL);          bool bHasClient = (m_pOptions != NULL && m_pClient != NULL);
1905          bool bHasChannel = (bHasClient && pChannelStrip != NULL);          bool bHasChannel = (bHasClient && pChannelStrip != NULL);
1906            bool bHasChannels = (bHasClient && m_pWorkspace->windowList().count() > 0);
1907          m_ui.fileNewAction->setEnabled(bHasClient);          m_ui.fileNewAction->setEnabled(bHasClient);
1908          m_ui.fileOpenAction->setEnabled(bHasClient);          m_ui.fileOpenAction->setEnabled(bHasClient);
1909          m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0);          m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0);
# Line 1864  void MainForm::stabilizeForm (void) Line 1919  void MainForm::stabilizeForm (void)
1919          m_ui.editEditChannelAction->setEnabled(false);          m_ui.editEditChannelAction->setEnabled(false);
1920  #endif  #endif
1921          m_ui.editResetChannelAction->setEnabled(bHasChannel);          m_ui.editResetChannelAction->setEnabled(bHasChannel);
1922          m_ui.editResetAllChannelsAction->setEnabled(bHasChannel);          m_ui.editResetAllChannelsAction->setEnabled(bHasChannels);
1923          m_ui.viewMessagesAction->setChecked(m_pMessages && m_pMessages->isVisible());          m_ui.viewMessagesAction->setChecked(m_pMessages && m_pMessages->isVisible());
1924  #ifdef CONFIG_MIDI_INSTRUMENT  #ifdef CONFIG_MIDI_INSTRUMENT
1925          m_ui.viewInstrumentsAction->setChecked(m_pInstrumentListForm          m_ui.viewInstrumentsAction->setChecked(m_pInstrumentListForm
# Line 1876  void MainForm::stabilizeForm (void) Line 1931  void MainForm::stabilizeForm (void)
1931          m_ui.viewDevicesAction->setChecked(m_pDeviceForm          m_ui.viewDevicesAction->setChecked(m_pDeviceForm
1932                  && m_pDeviceForm->isVisible());                  && m_pDeviceForm->isVisible());
1933          m_ui.viewDevicesAction->setEnabled(bHasClient);          m_ui.viewDevicesAction->setEnabled(bHasClient);
1934          m_ui.channelsArrangeAction->setEnabled(bHasChannel);          m_ui.viewMidiDeviceStatusMenu->setEnabled(
1935                    DeviceStatusForm::getInstances().size() > 0);
1936            m_ui.channelsArrangeAction->setEnabled(bHasChannels);
1937    
1938  #ifdef CONFIG_VOLUME  #ifdef CONFIG_VOLUME
1939          // Toolbar widgets are also affected...          // Toolbar widgets are also affected...
# Line 2209  void MainForm::appendMessagesError( cons Line 2266  void MainForm::appendMessagesError( cons
2266          QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);          QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
2267    
2268          QMessageBox::critical(this,          QMessageBox::critical(this,
2269                  QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel"));                  QSAMPLER_TITLE ": " + tr("Error"), s, QMessageBox::Cancel);
2270  }  }
2271    
2272    
# Line 2497  void MainForm::startServer (void) Line 2554  void MainForm::startServer (void)
2554    
2555          // Is the server process instance still here?          // Is the server process instance still here?
2556          if (m_pServer) {          if (m_pServer) {
2557                  switch (QMessageBox::warning(this,                  if (QMessageBox::warning(this,
2558                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),
2559                          tr("Could not start the LinuxSampler server.\n\n"                          tr("Could not start the LinuxSampler server.\n\n"
2560                          "Maybe it is already started."),                          "Maybe it is already started."),
2561                          tr("Stop"), tr("Kill"), tr("Cancel"))) {                          QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
                 case 0:  
2562                          m_pServer->terminate();                          m_pServer->terminate();
                         break;  
                 case 1:  
2563                          m_pServer->kill();                          m_pServer->kill();
                         break;  
2564                  }                  }
2565                  return;                  return;
2566          }          }
# Line 2581  void MainForm::stopServer (bool bInterac Line 2634  void MainForm::stopServer (bool bInterac
2634                          "running in the background. The sampler would continue to work\n"                          "running in the background. The sampler would continue to work\n"
2635                          "according to your current sampler session and you could alter the\n"                          "according to your current sampler session and you could alter the\n"
2636                          "sampler session at any time by relaunching QSampler.\n\n"                          "sampler session at any time by relaunching QSampler.\n\n"
2637                          "Do you want LinuxSampler to stop or to keep running in\n"                          "Do you want LinuxSampler to stop?"),
2638                          "the background?"),                          QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
                         tr("Stop"), tr("Keep Running")) == 1)  
2639                  {                  {
2640                          bForceServerStop = false;                          bForceServerStop = false;
2641                  }                  }
# Line 2669  lscp_status_t qsampler_client_callback ( Line 2721  lscp_status_t qsampler_client_callback (
2721          // as this is run under some other thread context.          // as this is run under some other thread context.
2722          // A custom event must be posted here...          // A custom event must be posted here...
2723          QApplication::postEvent(pMainForm,          QApplication::postEvent(pMainForm,
2724                  new CustomEvent(event, pchData, cchData));                  new LscpEvent(event, pchData, cchData));
2725    
2726          return LSCP_OK;          return LSCP_OK;
2727  }  }
# Line 2767  bool MainForm::startClient (void) Line 2819  bool MainForm::startClient (void)
2819                  }                  }
2820          }          }
2821    
2822            // send the current / loaded fine tuning settings to the sampler
2823            m_pOptions->sendFineTuningSettings();
2824    
2825          // Make a new session          // Make a new session
2826          return newSession();          return newSession();
2827  }  }

Legend:
Removed from v.1738  
changed lines
  Added in v.2077

  ViewVC Help
Powered by ViewVC