1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Resave all projects

This commit is contained in:
reuk 2022-11-29 17:08:59 +00:00
parent da38c1ed2a
commit a309775160
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
9 changed files with 92 additions and 89 deletions

View file

@ -4,7 +4,10 @@
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"
android:xlargeScreens="true"/> android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
@ -15,7 +18,7 @@
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:glEsVersion="0x00030000" android:required="true"/> <uses-feature android:glEsVersion="0x00030000" android:required="true"/>
<application android:label="@string/app_name" android:name="com.rmsl.juce.JuceApp" android:icon="@drawable/icon" android:hardwareAccelerated="false"> <application android:label="@string/app_name" android:name="com.rmsl.juce.JuceApp" android:icon="@drawable/icon" android:hardwareAccelerated="false">
<activity android:name="com.rmsl.juce.JuceActivity" android:configChanges="keyboardHidden|orientation|screenSize" <activity android:name="com.rmsl.juce.JuceActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|navigation"
android:screenOrientation="unspecified" android:launchMode="singleTask" android:hardwareAccelerated="true" android:screenOrientation="unspecified" android:launchMode="singleTask" android:hardwareAccelerated="true"
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>

View file

@ -25,7 +25,7 @@ using namespace dsp;
struct DSPDemoParameterBase : public ChangeBroadcaster struct DSPDemoParameterBase : public ChangeBroadcaster
{ {
DSPDemoParameterBase (const String& labelName) : name (labelName) {} DSPDemoParameterBase (const String& labelName) : name (labelName) {}
virtual ~DSPDemoParameterBase() {} virtual ~DSPDemoParameterBase() = default;
virtual Component* getComponent() = 0; virtual Component* getComponent() = 0;
@ -142,7 +142,7 @@ public:
loadURL (u); loadURL (u);
} }
URL getCurrentURL() { return currentURL; } URL getCurrentURL() const { return currentURL; }
void setTransportSource (AudioTransportSource* newSource) void setTransportSource (AudioTransportSource* newSource)
{ {
@ -189,21 +189,7 @@ private:
currentURL = u; currentURL = u;
InputSource* inputSource = nullptr; thumbnail.setSource (makeInputSource (u).release());
#if ! JUCE_IOS
if (u.isLocalFile())
{
inputSource = new FileInputSource (u.getLocalFile());
}
else
#endif
{
if (inputSource == nullptr)
inputSource = new URLInputSource (u);
}
thumbnail.setSource (inputSource);
if (notify) if (notify)
sendChangeMessage(); sendChangeMessage();
@ -407,24 +393,21 @@ public:
transportSource.reset(); transportSource.reset();
readerSource.reset(); readerSource.reset();
AudioFormatReader* newReader = nullptr; auto source = makeInputSource (fileToPlay);
#if ! JUCE_IOS if (source == nullptr)
if (fileToPlay.isLocalFile()) return false;
{
newReader = formatManager.createReaderFor (fileToPlay.getLocalFile());
}
else
#endif
{
if (newReader == nullptr)
newReader = formatManager.createReaderFor (fileToPlay.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)));
}
reader.reset (newReader); auto stream = rawToUniquePtr (source->createInputStream());
if (stream == nullptr)
return false;
reader = rawToUniquePtr (formatManager.createReaderFor (std::move (stream)));
if (reader == nullptr)
return false;
if (reader.get() != nullptr)
{
readerSource.reset (new AudioFormatReaderSource (reader.get(), false)); readerSource.reset (new AudioFormatReaderSource (reader.get(), false));
readerSource->setLooping (loopState.getValue()); readerSource->setLooping (loopState.getValue());
@ -433,9 +416,6 @@ public:
return true; return true;
} }
return false;
}
void togglePlay() void togglePlay()
{ {
if (playState.getValue()) if (playState.getValue())
@ -613,7 +593,7 @@ private:
{ {
if (fc.getURLResults().size() > 0) if (fc.getURLResults().size() > 0)
{ {
auto u = fc.getURLResult(); const auto u = fc.getURLResult();
if (! audioFileReader.loadURL (u)) if (! audioFileReader.loadURL (u))
NativeMessageBox::showAsync (MessageBoxOptions() NativeMessageBox::showAsync (MessageBoxOptions()

View file

@ -242,4 +242,19 @@ struct SlowerBouncingNumber : public BouncingNumber
} }
}; };
inline std::unique_ptr<InputSource> makeInputSource (const URL& url)
{
#if JUCE_ANDROID
if (auto doc = AndroidDocument::fromDocument (url))
return std::make_unique<AndroidDocumentInputSource> (doc);
#endif
#if ! JUCE_IOS
if (url.isLocalFile())
return std::make_unique<FileInputSource> (url.getLocalFile());
#endif
return std::make_unique<URLInputSource> (url);
}
#endif // PIP_DEMO_UTILITIES_INCLUDED #endif // PIP_DEMO_UTILITIES_INCLUDED

View file

@ -89,9 +89,10 @@
</MODULEPATHS> </MODULEPATHS>
</LINUX_MAKE> </LINUX_MAKE>
<ANDROIDSTUDIO targetFolder="Builds/Android" androidMinimumSDK="23" microphonePermissionNeeded="1" <ANDROIDSTUDIO targetFolder="Builds/Android" androidMinimumSDK="23" microphonePermissionNeeded="1"
androidBluetoothNeeded="1" androidExternalReadNeeded="1" androidExternalWriteNeeded="1" androidBluetoothNeeded="1" androidExternalWriteNeeded="1" androidEnableContentSharing="1"
androidEnableContentSharing="1" androidExtraAssetsFolder="../Assets" androidExtraAssetsFolder="../Assets" smallIcon="YyqWd2" bigIcon="YyqWd2"
smallIcon="YyqWd2" bigIcon="YyqWd2" cameraPermissionNeeded="1"> cameraPermissionNeeded="1" androidReadMediaAudioPermission="1"
androidReadMediaImagesPermission="1" androidReadMediaVideoPermission="1">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug" recommendedWarnings="LLVM"/> <CONFIGURATION isDebug="1" name="Debug" recommendedWarnings="LLVM"/>
<CONFIGURATION isDebug="0" name="Release" recommendedWarnings="LLVM"/> <CONFIGURATION isDebug="0" name="Release" recommendedWarnings="LLVM"/>

View file

@ -4,7 +4,10 @@
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"
android:xlargeScreens="true"/> android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
@ -12,7 +15,7 @@
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/> <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:name="com.rmsl.juce.JuceApp" android:hardwareAccelerated="false"> <application android:label="@string/app_name" android:name="com.rmsl.juce.JuceApp" android:hardwareAccelerated="false">
<activity android:name="com.rmsl.juce.JuceActivity" android:configChanges="keyboardHidden|orientation|screenSize" <activity android:name="com.rmsl.juce.JuceActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|navigation"
android:screenOrientation="unspecified" android:launchMode="singleTask" android:hardwareAccelerated="true" android:screenOrientation="unspecified" android:launchMode="singleTask" android:hardwareAccelerated="true"
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>

View file

@ -4,7 +4,10 @@
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"
android:xlargeScreens="true"/> android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
@ -14,7 +17,7 @@
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:glEsVersion="0x00030000" android:required="true"/> <uses-feature android:glEsVersion="0x00030000" android:required="true"/>
<application android:label="@string/app_name" android:name="com.rmsl.juce.JuceApp" android:icon="@drawable/icon" android:hardwareAccelerated="false"> <application android:label="@string/app_name" android:name="com.rmsl.juce.JuceApp" android:icon="@drawable/icon" android:hardwareAccelerated="false">
<activity android:name="com.rmsl.juce.JuceActivity" android:configChanges="keyboardHidden|orientation|screenSize" <activity android:name="com.rmsl.juce.JuceActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|navigation"
android:screenOrientation="unspecified" android:launchMode="singleTask" android:hardwareAccelerated="true" android:screenOrientation="unspecified" android:launchMode="singleTask" android:hardwareAccelerated="true"
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>

View file

@ -25,7 +25,7 @@ using namespace dsp;
struct DSPDemoParameterBase : public ChangeBroadcaster struct DSPDemoParameterBase : public ChangeBroadcaster
{ {
DSPDemoParameterBase (const String& labelName) : name (labelName) {} DSPDemoParameterBase (const String& labelName) : name (labelName) {}
virtual ~DSPDemoParameterBase() {} virtual ~DSPDemoParameterBase() = default;
virtual Component* getComponent() = 0; virtual Component* getComponent() = 0;
@ -142,7 +142,7 @@ public:
loadURL (u); loadURL (u);
} }
URL getCurrentURL() { return currentURL; } URL getCurrentURL() const { return currentURL; }
void setTransportSource (AudioTransportSource* newSource) void setTransportSource (AudioTransportSource* newSource)
{ {
@ -189,21 +189,7 @@ private:
currentURL = u; currentURL = u;
InputSource* inputSource = nullptr; thumbnail.setSource (makeInputSource (u).release());
#if ! JUCE_IOS
if (u.isLocalFile())
{
inputSource = new FileInputSource (u.getLocalFile());
}
else
#endif
{
if (inputSource == nullptr)
inputSource = new URLInputSource (u);
}
thumbnail.setSource (inputSource);
if (notify) if (notify)
sendChangeMessage(); sendChangeMessage();
@ -407,24 +393,21 @@ public:
transportSource.reset(); transportSource.reset();
readerSource.reset(); readerSource.reset();
AudioFormatReader* newReader = nullptr; auto source = makeInputSource (fileToPlay);
#if ! JUCE_IOS if (source == nullptr)
if (fileToPlay.isLocalFile()) return false;
{
newReader = formatManager.createReaderFor (fileToPlay.getLocalFile());
}
else
#endif
{
if (newReader == nullptr)
newReader = formatManager.createReaderFor (fileToPlay.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)));
}
reader.reset (newReader); auto stream = rawToUniquePtr (source->createInputStream());
if (stream == nullptr)
return false;
reader = rawToUniquePtr (formatManager.createReaderFor (std::move (stream)));
if (reader == nullptr)
return false;
if (reader.get() != nullptr)
{
readerSource.reset (new AudioFormatReaderSource (reader.get(), false)); readerSource.reset (new AudioFormatReaderSource (reader.get(), false));
readerSource->setLooping (loopState.getValue()); readerSource->setLooping (loopState.getValue());
@ -433,9 +416,6 @@ public:
return true; return true;
} }
return false;
}
void togglePlay() void togglePlay()
{ {
if (playState.getValue()) if (playState.getValue())
@ -613,7 +593,7 @@ private:
{ {
if (fc.getURLResults().size() > 0) if (fc.getURLResults().size() > 0)
{ {
auto u = fc.getURLResult(); const auto u = fc.getURLResult();
if (! audioFileReader.loadURL (u)) if (! audioFileReader.loadURL (u))
NativeMessageBox::showAsync (MessageBoxOptions() NativeMessageBox::showAsync (MessageBoxOptions()

View file

@ -242,4 +242,19 @@ struct SlowerBouncingNumber : public BouncingNumber
} }
}; };
inline std::unique_ptr<InputSource> makeInputSource (const URL& url)
{
#if JUCE_ANDROID
if (auto doc = AndroidDocument::fromDocument (url))
return std::make_unique<AndroidDocumentInputSource> (doc);
#endif
#if ! JUCE_IOS
if (url.isLocalFile())
return std::make_unique<FileInputSource> (url.getLocalFile());
#endif
return std::make_unique<URLInputSource> (url);
}
#endif // PIP_DEMO_UTILITIES_INCLUDED #endif // PIP_DEMO_UTILITIES_INCLUDED

View file

@ -4,7 +4,10 @@
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"
android:xlargeScreens="true"/> android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
@ -13,7 +16,7 @@
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/> <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<application android:label="@string/app_name" android:name="com.rmsl.juce.JuceApp" android:icon="@drawable/icon" android:hardwareAccelerated="false"> <application android:label="@string/app_name" android:name="com.rmsl.juce.JuceApp" android:icon="@drawable/icon" android:hardwareAccelerated="false">
<activity android:name="com.rmsl.juce.JuceActivity" android:configChanges="keyboardHidden|orientation|screenSize" <activity android:name="com.rmsl.juce.JuceActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|navigation"
android:screenOrientation="unspecified" android:launchMode="singleTask" android:hardwareAccelerated="true" android:screenOrientation="unspecified" android:launchMode="singleTask" android:hardwareAccelerated="true"
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>