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

Projucer: Request audio recording permissions in the Audio Application template on platforms which require it

This commit is contained in:
ed 2018-11-16 16:59:52 +00:00
parent 35890478a3
commit 9ade3b30d5
4 changed files with 52 additions and 12 deletions

View file

@ -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;