src/song.h File Reference

#include "util/list.h"
#include <stddef.h>
#include <stdbool.h>
#include <sys/time.h>

Go to the source code of this file.

Data Structures

struct  song

Defines

#define SONG_FILE   "file: "
#define SONG_TIME   "Time: "

Functions

struct songsong_remote_new (const char *uri)
 allocate a new song with a remote URL
struct songsong_file_new (const char *path, struct directory *parent)
 allocate a new song with a local file name
struct songsong_file_load (const char *path, struct directory *parent)
 allocate a new song structure with a local file name and attempt to load its metadata.
struct songsong_replace_uri (struct song *song, const char *uri)
 Replaces the URI of a song object.
void song_free (struct song *song)
bool song_file_update (struct song *song)
bool song_file_update_inarchive (struct song *song)
char * song_get_uri (const struct song *song)
 Returns the URI of the song in UTF-8 encoding, including its location within the music directory.
double song_get_duration (const struct song *song)
static bool song_in_database (const struct song *song)
static bool song_is_file (const struct song *song)

Define Documentation

#define SONG_FILE   "file: "

Definition at line 29 of file song.h.

#define SONG_TIME   "Time: "

Definition at line 30 of file song.h.


Function Documentation

struct song* song_file_load ( const char *  path,
struct directory parent 
) [read]

allocate a new song structure with a local file name and attempt to load its metadata.

If all decoder plugin fail to read its meta data, NULL is returned.

struct song* song_file_new ( const char *  path,
struct directory parent 
) [read]

allocate a new song with a local file name

bool song_file_update ( struct song song  ) 
bool song_file_update_inarchive ( struct song song  ) 
void song_free ( struct song song  ) 
double song_get_duration ( const struct song song  ) 
char* song_get_uri ( const struct song song  ) 

Returns the URI of the song in UTF-8 encoding, including its location within the music directory.

The return value is allocated on the heap, and must be freed by the caller.

static bool song_in_database ( const struct song song  )  [inline, static]

Definition at line 109 of file song.h.

static bool song_is_file ( const struct song song  )  [inline, static]

Definition at line 115 of file song.h.

struct song* song_remote_new ( const char *  uri  )  [read]

allocate a new song with a remote URL

struct song* song_replace_uri ( struct song song,
const char *  uri 
) [read]

Replaces the URI of a song object.

The given song object is destroyed, and a newly allocated one is returned. It does not update the reference within the parent directory; the caller is responsible for doing that.


Generated on 17 Jul 2013 for MPD by  doxygen 1.6.1