/[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 1702 by schoenebeck, Sun Feb 17 13:53:00 2008 UTC revision 1815 by capela, Mon Dec 22 10:04:59 2008 UTC
# Line 1  Line 1 
1  // qsamplerMainForm.cpp  // qsamplerMainForm.cpp
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2008, 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 391  void MainForm::setup ( Options *pOptions Line 391  void MainForm::setup ( Options *pOptions
391  #else  #else
392          viewInstrumentsAction->setEnabled(false);          viewInstrumentsAction->setEnabled(false);
393  #endif  #endif
394            // Setup messages logging appropriately...
395            m_pMessages->setLogging(
396                    m_pOptions->bMessagesLog,
397                    m_pOptions->sMessagesLogPath);
398          // Set message defaults...          // Set message defaults...
399          updateMessagesFont();          updateMessagesFont();
400          updateMessagesLimit();          updateMessagesLimit();
# Line 581  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_LSCP_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);
# Line 590  void MainForm::customEvent(QEvent* pCust Line 594  void MainForm::customEvent(QEvent* pCust
594                                  break;                                  break;
595                          }                          }
596  #endif  #endif
597  #if CONFIG_LSCP_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();
# Line 1616  void MainForm::viewOptions (void) Line 1620  void MainForm::viewOptions (void)
1620                  int     iOldServerTimeout   = m_pOptions->iServerTimeout;                  int     iOldServerTimeout   = m_pOptions->iServerTimeout;
1621                  bool    bOldServerStart     = m_pOptions->bServerStart;                  bool    bOldServerStart     = m_pOptions->bServerStart;
1622                  QString sOldServerCmdLine   = m_pOptions->sServerCmdLine;                  QString sOldServerCmdLine   = m_pOptions->sServerCmdLine;
1623                    bool    bOldMessagesLog     = m_pOptions->bMessagesLog;
1624                    QString sOldMessagesLogPath = m_pOptions->sMessagesLogPath;
1625                  QString sOldDisplayFont     = m_pOptions->sDisplayFont;                  QString sOldDisplayFont     = m_pOptions->sDisplayFont;
1626                  bool    bOldDisplayEffect   = m_pOptions->bDisplayEffect;                  bool    bOldDisplayEffect   = m_pOptions->bDisplayEffect;
1627                  int     iOldMaxVolume       = m_pOptions->iMaxVolume;                  int     iOldMaxVolume       = m_pOptions->iMaxVolume;
# Line 1627  void MainForm::viewOptions (void) Line 1633  void MainForm::viewOptions (void)
1633                  bool    bOldCompletePath    = m_pOptions->bCompletePath;                  bool    bOldCompletePath    = m_pOptions->bCompletePath;
1634                  bool    bOldInstrumentNames = m_pOptions->bInstrumentNames;                  bool    bOldInstrumentNames = m_pOptions->bInstrumentNames;
1635                  int     iOldMaxRecentFiles  = m_pOptions->iMaxRecentFiles;                  int     iOldMaxRecentFiles  = m_pOptions->iMaxRecentFiles;
1636                    int     iOldBaseFontSize    = m_pOptions->iBaseFontSize;
1637                  // Load the current setup settings.                  // Load the current setup settings.
1638                  pOptionsForm->setup(m_pOptions);                  pOptionsForm->setup(m_pOptions);
1639                  // Show the setup dialog...                  // Show the setup dialog...
# Line 1635  void MainForm::viewOptions (void) Line 1642  void MainForm::viewOptions (void)
1642                          if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) ||                          if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) ||
1643                                  (!bOldStdoutCapture &&  m_pOptions->bStdoutCapture) ||                                  (!bOldStdoutCapture &&  m_pOptions->bStdoutCapture) ||
1644                                  ( bOldKeepOnTop     && !m_pOptions->bKeepOnTop)     ||                                  ( bOldKeepOnTop     && !m_pOptions->bKeepOnTop)     ||
1645                                  (!bOldKeepOnTop     &&  m_pOptions->bKeepOnTop)) {                                  (!bOldKeepOnTop     &&  m_pOptions->bKeepOnTop)     ||
1646                                    (iOldBaseFontSize   !=  m_pOptions->iBaseFontSize)) {
1647                                  QMessageBox::information(this,                                  QMessageBox::information(this,
1648                                          QSAMPLER_TITLE ": " + tr("Information"),                                          QSAMPLER_TITLE ": " + tr("Information"),
1649                                          tr("Some settings may be only effective\n"                                          tr("Some settings may be only effective\n"
# Line 1643  void MainForm::viewOptions (void) Line 1651  void MainForm::viewOptions (void)
1651                                  updateMessagesCapture();                                  updateMessagesCapture();
1652                          }                          }
1653                          // Check wheather something immediate has changed.                          // Check wheather something immediate has changed.
1654                            if (( bOldMessagesLog && !m_pOptions->bMessagesLog) ||
1655                                    (!bOldMessagesLog &&  m_pOptions->bMessagesLog) ||
1656                                    (sOldMessagesLogPath != m_pOptions->sMessagesLogPath))
1657                                    m_pMessages->setLogging(
1658                                            m_pOptions->bMessagesLog, m_pOptions->sMessagesLogPath);
1659                          if (( bOldCompletePath && !m_pOptions->bCompletePath) ||                          if (( bOldCompletePath && !m_pOptions->bCompletePath) ||
1660                                  (!bOldCompletePath &&  m_pOptions->bCompletePath) ||                                  (!bOldCompletePath &&  m_pOptions->bCompletePath) ||
1661                                  (iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles))                                  (iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles))
# Line 1797  void MainForm::helpAbout (void) Line 1810  void MainForm::helpAbout (void)
1810          sText += tr("Instrument editing support disabled.");          sText += tr("Instrument editing support disabled.");
1811          sText += "</font></small><br />";          sText += "</font></small><br />";
1812  #endif  #endif
1813    #ifndef CONFIG_EVENT_CHANNEL_MIDI
1814            sText += "<small><font color=\"red\">";
1815            sText += tr("Channel MIDI event support disabled.");
1816            sText += "</font></small><br />";
1817    #endif
1818    #ifndef CONFIG_EVENT_DEVICE_MIDI
1819            sText += "<small><font color=\"red\">";
1820            sText += tr("Device MIDI event support disabled.");
1821            sText += "</font></small><br />";
1822    #endif
1823    #ifndef CONFIG_MAX_VOICES
1824            sText += "<small><font color=\"red\">";
1825            sText += tr("Runtime max. voices / disk streams support disabled.");
1826            sText += "</font></small><br />";
1827    #endif
1828          sText += "<br />\n";          sText += "<br />\n";
1829          sText += tr("Using") + ": ";          sText += tr("Using") + ": ";
1830          sText += ::lscp_client_package();          sText += ::lscp_client_package();
# Line 2721  bool MainForm::startClient (void) Line 2749  bool MainForm::startClient (void)
2749          if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO) != LSCP_OK)          if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO) != LSCP_OK)
2750                  appendMessagesClient("lscp_client_subscribe(AUDIO_OUTPUT_DEVICE_INFO)");                  appendMessagesClient("lscp_client_subscribe(AUDIO_OUTPUT_DEVICE_INFO)");
2751    
2752  #if CONFIG_LSCP_CHANNEL_MIDI  #if CONFIG_EVENT_CHANNEL_MIDI
2753          // Subscribe to channel MIDI data notifications...          // Subscribe to channel MIDI data notifications...
2754          if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI) != LSCP_OK)          if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI) != LSCP_OK)
2755                  appendMessagesClient("lscp_client_subscribe(CHANNEL_MIDI)");                  appendMessagesClient("lscp_client_subscribe(CHANNEL_MIDI)");
2756  #endif  #endif
2757    
2758  #if CONFIG_LSCP_DEVICE_MIDI  #if CONFIG_EVENT_DEVICE_MIDI
2759          // Subscribe to channel MIDI data notifications...          // Subscribe to channel MIDI data notifications...
2760          if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI) != LSCP_OK)          if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI) != LSCP_OK)
2761                  appendMessagesClient("lscp_client_subscribe(DEVICE_MIDI)");                  appendMessagesClient("lscp_client_subscribe(DEVICE_MIDI)");
# Line 2758  bool MainForm::startClient (void) Line 2786  bool MainForm::startClient (void)
2786                  }                  }
2787          }          }
2788    
2789            // send the current / loaded fine tuning settings to the sampler
2790            m_pOptions->sendFineTuningSettings();
2791    
2792          // Make a new session          // Make a new session
2793          return newSession();          return newSession();
2794  }  }
# Line 2785  void MainForm::stopClient (void) Line 2816  void MainForm::stopClient (void)
2816          closeSession(false);          closeSession(false);
2817    
2818          // Close us as a client...          // Close us as a client...
2819  #if CONFIG_LSCP_DEVICE_MIDI  #if CONFIG_EVENT_DEVICE_MIDI
2820          ::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI);          ::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI);
2821  #endif  #endif
2822  #if CONFIG_LSCP_CHANNEL_MIDI  #if CONFIG_EVENT_CHANNEL_MIDI
2823          ::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI);          ::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI);
2824  #endif  #endif
2825          ::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO);          ::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO);

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

  ViewVC Help
Powered by ViewVC