Skip to content
Snippets Groups Projects
Commit 918c67d9 authored by Stepan Salenikovich's avatar Stepan Salenikovich Committed by Alexandre Viau
Browse files

save default video device


Now setting the default video device will update the order of the
video preferences and then save the config. This ensures that the
default video device setting persists between dring sessions as
the order of the video preferences in dring.yml is used to determine
the default device when launching dring.

Reviewed-by: default avatarAlexandre Viau <alexandre.viau@savoirfairelinux.com>
Change-Id: I7af715c80db58b83eaf4b7584b34ca2279023a2c
Tuleap: #1035
parent 10f592d5
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,7 @@ setDefaultDevice(const std::string& name)
{
RING_DBG("Setting default device to %s", name.c_str());
ring::Manager::instance().getVideoManager().videoDeviceMonitor.setDefaultDevice(name);
ring::Manager::instance().saveConfig();
}
std::map<std::string, std::string>
......
......@@ -109,9 +109,20 @@ VideoDeviceMonitor::getMRLForDefaultDevice() const
void
VideoDeviceMonitor::setDefaultDevice(const std::string& name)
{
const auto it = findDeviceByName(name);
if (it != devices_.end())
defaultDevice_ = it->name;
const auto itDev = findDeviceByName(name);
if (itDev != devices_.end()) {
defaultDevice_ = itDev->name;
// place it at the begining of the prefs
auto itPref = findPreferencesByName(name);
if (itPref != preferences_.end()) {
auto settings = *itPref;
preferences_.erase(itPref);
preferences_.insert(preferences_.begin(), settings);
} else {
preferences_.insert(preferences_.begin(), itDev->getSettings());
}
}
}
DeviceParams
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment