Hi!
I have some good news.
I installed everything in my computer to be able to compile Win32 Kodi.
I made some changes in Application.cpp, so it would work for all configurations:
- With DVD Drive: As usual. There would be a DialogPlayEject to be able to load the correct DVD, so the movie would be played afterwards:
- Without DVD Drive: Since it is impossible to eject the DVD tray and load a DVD, the DialogPlayEject would not be applicable. Instead, a DialogOK would appear with the title and message set in the .disc file. For the moment, I have reused a "Media Info" string, but I am opened to put whatever we think is more coherent: info, stub info, stub details...
What do you think?
When we all agree, I can submit the pull request:
Code:
if (item.IsDiscStub())
{
#ifdef HAS_DVD_DRIVE
// Display the Play Eject dialog if there is any optical disc drive
if (g_mediaManager.HasOpticalDrive())
{
if (CGUIDialogPlayEject::ShowAndGetInput(item))
// PlayDiscAskResume takes path to disc. No parameter means default DVD drive.
// Can't do better as CGUIDialogPlayEject calls CMediaManager::IsDiscInDrive, which assumes default DVD drive anyway
return MEDIA_DETECT::CAutorun::PlayDiscAskResume() ? PLAYBACK_OK : PLAYBACK_FAIL;
}
else
#endif
{
// Since there is no DVD Drive, display a CGUIDialogOK instead
// Figure out Lines 0 and 1 of the dialog
std::string strLine1, strLine2;
CXBMCTinyXML discStubXML;
if (discStubXML.LoadFile(item.GetPath()))
{
TiXmlElement * pRootElement = discStubXML.RootElement();
if (!pRootElement || strcmpi(pRootElement->Value(), "discstub") != 0)
CLog::Log(LOGERROR, "Error loading %s, no <discstub> node", item.GetPath().c_str());
else
{
XMLUtils::GetString(pRootElement, "title", strLine1);
XMLUtils::GetString(pRootElement, "message", strLine2);
}
}
// Use the label for Line 1 if not defined
if (strLine1.empty())
strLine1 = item.GetLabel();
CGUIDialogOK::ShowAndGetInput(CVariant{544}, CVariant{std::move(strLine1)}, CVariant{std::move(strLine2)}, false);
}
return PLAYBACK_OK;
}