mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-08 12:42:03 +01:00
Allow capture retries if time since Rescan() < 10s
The time since Rescan() of recording device is the important factor, not the "newness" of the project.
This commit is contained in:
@@ -306,8 +306,17 @@ void DeviceManager::Rescan()
|
||||
}
|
||||
}
|
||||
m_inited = true;
|
||||
mRescanTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
|
||||
float DeviceManager::GetTimeSinceRescan() {
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
auto dur = std::chrono::duration_cast<std::chrono::duration<float>>(now - mRescanTime);
|
||||
return dur.count();
|
||||
}
|
||||
|
||||
|
||||
//private constructor - Singleton.
|
||||
DeviceManager::DeviceManager()
|
||||
#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
|
||||
@@ -317,6 +326,7 @@ DeviceManager::DeviceManager()
|
||||
#endif
|
||||
{
|
||||
m_inited = false;
|
||||
mRescanTime = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
DeviceManager::~DeviceManager()
|
||||
|
||||
Reference in New Issue
Block a user