当前位置: 首页>>代码示例>>C++>>正文


C++ Mixer::id方法代码示例

本文整理汇总了C++中Mixer::id方法的典型用法代码示例。如果您正苦于以下问题:C++ Mixer::id方法的具体用法?C++ Mixer::id怎么用?C++ Mixer::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mixer的用法示例。


在下文中一共展示了Mixer::id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: saveViewConfig

/**
 * Create or recreate the Mixer GUI elements
 *
 * @param saveConfig  Whether to save all View configurations before recreating
 * @param forceNewTab To enforce opening a new tab, even when the profileList in the kmixrc is empty.
 *                    It should only be set to "true" in case of a Hotplug (because then the user definitely expects a new Tab to show).
 */
void
KMixWindow::recreateGUI(bool saveConfig, const QString& mixerId,
    bool forceNewTab)
{
  // -1- Remember which of the tabs is currently selected for restoration for re-insertion
  int oldTabPosition = m_wsMixers->currentIndex();

  if (saveConfig)
    saveViewConfig();  // save the state before recreating

  // -2- RECREATE THE ALREADY EXISTING TABS **********************************
  QMap<Mixer*, bool> mixerHasProfile;

  // -2a- Build a list of all active profiles in the main window (that means: from all tabs)
  QList<GUIProfile*> activeGuiProfiles;
  for (int i = 0; i < m_wsMixers->count(); ++i)
    {
      KMixerWidget* kmw = dynamic_cast<KMixerWidget*>(m_wsMixers->widget(i));
      if (kmw)
        {
          activeGuiProfiles.append(kmw->getGuiprof());
        }
    }

  // TODO The following loop is a bit buggy, as it iterates over all cached Profiles. But that is wrong for Tabs that got closed.
  //       I need to loop over something else, e.g. a  profile list built from the currently open Tabs.
  //       Or (if it that is easier) I might discard the Profile from the cache on "close-tab" (but that must also include unplug actions).
  foreach( GUIProfile* guiprof, activeGuiProfiles){
  KMixerWidget* kmw = findKMWforTab(guiprof->getId());
  Mixer *mixer = Mixer::findMixer( guiprof->getMixerId() );
  if ( mixer == 0 )
    {
      kError() << "MixerToolBox::find() hasn't found the Mixer for the profile " << guiprof->getId();
      continue;
    }
  mixerHasProfile[mixer] = true;
  if ( kmw == 0 )
    {
      // does not yet exist => create
      addMixerWidget(mixer->id(), guiprof->getId(), -1);
    }
  else
    {
      // did exist => remove and insert new guiprof at old position
      int indexOfTab = m_wsMixers->indexOf(kmw);
      if ( indexOfTab != -1 ) m_wsMixers->removeTab(indexOfTab);
      delete kmw;
      addMixerWidget(mixer->id(), guiprof->getId(), indexOfTab);
    }
} // Loop over all GUIProfile's
开发者ID:,项目名称:,代码行数:57,代码来源:

示例2: handleNewMaster

void KMixDockWidget::handleNewMaster(int soundcard_id, QString& channel_id) // !! @todo rework parameters
{
  //kdDebug(67100) << "KMixDockWidget::handleNewMaster() soundcard_id=" << soundcard_id << " , channel_id=" << channel_id << endl;
  Mixer *mixer = Mixer::mixers().at(soundcard_id);
  if ( mixer == 0 ) {
    kdError(67100) << "KMixDockWidget::createPage(): Invalid Mixer (soundcard_id=" << soundcard_id << ")" << endl;
    return; // can not happen
  }
  m_mixer = mixer;
  Mixer::setMasterCard(mixer->id()); // We must save this information "somewhere".
  Mixer::setMasterCardDevice( channel_id );
  createMasterVolWidget();
}
开发者ID:serghei,项目名称:kde3-kdemultimedia,代码行数:13,代码来源:kmixdockwidget.cpp

示例3: createWidgets

/**
 * Create basic widgets of the Dialog.
 */
void DialogSelectMaster::createWidgets(Mixer *ptr_mixer)
{
    m_mainFrame = new QWidget( this );
    setMainWidget( m_mainFrame );
    _layout = new QVBoxLayout(m_mainFrame);
    _layout->setMargin(0);

    if ( Mixer::mixers().count() > 1 ) {
        // More than one Mixer => show Combo-Box to select Mixer
        // Mixer widget line
        QHBoxLayout* mixerNameLayout = new QHBoxLayout();
        _layout->addItem( mixerNameLayout );
        mixerNameLayout->setMargin(0);
        mixerNameLayout->setSpacing(KDialog::spacingHint());
    
        QLabel *qlbl = new QLabel( i18n("Current mixer:"), m_mainFrame );
        mixerNameLayout->addWidget(qlbl);
        qlbl->setFixedHeight(qlbl->sizeHint().height());
    
        m_cMixer = new KComboBox( false, m_mainFrame);
        m_cMixer->setObjectName( QLatin1String( "mixerCombo" ) );
        m_cMixer->setFixedHeight(m_cMixer->sizeHint().height());
        connect( m_cMixer, SIGNAL(activated(int)), this, SLOT(createPageByID(int)) );

        for( int i =0; i<Mixer::mixers().count(); i++ )
        {
            Mixer *mixer = (Mixer::mixers())[i];
            m_cMixer->addItem( mixer->readableName(), mixer->id() );
         } // end for all_Mixers
        // Make the current Mixer the current item in the ComboBox
        int findIndex = m_cMixer->findData( ptr_mixer->id() );
        if ( findIndex != -1 ) m_cMixer->setCurrentIndex( findIndex );
        
    
        m_cMixer->setToolTip( i18n("Current mixer" ) );
        mixerNameLayout->addWidget(m_cMixer, 1);
        _layout->addSpacing(KDialog::spacingHint());

    } // end if (more_than_1_Mixer)
开发者ID:KDE,项目名称:kmix,代码行数:42,代码来源:dialogselectmaster.cpp


注:本文中的Mixer::id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。