1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Android: Allow recording demo to write files on recent Android versions

This commit is contained in:
reuk 2023-01-18 18:47:04 +00:00
parent 070a6b35e9
commit 273275cf07
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
3 changed files with 35 additions and 33 deletions

View file

@ -244,10 +244,8 @@ struct SlowerBouncingNumber : public BouncingNumber
inline std::unique_ptr<InputSource> makeInputSource (const URL& url)
{
#if JUCE_ANDROID
if (auto doc = AndroidDocument::fromDocument (url))
if (const auto doc = AndroidDocument::fromDocument (url))
return std::make_unique<AndroidDocumentInputSource> (doc);
#endif
#if ! JUCE_IOS
if (url.isLocalFile())
@ -257,4 +255,17 @@ inline std::unique_ptr<InputSource> makeInputSource (const URL& url)
return std::make_unique<URLInputSource> (url);
}
inline std::unique_ptr<OutputStream> makeOutputStream (const URL& url)
{
if (const auto doc = AndroidDocument::fromDocument (url))
return doc.createOutputStream();
#if ! JUCE_IOS
if (url.isLocalFile())
return url.getLocalFile().createOutputStream();
#endif
return url.createOutputStream();
}
#endif // PIP_DEMO_UTILITIES_INCLUDED