aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-09-09 19:45:15 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-09-09 19:45:15 +0000
commit0e860ae0ba0c6ed9f14b9d01a28b44ae64d91532 (patch)
tree33da2a2b96d40e270b4bbe3a124bdf7e23b788f5 /src/plugins
parent3188ada336102df3bf8d77cdafdab1a8f65f4d86 (diff)
downloadqmmp-0e860ae0ba0c6ed9f14b9d01a28b44ae64d91532.tar.gz
qmmp-0e860ae0ba0c6ed9f14b9d01a28b44ae64d91532.tar.bz2
qmmp-0e860ae0ba0c6ed9f14b9d01a28b44ae64d91532.zip
new libqmmp api, a lot of features has been temporary disabled
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@546 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Input/CMakeLists.txt14
-rw-r--r--src/plugins/Input/Input.pro10
-rw-r--r--src/plugins/Input/mad/decoder_mad.cpp51
-rw-r--r--src/plugins/Input/mad/decoder_mad.h4
-rw-r--r--src/plugins/Output/CMakeLists.txt6
-rw-r--r--src/plugins/Output/Output.pro6
-rw-r--r--src/plugins/Output/alsa/outputalsa.cpp20
-rw-r--r--src/plugins/Output/alsa/outputalsa.h6
8 files changed, 59 insertions, 58 deletions
diff --git a/src/plugins/Input/CMakeLists.txt b/src/plugins/Input/CMakeLists.txt
index a1f91866d..57df47d99 100644
--- a/src/plugins/Input/CMakeLists.txt
+++ b/src/plugins/Input/CMakeLists.txt
@@ -17,29 +17,29 @@ add_subdirectory(mad)
ENDIF(USE_MAD AND TAGLIB_FOUND)
IF(USE_FLAC AND TAGLIB_FOUND)
-add_subdirectory(flac)
+#add_subdirectory(flac)
ENDIF(USE_FLAC AND TAGLIB_FOUND)
IF(USE_VORBIS AND TAGLIB_FOUND)
-add_subdirectory(vorbis)
+#add_subdirectory(vorbis)
ENDIF(USE_VORBIS AND TAGLIB_FOUND)
IF(USE_FFMPEG)
-add_subdirectory(ffmpeg)
+#add_subdirectory(ffmpeg)
ENDIF(USE_FFMPEG)
IF(USE_MPC AND TAGLIB_FOUND)
-add_subdirectory(mpc)
+#add_subdirectory(mpc)
ENDIF(USE_MPC AND TAGLIB_FOUND)
IF(USE_SNDFILE)
-add_subdirectory(sndfile)
+#add_subdirectory(sndfile)
ENDIF(USE_SNDFILE)
IF(USE_WAVPACK)
-add_subdirectory(wavpack)
+#add_subdirectory(wavpack)
ENDIF(USE_WAVPACK)
IF(USE_MODPLUG)
-add_subdirectory(modplug)
+#add_subdirectory(modplug)
ENDIF(USE_MODPLUG)
diff --git a/src/plugins/Input/Input.pro b/src/plugins/Input/Input.pro
index 2b75906fb..6dff07146 100644
--- a/src/plugins/Input/Input.pro
+++ b/src/plugins/Input/Input.pro
@@ -1,31 +1,31 @@
include(../../../qmmp.pri)
-SUBDIRS += mad vorbis sndfile wavpack
+SUBDIRS += mad# vorbis sndfile wavpack
TEMPLATE = subdirs
contains(CONFIG, MODPLUG_PLUGIN){
- SUBDIRS += modplug
+# SUBDIRS += modplug
message(***************************)
message(* Modplug plugin enabled *)
message(***************************)
}
contains(CONFIG, MUSEPACK_PLUGIN){
- SUBDIRS += mpc
+# SUBDIRS += mpc
message(***************************)
message(* Musepack plugin enabled *)
message(***************************)
}
contains(CONFIG, FLAC_PLUGIN){
- SUBDIRS += flac
+# SUBDIRS += flac
message(***********************)
message(* FLAC plugin enabled *)
message(***********************)
}
contains(CONFIG, FFMPEG_PLUGIN){
- SUBDIRS += ffmpeg
+# SUBDIRS += ffmpeg
message(*************************)
message(* FFMPEG plugin enabled *)
message(*************************)
diff --git a/src/plugins/Input/mad/decoder_mad.cpp b/src/plugins/Input/mad/decoder_mad.cpp
index 7c8cc8f1b..98e437075 100644
--- a/src/plugins/Input/mad/decoder_mad.cpp
+++ b/src/plugins/Input/mad/decoder_mad.cpp
@@ -25,7 +25,7 @@ DecoderMAD::DecoderMAD(QObject *parent, DecoderFactory *d, QIODevice *i, Output
inited = false;
user_stop = false;
done = false;
- finish = false;
+ m_finish = false;
derror = false;
eof = false;
useeq = false;
@@ -72,7 +72,7 @@ bool DecoderMAD::initialize()
inited = false;
user_stop = false;
done = false;
- finish = false;
+ m_finish = false;
derror = false;
eof = false;
totalTime = 0.;
@@ -88,7 +88,7 @@ bool DecoderMAD::initialize()
if (! input())
{
- error("DecoderMAD: cannot initialize. No input.");
+ qWarning("DecoderMAD: cannot initialize. No input.");
return FALSE;
}
@@ -102,8 +102,8 @@ bool DecoderMAD::initialize()
{
if (! input()->open(QIODevice::ReadOnly))
{
- error("DecoderMAD: Failed to open input. Error " +
- QString::number(input()->isOpen()) + ".");
+ /*qWarning("DecoderMAD: Failed to open input. Error " +
+ QString::number(input()->isOpen()) + ".");*/
return FALSE;
}
}
@@ -112,8 +112,8 @@ bool DecoderMAD::initialize()
{
TagExtractor extractor(input());
FileTag tag = extractor.id3v2tag();
- if (!tag.isEmpty())
- dispatch(extractor.id3v2tag());
+ // if (!tag.isEmpty())
+// dispatch(extractor.id3v2tag());
}
mad_stream_init(&stream);
@@ -131,7 +131,7 @@ bool DecoderMAD::initialize()
mad_frame_mute (&frame);
stream.next_frame = NULL;
stream.sync = 0;
- configure(freq, channels, 16, bitrate);
+ configure(freq, channels, 16);
inited = TRUE;
return TRUE;
@@ -150,7 +150,7 @@ void DecoderMAD::deinit()
inited = false;
user_stop = false;
done = false;
- finish = false;
+ m_finish = false;
derror = false;
eof = false;
useeq = false;
@@ -339,7 +339,7 @@ bool DecoderMAD::findHeader()
return TRUE;
}
-double DecoderMAD::lengthInSeconds()
+qint64 DecoderMAD::lengthInSeconds()
{
if (! inited)
return 0.;
@@ -360,11 +360,11 @@ void DecoderMAD::flush(bool final)
{
ulong min = final ? 0 : bks;
- while ((! done && ! finish) && output_bytes > min)
+ while ((! done && ! m_finish) && output_bytes > min)
{
output()->recycler()->mutex()->lock();
- while ((! done && ! finish) && output()->recycler()->full())
+ while ((! done && ! m_finish) && output()->recycler()->full())
{
mutex()->unlock();
output()->recycler()->cond()->wait(output()->recycler()->mutex());
@@ -373,7 +373,7 @@ void DecoderMAD::flush(bool final)
done = user_stop;
}
- if (user_stop || finish)
+ if (user_stop || m_finish)
{
inited = FALSE;
done = TRUE;
@@ -406,13 +406,13 @@ void DecoderMAD::run()
}
- DecoderState::Type stat = DecoderState::Decoding;
+ //DecoderState::Type stat = DecoderState::Decoding;
mutex()->unlock();
- dispatch(stat);
+ //dispatch(stat);
- while (! done && ! finish && ! derror)
+ while (! done && ! m_finish && ! derror)
{
mutex()->lock();
@@ -433,7 +433,7 @@ void DecoderMAD::run()
eof = false;
}
- finish = eof;
+ m_finish = eof;
if (! eof)
{
@@ -469,7 +469,7 @@ void DecoderMAD::run()
mutex()->unlock();
// decode
- while (! done && ! finish && ! derror)
+ while (! done && ! m_finish && ! derror)
{
if (mad_frame_decode(&frame, &stream) == -1)
{
@@ -530,17 +530,18 @@ void DecoderMAD::run()
done = TRUE;
if (! user_stop)
- finish = TRUE;
+ m_finish = TRUE;
}
- if (finish)
- stat = DecoderState::Finished;
- else if (user_stop)
- stat = DecoderState::Stopped;
+ if (m_finish)
+ finish();
+// stat = DecoderState::Finished;
+ //else if (user_stop)
+ // stat = DecoderState::Stopped;
mutex()->unlock();
- dispatch(stat);
+ //dispatch(stat);
if (input())
input()->close();
@@ -617,7 +618,7 @@ enum mad_flow DecoderMAD::madOutput()
}
}
- if (done || finish)
+ if (done || m_finish)
{
return MAD_FLOW_STOP;
}
diff --git a/src/plugins/Input/mad/decoder_mad.h b/src/plugins/Input/mad/decoder_mad.h
index f37016657..55c662737 100644
--- a/src/plugins/Input/mad/decoder_mad.h
+++ b/src/plugins/Input/mad/decoder_mad.h
@@ -27,7 +27,7 @@ public:
// standard decoder API
bool initialize();
- double lengthInSeconds();
+ qint64 lengthInSeconds();
void seek(double);
void stop();
@@ -43,7 +43,7 @@ private:
void deinit();
bool findHeader();
bool findXingHeader(struct mad_bitptr, unsigned int);
- bool inited, user_stop, done, finish, derror, eof, useeq;
+ bool inited, user_stop, done, m_finish, derror, eof, useeq;
double totalTime, seekTime;
int channels;
unsigned long bitrate;
diff --git a/src/plugins/Output/CMakeLists.txt b/src/plugins/Output/CMakeLists.txt
index 9bd11aea8..eabd34ae3 100644
--- a/src/plugins/Output/CMakeLists.txt
+++ b/src/plugins/Output/CMakeLists.txt
@@ -8,13 +8,13 @@ add_subdirectory(alsa)
ENDIF(USE_ALSA)
IF(USE_JACK)
-add_subdirectory(jack)
+#add_subdirectory(jack)
ENDIF(USE_JACK)
IF(USE_OSS)
-add_subdirectory(oss)
+#add_subdirectory(oss)
ENDIF(USE_OSS)
IF(USE_PULSE)
-add_subdirectory(pulseaudio)
+#add_subdirectory(pulseaudio)
ENDIF(USE_PULSE)
diff --git a/src/plugins/Output/Output.pro b/src/plugins/Output/Output.pro
index 19a20bcd3..b7a8c6cf8 100644
--- a/src/plugins/Output/Output.pro
+++ b/src/plugins/Output/Output.pro
@@ -4,21 +4,21 @@ CONFIG += release warn_on
TEMPLATE = subdirs
contains(CONFIG, JACK_PLUGIN){
- SUBDIRS += jack
+# SUBDIRS += jack
message(***********************)
message(* JACK plugin enabled *)
message(***********************)
}
contains(CONFIG, OSS_PLUGIN){
- SUBDIRS += oss
+# SUBDIRS += oss
message(**********************)
message(* OSS plugin enabled *)
message(**********************)
}
contains(CONFIG, PULSE_AUDIO_PLUGIN){
- SUBDIRS += pulseaudio
+# SUBDIRS += pulseaudio
message(******************************)
message(* PULSE AUDIO plugin enabled *)
message(******************************)
diff --git a/src/plugins/Output/alsa/outputalsa.cpp b/src/plugins/Output/alsa/outputalsa.cpp
index 51f3a6189..35e37b301 100644
--- a/src/plugins/Output/alsa/outputalsa.cpp
+++ b/src/plugins/Output/alsa/outputalsa.cpp
@@ -34,6 +34,7 @@
#include <qmmp/constants.h>
#include <qmmp/buffer.h>
#include <qmmp/visual.h>
+#include <qmmp/statehandler.h>
#include "outputalsa.h"
OutputALSA::OutputALSA(QObject * parent, bool useVolume)
@@ -84,7 +85,7 @@ void OutputALSA::status()
}
}
-long OutputALSA::written()
+qint64 OutputALSA::written()
{
return m_totalWritten;
}
@@ -95,7 +96,7 @@ void OutputALSA::seek(long pos)
m_currentSeconds = -1;
}
-void OutputALSA::configure(long freq, int chan, int prec, int brate)
+void OutputALSA::configure(qint64 freq, int chan, int prec)
{
// we need to configure
if (freq != m_frequency || chan != m_channels || prec != m_precision)
@@ -166,8 +167,7 @@ void OutputALSA::configure(long freq, int chan, int prec, int brate)
return;
}
exact_rate = rate;// = 11000;
- qDebug("OutputALSA: frequency=%d, channels=%d, bitrate=%d",
- rate, chan, brate);
+ qDebug("OutputALSA: frequency=%d, channels=%d", rate, chan);
if ((err = snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &exact_rate, 0)) < 0)
{
@@ -248,8 +248,8 @@ void OutputALSA::pause()
{
if (!m_play)
return;
- m_pause = (m_pause) ? FALSE : TRUE;
- OutputState::Type state = m_pause ? OutputState::Paused: OutputState::Playing;
+ m_pause = !m_pause;
+ Qmmp::State state = m_pause ? Qmmp::Paused: Qmmp::Playing;
dispatch(state);
}
@@ -273,7 +273,7 @@ bool OutputALSA::initialize()
}
-long OutputALSA::latency()
+qint64 OutputALSA::latency()
{
long used = 0;
@@ -310,7 +310,7 @@ void OutputALSA::run()
unsigned char *prebuffer = (unsigned uchar *)malloc(prebuffer_size);
ulong prebuffer_fill = 0;
- dispatch(OutputState::Playing);
+ dispatch(Qmmp::Playing);
while (!done)
{
@@ -400,7 +400,7 @@ void OutputALSA::run()
}
}
m_play = FALSE;
- dispatch(OutputState::Stopped);
+ dispatch(Qmmp::Stopped);
free(prebuffer);
prebuffer = 0;
mutex()->unlock();
@@ -483,7 +483,7 @@ void OutputALSA::uninitialize()
snd_pcm_close(pcm_handle);
pcm_handle = 0;
}
- dispatch(OutputState::Stopped);
+ dispatch(Qmmp::Stopped);
}
/* ****** MIXER ******* */
diff --git a/src/plugins/Output/alsa/outputalsa.h b/src/plugins/Output/alsa/outputalsa.h
index 432e31043..333600b1d 100644
--- a/src/plugins/Output/alsa/outputalsa.h
+++ b/src/plugins/Output/alsa/outputalsa.h
@@ -42,11 +42,11 @@ public:
bool initialize();
bool isInitialized() const { return m_inited; }
void uninitialize();
- void configure(long, int, int, int);
+ void configure(qint64, int, int);
void stop();
void pause();
- long written();
- long latency();
+ qint64 written();
+ qint64 latency();
void seek(long);
void setVolume(int l, int r);
void volume(int *l, int *r);