File indexing completed on 2024-05-12 04:49:59

0001 /*
0002     Copyright (C) 2004 Allan Sandfeld Jensen <kde@carewolf.com>
0003     Copyright (C) 2005 Benjamin Meyer <ben at meyerhome dot net>
0004 
0005     This library is free software; you can redistribute it and/or
0006     modify it under the terms of the GNU Library General Public
0007     License as published by the Free Software Foundation; either
0008     version 2 of the License, or (at your option) any later version.
0009 
0010     This library is distributed in the hope that it will be useful,
0011     but WITHOUT ANY WARRANTY; without even the implied warranty of
0012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013     Library General Public License for more details.
0014 
0015     You should have received a copy of the GNU Library General Public License
0016     along with this library; see the file COPYING.LIB.  If not, write to
0017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018     Boston, MA 02110-1301, USA.
0019 */
0020 
0021 #ifndef ENCODER_FLAC_H
0022 #define ENCODER_FLAC_H
0023 
0024 #include <config-audiocd.h>
0025 
0026 #include "ui_encoderflacconfig.h"
0027 
0028 #include "audiocdencoder.h"
0029 
0030 class EncoderFLACConfig : public QWidget, public Ui::EncoderFLACConfig {
0031 public:
0032     explicit EncoderFLACConfig(QWidget *parent = nullptr)
0033         : QWidget(parent)
0034     {
0035         setupUi(this);
0036     }
0037 };
0038 
0039 /**
0040  * FLAC encoder.
0041  * Check out https://xiph.org/flac/ for more information.
0042  */
0043 class EncoderFLAC : public AudioCDEncoder {
0044 
0045 public:
0046     explicit EncoderFLAC(KIO::WorkerBase *worker);
0047     ~EncoderFLAC() override;
0048 
0049     QString type() const override
0050     {
0051         return QLatin1String("FLAC");
0052     }
0053   bool init() override;
0054   void loadSettings() override;
0055   unsigned long size(long time_secs) const override;
0056   const char *fileType() const override
0057   {
0058       return "flac";
0059   }
0060   const char *mimeType() const override
0061   {
0062       return "audio/x-flac";
0063   }
0064   void fillSongInfo(KCDDB::CDInfo info, int track, const QString &comment) override;
0065   long readInit(long size) override;
0066   long read(qint16 *buf, int frames) override;
0067   long readCleanup() override;
0068   QWidget *getConfigureWidget(KConfigSkeleton **manager) const override;
0069 
0070   class Private;
0071 
0072   private:
0073   Private *d;
0074 };
0075 
0076 #endif // ENCODER_FLAC_H