/[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 1815 by capela, Mon Dec 22 10:04:59 2008 UTC revision 2036 by capela, Wed Jan 6 09:52:32 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 585  void MainForm::customEvent(QEvent* pCust Line 585  void MainForm::customEvent(QEvent* pCust
585                          case LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO:                          case LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO:
586                                  if (m_pDeviceForm) m_pDeviceForm->refreshDevices();                                  if (m_pDeviceForm) m_pDeviceForm->refreshDevices();
587                                  break;                                  break;
588  #if CONFIG_EVENT_CHANNEL_MIDI                  #if CONFIG_EVENT_CHANNEL_MIDI
589                          case LSCP_EVENT_CHANNEL_MIDI: {                          case LSCP_EVENT_CHANNEL_MIDI: {
590                                  const int iChannelID = pEvent->data().section(' ', 0, 0).toInt();                                  const int iChannelID = pEvent->data().section(' ', 0, 0).toInt();
591                                  ChannelStrip *pChannelStrip = channelStrip(iChannelID);                                  ChannelStrip *pChannelStrip = channelStrip(iChannelID);
592                                  if (pChannelStrip)                                  if (pChannelStrip)
593                                          pChannelStrip->midiArrived();                                          pChannelStrip->midiActivityLedOn();
594                                  break;                                  break;
595                          }                          }
596  #endif                  #endif
597  #if CONFIG_EVENT_DEVICE_MIDI                  #if CONFIG_EVENT_DEVICE_MIDI
598                          case LSCP_EVENT_DEVICE_MIDI: {                          case LSCP_EVENT_DEVICE_MIDI: {
599                                  const int iDeviceID = pEvent->data().section(' ', 0, 0).toInt();                                  const int iDeviceID = pEvent->data().section(' ', 0, 0).toInt();
600                                  const int iPortID   = pEvent->data().section(' ', 1, 1).toInt();                                  const int iPortID   = pEvent->data().section(' ', 1, 1).toInt();
601                                  DeviceStatusForm* pDeviceStatusForm =                                  DeviceStatusForm *pDeviceStatusForm
602                                          DeviceStatusForm::getInstance(iDeviceID);                                          = DeviceStatusForm::getInstance(iDeviceID);
603                                  if (pDeviceStatusForm)                                  if (pDeviceStatusForm)
604                                          pDeviceStatusForm->midiArrived(iPortID);                                          pDeviceStatusForm->midiArrived(iPortID);
605                                  break;                                  break;
606                          }                          }
607  #endif                  #endif
608                          default:                          default:
609                                  appendMessagesColor(tr("Notify event: %1 data: %2")                                  appendMessagesColor(tr("Notify event: %1 data: %2")
610                                          .arg(::lscp_event_to_text(pEvent->event()))                                          .arg(::lscp_event_to_text(pEvent->event()))
# Line 759  bool MainForm::saveSession ( bool bPromp Line 759  bool MainForm::saveSession ( bool bPromp
759                                  "\"%1\"\n\n"                                  "\"%1\"\n\n"
760                                  "Do you want to replace it?")                                  "Do you want to replace it?")
761                                  .arg(sFilename),                                  .arg(sFilename),
762                                  tr("Replace"), tr("Cancel")) > 0)                                  QMessageBox::Yes | QMessageBox::No)
763                                    == QMessageBox::No)
764                                  return false;                                  return false;
765                  }                  }
766          }          }
# Line 782  bool MainForm::closeSession ( bool bForc Line 783  bool MainForm::closeSession ( bool bForc
783                          "\"%1\"\n\n"                          "\"%1\"\n\n"
784                          "Do you want to save the changes?")                          "Do you want to save the changes?")
785                          .arg(sessionName(m_sFilename)),                          .arg(sessionName(m_sFilename)),
786                          tr("Save"), tr("Discard"), tr("Cancel"))) {                          QMessageBox::Save |
787                  case 0:     // Save...                          QMessageBox::Discard |
788                            QMessageBox::Cancel)) {
789                    case QMessageBox::Save:
790                          bClose = saveSession(false);                          bClose = saveSession(false);
791                          // Fall thru....                          // Fall thru....
792                  case 1:     // Discard                  case QMessageBox::Discard:
793                          break;                          break;
794                  default:    // Cancel.                  default:    // Cancel.
795                          bClose = false;                          bClose = false;
# Line 1307  void MainForm::fileReset (void) Line 1310  void MainForm::fileReset (void)
1310                  "Please note that this operation may cause\n"                  "Please note that this operation may cause\n"
1311                  "temporary MIDI and Audio disruption.\n\n"                  "temporary MIDI and Audio disruption.\n\n"
1312                  "Do you want to reset the sampler engine now?"),                  "Do you want to reset the sampler engine now?"),
1313                  tr("Reset"), tr("Cancel")) > 0)                  QMessageBox::Ok | QMessageBox::Cancel)
1314                    == QMessageBox::Cancel)
1315                  return;                  return;
1316    
1317          // Trye closing the current session, first...          // Trye closing the current session, first...
# Line 1348  void MainForm::fileRestart (void) Line 1352  void MainForm::fileRestart (void)
1352                          "Please note that this operation may cause\n"                          "Please note that this operation may cause\n"
1353                          "temporary MIDI and Audio disruption.\n\n"                          "temporary MIDI and Audio disruption.\n\n"
1354                          "Do you want to restart the connection now?"),                          "Do you want to restart the connection now?"),
1355                          tr("Restart"), tr("Cancel")) == 0);                          QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok);
1356          }          }
1357    
1358          // Are we still for it?          // Are we still for it?
# Line 1429  void MainForm::editRemoveChannel (void) Line 1433  void MainForm::editRemoveChannel (void)
1433                          "%1\n\n"                          "%1\n\n"
1434                          "Are you sure?")                          "Are you sure?")
1435                          .arg(pChannelStrip->windowTitle()),                          .arg(pChannelStrip->windowTitle()),
1436                          tr("OK"), tr("Cancel")) > 0)                          QMessageBox::Ok | QMessageBox::Cancel)
1437                            == QMessageBox::Cancel)
1438                          return;                          return;
1439          }          }
1440    
# Line 1647  void MainForm::viewOptions (void) Line 1652  void MainForm::viewOptions (void)
1652                                  QMessageBox::information(this,                                  QMessageBox::information(this,
1653                                          QSAMPLER_TITLE ": " + tr("Information"),                                          QSAMPLER_TITLE ": " + tr("Information"),
1654                                          tr("Some settings may be only effective\n"                                          tr("Some settings may be only effective\n"
1655                                          "next time you start this program."), tr("OK"));                                          "next time you start this program."));
1656                                  updateMessagesCapture();                                  updateMessagesCapture();
1657                          }                          }
1658                          // Check wheather something immediate has changed.                          // Check wheather something immediate has changed.
# Line 2228  void MainForm::appendMessagesError( cons Line 2233  void MainForm::appendMessagesError( cons
2233          QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);          QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
2234    
2235          QMessageBox::critical(this,          QMessageBox::critical(this,
2236                  QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel"));                  QSAMPLER_TITLE ": " + tr("Error"), s, QMessageBox::Cancel);
2237  }  }
2238    
2239    
# Line 2516  void MainForm::startServer (void) Line 2521  void MainForm::startServer (void)
2521    
2522          // Is the server process instance still here?          // Is the server process instance still here?
2523          if (m_pServer) {          if (m_pServer) {
2524                  switch (QMessageBox::warning(this,                  if (QMessageBox::warning(this,
2525                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),
2526                          tr("Could not start the LinuxSampler server.\n\n"                          tr("Could not start the LinuxSampler server.\n\n"
2527                          "Maybe it is already started."),                          "Maybe it is already started."),
2528                          tr("Stop"), tr("Kill"), tr("Cancel"))) {                          QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
                 case 0:  
2529                          m_pServer->terminate();                          m_pServer->terminate();
                         break;  
                 case 1:  
2530                          m_pServer->kill();                          m_pServer->kill();
                         break;  
2531                  }                  }
2532                  return;                  return;
2533          }          }
# Line 2600  void MainForm::stopServer (bool bInterac Line 2601  void MainForm::stopServer (bool bInterac
2601                          "running in the background. The sampler would continue to work\n"                          "running in the background. The sampler would continue to work\n"
2602                          "according to your current sampler session and you could alter the\n"                          "according to your current sampler session and you could alter the\n"
2603                          "sampler session at any time by relaunching QSampler.\n\n"                          "sampler session at any time by relaunching QSampler.\n\n"
2604                          "Do you want LinuxSampler to stop or to keep running in\n"                          "Do you want LinuxSampler to stop?"),
2605                          "the background?"),                          QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
                         tr("Stop"), tr("Keep Running")) == 1)  
2606                  {                  {
2607                          bForceServerStop = false;                          bForceServerStop = false;
2608                  }                  }

Legend:
Removed from v.1815  
changed lines
  Added in v.2036

  ViewVC Help
Powered by ViewVC