mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 01:59:52 -06:00
Add an option to eject the disc
This commit is contained in:
@ -468,6 +468,12 @@ static void InsertDiscCallback(u64 userdata, s64 cyclesLate)
|
||||
s_disc_path_to_insert.clear();
|
||||
}
|
||||
|
||||
// Must only be called on the CPU thread
|
||||
void EjectDisc()
|
||||
{
|
||||
CoreTiming::ScheduleEvent(0, s_eject_disc);
|
||||
}
|
||||
|
||||
// Must only be called on the CPU thread
|
||||
void ChangeDisc(const std::string& new_path)
|
||||
{
|
||||
@ -477,10 +483,10 @@ void ChangeDisc(const std::string& new_path)
|
||||
return;
|
||||
}
|
||||
|
||||
s_disc_path_to_insert = new_path;
|
||||
CoreTiming::ScheduleEvent(0, s_eject_disc);
|
||||
CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond(), s_insert_disc);
|
||||
EjectDisc();
|
||||
|
||||
s_disc_path_to_insert = new_path;
|
||||
CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond(), s_insert_disc);
|
||||
Movie::SignalDiscChange(new_path);
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base);
|
||||
|
||||
void SetDisc(std::unique_ptr<DiscIO::Volume> disc);
|
||||
bool IsDiscInside();
|
||||
void EjectDisc(); // Must only be called on the CPU thread
|
||||
void ChangeDisc(const std::string& new_path); // Must only be called on the CPU thread
|
||||
|
||||
// This function returns true and calls SConfig::SetRunningGameMetadata(Volume&, Partition&)
|
||||
|
@ -23,6 +23,7 @@
|
||||
const std::string hotkey_labels[] = {
|
||||
_trans("Open"),
|
||||
_trans("Change Disc"),
|
||||
_trans("Eject Disc"),
|
||||
_trans("Refresh List"),
|
||||
_trans("Toggle Pause"),
|
||||
_trans("Stop"),
|
||||
|
@ -21,6 +21,7 @@ enum Hotkey
|
||||
{
|
||||
HK_OPEN,
|
||||
HK_CHANGE_DISC,
|
||||
HK_EJECT_DISC,
|
||||
HK_REFRESH_LIST,
|
||||
HK_PLAY_PAUSE,
|
||||
HK_STOP,
|
||||
|
Reference in New Issue
Block a user