void AudioPortConfig::songChanged(int v) { if (v & (SC_TRACK_INSERTED | SC_TRACK_MODIFIED | SC_TRACK_REMOVED | SC_ROUTE | SC_CHANNELS)) { routingChanged(); } }
void RouteRequestModel::setRouting( Marble::Routing *routing ) { if ( routing != m_routing ) { m_routing = routing; updateMap(); connect( m_routing, SIGNAL(marbleMapChanged()), this, SLOT(updateMap()) ); emit routingChanged(); } }
String open (const BigInteger& inputChannels, const BigInteger& outputChannels, double sampleRate, int bufferSize) { close(); lastError = String::empty; preferredBufferSize = (bufferSize <= 0) ? getDefaultBufferSize() : bufferSize; // xxx set up channel mapping activeOutputChans = outputChannels; activeOutputChans.setRange (2, activeOutputChans.getHighestBit(), false); numOutputChannels = activeOutputChans.countNumberOfSetBits(); monoOutputChannelNumber = activeOutputChans.findNextSetBit (0); activeInputChans = inputChannels; activeInputChans.setRange (2, activeInputChans.getHighestBit(), false); numInputChannels = activeInputChans.countNumberOfSetBits(); monoInputChannelNumber = activeInputChans.findNextSetBit (0); AudioSessionSetActive (true); UInt32 audioCategory = (numInputChannels > 0 && audioInputIsAvailable) ? kAudioSessionCategory_PlayAndRecord : kAudioSessionCategory_MediaPlayback; AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (audioCategory), &audioCategory); if (audioCategory == kAudioSessionCategory_PlayAndRecord) { // (note: mustn't set this until after the audio category property has been set) UInt32 allowBluetoothInput = 1; AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof (allowBluetoothInput), &allowBluetoothInput); } AudioSessionAddPropertyListener (kAudioSessionProperty_AudioRouteChange, routingChangedStatic, this); fixAudioRouteIfSetToReceiver(); updateDeviceInfo(); Float32 bufferDuration = preferredBufferSize / sampleRate; AudioSessionSetProperty (kAudioSessionProperty_PreferredHardwareIOBufferDuration, sizeof (bufferDuration), &bufferDuration); actualBufferSize = preferredBufferSize; prepareFloatBuffers (actualBufferSize); isRunning = true; routingChanged (nullptr); // creates and starts the AU lastError = audioUnit != 0 ? "" : "Couldn't open the device"; return lastError; }
void ProcessModel::updateRouting(const Routing & r) { auto it = m_routings.find(r); ISCORE_ASSERT(it != m_routings.end()); m_routings.modify(it, [&] (auto& obj) { obj.mix = r.mix; obj.enabled = r.enabled; }); emit routingChanged(r); }
String open (const BigInteger& inputChannelsWanted, const BigInteger& outputChannelsWanted, double targetSampleRate, int bufferSize) override { close(); lastError.clear(); preferredBufferSize = (bufferSize <= 0) ? getDefaultBufferSize() : bufferSize; // xxx set up channel mapping activeOutputChans = outputChannelsWanted; activeOutputChans.setRange (2, activeOutputChans.getHighestBit(), false); numOutputChannels = activeOutputChans.countNumberOfSetBits(); monoOutputChannelNumber = activeOutputChans.findNextSetBit (0); activeInputChans = inputChannelsWanted; activeInputChans.setRange (2, activeInputChans.getHighestBit(), false); numInputChannels = activeInputChans.countNumberOfSetBits(); monoInputChannelNumber = activeInputChans.findNextSetBit (0); AudioSessionSetActive (true); if (numInputChannels > 0 && audioInputIsAvailable) { setSessionUInt32Property (kAudioSessionProperty_AudioCategory, kAudioSessionCategory_PlayAndRecord); setSessionUInt32Property (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, 1); } else { setSessionUInt32Property (kAudioSessionProperty_AudioCategory, kAudioSessionCategory_MediaPlayback); } AudioSessionAddPropertyListener (kAudioSessionProperty_AudioRouteChange, routingChangedStatic, this); fixAudioRouteIfSetToReceiver(); updateDeviceInfo(); setSessionFloat64Property (kAudioSessionProperty_PreferredHardwareSampleRate, targetSampleRate); updateSampleRates(); setSessionFloat64Property (kAudioSessionProperty_PreferredHardwareIOBufferDuration, preferredBufferSize / sampleRate); updateCurrentBufferSize(); prepareFloatBuffers (actualBufferSize); isRunning = true; routingChanged (nullptr); // creates and starts the AU lastError = audioUnit != 0 ? "" : "Couldn't open the device"; return lastError; }
AudioPortConfig::AudioPortConfig(QWidget* parent) : QFrame(parent) { setupUi(this); _selected = 0; selectedIndex = -1; connect(routeList, SIGNAL(itemSelectionChanged()), SLOT(routeSelectionChanged())); connect(newSrcList, SIGNAL(itemSelectionChanged()), SLOT(srcSelectionChanged())); connect(newDstList, SIGNAL(itemSelectionChanged()), SLOT(dstSelectionChanged())); connect(tracksList, SIGNAL(itemSelectionChanged()), SLOT(trackSelectionChanged())); connect(removeButton, SIGNAL(clicked()), SLOT(removeRoute())); connect(connectButton, SIGNAL(clicked()), SLOT(addRoute())); connect(btnConnectOut, SIGNAL(clicked()), SLOT(addOutRoute())); connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); routingChanged(); }