From 0853e9b69df86182c572eccd671b3097cf348f72 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 5 Jan 2009 15:13:35 +0000 Subject: cd audio plugin git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@732 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/cdaudio/decoder_cdaudio.h | 80 +++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/plugins/Input/cdaudio/decoder_cdaudio.h (limited to 'src/plugins/Input/cdaudio/decoder_cdaudio.h') diff --git a/src/plugins/Input/cdaudio/decoder_cdaudio.h b/src/plugins/Input/cdaudio/decoder_cdaudio.h new file mode 100644 index 000000000..b0e4da792 --- /dev/null +++ b/src/plugins/Input/cdaudio/decoder_cdaudio.h @@ -0,0 +1,80 @@ +/*************************************************************************** + * Copyright (C) 2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef DECODER_CDAUIDO_H +#define DECODER_CDAUIDO_H + +#include +#include + +#include + +class CDATrack +{ +public: + CDATrack() + { + first_sector = 0; + last_sector = 0; + } + + FileInfo info; + lsn_t first_sector; + lsn_t last_sector; +}; + +class DecoderCDAudio : public Decoder +{ +public: + DecoderCDAudio(QObject *, DecoderFactory *, const QString &url, Output *); + virtual ~DecoderCDAudio(); + + static QList generateTrackList(); + static qint64 calculateTrackLength(lsn_t startlsn, lsn_t endlsn); + + // Standard Decoder API + bool initialize(); + qint64 lengthInSeconds(); + void seek(qint64); + void stop(); + +private: + // thread run function + void run(); + // helper functions + void flush(bool = FALSE); + void deinit(); + // libcdio variables + lsn_t m_first_sector; + lsn_t m_last_sector; + lsn_t m_current_sector; + CdIo_t *m_cdio; + // output buffer + char *m_output_buf; + ulong m_output_bytes, m_output_at; + //other variables + bool m_inited, m_user_stop, m_done, m_finish; + QString m_url; + unsigned int m_bks; + quint64 m_bitrate; + qint64 m_totalTime, m_seekTime; +}; + +#endif // DECODER_CDAUIDO_H -- cgit v1.2.3-13-gbd6f