BeatLib


AudioFileSelector QML Type

Shows a native dialog to select an audio file. More...

Import Statement: import

Signals

Methods

Detailed Description

This QML type shows a native dialog to select an audio file. You can either call it to obtain an audio file name or directly open it as AudioStream instance.

Note: On some operating systems, like Android, the file names provided by audioFileSelected() may not be usable by other Qt or QML types, only by the method openAudioStream().

Signal Documentation

void audioFileSelected(string fileName)

Emitted when the user selects an audio file after a call to selectAudioFile().

The parameter fileName is the path to the selected file.


void audioStreamSelected(AudioStream stream)

Emitted when the user selects an audio file after a call to selectAudioStream().

The parameter stream is an AudioStream instance reading the selected file.


Method Documentation

AudioStream openAudioStream(string fileName)

Open an audio file at fileName and create and return an AudioStream instance.

fileName can be a direct file path, or any URLs native to the current platform, like content:// or file:///android_asset/ on Android.


void selectAudioFile()

Show a platform-native file dialog to select an audio file.

When the user selects a file in the dialog, audioFileSelected() will be emitted.


void selectAudioStream()

Show a platform-native file dialog to select an audio file.

When the user selects a file in the dialog, audioStreamSelected() will be emitted.