Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
MPD::Song Class Reference

A wrapper for mpd_song. More...

#include <Song.hh>

Inheritance diagram for MPD::Song:
[legend]
Collaboration diagram for MPD::Song:
[legend]

Public Member Functions

 Song (const mpd_song &song)
 You are not supposed to instance this yourself.
 Song (const MPD::Song &other)
 Copy Ctor.
 ~Song ()
const char * get_path ()
 The path of the song in the DB.
const char * get_tag (enum mpd_tag_type type, unsigned idx=0)
 Get a certain tag from the song.
Glib::ustring song_format (const char *format, bool markup=true)
 Formats the data of the song into a string.
unsigned get_duration ()
 Get duratin of song in seconds.
time_t get_last_modified ()
 Get seconds since last modifieGet seconds since last modifieff.
void set_pos (unsigned pos)
 Set the position in the queue.
unsigned get_pos ()
 Get the position of the Song in the Queue.
unsigned get_id ()
 Get Database ID of the Song.

Detailed Description

A wrapper for mpd_song.

Definition at line 44 of file Song.hh.


Constructor & Destructor Documentation

MPD::Song::Song ( const mpd_song &  song)

You are not supposed to instance this yourself.

Parameters:
song
MPD::Song::Song ( const MPD::Song &  other)

Copy Ctor.

Parameters:
other

Member Function Documentation

Get duratin of song in seconds.

Returns:
unsigned MPD::Song::get_id ( )

Get Database ID of the Song.

Returns:

Get seconds since last modifieGet seconds since last modifieff.

Returns:
time_t type (unsigned long)
const char* MPD::Song::get_path ( ) [virtual]

The path of the song in the DB.

Returns:

Implements MPD::AbstractComposite.

unsigned MPD::Song::get_pos ( )

Get the position of the Song in the Queue.

Returns:
const char* MPD::Song::get_tag ( enum mpd_tag_type  type,
unsigned  idx = 0 
)

Get a certain tag from the song.

use song_format() if you just want a easy way to convert a MPD::Song to a nice string.

Parameters:
typeThe typ of the tag
idxsome tags might have more than values, use this to index it, starting with 0
Returns:
a string
void MPD::Song::set_pos ( unsigned  pos)

Set the position in the queue.

This is not a client command, and it is not used in Freya.

Parameters:
posthe new pos
Glib::ustring MPD::Song::song_format ( const char *  format,
bool  markup = true 
)

Formats the data of the song into a string.

You can use the following formatting strings inside format

  • artist
  • title
  • album
  • track
  • name
  • data
  • album_artist
  • genre
  • composer
  • performer
  • comment
  • disc

Each of these values should be placed inside ${fill_tagtype_in_here}, If the tagtype is not known, it gets not escaped, if the tag is empty, it is escaped with "unknown".

If markup ist set the string gets already markup'd for use in Gtk Widgets.

Parameters:
formatThe format prototype
markupif markup should be done (see Glib::Markup::escape())
Returns:
the ready formatted string

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