void MainWindow::channelSettingsPressed(QString channel) { if (channel.isEmpty()) channel = ui->treeWidget->selectedChannel(); if (!channelsettingsdialog) { channelsettingsdialog = new ChannelSettingsDialog(this); connect(irc, SIGNAL(sigBanList(QString,QString,QString,QString)), channelsettingsdialog, SLOT(bansReceived(QString,QString,QString,QString))); connect(irc, SIGNAL(sigChannelMode(QString,QStringList)), channelsettingsdialog, SLOT(channelModeReceived(QString,QStringList))); connect(channelsettingsdialog, SIGNAL(updatePressed(QString)), irc, SLOT(getBans(QString))); connect(channelsettingsdialog, SIGNAL(channelModeChanged(QString,QString)), irc, SLOT(setChannelMode(QString,QString))); connect(channelsettingsdialog, SIGNAL(topicChanged(QString,QString)), irc, SLOT(setTopic(QString,QString))); } channelsettingsdialog->clearItems(); channelsettingsdialog->channel = channel; channelsettingsdialog->setWindowTitle(tr("%1 settings").arg(channel)); channelsettingsdialog->setTopicText(getTopic(channelsettingsdialog->channel)); channelsettingsdialog->show(); irc->getBans(channelsettingsdialog->channel); irc->getChannelMode(channelsettingsdialog->channel); }
OutputDeviceNode::OutputDeviceNode( const DeviceRef &device, const Format &format ) : OutputNode( format ), mDevice( device ) { if( ! mDevice ) { string errorMsg = "Empty DeviceRef."; if( ! audio::Device::getDefaultOutput() ) errorMsg += " Also, no default output Device so perhaps there is no available hardware output."; throw AudioDeviceExc( errorMsg ); } // listen to the notifications sent by device property changes in order to update the audio graph. mWillChangeConn = mDevice->getSignalParamsWillChange().connect( bind( &OutputDeviceNode::deviceParamsWillChange, this ) ); mDidChangeConn = mDevice->getSignalParamsDidChange().connect( bind( &OutputDeviceNode::deviceParamsDidChange, this ) ); mInterruptionBeganConn = Context::deviceManager()->getSignalInterruptionBegan().connect( [this] { disable(); } ); mInterruptionEndedConn = Context::deviceManager()->getSignalInterruptionEnded().connect( [this] { enable(); } ); size_t deviceNumChannels = mDevice->getNumOutputChannels(); // If number of channels hasn't been specified, default to 2 (or 1 if that is all that is available). if( getChannelMode() != ChannelMode::SPECIFIED ) { setChannelMode( ChannelMode::SPECIFIED ); setNumChannels( std::min( deviceNumChannels, (size_t)2 ) ); } // Double check the device has enough channels to support what was requested, which may not be the case if the user asked for more than what is available. if( deviceNumChannels < getNumChannels() ) throw AudioFormatExc( string( "Device can not accommodate " ) + to_string( deviceNumChannels ) + " output channels." ); }
OutputDeviceNode::OutputDeviceNode( const DeviceRef &device, const Format &format ) : OutputNode( format ), mDevice( device ) { CI_ASSERT( mDevice ); // listen to the notifications sent by device property changes in order to update the audio graph. mWillChangeConn = mDevice->getSignalParamsWillChange().connect( bind( &OutputDeviceNode::deviceParamsWillChange, this ) ); mDidChangeConn = mDevice->getSignalParamsDidChange().connect( bind( &OutputDeviceNode::deviceParamsDidChange, this ) ); size_t deviceNumChannels = mDevice->getNumOutputChannels(); // If number of channels hasn't been specified, default to 2 (or 1 if that is all that is available). if( getChannelMode() != ChannelMode::SPECIFIED ) { setChannelMode( ChannelMode::SPECIFIED ); setNumChannels( std::min( deviceNumChannels, (size_t)2 ) ); } // Double check the device has enough channels to support what was requested, which may not be the case if the user asked for more than what is available. if( deviceNumChannels < getNumChannels() ) throw AudioFormatExc( string( "Device can not accommodate " ) + to_string( deviceNumChannels ) + " output channels." ); }
DelayNode::DelayNode( const Format &format ) : Node( format ), mParamDelaySeconds( this, 0 ), mWriteIndex( 0 ), mSampleRate( 0 ), mMaxDelaySeconds( 0 ) { setNumChannels( 1 ); setChannelMode( ChannelMode::SPECIFIED ); }
void GenNode::initImpl() { setChannelMode( ChannelMode::SPECIFIED ); setNumChannels( 1 ); }