Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
file_manager.h
1// SPDX-FileCopyrightText: © 2019-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __GUI_BACKEND_FILE_MANAGER_H__
5#define __GUI_BACKEND_FILE_MANAGER_H__
6
7#include <stdbool.h>
8
9typedef struct SupportedFile SupportedFile;
10
21{
22 FILE_MANAGER_NONE,
23 FILE_MANAGER_HOME,
24 FILE_MANAGER_DESKTOP,
25 FILE_MANAGER_DRIVE,
27
28#define FILE_MANAGER (ZRYTHM->file_manager)
29
54
59{
60 FB_SELECTION_TYPE_COLLECTIONS,
61 FB_SELECTION_TYPE_LOCATIONS,
63
64typedef struct FileManager
65{
75 GPtrArray * files;
76
77#if 0
81 char * collections[50];
82 int num_collections;
83#endif
84
90 GPtrArray * locations;
91
96
98
104
108void
110
115NONNULL void
117 FileManager * self,
119 bool load_files,
120 bool save_to_settings);
121
125void
127
129file_browser_location_new (void);
130
132file_browser_location_clone (FileBrowserLocation * loc);
133
134void
135file_browser_location_print (const FileBrowserLocation * loc);
136
140void
142 FileManager * self,
143 const char * abs_path);
144
152void
154 FileManager * self,
155 const char * location,
156 bool skip_if_standard);
157
158NONNULL void
159file_browser_location_free (FileBrowserLocation * loc);
160
165#endif
void file_manager_add_location_and_save(FileManager *self, const char *abs_path)
Adds a location and saves the settings.
FileManagerSpecialLocation
Special location type.
void file_manager_free(FileManager *self)
Frees the file manager.
void file_manager_load_files(FileManager *self)
Loads the files under the current selection.
void file_manager_remove_location_and_save(FileManager *self, const char *location, bool skip_if_standard)
Removes the given location (bookmark) from the saved locations.
FileBrowserSelectionType
Current selection in the top window.
NONNULL void file_manager_set_selection(FileManager *self, FileBrowserLocation *sel, bool load_files, bool save_to_settings)
FileManager * file_manager_new(void)
Creates the file manager.
Locations to be used in the file browser.
char * path
Absolute path.
char * label
Human readable label.
FileManagerSpecialLocation special_location
Whether this is a standard (undeletable) location.
GPtrArray * locations
Default locations & user defined locations.
GPtrArray * files
Descriptors for files under the current collection / location.
FileBrowserLocation * selection
Current selection in the top window.
Metadata for a supported file.