Skip to content

TrackSelectionDialog ​

Inherits: ConfirmationDialog

Track selection dialog of the audio library: the tracks of an album, of a zone, of a weather, of a shelter, of an event. Works directly with the DatabaseAudio categories (music, atmospheric_ambience, loop). A field that chooses tracks makes it with TrackSelectionDialog.create_for(parent, kind) and listens to selection_made.

Variables ​

Array[String]supported_categories["music", "atmospheric_ambience", "loop"]
Stringcurrent_category""
Stringcurrent_type""
boolis_loadingfalse
AudioStreamPlayeraudio_player
Buttonimport_button
FileDialogimport_dialog
Stringimport_message""
Stringsearch_text""

Methods ​

TrackSelectionDialogcreate_for( parent: Node, kind: Kind = Kind.ANY ) static
Dictionaryimport_files( paths: PackedStringArray )
voidshow_for_category( category: String )
voidshow_all_categories()
Array[String]get_selected_track_paths()
Stringget_selection_summary()
boolhas_valid_selection()
voidshow_music_only()
voidshow_ambience_only()
voidshow_world_sounds_only()
voidshow_all_supported()
voidset_search_filter( search: String )

Signals ​

selection_made( selected_files: Array[String] ) ​

Enumerations ​

enum Kind ​

What a field chooses: any of the tracks of the library, music only, or ambient sound only

  • ANY = 0
  • MUSIC = 1
  • AMBIENCE = 2
  • WORLD_SOUND = 3

Variable descriptions ​

Array[String] supported_categories = ["music", "atmospheric_ambience", "loop"] ​

No description yet.

String current_category = "" ​

No description yet.

String current_type = "" ​

No description yet.

bool is_loading = false ​

No description yet.

AudioStreamPlayer audio_player ​

No description yet.

Button import_button ​

The button that copies sound files into the folder that is shown (the category and the type), and the window that picks them

FileDialog import_dialog ​

No description yet.

String import_message = "" ​

What the last import did (shown in the window)

String search_text = "" ​

No description yet.

Method descriptions ​

TrackSelectionDialog create_for( parent: Node, kind: Kind = Kind.ANY ) ​

A dialog for a field: made from its scene, added to parent (it needs to be in the tree) and set to show the tracks of a kind. The caller pops it up with popup_centered()

Dictionary import_files( paths: PackedStringArray ) ​

Copies the files into the folder that is shown, and shows them in the list (selected, so Select Track takes them)

void show_for_category( category: String ) ​

Show dialog for selecting tracks from a specific category

void show_all_categories() ​

Show dialog with all categories available

Array[String] get_selected_track_paths() ​

No description yet.

String get_selection_summary() ​

Get display text for current selection

bool has_valid_selection() ​

Check if current selection is valid

void show_music_only() ​

Show only music tracks (loop and non-loop)

void show_ambience_only() ​

Show only ambience tracks (loop and non-loop)

void show_world_sounds_only() ​

Show the sounds that come from a place in the world: the environmental sounds (a waterfall, a fire, a mechanism), the ambient sounds and the loops

void show_all_supported() ​

Show all supported categories (default)

void set_search_filter( search: String ) ​

Add search functionality (can be called from parent)