mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
AudioPlaybackDemo: Fix usability issues on Android
Android devices won't necessarily be able to load MP3 files, so that option has been removed from the file chooser. FLAC files should be supported, but were missing from the MIME table. The demo no longer tries to load files into the thumbnail view if they previously failed to load into the transport.
This commit is contained in:
parent
36627a2216
commit
8b708b348d
2 changed files with 9 additions and 3 deletions
|
|
@ -415,9 +415,14 @@ private:
|
|||
//==============================================================================
|
||||
void showAudioResource (URL resource)
|
||||
{
|
||||
if (loadURLIntoTransport (resource))
|
||||
currentAudioFile = std::move (resource);
|
||||
if (! loadURLIntoTransport (resource))
|
||||
{
|
||||
// Failed to load the audio file!
|
||||
jassertfalse;
|
||||
return;
|
||||
}
|
||||
|
||||
currentAudioFile = std::move (resource);
|
||||
zoomSlider.setValue (0, dontSendNotification);
|
||||
thumbnail->setURL (currentAudioFile);
|
||||
}
|
||||
|
|
@ -492,7 +497,7 @@ private:
|
|||
|
||||
if (FileChooser::isPlatformDialogAvailable())
|
||||
{
|
||||
fileChooser = std::make_unique<FileChooser> ("Select an audio file...", File(), "*.wav;*.mp3;*.aif");
|
||||
fileChooser = std::make_unique<FileChooser> ("Select an audio file...", File(), "*.wav;*.flac;*.aif");
|
||||
|
||||
fileChooser->launchAsync (FileBrowserComponent::openMode | FileBrowserComponent::canSelectFiles,
|
||||
[this] (const FileChooser& fc) mutable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue