diff --git a/extras/Projucer/JuceLibraryCode/BinaryData.cpp b/extras/Projucer/JuceLibraryCode/BinaryData.cpp index 0f57656430..3e796febb1 100644 --- a/extras/Projucer/JuceLibraryCode/BinaryData.cpp +++ b/extras/Projucer/JuceLibraryCode/BinaryData.cpp @@ -5514,8 +5514,18 @@ static const unsigned char temp_binary_data_27[] = " // you add any child components.\r\n" " setSize (800, 600);\r\n" "\r\n" -" // specify the number of input and output channels that we want to open\r\n" -" setAudioChannels (2, 2);\r\n" +" // Some platforms require permissions to open input channels so request that here\r\n" +" if (RuntimePermissions::isRequired (RuntimePermissions::recordAudio)\r\n" +" && ! RuntimePermissions::isGranted (RuntimePermissions::recordAudio))\r\n" +" {\r\n" +" RuntimePermissions::request (RuntimePermissions::recordAudio,\r\n" +" [&] (bool granted) { if (granted) setAudioChannels (2, 2); });\r\n" +" }\r\n" +" else\r\n" +" {\r\n" +" // Specify the number of input and output channels that we want to open\r\n" +" setAudioChannels (2, 2);\r\n" +" }\r\n" " }\r\n" "\r\n" " ~%%content_component_class%%()\r\n" @@ -5601,8 +5611,18 @@ static const unsigned char temp_binary_data_28[] = " // you add any child components.\r\n" " setSize (800, 600);\r\n" "\r\n" -" // specify the number of input and output channels that we want to open\r\n" -" setAudioChannels (2, 2);\r\n" +" // Some platforms require permissions to open input channels so request that here\r\n" +" if (RuntimePermissions::isRequired (RuntimePermissions::recordAudio)\r\n" +" && ! RuntimePermissions::isGranted (RuntimePermissions::recordAudio))\r\n" +" {\r\n" +" RuntimePermissions::request (RuntimePermissions::recordAudio,\r\n" +" [&] (bool granted) { if (granted) setAudioChannels (2, 2); });\r\n" +" }\r\n" +" else\r\n" +" {\r\n" +" // Specify the number of input and output channels that we want to open\r\n" +" setAudioChannels (2, 2);\r\n" +" }\r\n" "}\r\n" "\r\n" "%%content_component_class%%::~%%content_component_class%%()\r\n" @@ -7818,8 +7838,8 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) case 0xd11e6d35: numBytes = 2085; return jucer_AnimatedComponentSimpleTemplate_h; case 0x6cf2645e: numBytes = 1563; return jucer_AnimatedComponentTemplate_cpp; case 0x97b055e3: numBytes = 1201; return jucer_AnimatedComponentTemplate_h; - case 0xfb6f6d96: numBytes = 3194; return jucer_AudioComponentSimpleTemplate_h; - case 0xafccbd3f: numBytes = 2635; return jucer_AudioComponentTemplate_cpp; + case 0xfb6f6d96: numBytes = 3693; return jucer_AudioComponentSimpleTemplate_h; + case 0xafccbd3f: numBytes = 3094; return jucer_AudioComponentTemplate_cpp; case 0x915d7304: numBytes = 1374; return jucer_AudioComponentTemplate_h; case 0x27c5a93a: numBytes = 1356; return jucer_AudioPluginEditorTemplate_cpp; case 0x4d0721bf: numBytes = 977; return jucer_AudioPluginEditorTemplate_h; diff --git a/extras/Projucer/JuceLibraryCode/BinaryData.h b/extras/Projucer/JuceLibraryCode/BinaryData.h index cad7d24f63..1f027de67c 100644 --- a/extras/Projucer/JuceLibraryCode/BinaryData.h +++ b/extras/Projucer/JuceLibraryCode/BinaryData.h @@ -90,10 +90,10 @@ namespace BinaryData const int jucer_AnimatedComponentTemplate_hSize = 1201; extern const char* jucer_AudioComponentSimpleTemplate_h; - const int jucer_AudioComponentSimpleTemplate_hSize = 3194; + const int jucer_AudioComponentSimpleTemplate_hSize = 3693; extern const char* jucer_AudioComponentTemplate_cpp; - const int jucer_AudioComponentTemplate_cppSize = 2635; + const int jucer_AudioComponentTemplate_cppSize = 3094; extern const char* jucer_AudioComponentTemplate_h; const int jucer_AudioComponentTemplate_hSize = 1374; diff --git a/extras/Projucer/Source/BinaryData/Templates/jucer_AudioComponentSimpleTemplate.h b/extras/Projucer/Source/BinaryData/Templates/jucer_AudioComponentSimpleTemplate.h index 8007840e77..d0cba52058 100644 --- a/extras/Projucer/Source/BinaryData/Templates/jucer_AudioComponentSimpleTemplate.h +++ b/extras/Projucer/Source/BinaryData/Templates/jucer_AudioComponentSimpleTemplate.h @@ -25,8 +25,18 @@ public: // you add any child components. setSize (800, 600); - // specify the number of input and output channels that we want to open - setAudioChannels (2, 2); + // Some platforms require permissions to open input channels so request that here + if (RuntimePermissions::isRequired (RuntimePermissions::recordAudio) + && ! RuntimePermissions::isGranted (RuntimePermissions::recordAudio)) + { + RuntimePermissions::request (RuntimePermissions::recordAudio, + [&] (bool granted) { if (granted) setAudioChannels (2, 2); }); + } + else + { + // Specify the number of input and output channels that we want to open + setAudioChannels (2, 2); + } } ~%%content_component_class%%() diff --git a/extras/Projucer/Source/BinaryData/Templates/jucer_AudioComponentTemplate.cpp b/extras/Projucer/Source/BinaryData/Templates/jucer_AudioComponentTemplate.cpp index b24e6e741f..946bc7bf5c 100644 --- a/extras/Projucer/Source/BinaryData/Templates/jucer_AudioComponentTemplate.cpp +++ b/extras/Projucer/Source/BinaryData/Templates/jucer_AudioComponentTemplate.cpp @@ -15,8 +15,18 @@ // you add any child components. setSize (800, 600); - // specify the number of input and output channels that we want to open - setAudioChannels (2, 2); + // Some platforms require permissions to open input channels so request that here + if (RuntimePermissions::isRequired (RuntimePermissions::recordAudio) + && ! RuntimePermissions::isGranted (RuntimePermissions::recordAudio)) + { + RuntimePermissions::request (RuntimePermissions::recordAudio, + [&] (bool granted) { if (granted) setAudioChannels (2, 2); }); + } + else + { + // Specify the number of input and output channels that we want to open + setAudioChannels (2, 2); + } } %%content_component_class%%::~%%content_component_class%%()