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

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

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

revision 2569 by schoenebeck, Tue May 20 20:04:19 2014 UTC revision 2570 by capela, Wed May 21 16:56:18 2014 UTC
# Line 242  void ChannelStrip::setDisplayFont ( cons Line 242  void ChannelStrip::setDisplayFont ( cons
242          m_ui.EngineNameTextLabel->setFont(font);          m_ui.EngineNameTextLabel->setFont(font);
243          m_ui.MidiPortChannelTextLabel->setFont(font);          m_ui.MidiPortChannelTextLabel->setFont(font);
244          m_ui.InstrumentNamePushButton->setFont(font);          m_ui.InstrumentNamePushButton->setFont(font);
         m_ui.InstrumentNamePushButton->setFont(font);  
245          m_ui.InstrumentStatusTextLabel->setFont(font);          m_ui.InstrumentStatusTextLabel->setFont(font);
246  }  }
247    
# Line 256  void ChannelStrip::setDisplayEffect ( bo Line 255  void ChannelStrip::setDisplayEffect ( bo
255          m_ui.EngineNameTextLabel->setPalette(pal);          m_ui.EngineNameTextLabel->setPalette(pal);
256          m_ui.MidiPortChannelTextLabel->setPalette(pal);          m_ui.MidiPortChannelTextLabel->setPalette(pal);
257          pal.setColor(QPalette::Foreground, Qt::green);          pal.setColor(QPalette::Foreground, Qt::green);
258            pal.setColor(QPalette::ButtonText, Qt::green);
259          if (bDisplayEffect) {          if (bDisplayEffect) {
260                  QPixmap pm(":/images/displaybg1.png");                  QPixmap pm(":/images/displaybg1.png");
261                  pal.setBrush(QPalette::Background, QBrush(pm));                  pal.setBrush(QPalette::Background, QBrush(pm));
# Line 407  bool ChannelStrip::updateInstrumentName Line 407  bool ChannelStrip::updateInstrumentName
407    
408          // Instrument list popup (for fast switching among sounds of the same file)          // Instrument list popup (for fast switching among sounds of the same file)
409          if (!m_pChannel->instrumentFile().isEmpty()) {          if (!m_pChannel->instrumentFile().isEmpty()) {
410                  QStringList instruments = Channel::getInstrumentList(                  const QStringList instruments
411                          m_pChannel->instrumentFile(), true                          = Channel::getInstrumentList(m_pChannel->instrumentFile(), true);
                 );  
412                  if (!instruments.isEmpty()) {                  if (!instruments.isEmpty()) {
413                          bShowInstrumentPopup = true;                          bShowInstrumentPopup = true;
414                          if (!m_instrumentListPopupMenu) {                          if (!m_instrumentListPopupMenu) {
415                                  m_instrumentListPopupMenu = new QMenu(m_ui.InstrumentNamePushButton);                                  m_instrumentListPopupMenu
416                                            = new QMenu(m_ui.InstrumentNamePushButton);
417                                  m_instrumentListPopupMenu->setTitle(tr("Instruments"));                                  m_instrumentListPopupMenu->setTitle(tr("Instruments"));
418                                  m_instrumentListPopupMenu->setMinimumWidth(118); // for cosmetical reasons, should have at least the width of the instrument name label                                  // for cosmetical reasons, should have at least
419                                    // the width of the instrument name label...
420                                    m_instrumentListPopupMenu->setMinimumWidth(120);
421                                  m_ui.InstrumentNamePushButton->setMenu(m_instrumentListPopupMenu);                                  m_ui.InstrumentNamePushButton->setMenu(m_instrumentListPopupMenu);
422                                  QObject::connect(                                  QObject::connect(m_instrumentListPopupMenu,
423                                          m_instrumentListPopupMenu, SIGNAL(triggered(QAction*)),                                          SIGNAL(triggered(QAction*)),
424                                          this, SLOT(instrumentListPopupItemClicked(QAction*))                                          SLOT(instrumentListPopupItemClicked(QAction *)));
425                                  );                          } else {
426                          } else m_instrumentListPopupMenu->clear();                                  m_instrumentListPopupMenu->clear();
427                            }
428                            QAction *action;
429                          for (int i = 0; i < instruments.size(); ++i) {                          for (int i = 0; i < instruments.size(); ++i) {
430                                  QAction* action =                                  action = m_instrumentListPopupMenu->addAction(instruments.at(i));
                                         m_instrumentListPopupMenu->addAction(instruments.at(i));  
431                                  action->setData(i);                                  action->setData(i);
432                                  if (i == m_pChannel->instrumentNr()) {                                  action->setCheckable(true);
433                                          action->setCheckable(true);                                  action->setChecked(i == m_pChannel->instrumentNr());
                                         action->setChecked(true);  
                                 }  
434                          }                          }
435                  }                  }
436          }          }
# Line 443  bool ChannelStrip::updateInstrumentName Line 443  bool ChannelStrip::updateInstrumentName
443          return true;          return true;
444  }  }
445    
446  void ChannelStrip::instrumentListPopupItemClicked (QAction* action)  void ChannelStrip::instrumentListPopupItemClicked ( QAction *action )
447  {  {
448          if (!action) return;          if (!action) return;
449    
# Line 524  bool ChannelStrip::updateChannelInfo (vo Line 524  bool ChannelStrip::updateChannelInfo (vo
524          const QColor& rgbFore = pal.color(QPalette::Foreground);          const QColor& rgbFore = pal.color(QPalette::Foreground);
525    
526          // Instrument status...          // Instrument status...
527          int iInstrumentStatus = m_pChannel->instrumentStatus();          const int iInstrumentStatus = m_pChannel->instrumentStatus();
528          if (iInstrumentStatus < 0) {          if (iInstrumentStatus < 0) {
529                  pal.setColor(QPalette::Foreground, Qt::red);                  pal.setColor(QPalette::Foreground, Qt::red);
530                  m_ui.InstrumentStatusTextLabel->setPalette(pal);                  m_ui.InstrumentStatusTextLabel->setPalette(pal);
# Line 533  bool ChannelStrip::updateChannelInfo (vo Line 533  bool ChannelStrip::updateChannelInfo (vo
533                  m_iErrorCount++;                  m_iErrorCount++;
534                  return false;                  return false;
535          }          }
536    
537          // All seems normal...          // All seems normal...
538          pal.setColor(QPalette::Foreground,          pal.setColor(QPalette::Foreground,
539                  iInstrumentStatus < 100 ? Qt::yellow : Qt::green);                  iInstrumentStatus < 100 ? Qt::yellow : Qt::green);

Legend:
Removed from v.2569  
changed lines
  Added in v.2570

  ViewVC Help
Powered by ViewVC