void favorite_manager::add_favorite_game() { if ((machine().system().flags & MACHINE_TYPE_ARCADE) != 0) { add_favorite_game(&machine().system()); return; } bool software_avail = false; image_interface_iterator iter(machine().root_device()); for (device_image_interface *image = iter.first(); image != nullptr; image = iter.next()) { if (image->exists() && image->software_entry()) { const software_info *swinfo = image->software_entry(); const software_part *part = image->part_entry(); ui_software_info tmpmatches; tmpmatches.shortname = strensure(swinfo->shortname()); tmpmatches.longname = strensure(image->longname()); tmpmatches.parentname = strensure(swinfo->parentname()); tmpmatches.year = strensure(image->year()); tmpmatches.publisher = strensure(image->manufacturer()); tmpmatches.supported = image->supported(); tmpmatches.part = strensure(part->name()); tmpmatches.driver = &machine().system(); tmpmatches.listname = strensure(image->software_list_name()); tmpmatches.interface = strensure(part->interface()); tmpmatches.instance = strensure(image->instance_name()); tmpmatches.startempty = 0; tmpmatches.parentlongname.clear(); if (swinfo->parentname()) { software_list_device *swlist = software_list_device::find_by_name(machine().config(), image->software_list_name()); for (software_info *c_swinfo = swlist->first_software_info(); c_swinfo != nullptr; c_swinfo = c_swinfo->next()) { std::string c_parent(c_swinfo->parentname()); if (!c_parent.empty() && c_parent == swinfo->shortname()) { tmpmatches.parentlongname = c_swinfo->longname(); break; } } } tmpmatches.usage.clear(); for (feature_list_item *flist = swinfo->other_info(); flist != nullptr; flist = flist->next()) if (!strcmp(flist->name(), "usage")) tmpmatches.usage = flist->value(); tmpmatches.devicetype = strensure(image->image_type_name()); tmpmatches.available = true; software_avail = true; m_list.push_back(tmpmatches); save_favorite_games(); } } if (!software_avail) add_favorite_game(&machine().system()); }
void favorite_manager::remove_favorite_game() { m_list.erase(m_list.begin() + m_current); save_favorite_games(); }
void favorite_manager::remove_favorite_game(ui_software_info &swinfo) { m_list.erase(std::remove(m_list.begin(), m_list.end(), swinfo), m_list.end()); save_favorite_games(); }
void favorite_manager::add_favorite_game(ui_software_info &swinfo) { m_list.push_back(swinfo); save_favorite_games(); }
void favorite_manager::add_favorite_game(const game_driver *driver) { m_list.emplace_back(driver->name, driver->description, "", "", "", 0, "", driver, "", "", "", 1, "", "", "", true); save_favorite_games(); }