mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Another batch of conversion of methods which returned bare XmlElement* to return unique_ptrs
This commit is contained in:
parent
fef1093f6e
commit
6463529371
23 changed files with 63 additions and 65 deletions
|
|
@ -139,12 +139,10 @@ void AudioDeviceManager::audioDeviceListChanged()
|
|||
{
|
||||
closeAudioDevice();
|
||||
|
||||
std::unique_ptr<XmlElement> e (createStateXml());
|
||||
|
||||
if (e == nullptr)
|
||||
initialiseDefault (preferredDeviceName, ¤tSetup);
|
||||
else
|
||||
if (auto e = createStateXml())
|
||||
initialiseFromXML (*e, true, preferredDeviceName, ¤tSetup);
|
||||
else
|
||||
initialiseDefault (preferredDeviceName, ¤tSetup);
|
||||
}
|
||||
|
||||
if (currentAudioDevice != nullptr)
|
||||
|
|
@ -344,9 +342,12 @@ void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) cons
|
|||
}
|
||||
}
|
||||
|
||||
XmlElement* AudioDeviceManager::createStateXml() const
|
||||
std::unique_ptr<XmlElement> AudioDeviceManager::createStateXml() const
|
||||
{
|
||||
return createCopyIfNotNull (lastExplicitSettings.get());
|
||||
if (lastExplicitSettings != nullptr)
|
||||
return std::make_unique<XmlElement> (*lastExplicitSettings);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue