/[svn]/qsampler/trunk/src/qsamplerMainForm.ui.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerMainForm.ui.h

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

revision 664 by capela, Sat Jun 18 22:44:56 2005 UTC revision 961 by capela, Sun Dec 3 18:26:13 2006 UTC
# Line 2  Line 2 
2  //  //
3  // ui.h extension file, included from the uic-generated form implementation.  // ui.h extension file, included from the uic-generated form implementation.
4  /****************************************************************************  /****************************************************************************
5     Copyright (C) 2004-2005, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved.
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License     modify it under the terms of the GNU General Public License
# Line 14  Line 14 
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.     GNU General Public License for more details.
16    
17     You should have received a copy of the GNU General Public License     You should have received a copy of the GNU General Public License along
18     along with this program; if not, write to the Free Software     with this program; if not, write to the Free Software Foundation, Inc.,
19     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20    
21  *****************************************************************************/  *****************************************************************************/
22    
# Line 41  Line 41 
41  #include "qsamplerMessages.h"  #include "qsamplerMessages.h"
42    
43  #include "qsamplerChannelStrip.h"  #include "qsamplerChannelStrip.h"
44    #include "qsamplerInstrumentList.h"
45    
46    #include "qsamplerInstrumentListForm.h"
47  #include "qsamplerDeviceForm.h"  #include "qsamplerDeviceForm.h"
48  #include "qsamplerOptionsForm.h"  #include "qsamplerOptionsForm.h"
49    
 #include "config.h"  
   
50  #ifdef HAVE_SIGNAL_H  #ifdef HAVE_SIGNAL_H
51  #include <signal.h>  #include <signal.h>
52  #endif  #endif
# Line 104  private: Line 104  private:
104  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
105  // qsamplerMainForm -- Main window form implementation.  // qsamplerMainForm -- Main window form implementation.
106    
107    // Kind of singleton reference.
108    qsamplerMainForm *qsamplerMainForm::g_pMainForm = NULL;
109    
110    
111  // Kind of constructor.  // Kind of constructor.
112  void qsamplerMainForm::init (void)  void qsamplerMainForm::init (void)
113  {  {
114            // Pseudo-singleton reference setup.
115            g_pMainForm = this;
116    
117      // Initialize some pointer references.      // Initialize some pointer references.
118      m_pOptions = NULL;      m_pOptions = NULL;
119    
120      // All child forms are to be created later, not earlier than setup.      // All child forms are to be created later, not earlier than setup.
121      m_pMessages   = NULL;      m_pMessages = NULL;
122        m_pInstrumentListForm = NULL;
123      m_pDeviceForm = NULL;      m_pDeviceForm = NULL;
124    
125      // We'll start clean.      // We'll start clean.
# Line 188  void qsamplerMainForm::destroy (void) Line 196  void qsamplerMainForm::destroy (void)
196      // Finally drop any widgets around...      // Finally drop any widgets around...
197      if (m_pDeviceForm)      if (m_pDeviceForm)
198          delete m_pDeviceForm;          delete m_pDeviceForm;
199        if (m_pInstrumentListForm)
200            delete m_pInstrumentListForm;
201      if (m_pMessages)      if (m_pMessages)
202          delete m_pMessages;          delete m_pMessages;
203      if (m_pWorkspace)      if (m_pWorkspace)
# Line 206  void qsamplerMainForm::destroy (void) Line 216  void qsamplerMainForm::destroy (void)
216      // Delete recentfiles menu.      // Delete recentfiles menu.
217      if (m_pRecentFilesMenu)      if (m_pRecentFilesMenu)
218          delete m_pRecentFilesMenu;          delete m_pRecentFilesMenu;
219    
220            // Pseudo-singleton reference shut-down.
221            g_pMainForm = NULL;
222  }  }
223    
224    
# Line 216  void qsamplerMainForm::setup ( qsamplerO Line 229  void qsamplerMainForm::setup ( qsamplerO
229      m_pOptions = pOptions;      m_pOptions = pOptions;
230    
231      // What style do we create these forms?      // What style do we create these forms?
232      WFlags wflags = Qt::WType_TopLevel;          Qt::WFlags wflags = Qt::WStyle_Customize
233                    | Qt::WStyle_Title
234                    | Qt::WStyle_SysMenu
235                    | Qt::WStyle_MinMax
236                    | Qt::WType_TopLevel;
237      if (m_pOptions->bKeepOnTop)      if (m_pOptions->bKeepOnTop)
238          wflags |= Qt::WStyle_Tool;          wflags |= Qt::WStyle_Tool;
239      // Some child forms are to be created right now.      // Some child forms are to be created right now.
240      m_pMessages = new qsamplerMessages(this);      m_pMessages = new qsamplerMessages(this);
241      m_pDeviceForm = new qsamplerDeviceForm(this, 0, wflags);      m_pDeviceForm = new qsamplerDeviceForm(this, 0, wflags);
242      m_pDeviceForm->setMainForm(this); // An important life immutable!  #ifdef CONFIG_MIDI_INSTRUMENT
243        m_pInstrumentListForm = new qsamplerInstrumentListForm(this, 0, wflags);
244            QObject::connect(m_pInstrumentListForm->InstrumentList,
245                    SIGNAL(instrumentsChanged()),
246                    SLOT(sessionDirty()));
247    #else
248            viewInstrumentsAction->setEnabled(false);
249    #endif
250      // Set message defaults...      // Set message defaults...
251      updateMessagesFont();      updateMessagesFont();
252      updateMessagesLimit();      updateMessagesLimit();
253      updateMessagesCapture();      updateMessagesCapture();
254      // Set the visibility signal.      // Set the visibility signal.
255      QObject::connect(m_pMessages, SIGNAL(visibilityChanged(bool)), this, SLOT(stabilizeForm()));      QObject::connect(m_pMessages,
256                    SIGNAL(visibilityChanged(bool)),
257                    SLOT(stabilizeForm()));
258    
259      // Initial decorations toggle state.      // Initial decorations toggle state.
260      viewMenubarAction->setOn(m_pOptions->bMenubar);      viewMenubarAction->setOn(m_pOptions->bMenubar);
# Line 253  void qsamplerMainForm::setup ( qsamplerO Line 279  void qsamplerMainForm::setup ( qsamplerO
279      }      }
280      // Try to restore old window positioning and initial visibility.      // Try to restore old window positioning and initial visibility.
281      m_pOptions->loadWidgetGeometry(this);      m_pOptions->loadWidgetGeometry(this);
282        m_pOptions->loadWidgetGeometry(m_pInstrumentListForm);
283      m_pOptions->loadWidgetGeometry(m_pDeviceForm);      m_pOptions->loadWidgetGeometry(m_pDeviceForm);
284    
285      // Final startup stabilization...      // Final startup stabilization...
# Line 293  bool qsamplerMainForm::queryClose (void) Line 320  bool qsamplerMainForm::queryClose (void)
320              m_pOptions->settings().writeEntry("/Layout/DockWindows", sDockables);              m_pOptions->settings().writeEntry("/Layout/DockWindows", sDockables);
321              // And the children, and the main windows state,.              // And the children, and the main windows state,.
322                          m_pOptions->saveWidgetGeometry(m_pDeviceForm);                          m_pOptions->saveWidgetGeometry(m_pDeviceForm);
323                            m_pOptions->saveWidgetGeometry(m_pInstrumentListForm);
324                          m_pOptions->saveWidgetGeometry(this);                          m_pOptions->saveWidgetGeometry(this);
325                          // Close popup widgets.                          // Close popup widgets.
326                            if (m_pInstrumentListForm)
327                                    m_pInstrumentListForm->close();
328                          if (m_pDeviceForm)                          if (m_pDeviceForm)
329                                  m_pDeviceForm->close();                                  m_pDeviceForm->close();
330              // Stop client and/or server, gracefully.              // Stop client and/or server, gracefully.
# Line 353  void qsamplerMainForm::dropEvent ( QDrop Line 383  void qsamplerMainForm::dropEvent ( QDrop
383                  const QString& sPath = *iter;                  const QString& sPath = *iter;
384                  if (qsamplerChannel::isInstrumentFile(sPath)) {                  if (qsamplerChannel::isInstrumentFile(sPath)) {
385                          // Try to create a new channel from instrument file...                          // Try to create a new channel from instrument file...
386                          qsamplerChannel *pChannel = new qsamplerChannel(this);                          qsamplerChannel *pChannel = new qsamplerChannel();
387                          if (pChannel == NULL)                          if (pChannel == NULL)
388                                  return;                                  return;
389                          // Start setting the instrument filename...                          // Start setting the instrument filename...
# Line 387  void qsamplerMainForm::customEvent ( QCu Line 417  void qsamplerMainForm::customEvent ( QCu
417      // For the time being, just pump it to messages.      // For the time being, just pump it to messages.
418      if (pCustomEvent->type() == QSAMPLER_CUSTOM_EVENT) {      if (pCustomEvent->type() == QSAMPLER_CUSTOM_EVENT) {
419          qsamplerCustomEvent *pEvent = (qsamplerCustomEvent *) pCustomEvent;          qsamplerCustomEvent *pEvent = (qsamplerCustomEvent *) pCustomEvent;
         appendMessagesColor(tr("Notify event: %1 data: %2")  
             .arg(::lscp_event_to_text(pEvent->event()))  
             .arg(pEvent->data()), "#996699");  
420                  if (pEvent->event() == LSCP_EVENT_CHANNEL_INFO) {                  if (pEvent->event() == LSCP_EVENT_CHANNEL_INFO) {
421                          int iChannelID = pEvent->data().toInt();                          int iChannelID = pEvent->data().toInt();
422                          qsamplerChannelStrip *pChannelStrip = channelStrip(iChannelID);                          qsamplerChannelStrip *pChannelStrip = channelStrip(iChannelID);
423                          if (pChannelStrip)                          if (pChannelStrip)
424                                  channelStripChanged(pChannelStrip);                                  channelStripChanged(pChannelStrip);
425                    } else {
426                            appendMessagesColor(tr("Notify event: %1 data: %2")
427                                    .arg(::lscp_event_to_text(pEvent->event()))
428                                    .arg(pEvent->data()), "#996699");
429                  }                  }
430      }      }
431  }  }
# Line 418  qsamplerOptions *qsamplerMainForm::optio Line 449  qsamplerOptions *qsamplerMainForm::optio
449      return m_pOptions;      return m_pOptions;
450  }  }
451    
452    
453  // The LSCP client descriptor property.  // The LSCP client descriptor property.
454  lscp_client_t *qsamplerMainForm::client (void)  lscp_client_t *qsamplerMainForm::client (void)
455  {  {
# Line 425  lscp_client_t *qsamplerMainForm::client Line 457  lscp_client_t *qsamplerMainForm::client
457  }  }
458    
459    
460    // The pseudo-singleton instance accessor.
461    qsamplerMainForm *qsamplerMainForm::getInstance (void)
462    {
463            return g_pMainForm;
464    }
465    
466    
467  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
468  // qsamplerMainForm -- Session file stuff.  // qsamplerMainForm -- Session file stuff.
469    
# Line 472  bool qsamplerMainForm::openSession (void Line 511  bool qsamplerMainForm::openSession (void
511    
512      // Ask for the filename to open...      // Ask for the filename to open...
513      QString sFilename = QFileDialog::getOpenFileName(      QString sFilename = QFileDialog::getOpenFileName(
514              m_pOptions->sSessionDir,                // Start here.                  m_pOptions->sSessionDir,                // Start here.
515              tr("LSCP Session files") + " (*.lscp)", // Filter (LSCP files)                  tr("LSCP Session files") + " (*.lscp)", // Filter (LSCP files)
516              this, 0,                                // Parent and name (none)                  this, 0,                                // Parent and name (none)
517              tr("Open Session")                      // Caption.                  QSAMPLER_TITLE ": " + tr("Open Session")        // Caption.
518      );      );
519    
520      // Have we cancelled?      // Have we cancelled?
# Line 506  bool qsamplerMainForm::saveSession ( boo Line 545  bool qsamplerMainForm::saveSession ( boo
545              sFilename = m_pOptions->sSessionDir;              sFilename = m_pOptions->sSessionDir;
546          // Prompt the guy...          // Prompt the guy...
547          sFilename = QFileDialog::getSaveFileName(          sFilename = QFileDialog::getSaveFileName(
548                  sFilename,                              // Start here.                          sFilename,                              // Start here.
549                  tr("LSCP Session files") + " (*.lscp)", // Filter (LSCP files)                          tr("LSCP Session files") + " (*.lscp)", // Filter (LSCP files)
550                  this, 0,                                // Parent and name (none)                          this, 0,                                // Parent and name (none)
551                  tr("Save Session")                      // Caption.                          QSAMPLER_TITLE ": " + tr("Save Session")        // Caption.
552          );          );
553          // Have we cancelled it?          // Have we cancelled it?
554          if (sFilename.isEmpty())          if (sFilename.isEmpty())
# Line 519  bool qsamplerMainForm::saveSession ( boo Line 558  bool qsamplerMainForm::saveSession ( boo
558              sFilename += ".lscp";              sFilename += ".lscp";
559          // Check if already exists...          // Check if already exists...
560          if (sFilename != m_sFilename && QFileInfo(sFilename).exists()) {          if (sFilename != m_sFilename && QFileInfo(sFilename).exists()) {
561              if (QMessageBox::warning(this, tr("Warning"),              if (QMessageBox::warning(this,
562                                    QSAMPLER_TITLE ": " + tr("Warning"),
563                  tr("The file already exists:\n\n"                  tr("The file already exists:\n\n"
564                     "\"%1\"\n\n"                     "\"%1\"\n\n"
565                     "Do you want to replace it?")                     "Do you want to replace it?")
# Line 541  bool qsamplerMainForm::closeSession ( bo Line 581  bool qsamplerMainForm::closeSession ( bo
581    
582      // Are we dirty enough to prompt it?      // Are we dirty enough to prompt it?
583      if (m_iDirtyCount > 0) {      if (m_iDirtyCount > 0) {
584          switch (QMessageBox::warning(this, tr("Warning"),          switch (QMessageBox::warning(this,
585                            QSAMPLER_TITLE ": " + tr("Warning"),
586              tr("The current session has been changed:\n\n"              tr("The current session has been changed:\n\n"
587              "\"%1\"\n\n"              "\"%1\"\n\n"
588              "Do you want to save the changes?")              "Do you want to save the changes?")
# Line 599  bool qsamplerMainForm::loadSessionFile ( Line 640  bool qsamplerMainForm::loadSessionFile (
640      QTextStream ts(&file);      QTextStream ts(&file);
641      while (!ts.atEnd()) {      while (!ts.atEnd()) {
642          // Read the line.          // Read the line.
643          QString sCommand = ts.readLine().simplifyWhiteSpace();          QString sCommand = ts.readLine().stripWhiteSpace();
644          // If not empty, nor a comment, call the server...          // If not empty, nor a comment, call the server...
645          if (!sCommand.isEmpty() && sCommand[0] != '#') {          if (!sCommand.isEmpty() && sCommand[0] != '#') {
646              appendMessagesColor(sCommand, "#996633");              appendMessagesColor(sCommand, "#996633");
# Line 677  bool qsamplerMainForm::saveSessionFile ( Line 718  bool qsamplerMainForm::saveSessionFile (
718          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio);          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio);
719          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {
720                  ts << endl;                  ts << endl;
721                  qsamplerDevice device(this, qsamplerDevice::Audio, piDeviceIDs[iDevice]);                  qsamplerDevice device(qsamplerDevice::Audio, piDeviceIDs[iDevice]);
722                  // Audio device specification...                  // Audio device specification...
723                  ts << "# " << device.deviceTypeName() << " " << device.driverName()                  ts << "# " << device.deviceTypeName() << " " << device.driverName()
724                          << " " << tr("Device") << " " << iDevice << endl;                          << " " << tr("Device") << " " << iDevice << endl;
# Line 717  bool qsamplerMainForm::saveSessionFile ( Line 758  bool qsamplerMainForm::saveSessionFile (
758          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);
759          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {          for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) {
760                  ts << endl;                  ts << endl;
761                  qsamplerDevice device(this, qsamplerDevice::Midi, piDeviceIDs[iDevice]);                  qsamplerDevice device(qsamplerDevice::Midi, piDeviceIDs[iDevice]);
762                  // MIDI device specification...                  // MIDI device specification...
763                  ts << "# " << device.deviceTypeName() << " " << device.driverName()                  ts << "# " << device.deviceTypeName() << " " << device.driverName()
764                          << " " << tr("Device") << " " << iDevice << endl;                          << " " << tr("Device") << " " << iDevice << endl;
# Line 786  bool qsamplerMainForm::saveSessionFile ( Line 827  bool qsamplerMainForm::saveSessionFile (
827                  ts << endl;                  ts << endl;
828                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl;                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl;
829                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl;                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl;
830                                    qsamplerChannelRoutingMap::ConstIterator audioRoute;
831                                    for (audioRoute = pChannel->audioRouting().begin();
832                                                    audioRoute != pChannel->audioRouting().end();
833                                                            ++audioRoute) {
834                                            ts << "SET CHANNEL AUDIO_OUTPUT_CHANNEL " << iChannel
835                                                    << " " << audioRoute.key()
836                                                    << " " << audioRoute.data() << endl;
837                                    }
838                  ts << "SET CHANNEL VOLUME " << iChannel << " " << pChannel->volume() << endl;                  ts << "SET CHANNEL VOLUME " << iChannel << " " << pChannel->volume() << endl;
839                                    if (pChannel->channelMute())
840                                            ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl;
841                                    if (pChannel->channelSolo())
842                                            ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl;
843                  ts << endl;                  ts << endl;
844              }              }
845          }          }
# Line 794  bool qsamplerMainForm::saveSessionFile ( Line 847  bool qsamplerMainForm::saveSessionFile (
847          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
848      }      }
849    
850    #ifdef CONFIG_MIDI_INSTRUMENT
851            // MIDI instrument mapping...
852            lscp_midi_instrument_t *pInstrs = ::lscp_list_midi_instruments(m_pClient);
853            if (pInstrs)
854            ts << "# " << tr("MIDI instrument mapping") << endl;
855            for (int iInstr = 0; pInstrs && pInstrs[iInstr].program >= 0; iInstr++) {
856                    lscp_midi_instrument_info_t *pInstrInfo
857                            = ::lscp_get_midi_instrument_info(m_pClient, &pInstrs[iInstr]);
858                    if (pInstrInfo) {
859                            ts << "MAP MIDI_INSTRUMENT "
860                                    << pInstrs[iInstr].bank_msb    << " "
861                                    << pInstrs[iInstr].bank_lsb    << " "
862                                    << pInstrs[iInstr].program     << " "
863                                    << pInstrInfo->engine_name     << " '"
864                                    << pInstrInfo->instrument_file << "' "
865                                    << pInstrInfo->instrument_nr   << " "
866                                    << pInstrInfo->volume          << " ";
867                            switch (pInstrInfo->load_mode) {
868                                    case LSCP_LOAD_PERSISTENT:
869                                            ts << "PERSISTENT";
870                                            break;
871                                    case LSCP_LOAD_ON_DEMAND_HOLD:
872                                            ts << "ON_DEMAND_HOLD";
873                                            break;
874                                    case LSCP_LOAD_ON_DEMAND:
875                                    case LSCP_LOAD_DEFAULT:
876                                    default:
877                                            ts << "ON_DEMAND";
878                                            break;
879                            }
880                            if (pInstrInfo->name)
881                                    ts << " '" << pInstrInfo->name << "'";
882                            ts << endl;
883                    }
884                    ts << endl;
885            // Try to keep it snappy :)
886            QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
887            }
888    #endif //  CONFIG_MIDI_INSTRUMENT
889    
890      // Ok. we've wrote it.      // Ok. we've wrote it.
891      file.close();      file.close();
892    
# Line 878  void qsamplerMainForm::fileReset (void) Line 971  void qsamplerMainForm::fileReset (void)
971          return;          return;
972    
973      // Ask user whether he/she want's an internal sampler reset...      // Ask user whether he/she want's an internal sampler reset...
974      if (QMessageBox::warning(this, tr("Warning"),      if (QMessageBox::warning(this,
975                    QSAMPLER_TITLE ": " + tr("Warning"),
976          tr("Resetting the sampler instance will close\n"          tr("Resetting the sampler instance will close\n"
977             "all device and channel configurations.\n\n"             "all device and channel configurations.\n\n"
978             "Please note that this operation may cause\n"             "Please note that this operation may cause\n"
# Line 913  void qsamplerMainForm::fileRestart (void Line 1007  void qsamplerMainForm::fileRestart (void
1007      // Ask user whether he/she want's a complete restart...      // Ask user whether he/she want's a complete restart...
1008      // (if we're currently up and running)      // (if we're currently up and running)
1009      if (bRestart && m_pClient) {      if (bRestart && m_pClient) {
1010          bRestart = (QMessageBox::warning(this, tr("Warning"),          bRestart = (QMessageBox::warning(this,
1011                            QSAMPLER_TITLE ": " + tr("Warning"),
1012              tr("New settings will be effective after\n"              tr("New settings will be effective after\n"
1013                 "restarting the client/server connection.\n\n"                 "restarting the client/server connection.\n\n"
1014                 "Please note that this operation may cause\n"                 "Please note that this operation may cause\n"
# Line 950  void qsamplerMainForm::editAddChannel (v Line 1045  void qsamplerMainForm::editAddChannel (v
1045          return;          return;
1046    
1047      // Just create the channel instance...      // Just create the channel instance...
1048      qsamplerChannel *pChannel = new qsamplerChannel(this);      qsamplerChannel *pChannel = new qsamplerChannel();
1049      if (pChannel == NULL)      if (pChannel == NULL)
1050          return;          return;
1051    
# Line 989  void qsamplerMainForm::editRemoveChannel Line 1084  void qsamplerMainForm::editRemoveChannel
1084    
1085      // Prompt user if he/she's sure about this...      // Prompt user if he/she's sure about this...
1086      if (m_pOptions && m_pOptions->bConfirmRemove) {      if (m_pOptions && m_pOptions->bConfirmRemove) {
1087          if (QMessageBox::warning(this, tr("Warning"),          if (QMessageBox::warning(this,
1088                            QSAMPLER_TITLE ": " + tr("Warning"),
1089              tr("About to remove channel:\n\n"              tr("About to remove channel:\n\n"
1090                 "%1\n\n"                 "%1\n\n"
1091                 "Are you sure?")                 "Are you sure?")
# Line 1112  void qsamplerMainForm::viewMessages ( bo Line 1208  void qsamplerMainForm::viewMessages ( bo
1208  }  }
1209    
1210    
1211    // Show/hide the MIDI instrument list-view form.
1212    void qsamplerMainForm::viewInstruments (void)
1213    {
1214            if (m_pOptions == NULL)
1215                    return;
1216    
1217            if (m_pInstrumentListForm) {
1218                    m_pOptions->saveWidgetGeometry(m_pInstrumentListForm);
1219                    if (m_pInstrumentListForm->isVisible()) {
1220                            m_pInstrumentListForm->hide();
1221                    } else {
1222                            m_pInstrumentListForm->show();
1223                            m_pInstrumentListForm->raise();
1224                            m_pInstrumentListForm->setActiveWindow();
1225                    }
1226            }
1227    }
1228    
1229    
1230  // Show/hide the device configurator form.  // Show/hide the device configurator form.
1231  void qsamplerMainForm::viewDevices (void)  void qsamplerMainForm::viewDevices (void)
1232  {  {
# Line 1120  void qsamplerMainForm::viewDevices (void Line 1235  void qsamplerMainForm::viewDevices (void
1235    
1236          if (m_pDeviceForm) {          if (m_pDeviceForm) {
1237                  m_pOptions->saveWidgetGeometry(m_pDeviceForm);                  m_pOptions->saveWidgetGeometry(m_pDeviceForm);
                 m_pDeviceForm->setClient(m_pClient);  
1238                  if (m_pDeviceForm->isVisible()) {                  if (m_pDeviceForm->isVisible()) {
1239                          m_pDeviceForm->hide();                          m_pDeviceForm->hide();
1240                  } else {                  } else {
# Line 1172  void qsamplerMainForm::viewOptions (void Line 1286  void qsamplerMainForm::viewOptions (void
1286                  (!bOldStdoutCapture &&  m_pOptions->bStdoutCapture) ||                  (!bOldStdoutCapture &&  m_pOptions->bStdoutCapture) ||
1287                  ( bOldKeepOnTop     && !m_pOptions->bKeepOnTop)     ||                  ( bOldKeepOnTop     && !m_pOptions->bKeepOnTop)     ||
1288                  (!bOldKeepOnTop     &&  m_pOptions->bKeepOnTop)) {                  (!bOldKeepOnTop     &&  m_pOptions->bKeepOnTop)) {
1289                  QMessageBox::information(this, tr("Information"),                  QMessageBox::information(this,
1290                                            QSAMPLER_TITLE ": " + tr("Information"),
1291                      tr("Some settings may be only effective\n"                      tr("Some settings may be only effective\n"
1292                         "next time you start this program."), tr("OK"));                         "next time you start this program."), tr("OK"));
1293                  updateMessagesCapture();                  updateMessagesCapture();
# Line 1300  void qsamplerMainForm::helpAbout (void) Line 1415  void qsamplerMainForm::helpAbout (void)
1415      sText += tr("LSCP (liblscp) instrument_name support disabled.");      sText += tr("LSCP (liblscp) instrument_name support disabled.");
1416      sText += "</font></small><br />";      sText += "</font></small><br />";
1417  #endif  #endif
1418    #ifndef CONFIG_MUTE_SOLO
1419        sText += "<small><font color=\"red\">";
1420        sText += tr("Sampler channel Mute/Solo support disabled.");
1421        sText += "</font></small><br />";
1422    #endif
1423    #ifndef CONFIG_MIDI_INSTRUMENT
1424        sText += "<small><font color=\"red\">";
1425        sText += tr("MIDI instrument mapping support disabled.");
1426        sText += "</font></small><br />";
1427    #endif
1428      sText += "<br />\n";      sText += "<br />\n";
1429      sText += tr("Using") + ": ";      sText += tr("Using") + ": ";
1430      sText += ::lscp_client_package();      sText += ::lscp_client_package();
# Line 1307  void qsamplerMainForm::helpAbout (void) Line 1432  void qsamplerMainForm::helpAbout (void)
1432      sText += ::lscp_client_version();      sText += ::lscp_client_version();
1433  #ifdef CONFIG_LIBGIG  #ifdef CONFIG_LIBGIG
1434      sText += ", ";      sText += ", ";
1435      sText += gig::libraryName();      sText += gig::libraryName().c_str();
1436      sText += " ";      sText += " ";
1437      sText += gig::libraryVersion();      sText += gig::libraryVersion().c_str();
1438  #endif  #endif
1439      sText += "<br />\n";      sText += "<br />\n";
1440      sText += "<br />\n";      sText += "<br />\n";
# Line 1335  void qsamplerMainForm::stabilizeForm (vo Line 1460  void qsamplerMainForm::stabilizeForm (vo
1460      // Update the main application caption...      // Update the main application caption...
1461      QString sSessionName = sessionName(m_sFilename);      QString sSessionName = sessionName(m_sFilename);
1462      if (m_iDirtyCount > 0)      if (m_iDirtyCount > 0)
1463          sSessionName += '*';          sSessionName += " *";
1464      setCaption(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName));      setCaption(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName));
1465    
1466      // Update the main menu state...      // Update the main menu state...
# Line 1354  void qsamplerMainForm::stabilizeForm (vo Line 1479  void qsamplerMainForm::stabilizeForm (vo
1479      editResetChannelAction->setEnabled(bHasChannel);      editResetChannelAction->setEnabled(bHasChannel);
1480      editResetAllChannelsAction->setEnabled(bHasChannel);      editResetAllChannelsAction->setEnabled(bHasChannel);
1481      viewMessagesAction->setOn(m_pMessages && m_pMessages->isVisible());      viewMessagesAction->setOn(m_pMessages && m_pMessages->isVisible());
1482      viewDevicesAction->setOn(m_pDeviceForm && m_pDeviceForm->isVisible());  #ifdef CONFIG_MIDI_INSTRUMENT
1483            viewInstrumentsAction->setOn(m_pInstrumentListForm
1484                    && m_pInstrumentListForm->isVisible());
1485            viewInstrumentsAction->setEnabled(bHasClient);
1486    #endif
1487            viewDevicesAction->setOn(m_pDeviceForm
1488                    && m_pDeviceForm->isVisible());
1489      viewDevicesAction->setEnabled(bHasClient);      viewDevicesAction->setEnabled(bHasClient);
1490      channelsArrangeAction->setEnabled(bHasChannel);      channelsArrangeAction->setEnabled(bHasChannel);
1491    
# Line 1420  void qsamplerMainForm::updateSession (vo Line 1551  void qsamplerMainForm::updateSession (vo
1551          for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) {          for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) {
1552                  // Check if theres already a channel strip for this one...                  // Check if theres already a channel strip for this one...
1553                  if (!channelStrip(piChannelIDs[iChannel]))                  if (!channelStrip(piChannelIDs[iChannel]))
1554                          createChannelStrip(new qsamplerChannel(this, piChannelIDs[iChannel]));                          createChannelStrip(new qsamplerChannel(piChannelIDs[iChannel]));
1555                  // Make it visibly responsive...                  // Make it visibly responsive...
1556                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);                  QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
1557          }          }
1558          m_pWorkspace->setUpdatesEnabled(true);          m_pWorkspace->setUpdatesEnabled(true);
1559                    
1560          // Remember to refresh devices          // Remember to refresh devices and instruments...
1561            if (m_pInstrumentListForm)
1562                m_pInstrumentListForm->refreshInstruments();
1563          if (m_pDeviceForm)          if (m_pDeviceForm)
1564              m_pDeviceForm->refreshDevices();              m_pDeviceForm->refreshDevices();
1565  }  }
# Line 1599  void qsamplerMainForm::appendMessagesErr Line 1732  void qsamplerMainForm::appendMessagesErr
1732    
1733      appendMessagesColor(s.simplifyWhiteSpace(), "#ff0000");      appendMessagesColor(s.simplifyWhiteSpace(), "#ff0000");
1734    
1735      QMessageBox::critical(this, tr("Error"), s, tr("Cancel"));      QMessageBox::critical(this,
1736                    QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel"));
1737  }  }
1738    
1739    
# Line 1871  void qsamplerMainForm::startServer (void Line 2005  void qsamplerMainForm::startServer (void
2005    
2006      // Is the server process instance still here?      // Is the server process instance still here?
2007      if (m_pServer) {      if (m_pServer) {
2008          switch (QMessageBox::warning(this, tr("Warning"),          switch (QMessageBox::warning(this,
2009                            QSAMPLER_TITLE ": " + tr("Warning"),
2010              tr("Could not start the LinuxSampler server.\n\n"              tr("Could not start the LinuxSampler server.\n\n"
2011                 "Maybe it ss already started."),                 "Maybe it ss already started."),
2012              tr("Stop"), tr("Kill"), tr("Cancel"))) {              tr("Stop"), tr("Kill"), tr("Cancel"))) {
# Line 2043  bool qsamplerMainForm::startClient (void Line 2178  bool qsamplerMainForm::startClient (void
2178      // Log success here.      // Log success here.
2179      appendMessages(tr("Client connected."));      appendMessages(tr("Client connected."));
2180    
2181          // Hard-notify device configuration form,          // Hard-notify instrumnet and device configuration forms,
2182          // if visible, that we're ready...          // if visible, that we're ready...
2183          if (m_pDeviceForm && m_pDeviceForm->isVisible())          if (m_pInstrumentListForm)
2184              m_pDeviceForm->setClient(m_pClient);              m_pInstrumentListForm->refreshInstruments();
2185            if (m_pDeviceForm)
2186                m_pDeviceForm->refreshDevices();
2187    
2188      // Is any session pending to be loaded?      // Is any session pending to be loaded?
2189      if (!m_pOptions->sSessionFile.isEmpty()) {      if (!m_pOptions->sSessionFile.isEmpty()) {
# Line 2068  void qsamplerMainForm::stopClient (void) Line 2205  void qsamplerMainForm::stopClient (void)
2205      if (m_pClient == NULL)      if (m_pClient == NULL)
2206          return;          return;
2207    
         // Hard-notify device configuration form,  
         // if visible, that we're running out...  
         if (m_pDeviceForm && m_pDeviceForm->isVisible())  
             m_pDeviceForm->setClient(NULL);  
   
2208      // Log prepare here.      // Log prepare here.
2209      appendMessages(tr("Client disconnecting..."));      appendMessages(tr("Client disconnecting..."));
2210    
# Line 2093  void qsamplerMainForm::stopClient (void) Line 2225  void qsamplerMainForm::stopClient (void)
2225      ::lscp_client_destroy(m_pClient);      ::lscp_client_destroy(m_pClient);
2226      m_pClient = NULL;      m_pClient = NULL;
2227    
2228            // Hard-notify instrumnet and device configuration forms,
2229            // if visible, that we're running out...
2230            if (m_pInstrumentListForm)
2231                m_pInstrumentListForm->refreshInstruments();
2232            if (m_pDeviceForm)
2233                m_pDeviceForm->refreshDevices();
2234    
2235      // Log final here.      // Log final here.
2236      appendMessages(tr("Client disconnected."));      appendMessages(tr("Client disconnected."));
2237    

Legend:
Removed from v.664  
changed lines
  Added in v.961

  ViewVC Help
Powered by ViewVC