mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-26 00:40:40 +00:00
Add an option to eject the disc
This commit is contained in:
parent
3c770693a2
commit
e4faabb763
@ -468,6 +468,12 @@ static void InsertDiscCallback(u64 userdata, s64 cyclesLate)
|
|||||||
s_disc_path_to_insert.clear();
|
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
|
// Must only be called on the CPU thread
|
||||||
void ChangeDisc(const std::string& new_path)
|
void ChangeDisc(const std::string& new_path)
|
||||||
{
|
{
|
||||||
@ -477,10 +483,10 @@ void ChangeDisc(const std::string& new_path)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_disc_path_to_insert = new_path;
|
EjectDisc();
|
||||||
CoreTiming::ScheduleEvent(0, s_eject_disc);
|
|
||||||
CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond(), s_insert_disc);
|
|
||||||
|
|
||||||
|
s_disc_path_to_insert = new_path;
|
||||||
|
CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond(), s_insert_disc);
|
||||||
Movie::SignalDiscChange(new_path);
|
Movie::SignalDiscChange(new_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +113,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base);
|
|||||||
|
|
||||||
void SetDisc(std::unique_ptr<DiscIO::Volume> disc);
|
void SetDisc(std::unique_ptr<DiscIO::Volume> disc);
|
||||||
bool IsDiscInside();
|
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
|
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&)
|
// This function returns true and calls SConfig::SetRunningGameMetadata(Volume&, Partition&)
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
const std::string hotkey_labels[] = {
|
const std::string hotkey_labels[] = {
|
||||||
_trans("Open"),
|
_trans("Open"),
|
||||||
_trans("Change Disc"),
|
_trans("Change Disc"),
|
||||||
|
_trans("Eject Disc"),
|
||||||
_trans("Refresh List"),
|
_trans("Refresh List"),
|
||||||
_trans("Toggle Pause"),
|
_trans("Toggle Pause"),
|
||||||
_trans("Stop"),
|
_trans("Stop"),
|
||||||
|
@ -21,6 +21,7 @@ enum Hotkey
|
|||||||
{
|
{
|
||||||
HK_OPEN,
|
HK_OPEN,
|
||||||
HK_CHANGE_DISC,
|
HK_CHANGE_DISC,
|
||||||
|
HK_EJECT_DISC,
|
||||||
HK_REFRESH_LIST,
|
HK_REFRESH_LIST,
|
||||||
HK_PLAY_PAUSE,
|
HK_PLAY_PAUSE,
|
||||||
HK_STOP,
|
HK_STOP,
|
||||||
|
@ -961,6 +961,8 @@ static int GetMenuIDFromHotkey(unsigned int key)
|
|||||||
return wxID_OPEN;
|
return wxID_OPEN;
|
||||||
case HK_CHANGE_DISC:
|
case HK_CHANGE_DISC:
|
||||||
return IDM_CHANGE_DISC;
|
return IDM_CHANGE_DISC;
|
||||||
|
case HK_EJECT_DISC:
|
||||||
|
return IDM_EJECT_DISC;
|
||||||
case HK_REFRESH_LIST:
|
case HK_REFRESH_LIST:
|
||||||
return wxID_REFRESH;
|
return wxID_REFRESH;
|
||||||
case HK_PLAY_PAUSE:
|
case HK_PLAY_PAUSE:
|
||||||
@ -1305,6 +1307,7 @@ void CFrame::ParseHotkeys()
|
|||||||
{
|
{
|
||||||
case HK_OPEN:
|
case HK_OPEN:
|
||||||
case HK_CHANGE_DISC:
|
case HK_CHANGE_DISC:
|
||||||
|
case HK_EJECT_DISC:
|
||||||
case HK_REFRESH_LIST:
|
case HK_REFRESH_LIST:
|
||||||
case HK_RESET:
|
case HK_RESET:
|
||||||
case HK_START_RECORDING:
|
case HK_START_RECORDING:
|
||||||
|
@ -299,6 +299,7 @@ private:
|
|||||||
void OnShowInputDisplay(wxCommandEvent& event);
|
void OnShowInputDisplay(wxCommandEvent& event);
|
||||||
void OnShowRTCDisplay(wxCommandEvent& event);
|
void OnShowRTCDisplay(wxCommandEvent& event);
|
||||||
void OnChangeDisc(wxCommandEvent& event);
|
void OnChangeDisc(wxCommandEvent& event);
|
||||||
|
void OnEjectDisc(wxCommandEvent& event);
|
||||||
void OnScreenshot(wxCommandEvent& event);
|
void OnScreenshot(wxCommandEvent& event);
|
||||||
void OnActive(wxActivateEvent& event);
|
void OnActive(wxActivateEvent& event);
|
||||||
void OnClose(wxCloseEvent& event);
|
void OnClose(wxCloseEvent& event);
|
||||||
|
@ -127,6 +127,7 @@ void CFrame::BindMenuBarEvents()
|
|||||||
// File menu
|
// File menu
|
||||||
Bind(wxEVT_MENU, &CFrame::OnOpen, this, wxID_OPEN);
|
Bind(wxEVT_MENU, &CFrame::OnOpen, this, wxID_OPEN);
|
||||||
Bind(wxEVT_MENU, &CFrame::OnChangeDisc, this, IDM_CHANGE_DISC);
|
Bind(wxEVT_MENU, &CFrame::OnChangeDisc, this, IDM_CHANGE_DISC);
|
||||||
|
Bind(wxEVT_MENU, &CFrame::OnEjectDisc, this, IDM_EJECT_DISC);
|
||||||
Bind(wxEVT_MENU, &CFrame::OnBootDrive, this, IDM_DRIVE1, IDM_DRIVE24);
|
Bind(wxEVT_MENU, &CFrame::OnBootDrive, this, IDM_DRIVE1, IDM_DRIVE24);
|
||||||
Bind(wxEVT_MENU, &CFrame::OnRefresh, this, wxID_REFRESH);
|
Bind(wxEVT_MENU, &CFrame::OnRefresh, this, wxID_REFRESH);
|
||||||
Bind(wxEVT_MENU, &CFrame::OnQuit, this, wxID_EXIT);
|
Bind(wxEVT_MENU, &CFrame::OnQuit, this, wxID_EXIT);
|
||||||
@ -459,6 +460,11 @@ void CFrame::OnChangeDisc(wxCommandEvent& WXUNUSED(event))
|
|||||||
DoOpen(false);
|
DoOpen(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CFrame::OnEjectDisc(wxCommandEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
Core::RunAsCPUThread(DVDInterface::EjectDisc);
|
||||||
|
}
|
||||||
|
|
||||||
void CFrame::OnRecord(wxCommandEvent& WXUNUSED(event))
|
void CFrame::OnRecord(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
if ((!Core::IsRunningAndStarted() && Core::IsRunning()) || Movie::IsRecordingInput() ||
|
if ((!Core::IsRunningAndStarted() && Core::IsRunning()) || Movie::IsRecordingInput() ||
|
||||||
|
@ -94,6 +94,7 @@ enum
|
|||||||
IDM_CHEATS,
|
IDM_CHEATS,
|
||||||
IDM_NETPLAY,
|
IDM_NETPLAY,
|
||||||
IDM_RESTART,
|
IDM_RESTART,
|
||||||
|
IDM_EJECT_DISC,
|
||||||
IDM_CHANGE_DISC,
|
IDM_CHANGE_DISC,
|
||||||
IDM_LIST_CHANGE_DISC,
|
IDM_LIST_CHANGE_DISC,
|
||||||
IDM_PROPERTIES,
|
IDM_PROPERTIES,
|
||||||
|
@ -79,6 +79,7 @@ wxMenu* MainMenuBar::CreateFileMenu() const
|
|||||||
auto* const file_menu = new wxMenu;
|
auto* const file_menu = new wxMenu;
|
||||||
file_menu->Append(wxID_OPEN, _("&Open..."));
|
file_menu->Append(wxID_OPEN, _("&Open..."));
|
||||||
file_menu->Append(IDM_CHANGE_DISC, _("Change &Disc..."));
|
file_menu->Append(IDM_CHANGE_DISC, _("Change &Disc..."));
|
||||||
|
file_menu->Append(IDM_EJECT_DISC, _("Eject Disc"));
|
||||||
file_menu->Append(IDM_DRIVES, _("&Boot from DVD Backup"), external_drive_menu);
|
file_menu->Append(IDM_DRIVES, _("&Boot from DVD Backup"), external_drive_menu);
|
||||||
file_menu->AppendSeparator();
|
file_menu->AppendSeparator();
|
||||||
file_menu->Append(wxID_REFRESH, _("&Refresh Game List"));
|
file_menu->Append(wxID_REFRESH, _("&Refresh Game List"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user