|
|
|
|
@ -31,171 +31,6 @@ MPD::Connection Mpd; |
|
|
|
|
|
|
|
|
|
namespace MPD {//
|
|
|
|
|
|
|
|
|
|
bool Statistics::empty() const |
|
|
|
|
{ |
|
|
|
|
return m_stats.get() == 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned Statistics::artists() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_stats_get_number_of_artists(m_stats.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned Statistics::albums() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_stats_get_number_of_albums(m_stats.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned Statistics::songs() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_stats_get_number_of_songs(m_stats.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned long Statistics::playTime() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_stats_get_play_time(m_stats.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned long Statistics::uptime() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_stats_get_uptime(m_stats.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned long Statistics::dbUpdateTime() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_stats_get_db_update_time(m_stats.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned long Statistics::dbPlayTime() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_stats_get_db_play_time(m_stats.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Status::clear() |
|
|
|
|
{ |
|
|
|
|
m_status.reset(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Status::empty() const |
|
|
|
|
{ |
|
|
|
|
return m_status.get() == 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int Status::volume() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_volume(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Status::repeat() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_repeat(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Status::random() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_random(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Status::single() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_single(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Status::consume() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_consume(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned Status::playlistLength() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_queue_length(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned int Status::playlistVersion() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_queue_version(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PlayerState Status::playerState() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return PlayerState(mpd_status_get_state(m_status.get())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned Status::crossfade() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_crossfade(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int Status::currentSongPosition() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_song_pos(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int Status::currentSongID() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_song_id(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int Status::nextSongPosition() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_next_song_pos(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int Status::nextSongID() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_next_song_id(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned Status::elapsedTime() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_elapsed_time(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned Status::totalTime() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_total_time(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned Status::kbps() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_kbit_rate(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned Status::updateID() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_update_id(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const char *Status::error() const |
|
|
|
|
{ |
|
|
|
|
assert(!empty()); |
|
|
|
|
return mpd_status_get_error(m_status.get()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Connection::Connection() : m_connection(nullptr), |
|
|
|
|
m_command_list_active(false), |
|
|
|
|
m_idle(false), |
|
|
|
|
|