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_WAV_H
0027 #define ENCODER_WAV_H
0028 
0029 #include "encodercda.h"
0030 #include <cstdlib>
0031 #include <sys/stat.h>
0032 #include <unistd.h>
0033 
0034 /**
0035  * Wav audio "encoder"
0036  * Takes the CDA take and adds the standard wav header.
0037  */
0038 class EncoderWav : public EncoderCda {
0039 
0040 public:
0041     explicit EncoderWav(KIO::WorkerBase *worker)
0042         : EncoderCda(worker)
0043     {
0044     }
0045   ~EncoderWav() override
0046   {
0047   }
0048   bool init() override
0049   {
0050       return true;
0051   }
0052   unsigned long size(long time_secs) const override;
0053   QString type() const override
0054   {
0055       return QLatin1String("Wav");
0056   }
0057   const char *fileType() const override
0058   {
0059       return "wav";
0060   }
0061   const char *mimeType() const override;
0062   void fillSongInfo(KCDDB::CDInfo, int, const QString &) override
0063   {
0064   }
0065   long readInit(long size) override;
0066 };
0067 
0068 #endif // ENCODER_WAV_H