summaryrefslogtreecommitdiff
path: root/src/libaudcore/playlist.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libaudcore/playlist.h')
-rw-r--r--src/libaudcore/playlist.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/libaudcore/playlist.h b/src/libaudcore/playlist.h
index 36e1263..ef63a28 100644
--- a/src/libaudcore/playlist.h
+++ b/src/libaudcore/playlist.h
@@ -70,10 +70,8 @@ enum SortType {
/* Possible behaviors for playlist_entry_get_{decoder, tuple}. */
enum GetMode {
- Nothing, // immediately return nullptr or Tuple() if not yet scanned
- Guess, // immediately return a best guess if not yet scanned
- Wait, // wait for the entry to be scanned; return nullptr or Tuple() on failure
- WaitGuess // wait for the entry to be scanned; return a best guess on failure
+ NoWait, // non-blocking call; returned tuple will be in Initial state if not yet scanned
+ Wait // blocking call; returned tuple will be either Valid or Failed
};
/* Format descriptor returned by playlist_save_formats() */
@@ -205,14 +203,13 @@ String aud_playlist_entry_get_filename (int playlist, int entry);
* or if the entry has not yet been scanned, returns nullptr according to
* <mode>. On error, an error message is optionally returned. */
PluginHandle * aud_playlist_entry_get_decoder (int playlist, int entry,
- Playlist::GetMode mode = Playlist::WaitGuess, String * error = nullptr);
+ Playlist::GetMode mode = Playlist::Wait, String * error = nullptr);
-/* Returns the tuple associated with an entry. On error, or if the entry has
- * not yet been scanned, returns either a blank tuple or a tuple filled with
- * "best guess" values, according to <mode>. On error, an error message is
- * optionally returned. */
+/* Returns the tuple associated with an entry. The state of the returned tuple
+ * may indicate that the entry has not yet been scanned, or an error occurred,
+ * according to <mode>. On error, an error message is optionally returned. */
Tuple aud_playlist_entry_get_tuple (int playlist, int entry,
- Playlist::GetMode mode = Playlist::WaitGuess, String * error = nullptr);
+ Playlist::GetMode mode = Playlist::Wait, String * error = nullptr);
/* Moves the playback position to the beginning of the entry at <position>. If
* <position> is -1, unsets the playback position. If <playlist> is the
@@ -371,8 +368,7 @@ void aud_playlist_sort_selected_by_scheme (int playlist, Playlist::SortType sche
void aud_playlist_remove_duplicates_by_scheme (int playlist, Playlist::SortType scheme);
/* Removes all entries referring to unavailable files in a playlist. ("Remove
- * failed" is something of a misnomer for the current behavior.) As currently
- * implemented, only works for file:// URIs. */
+ * failed" is something of a misnomer for the current behavior.) */
void aud_playlist_remove_failed (int playlist);
/* Selects all the entries in a playlist that match regular expressions stored
@@ -381,6 +377,10 @@ void aud_playlist_remove_failed (int playlist);
* create a blank tuple and set its title field to "^A". */
void aud_playlist_select_by_patterns (int playlist, const Tuple & patterns);
+/* Saves metadata for the selected entries in a playlist to an internal cache,
+ * which is used to speed up adding these entries to another playlist. */
+void aud_playlist_cache_selected (int playlist);
+
/* Returns true if <filename> refers to a playlist file. */
bool aud_filename_is_playlist (const char * filename);