2014-01-11 04:32:08 +01:00
|
|
|
/* This file is part of Clementine.
|
2014-01-13 06:32:25 +01:00
|
|
|
Copyright 2014, Andre Siviero <altsiviero@gmail.com>
|
2014-01-11 04:32:08 +01:00
|
|
|
|
2014-01-13 06:32:25 +01:00
|
|
|
Clementine 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 3 of the License, or
|
|
|
|
(at your option) any later version.
|
2014-01-11 04:32:08 +01:00
|
|
|
|
2014-01-13 06:32:25 +01:00
|
|
|
Clementine 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.
|
2014-01-11 04:32:08 +01:00
|
|
|
|
2014-01-13 06:32:25 +01:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2013-12-27 06:38:43 +01:00
|
|
|
|
|
|
|
#ifndef RIPCD_H
|
|
|
|
#define RIPCD_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2014-01-11 06:02:11 +01:00
|
|
|
#include <QCheckBox>
|
2014-01-08 04:39:28 +01:00
|
|
|
#include <QThread>
|
|
|
|
#include <cdio/cdio.h>
|
2013-12-27 06:38:43 +01:00
|
|
|
#include "ui_ripcd.h"
|
2014-01-11 04:26:13 +01:00
|
|
|
|
2014-01-13 06:32:25 +01:00
|
|
|
class Ui_RipCD;
|
2014-01-11 04:26:13 +01:00
|
|
|
class Transcoder;
|
2013-12-27 06:38:43 +01:00
|
|
|
|
2014-01-13 06:32:25 +01:00
|
|
|
struct TranscoderPreset;
|
|
|
|
|
|
|
|
class RipCD: public QDialog {
|
2013-12-27 06:38:43 +01:00
|
|
|
Q_OBJECT
|
2014-01-08 04:39:28 +01:00
|
|
|
// QThread thread;
|
2013-12-27 06:38:43 +01:00
|
|
|
|
2014-01-13 06:32:25 +01:00
|
|
|
public:
|
2013-12-27 06:38:43 +01:00
|
|
|
RipCD(QWidget* parent = 0);
|
2014-01-13 06:32:25 +01:00
|
|
|
static const char* kSettingsGroup;
|
|
|
|
static const int kProgressInterval;
|
|
|
|
static const int kMaxDestinationItems;
|
2014-01-08 04:39:28 +01:00
|
|
|
|
2014-01-13 06:32:25 +01:00
|
|
|
private:
|
2014-01-09 05:47:33 +01:00
|
|
|
Transcoder* transcoder_;
|
2014-01-13 06:32:25 +01:00
|
|
|
int queued_;
|
|
|
|
int finished_success_;
|
|
|
|
int finished_failed_;
|
|
|
|
track_t i_tracks;
|
|
|
|
Ui_RipCD* ui_;
|
2014-01-08 04:39:28 +01:00
|
|
|
CdIo_t *p_cdio;
|
2014-01-13 06:32:25 +01:00
|
|
|
QList<QCheckBox*> checkboxes_;
|
|
|
|
QList<QString> generated_files_;
|
|
|
|
QList<int> tracks_to_rip_;
|
|
|
|
QList<QLineEdit*> track_names_;
|
|
|
|
QString last_add_dir_;
|
|
|
|
QPushButton* cancel_button_;
|
|
|
|
|
|
|
|
void write_WAV_header(FILE *stream, int32_t i_bytecount);
|
2014-01-08 04:39:28 +01:00
|
|
|
void put_num(long int num, FILE *stream, int bytes);
|
2014-01-13 06:32:25 +01:00
|
|
|
int nTracksToRip();
|
2014-01-11 04:26:13 +01:00
|
|
|
void toThreadClickedRipButton();
|
2014-01-13 06:32:25 +01:00
|
|
|
QString TrimPath(const QString& path) const;
|
|
|
|
QString GetOutputFileName(const QString& input,
|
|
|
|
const TranscoderPreset& preset) const;
|
2014-01-13 16:38:25 +01:00
|
|
|
QString ParseFileFormatString(const QString& file_format, int trackNo) const;
|
2014-01-11 04:26:13 +01:00
|
|
|
|
2014-01-11 06:02:11 +01:00
|
|
|
|
2014-01-13 06:32:25 +01:00
|
|
|
|
|
|
|
signals:
|
2014-01-11 04:26:13 +01:00
|
|
|
void RippingComplete();
|
2014-01-13 06:32:25 +01:00
|
|
|
void signalUpdateProgress();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void UpdateProgress();
|
2014-01-11 04:26:13 +01:00
|
|
|
void threadedTranscoding();
|
2014-01-08 04:39:28 +01:00
|
|
|
void clickedRipButton();
|
2014-01-11 04:26:13 +01:00
|
|
|
void JobComplete(const QString& filename, bool success);
|
2014-01-09 05:47:33 +01:00
|
|
|
void AllJobsComplete();
|
2014-01-11 06:02:11 +01:00
|
|
|
void AppendOutput(const QString &filename);
|
2014-01-13 06:32:25 +01:00
|
|
|
void Options();
|
|
|
|
void AddDestination();
|
|
|
|
void Cancel();
|
2013-12-27 06:38:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RIPCD_H
|