summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/auditmenu.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-10-15 09:42:35 +1100
committer Vas Crabb <vas@vastheman.com>2021-10-15 10:12:56 +1100
commit22bc3486c3ef8f2230e99daf49785a89ac8a1182 (patch)
tree4f10f7386b7b0a32c9d560395399e8b7632df34c /src/frontend/mame/ui/auditmenu.h
parent3e8763bea5a93f3139204fcb8a0c74c2ac364af5 (diff)
More user experience improvements:
frontend: Made it possible to cancel a media audit while it's in progress. Also made the media audit multi-threaded so it's faster. frontend: Made the DIP switches in the DIP switch preview clickable. frontend: Made the system and software selection menus leave focus on the same system when clearing the search rather than jumping to the first item. Also fixed a couple of bugs in the logic for keeping the selected item visible. frontend: Fixed a few places that weren't showing localised system names. frontend: Made UI Cancel clear a search in the file manager the same way it does on the system and sofware selection menus. frontend: Made it possible for plugin menus to handle UI Cancel more naturally, backing up to the previous plugin menu rather than dropping straight back to the list of plugins. Updated the autofire, cheat and cheatfind plugins, and fixed a few other issues in the cheatfind plugin. debugger: Made the mount and unmount commands accept instance names as well as brief instance names. Also updated another page of debugger documentation.
Diffstat (limited to 'src/frontend/mame/ui/auditmenu.h')
-rw-r--r--src/frontend/mame/ui/auditmenu.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/frontend/mame/ui/auditmenu.h b/src/frontend/mame/ui/auditmenu.h
index a9734e71709..6536c3a19aa 100644
--- a/src/frontend/mame/ui/auditmenu.h
+++ b/src/frontend/mame/ui/auditmenu.h
@@ -16,7 +16,7 @@
#include "ui/utils.h"
#include <atomic>
-#include <thread>
+#include <future>
#include <vector>
@@ -25,28 +25,29 @@ namespace ui {
class menu_audit : public menu
{
public:
- menu_audit(mame_ui_manager &mui, render_container &container, std::vector<ui_system_info> &availablesorted);
+ menu_audit(mame_ui_manager &mui, render_container &container);
virtual ~menu_audit() override;
protected:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+ virtual bool custom_ui_cancel() override;
private:
- enum class phase { CONSENT, AUDIT };
+ enum class phase { CONFIRMATION, AUDIT, CANCELLATION };
virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
- void audit_fast();
- void audit_all();
+ bool do_audit();
void save_available_machines();
- std::thread m_worker_thread;
- std::size_t const m_unavailable;
std::string m_prompt;
- std::vector<ui_system_info> &m_availablesorted;
+ std::vector<std::reference_wrapper<ui_system_info> > const &m_availablesorted;
+ std::size_t const m_unavailable;
+ std::vector<std::future<bool> > m_future;
std::atomic<std::size_t> m_audited;
- std::atomic<game_driver const *> m_current;
+ std::atomic<ui_system_info const *> m_current;
+ std::atomic<bool> m_cancel;
phase m_phase;
bool m_fast;
};