mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-16 14:25:45 -04:00
Android: Add manual disc change from file
This commit is contained in:
@ -1503,4 +1503,22 @@ DEFINE_JNI_ARGS_METHOD(jboolean, AndroidHostInterface_setMediaPlaylistIndex, job
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_JNI_ARGS_METHOD(jboolean, AndroidHostInterface_setMediaFilename, jstring obj, jstring filename)
|
||||
{
|
||||
if (!System::IsValid() || !filename)
|
||||
return false;
|
||||
|
||||
std::string filename_str(AndroidHelpers::JStringToString(env, filename));
|
||||
AndroidHostInterface* hi = AndroidHelpers::GetNativeClass(env, obj);
|
||||
hi->RunOnEmulationThread([filename_str, hi]() {
|
||||
if (System::IsValid())
|
||||
{
|
||||
if (!System::InsertMedia(filename_str.c_str()))
|
||||
hi->AddOSDMessage("Disc switch failed. Please make sure the file exists and is a supported disc image.");
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user