mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Set the actually opened audio device from vatlib
In the past, the optional arguments currentInput and currentOutput were not used. Therefore we never knew which device was actually opened by vatlib. This caused the Audio UI to be completely unsychronized from the reality when loading swiftgui. ref T337
This commit is contained in:
committed by
Klaus Basan
parent
44b1273085
commit
24ebc2ce7f
@@ -36,6 +36,11 @@ namespace BlackMisc
|
||||
return this->findBy(&CAudioDeviceInfo::getType, CAudioDeviceInfo::InputDevice);
|
||||
}
|
||||
|
||||
CAudioDeviceInfo CAudioDeviceInfoList::findByDeviceIndex(int deviceIndex)
|
||||
{
|
||||
return this->findBy(&CAudioDeviceInfo::getIndex, deviceIndex).frontOrDefault();
|
||||
}
|
||||
|
||||
int CAudioDeviceInfoList::count(CAudioDeviceInfo::DeviceType type) const
|
||||
{
|
||||
return std::count_if(this->begin(), this->end(), [type](const CAudioDeviceInfo &device)
|
||||
|
||||
@@ -44,6 +44,9 @@ namespace BlackMisc
|
||||
//! Get output devices in that list
|
||||
CAudioDeviceInfoList getInputDevices() const;
|
||||
|
||||
//! Find device by its index
|
||||
CAudioDeviceInfo findByDeviceIndex(int deviceIndex);
|
||||
|
||||
//! Count (as of type)
|
||||
int count(CAudioDeviceInfo::DeviceType type) const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user