aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-12-08 13:52:21 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-12-08 13:52:21 +0000
commit34645c24a21c63235468304bcda15d4507c915f0 (patch)
tree50627a21ed8ba5e97458e645dd620c0653d88568 /src/plugins/Input
parentb933bdf4bdb007e5cd6aac4f14e5dce7dd5cc26e (diff)
downloadqmmp-34645c24a21c63235468304bcda15d4507c915f0.tar.gz
qmmp-34645c24a21c63235468304bcda15d4507c915f0.tar.bz2
qmmp-34645c24a21c63235468304bcda15d4507c915f0.zip
cdaudio: added cddb logger
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3957 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input')
-rw-r--r--src/plugins/Input/cdaudio/decoder_cdaudio.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/plugins/Input/cdaudio/decoder_cdaudio.cpp b/src/plugins/Input/cdaudio/decoder_cdaudio.cpp
index 88a22a2d6..b7dce8f2a 100644
--- a/src/plugins/Input/cdaudio/decoder_cdaudio.cpp
+++ b/src/plugins/Input/cdaudio/decoder_cdaudio.cpp
@@ -45,7 +45,7 @@
QList <CDATrack> DecoderCDAudio::m_track_cache;
-static void log_handler (cdio_log_level_t level, const char message[])
+static void log_handler (cdio_log_level_t level, const char *message)
{
QString str = QString::fromLocal8Bit(message).trimmed();
switch (level)
@@ -60,6 +60,21 @@ static void log_handler (cdio_log_level_t level, const char message[])
}
}
+static void cddb_log_handler(cddb_log_level_t level, const char *message)
+{
+ QString str = QString::fromLocal8Bit(message).trimmed();
+ switch (level)
+ {
+ case CDDB_LOG_DEBUG:
+ qDebug("DecoderCDAudio: cddb message: %s (level=debug)", qPrintable(str));
+ case CDDB_LOG_INFO:
+ qDebug("DecoderCDAudio: cddb message: %s (level=info)", qPrintable(str));
+ return;
+ default:
+ qWarning("DecoderCDAudio: cddb message: %s (level=error)", qPrintable(str));
+ }
+}
+
// Decoder class
DecoderCDAudio::DecoderCDAudio(const QString &url) : Decoder()
@@ -75,7 +90,6 @@ DecoderCDAudio::DecoderCDAudio(const QString &url) : Decoder()
m_buffer = new char[CDDA_BUFFER_SIZE];
}
-
DecoderCDAudio::~DecoderCDAudio()
{
m_bitrate = 0;
@@ -209,6 +223,7 @@ QList <CDATrack> DecoderCDAudio::generateTrackList(const QString &device)
if(use_cddb)
{
qDebug("DecoderCDAudio: reading CDDB...");
+ cddb_log_set_handler(cddb_log_handler);
cddb_conn_t *cddb_conn = cddb_new ();
cddb_disc_t *cddb_disc = NULL;
cddb_track_t *cddb_track = NULL;
@@ -253,8 +268,9 @@ QList <CDATrack> DecoderCDAudio::generateTrackList(const QString &device)
}
cddb_disc_calc_discid (cddb_disc);
- qDebug ("DecoderCDAudio: disc id = %x", cddb_disc_get_discid (cddb_disc));
uint id = cddb_disc_get_discid (cddb_disc);
+ qDebug ("DecoderCDAudio: disc id = %x", id);
+
if(readFromCache(&tracks, id))
qDebug("DecoderCDAudio: using local cddb cache");