示例#1
0
void ItemEditor::slotClear()
{
	m_pPropertyEditor->reset( );
	m_pComponentModelWidget->reset();
	m_pOrientationWidget->slotClear();
	updateNameLabel(0l);
}
示例#2
0
MixerTrackPart::MixerTrackPart(QWidget *parent, MixerTrackItemPtr mti, bool expanded) :
      QWidget(parent), _mti(mti), _selected(false), _group(0)
      {
      setupUi(this);

      int numChannels = 0;
      Part* part = _mti->part();
      const InstrumentList* il = part->instruments();
      for (auto it = il->begin(); it != il->end(); ++it) {
            Instrument* instr = it->second;
            numChannels += instr->channel().size();
            }

      expandBn->setEnabled(numChannels > 1);
      expandBn->setChecked(expanded);

      connect(expandBn, SIGNAL(toggled(bool)), SLOT(expandToggled(bool)));

      connect(soloBn, SIGNAL(toggled(bool)), SLOT(updateSolo(bool)));
      connect(muteBn, SIGNAL(toggled(bool)), SLOT(updateMute(bool)));

      updateNameLabel();

      //set up rest

      Channel* chan = _mti->focusedChan();

      soloBn->setChecked(chan->solo());
      muteBn->setChecked(chan->mute());

      chan->addListener(this);
      volumeSlider->setValue(chan->volume());
      volumeSlider->setToolTip(tr("Volume: %1").arg(QString::number(chan->volume())));
      volumeSlider->setMaxValue(127);
      volumeSlider->setMinValue(0);
      volumeSlider->setNumMajorTicks(10);
      volumeSlider->setNumMinorTicks(4);

      QIcon iconSliderHead;
      iconSliderHead.addFile(QStringLiteral(":/data/icons/mixer-slider-handle-vertical.svg"), QSize(), QIcon::Normal, QIcon::Off);
      volumeSlider->setSliderHeadIcon(iconSliderHead);

      panSlider->setValue(chan->pan());
      panSlider->setToolTip(tr("Pan: %1").arg(QString::number(chan->pan())));
      panSlider->setMaxValue(127);
      panSlider->setMinValue(0);

      connect(volumeSlider, SIGNAL(valueChanged(double)),      SLOT(volumeChanged(double)));
      connect(panSlider,    SIGNAL(valueChanged(double, int)), SLOT(panChanged(double)));

      connect(volumeSlider, SIGNAL(sliderPressed()),    SLOT(controlSelected()));
      connect(panSlider,    SIGNAL(sliderPressed(int)), SLOT(controlSelected()));
      }
示例#3
0
void ItemEditor::slotUpdate( ItemGroup * itemGroup )
{
	if (!itemGroup)
	{
		slotClear();
		return;
	}
	
	m_pPropertyEditor->create(itemGroup);
	updateNameLabel(itemGroup->activeItem());
	
	m_pOrientationWidget->slotUpdate( dynamic_cast<CNItemGroup *>(itemGroup) );
}
示例#4
0
void MixerTrackPart::propertyChanged(Channel::Prop property)
      {
      Channel* chan = _mti->focusedChan();

      switch (property) {
            case Channel::Prop::VOLUME: {
                  volumeSlider->blockSignals(true);
                  volumeSlider->setValue(chan->volume());
                  volumeSlider->setToolTip(tr("Volume: %1").arg(QString::number(chan->volume())));
                  volumeSlider->blockSignals(false);
                  break;
                  }
            case Channel::Prop::PAN: {
                  panSlider->blockSignals(true);
                  panSlider->setValue(chan->pan());
                  panSlider->setToolTip(tr("Pan: %1").arg(QString::number(chan->pan())));
                  panSlider->blockSignals(false);
                  break;
                  }
            case Channel::Prop::MUTE: {
                  muteBn->blockSignals(true);
                  muteBn->setChecked(chan->mute());
                  muteBn->blockSignals(false);
                  break;
                  }
            case Channel::Prop::SOLO: {
                  soloBn->blockSignals(true);
                  soloBn->setChecked(chan->solo());
                  soloBn->blockSignals(false);
                  break;
                  }
            case Channel::Prop::COLOR: {
                  updateNameLabel();
                  break;
                  }
            default:
                  break;
            }
      }
示例#5
0
TabView::TabView(TraceItemView* parentView,
                 QWidget* parent, const char* name)
  : QWidget(parent), TraceItemView(parentView)
{
  setFocusPolicy(Qt::StrongFocus);
  setObjectName(name);

  _isCollapsed = true;

  QVBoxLayout* vbox = new QVBoxLayout( this );
  vbox->setSpacing( 6 );
  vbox->setMargin( 6 );

  _nameLabel = new QLabel(this); //KSqueezedTextLabel( this);
  _nameLabel->setSizePolicy(QSizePolicy( QSizePolicy::Ignored,
					 QSizePolicy::Fixed ));
  _nameLabel->setObjectName( "nameLabel" );
  _nameLabel->setText(tr("(No profile data file loaded)"));
  vbox->addWidget( _nameLabel );
  updateNameLabel(tr("(No profile data file loaded)"));

  _mainSplitter   = new QSplitter(Qt::Horizontal, this);
  _leftSplitter   = new Splitter(Qt::Vertical, _mainSplitter, "Left");
  vbox->addWidget( _mainSplitter );

  _rightTW = new TabWidget(this, _mainSplitter, "Right");
  connect(_rightTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_rightTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  _topTW = new TabWidget(this, _leftSplitter, "Top");
  connect(_topTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_topTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  _bottomSplitter = new Splitter(Qt::Horizontal,
                                  _leftSplitter, "Bottom");

  _leftTW = new TabWidget(this, _bottomSplitter, "Left");
  _leftTW->setTabPosition(QTabWidget::Bottom);
  connect(_leftTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_leftTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  _bottomTW = new TabWidget(this, _bottomSplitter, "Bottom");
  _bottomTW->setTabPosition(QTabWidget::Bottom);
  connect(_bottomTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_bottomTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  CallView* callerView = new CallView(true, this);
  CallView* calleeView = new CallView(false, this);
  CoverageView * allCallerView = new CoverageView(true, this);
  CoverageView * allCalleeView = new CoverageView(false, this);

  // Options of visualization views are stored by their view name
  callerView->setObjectName("CallerView");
  calleeView->setObjectName("CalleeView");
  allCallerView->setObjectName("AllCallerView");
  allCalleeView->setObjectName("AllCalleeView");

  // default positions...
  // Keep following order in sync with DEFAULT_xxxTABS defines!

  addTop( addTab( tr("Types"),
		  new EventTypeView(this, 0,
				   "EventTypeView")));
  addTop( addTab( tr("Callers"), callerView) );
  addTop( addTab( tr("All Callers"), allCallerView) );
  addTop( addTab( tr("Callee Map"),
		  new CallMapView(false, this, 0,
				  "CalleeMapView")));
  addTop( addTab( tr("Source Code"),
		  new SourceView(this, 0,
				 "SourceView")));

  addBottom( addTab( tr("Parts"),
		     new PartView(this, 0,
				  "PartView")));
  addBottom( addTab( tr("Callees"), calleeView) );
  addBottom( addTab( tr("Call Graph"),
		     new CallGraphView(this, 0,
				       "CallGraphView")));
  addBottom( addTab( tr("All Callees"), allCalleeView) );
  addBottom( addTab( tr("Caller Map"),
		     new CallMapView(true, this, 0,
				     "CallerMapView")));
  addBottom( addTab( tr("Machine Code"),
		     new InstrView(this, 0,
				   "InstrView")));

  // after all child widgets are created...
  _lastFocus = 0;
  _active = false;
  installFocusFilters();

  updateVisibility();

  this->setWhatsThis( whatsThis() );
}