From 018f3c97a838542f4213d83209da962cd072dec6 Mon Sep 17 00:00:00 2001 From: Tobias Rundstrom Date: Wed, 22 Feb 2006 16:02:56 -0300 Subject: [PATCH] API updates --- XMMSHandler.cpp | 22 +++++++++++----------- XMMSHandler.h | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/XMMSHandler.cpp b/XMMSHandler.cpp index 59bedb5..8e14b44 100644 --- a/XMMSHandler.cpp +++ b/XMMSHandler.cpp @@ -20,7 +20,7 @@ XMMSHandler::XMMSHandler (MainWindow *mw) : sigc::trackable () } m_qt4 = new XmmsQT4 (m_xmmsc->getConn (), qApp); - XMMSResult *r = m_xmmsc->signal_playback_playtime (); + XMMSResultValueUint *r = m_xmmsc->signal_playback_playtime (); r->connect (sigc::mem_fun (this, &XMMSHandler::playback_playtime)); r = m_xmmsc->broadcast_playback_current_id (); @@ -31,7 +31,7 @@ XMMSHandler::XMMSHandler (MainWindow *mw) : sigc::trackable () } void -XMMSHandler::playback_status (XMMSResult *res) +XMMSHandler::playback_status (XMMSResultValueUint *res) { uint i; res->getValue (&i); @@ -48,10 +48,10 @@ XMMSHandler::playback_status (XMMSResult *res) } void -XMMSHandler::playback_playtime (XMMSResult *res) +XMMSHandler::playback_playtime (XMMSResultValueUint *res) { uint i, sec, min; - res->getValue (&i); + res->getValue (&i); sec = (i / 1000) % 60; min = (i / 1000) / 60; @@ -71,14 +71,14 @@ XMMSHandler::playback_playtime (XMMSResult *res) } void -XMMSHandler::playback_current_id (XMMSResult *res) +XMMSHandler::playback_current_id (XMMSResultValueUint *res) { uint i; res->getValue (&i); qDebug ("current id = %d", i); - XMMSResult *r = m_xmmsc->medialib_get_info (i); + XMMSResultDict *r = m_xmmsc->medialib_get_info (i); r->connect (sigc::mem_fun (this, &XMMSHandler::medialib_info)); } @@ -92,7 +92,7 @@ XMMSHandler::setPlaytime (void) } void -XMMSHandler::medialib_info (XMMSResult *res) +XMMSHandler::medialib_info (XMMSResultDict *res) { char str[4096]; int b; @@ -102,15 +102,15 @@ XMMSHandler::medialib_info (XMMSResult *res) m_mw->getMD ()->m_text->setText (QString::fromUtf8 (str)); m_mw->getSD ()->m_title->setText (QString::fromUtf8 (str)); - if (res->getDictValue ("bitrate", &b)) { + if (res->getValue ("bitrate", &b)) { m_mw->getMD ()->m_kbps->setNumber (b/1000, 3); } - if (res->getDictValue ("samplerate", &b)) { + if (res->getValue ("samplerate", &b)) { m_mw->getMD ()->m_khz->setNumber (b/1000, 2); } - if (res->getDictValue ("channels:out", &b)) { + if (res->getValue ("channels:out", &b)) { if (b == 1) { m_mw->getMD ()->m_stereo->setStereoMono (0, 1); } else { @@ -118,7 +118,7 @@ XMMSHandler::medialib_info (XMMSResult *res) } } - if (res->getDictValue ("duration", &b)) { + if (res->getValue ("duration", &b)) { if (b > 0) { m_mw->getMD ()->m_slider->setMax (b); m_mw->getMD ()->m_slider->hideBar (false); diff --git a/XMMSHandler.h b/XMMSHandler.h index fc09516..e4b1c02 100644 --- a/XMMSHandler.h +++ b/XMMSHandler.h @@ -15,10 +15,10 @@ class XMMSHandler : public QObject, public sigc::trackable { public: XMMSHandler (MainWindow *mw); ~XMMSHandler (); - void playback_playtime (XMMSResult *res); - void playback_current_id (XMMSResult *res); - void medialib_info (XMMSResult *res); - void playback_status (XMMSResult *res); + void playback_playtime (XMMSResultValueUint *res); + void playback_current_id (XMMSResultValueUint *res); + void medialib_info (XMMSResultDict *res); + void playback_status (XMMSResultValueUint *res); const XMMSClient *getXMMS () { return m_xmmsc; }