1
0
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:
Steve Daulton
2018-08-12 23:47:48 +01:00
parent aeba34b152
commit 11da92d668
3 changed files with 21 additions and 3 deletions

View File

@@ -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()