/[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 297 by capela, Wed Nov 17 12:40:25 2004 UTC revision 341 by capela, Tue Jan 18 11:29:01 2005 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, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2005, 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 44  Line 44 
44    
45  #include "config.h"  #include "config.h"
46    
47    #ifdef HAVE_SIGNAL_H
48    #include <signal.h>
49    #endif
50    
51  // Timer constant stuff.  // Timer constant stuff.
52  #define QSAMPLER_TIMER_MSECS    200  #define QSAMPLER_TIMER_MSECS    200
# Line 116  void qsamplerMainForm::init (void) Line 119  void qsamplerMainForm::init (void)
119    
120      m_iTimerSlot = 0;      m_iTimerSlot = 0;
121    
122    #ifdef HAVE_SIGNAL_H
123            // Set to ignore any fatal "Broken pipe" signals.
124            ::signal(SIGPIPE, SIG_IGN);
125    #endif
126    
127      // Make it an MDI workspace.      // Make it an MDI workspace.
128      m_pWorkspace = new QWorkspace(this);      m_pWorkspace = new QWorkspace(this);
129      m_pWorkspace->setScrollBarsEnabled(true);      m_pWorkspace->setScrollBarsEnabled(true);
# Line 197  void qsamplerMainForm::setup ( qsamplerO Line 205  void qsamplerMainForm::setup ( qsamplerO
205      // We got options?      // We got options?
206      m_pOptions = pOptions;      m_pOptions = pOptions;
207    
208            // Set initial instrument name display mode.
209        qsamplerChannel::setInstrumentNames(m_pOptions->bInstrumentNames);
210    
211      // Some child forms are to be created right now.      // Some child forms are to be created right now.
212      m_pMessages = new qsamplerMessages(this);      m_pMessages = new qsamplerMessages(this);
213      // Set message defaults...      // Set message defaults...
# Line 544  bool qsamplerMainForm::loadSessionFile ( Line 555  bool qsamplerMainForm::loadSessionFile (
555          appendMessagesError(tr("Some setttings could not be loaded\nfrom \"%1\" session file.\n\nSorry.").arg(sFilename));          appendMessagesError(tr("Some setttings could not be loaded\nfrom \"%1\" session file.\n\nSorry.").arg(sFilename));
556    
557      // Now we'll try to create the whole GUI session.      // Now we'll try to create the whole GUI session.
558      int iChannels = ::lscp_get_channels(m_pClient);      int *piChannelIDs = ::lscp_list_channels(m_pClient);
559      if (iChannels < 0) {      if (piChannelIDs == NULL) {
560          appendMessagesClient("lscp_get_channels");          appendMessagesClient("lscp_list_channels");
561          appendMessagesError(tr("Could not get current number of channels.\n\nSorry."));          appendMessagesError(tr("Could not get current list of channels.\n\nSorry."));
562      }      }
563            
564      // Try to (re)create each channel.      // Try to (re)create each channel.
565      m_pWorkspace->setUpdatesEnabled(false);      m_pWorkspace->setUpdatesEnabled(false);
566      for (int iChannelID = 0; iChannelID < iChannels; iChannelID++) {      for (int iChannel = 0; piChannelIDs[iChannel] >= 0; iChannel++) {
567          createChannelStrip(iChannelID);          createChannelStrip(new qsamplerChannel(this, piChannelIDs[iChannel]));
568          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);          QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
569      }      }
570      m_pWorkspace->setUpdatesEnabled(true);      m_pWorkspace->setUpdatesEnabled(true);
# Line 567  bool qsamplerMainForm::loadSessionFile ( Line 578  bool qsamplerMainForm::loadSessionFile (
578      m_sFilename = sFilename;      m_sFilename = sFilename;
579      updateRecentFiles(sFilename);      updateRecentFiles(sFilename);
580      appendMessages(tr("Open session: \"%1\".").arg(sessionName(m_sFilename)));      appendMessages(tr("Open session: \"%1\".").arg(sessionName(m_sFilename)));
581        
582        // Make that an overall update.
583        m_iChangeCount++;
584      stabilizeForm();      stabilizeForm();
585      return true;      return true;
586  }  }
# Line 611  bool qsamplerMainForm::saveSessionFile ( Line 625  bool qsamplerMainForm::saveSessionFile (
625                  ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl;                  ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl;
626                  ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl;                  ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl;
627                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " ";                  ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " ";
628                  if (pChannel->midiChannel() > 0)                  if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL)
                     ts << pChannel->midiChannel();  
                  else  
629                      ts << "ALL";                      ts << "ALL";
630                    else
631                        ts << pChannel->midiChannel();
632                  ts << endl;                  ts << endl;
633                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl;                  ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl;
634                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannelID << endl;                  ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannelID << endl;
# Line 768  void qsamplerMainForm::editAddChannel (v Line 782  void qsamplerMainForm::editAddChannel (v
782      if (m_pClient == NULL)      if (m_pClient == NULL)
783          return;          return;
784    
785      // Just create the channel strip,      // Just create the channel instance...
786      // by giving an invalid channel id.      qsamplerChannel *pChannel = new qsamplerChannel(this);
787      createChannelStrip(-1);      if (pChannel == NULL)
788            return;
789    
790        // Before we show it up, may be we'll
791        // better ask for some initial values?
792        if (!pChannel->channelSetup(this)) {
793            delete pChannel;
794            return;
795        }
796        
797        // And give it to the strip (will own the channel instance, if successful).
798        if (!createChannelStrip(pChannel)) {
799            delete pChannel;
800            return;
801        }
802    
803        // Make that an overall update.
804        m_iDirtyCount++;
805        m_iChangeCount++;
806        stabilizeForm();
807  }  }
808    
809    
# Line 848  void qsamplerMainForm::editResetChannel Line 881  void qsamplerMainForm::editResetChannel
881      // Reset the existing sampler channel.      // Reset the existing sampler channel.
882      pChannel->resetChannel();      pChannel->resetChannel();
883    
884      // Refresh channel strip info.      // And force a deferred update.
885      pChannelStrip->updateChannelInfo();      m_iChangeCount++;
886  }  }
887    
888    
# Line 930  void qsamplerMainForm::viewOptions (void Line 963  void qsamplerMainForm::viewOptions (void
963          int     iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines;          int     iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines;
964          bool    bOldCompletePath    = m_pOptions->bCompletePath;          bool    bOldCompletePath    = m_pOptions->bCompletePath;
965          int     iOldMaxRecentFiles  = m_pOptions->iMaxRecentFiles;          int     iOldMaxRecentFiles  = m_pOptions->iMaxRecentFiles;
966            bool    bOldInstrumentNames = m_pOptions->bInstrumentNames;
967          // Load the current setup settings.          // Load the current setup settings.
968          pOptionsForm->setup(m_pOptions);          pOptionsForm->setup(m_pOptions);
969          // Show the setup dialog...          // Show the setup dialog...
# Line 943  void qsamplerMainForm::viewOptions (void Line 977  void qsamplerMainForm::viewOptions (void
977                  updateMessagesCapture();                  updateMessagesCapture();
978              }              }
979              // Check wheather something immediate has changed.              // Check wheather something immediate has changed.
980                if (( bOldInstrumentNames && !m_pOptions->bInstrumentNames) ||
981                    (!bOldInstrumentNames &&  m_pOptions->bInstrumentNames))
982                    qsamplerChannel::setInstrumentNames(m_pOptions->bInstrumentNames);
983              if (( bOldCompletePath && !m_pOptions->bCompletePath) ||              if (( bOldCompletePath && !m_pOptions->bCompletePath) ||
984                  (!bOldCompletePath &&  m_pOptions->bCompletePath) ||                  (!bOldCompletePath &&  m_pOptions->bCompletePath) ||
985                  (iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles))                  (iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles))
# Line 1355  void qsamplerMainForm::updateMessagesCap Line 1392  void qsamplerMainForm::updateMessagesCap
1392  // qsamplerMainForm -- MDI channel strip management.  // qsamplerMainForm -- MDI channel strip management.
1393    
1394  // The channel strip creation executive.  // The channel strip creation executive.
1395  qsamplerChannelStrip *qsamplerMainForm::createChannelStrip ( int iChannelID )  qsamplerChannelStrip *qsamplerMainForm::createChannelStrip ( qsamplerChannel *pChannel )
1396  {  {
1397      if (m_pClient == NULL)      if (m_pClient == NULL || pChannel == NULL)
1398          return NULL;          return NULL;
1399    
1400      // Prepare for auto-arrange?      // Prepare for auto-arrange?
# Line 1375  qsamplerChannelStrip *qsamplerMainForm:: Line 1412  qsamplerChannelStrip *qsamplerMainForm::
1412      // Add a new channel itema...      // Add a new channel itema...
1413      WFlags wflags = Qt::WStyle_Customize | Qt::WStyle_Tool | Qt::WStyle_Title | Qt::WStyle_NoBorder;      WFlags wflags = Qt::WStyle_Customize | Qt::WStyle_Tool | Qt::WStyle_Title | Qt::WStyle_NoBorder;
1414      pChannelStrip = new qsamplerChannelStrip(m_pWorkspace, 0, wflags);      pChannelStrip = new qsamplerChannelStrip(m_pWorkspace, 0, wflags);
1415      // Actual channel setup.      if (pChannelStrip == NULL)
     pChannelStrip->setup(this, iChannelID);  
     QObject::connect(pChannelStrip, SIGNAL(channelChanged(qsamplerChannelStrip *)), this, SLOT(channelStripChanged(qsamplerChannelStrip *)));  
     // Before we show it up, may be we'll  
     // better ask for some initial values?  
     if (iChannelID < 0 && !pChannelStrip->channelSetup()) {  
         // No luck, bail out...  
         delete pChannelStrip;  
1416          return NULL;          return NULL;
1417      }          
1418        // Actual channel strip setup...
1419        pChannelStrip->setup(pChannel);
1420        QObject::connect(pChannelStrip, SIGNAL(channelChanged(qsamplerChannelStrip *)), this, SLOT(channelStripChanged(qsamplerChannelStrip *)));
1421      // Set some initial aesthetic options...      // Set some initial aesthetic options...
1422      if (m_pOptions) {      if (m_pOptions) {
1423          // Background display effect...          // Background display effect...

Legend:
Removed from v.297  
changed lines
  Added in v.341

  ViewVC Help
Powered by ViewVC