Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
FileManager Class Reference

Manages the file browser functionality, including loading files, setting the current selection, adding and removing locations (bookmarks), and saving the locations. More...

#include <src/gui/backend/backend/file_manager.h>

Public Member Functions

void load_files ()
 Loads the files under the current selection.
 
void set_selection (FileBrowserLocation &sel, bool load_files, bool save_to_settings)
 Sets the current selection and optionally loads the files and saves the location to the settings.
 
void add_location_and_save (const fs::path &abs_path)
 Adds a new location (bookmark) to the saved locations and saves the settings.
 
void remove_location_and_save (const fs::path &location, bool skip_if_standard)
 Removes the given location (bookmark) from the saved locations and saves the settings.
 

Data Fields

std::vector< FileDescriptorfiles
 The file descriptors for the files under the current collection/location.
 
std::vector< FileBrowserLocationlocations
 The default and user-defined locations (bookmarks).
 
std::unique_ptr< FileBrowserLocationselection
 The current selection in the top window.
 

Detailed Description

Manages the file browser functionality, including loading files, setting the current selection, adding and removing locations (bookmarks), and saving the locations.

Definition at line 100 of file file_manager.h.

Member Function Documentation

◆ add_location_and_save()

void FileManager::add_location_and_save ( const fs::path & abs_path)

Adds a new location (bookmark) to the saved locations and saves the settings.

Parameters
abs_pathThe absolute path of the new location to add.

◆ remove_location_and_save()

void FileManager::remove_location_and_save ( const fs::path & location,
bool skip_if_standard )

Removes the given location (bookmark) from the saved locations and saves the settings.

Parameters
locationThe location to remove.
skip_if_standardWhether to skip removal if the location is a standard location.

◆ set_selection()

void FileManager::set_selection ( FileBrowserLocation & sel,
bool load_files,
bool save_to_settings )

Sets the current selection and optionally loads the files and saves the location to the settings.

Parameters
selThe new file browser location to select.
load_filesWhether to load the files under the new selection.
save_to_settingsWhether to save the new selection to the settings.

Field Documentation

◆ files

std::vector<FileDescriptor> FileManager::files

The file descriptors for the files under the current collection/location.

This is updated whenever the location or collection selection changes.

Definition at line 160 of file file_manager.h.

◆ locations

std::vector<FileBrowserLocation> FileManager::locations

The default and user-defined locations (bookmarks).

Definition at line 165 of file file_manager.h.

◆ selection

std::unique_ptr<FileBrowserLocation> FileManager::selection

The current selection in the top window.

Definition at line 170 of file file_manager.h.


The documentation for this class was generated from the following file: