File indexing completed on 2024-05-19 04:51:10

0001 /*
0002   Copyright (C) 2000 Rik Hemsley (rikkus) <rik@kde.org>
0003   Copyright (C) 2000, 2001, 2002 Michael Matz <matz@kde.org>
0004   Copyright (C) 2001 Carsten Duvenhorst <duvenhorst@m2.uni-hannover.de>
0005   Copyright (C) 2001 Adrian Schroeter <adrian@suse.de>
0006   Copyright (C) 2003 Richard Lärkäng <richard@goteborg.utfors.se>
0007   Copyright (C) 2003 Scott Wheeler <wheeler@kde.org>
0008   Copyright (C) 2004, 2005 Benjamin Meyer <ben at meyerhome dot net>
0009 
0010   This program is free software; you can redistribute it and/or modify
0011   it under the terms of the GNU General Public License as published by
0012   the Free Software Foundation; either version 2 of the License, or
0013   (at your option) any later version.
0014 
0015   This program is distributed in the hope that it will be useful,
0016   but WITHOUT ANY WARRANTY; without even the implied warranty of
0017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0018   GNU General Public License for more details.
0019 
0020   You should have received a copy of the GNU General Public License
0021   along with this program; if not, write to the Free Software
0022   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
0023   USA.
0024 */
0025 
0026 #ifndef ENCODER_CDA_H
0027 #define ENCODER_CDA_H
0028 
0029 #include "audiocdencoder.h"
0030 #include <cstdlib>
0031 #include <sys/stat.h>
0032 #include <unistd.h>
0033 
0034 /**
0035  * Raw cd "encoder"
0036  * Does little more than copy the data and make sure it is in the right
0037  * endian.
0038  */
0039 class EncoderCda : public AudioCDEncoder {
0040 
0041 public:
0042     explicit EncoderCda(KIO::WorkerBase *worker)
0043         : AudioCDEncoder(worker)
0044     {
0045     }
0046   ~EncoderCda() override
0047   {
0048   }
0049   bool init() override
0050   {
0051       return true;
0052   }
0053   void loadSettings() override
0054   {
0055   }
0056   unsigned long size(long time_secs) const override;
0057   QString type() const override
0058   {
0059       return QLatin1String("CDA");
0060   }
0061   const char *mimeType() const override;
0062   const char *fileType() const override
0063   {
0064       return "cda";
0065   }
0066   void fillSongInfo(KCDDB::CDInfo, int, const QString &) override
0067   {
0068   }
0069   long readInit(long) override
0070   {
0071       return 0;
0072   }
0073   long read(qint16 *buf, int frames) override;
0074   long readCleanup() override
0075   {
0076       return 0;
0077   }
0078 };
0079 
0080 #endif // ENCODER_CDA_H