summaryrefslogtreecommitdiff
path: root/playlist.h
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-03-09 11:38:38 +0100
committerGravatar waker <wakeroid@gmail.com>2011-03-09 11:38:38 +0100
commit2d0b00f6bbd326790c053961ccec07106cb172c7 (patch)
treea4ffb39b2a5d1c9a80aa2ba79f885d0d20667df8 /playlist.h
parentfb269bc2b4cbbe6b457b46588d39ace1c021e3f1 (diff)
moved most of track properties from playItem struct to metadata
implemented track properties with multiple selection
Diffstat (limited to 'playlist.h')
-rw-r--r--playlist.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/playlist.h b/playlist.h
index 03692ae0..11e3cb63 100644
--- a/playlist.h
+++ b/playlist.h
@@ -23,22 +23,21 @@
#define PL_MAX_ITERATORS 2
+// predefined properties stored in metadata for storage unification:
+// :URI - full pathname
+// :DECODER - decoder id
+// :TRACKNUM - subsong index (sid, nsf, cue, etc)
+// :DURATION - length in seconds
+
typedef struct playItem_s {
- char *fname; // full pathname
- const char *decoder_id;
- int tracknum; // used for stuff like sid, nsf, cue (will be ignored by most codecs)
int startsample;
int endsample;
int shufflerating; // sort order for shuffle mode
float playtime; // total playtime
time_t started_timestamp; // result of calling time(NULL)
const char *filetype; // e.g. MP3 or OGG
- float replaygain_album_gain;
- float replaygain_album_peak;
- float replaygain_track_gain;
- float replaygain_track_peak;
// private area, must not be visible to plugins
- float _duration; // in seconds
+ float _duration;
uint32_t _flags;
int _refc;
struct playItem_s *next[PL_MAX_ITERATORS]; // next item in linked list
@@ -171,6 +170,9 @@ pl_remove_item (playItem_t *i);
playItem_t *
pl_item_alloc (void);
+playItem_t *
+pl_item_alloc_init (const char *fname, const char *decoder_id);
+
void
pl_item_ref (playItem_t *it);
@@ -215,10 +217,22 @@ pl_append_meta (playItem_t *it, const char *key, const char *value);
const char *
pl_find_meta (playItem_t *it, const char *key);
+int
+pl_find_meta_int (playItem_t *it, const char *key, int def);
+
+float
+pl_find_meta_float (playItem_t *it, const char *key, float def);
+
void
pl_replace_meta (playItem_t *it, const char *key, const char *value);
void
+pl_set_meta_int (playItem_t *it, const char *key, int value);
+
+void
+pl_set_meta_float (playItem_t *it, const char *key, float value);
+
+void
pl_delete_all_meta (playItem_t *it);
// returns index of 1st deleted item
@@ -262,6 +276,12 @@ pl_set_item_duration (playItem_t *it, float duration);
float
pl_get_item_duration (playItem_t *it);
+void
+pl_set_item_replaygain (playItem_t *it, int idx, float value);
+
+float
+pl_get_item_replaygain (playItem_t *it, int idx);
+
uint32_t
pl_get_item_flags (playItem_t *it);