FIX: media play state conflict when switch device

Change-Id: I95680159a50b2085cb6de5b7cd612d6b444a6446
This commit is contained in:
chunmao.guo 2022-08-26 09:39:45 +08:00 committed by Lane.Wei
parent 3c8d9be77e
commit 2ecdf43ca1
4 changed files with 38 additions and 23 deletions

View file

@ -390,8 +390,10 @@ void PresetComboBox::add_ams_filaments(std::string selected, bool alias_name)
std::string setting_id = f.opt_string("filament_settings_id", 0u);
auto iter = std::find_if(filaments.begin(), filaments.end(),
[&setting_id](auto &f) { return f.is_compatible && f.is_system && f.filament_id == setting_id; });
if (iter == filaments.end())
if (iter == filaments.end()) {
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": filament_id %1% not found or system or compatible") % setting_id;
continue;
}
const_cast<Preset&>(*iter).is_visible = true;
auto color = f.opt_string("filament_colour", 0u);
wxColour clr(color);