diff --git a/core/audex.h b/core/audex.h index 3a7c9d0..d8ba20e 100644 --- a/core/audex.h +++ b/core/audex.h @@ -1,290 +1,290 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef AUDEX_HEADER #define AUDEX_HEADER #include #include #include #include #include #include #include "models/cddamodel.h" #include "models/profilemodel.h" #include "utils/cddaextractthread.h" #include "utils/cuesheetwriter.h" #include "utils/discidcalculator.h" #include "utils/encoderwrapper.h" #include "utils/hashlist.h" #include "utils/parameters.h" #include "utils/patternparser.h" #include "utils/playlist.h" #include "utils/tmpdir.h" #include "utils/upload.h" #include "utils/wavefilewriter.h" #include "preferences.h" class AudexJob : public QObject { Q_OBJECT public: explicit AudexJob(QObject *parent = 0) : QObject(parent) { source_filename = ""; target_filename = ""; _trackno = 0; } - ~AudexJob() + ~AudexJob() override { } void setSourceFilename(const QString &n) { source_filename = n; } QString sourceFilename() const { return source_filename; } void setTargetFilename(const QString &n) { target_filename = n; } QString targetFilename() const { return target_filename; } void setTrackNo(const int t) { _trackno = t; } int trackNo() const { return _trackno; } private: QString source_filename; QString target_filename; int _trackno; }; class AudexJobs : public QObject { Q_OBJECT public: explicit AudexJobs(QObject *parent = 0) : QObject(parent) { job_in_progress = false; } - ~AudexJobs() + ~AudexJobs() override { for (int i = 0; i < cache.count(); i++) { // make really sure all files are away QFile file(cache.at(i)->sourceFilename()); if (file.exists()) file.remove(); delete cache.at(i); } } AudexJob *orderJob() { if (job_queue.isEmpty()) { return NULL; } else { job_in_progress = true; return job_queue.dequeue(); } } void reportJobFinished() { job_in_progress = false; } bool jobInProgress() { return job_in_progress; } bool pendingJobs() { return (job_queue.count() > 0); } public slots: void addNewJob(const QString &sourceFilename, const QString &targetFilename, const int trackno) { AudexJob *j = new AudexJob(); j->setSourceFilename(sourceFilename); j->setTargetFilename(targetFilename); j->setTrackNo(trackno); job_queue.enqueue(j); cache.append(j); emit newJobAvailable(); } signals: void newJobAvailable(); private: QQueue job_queue; QList cache; bool job_in_progress; }; class Audex : public QObject { Q_OBJECT public: Audex(QWidget *parent, ProfileModel *profile_model, CDDAModel *cdda_model); - ~Audex(); + ~Audex() override; bool prepare(); public slots: void start(); void cancel(); const QStringList &extractProtocol(); const QStringList &encoderProtocol(); private slots: void start_extract(); void finish_extract(); void start_encode(); void finish_encode(); void calculate_speed_extract(); void calculate_speed_encode(); void progress_extract(int percent_of_track, int sector, int overall_sectors_read); void progress_encode(int percent); void write_to_wave(const QByteArray &data); void slot_error(const QString &message, const QString &details = QString()); void slot_warning(const QString &message); void slot_info(const QString &message); void check_if_thread_still_running(); signals: void changedExtractTrack(int no, int total, const QString &artist, const QString &title); void changedEncodeTrack(int no, int total, const QString &filename); void progressExtractTrack(int percent); void progressExtractOverall(int percent); void progressEncodeTrack(int percent); void progressEncodeOverall(int percent); void speedExtract(double times); void speedEncode(double times); void finished(bool successful); void timeout(); void error(const QString &message, const QString &details = QString()); void warning(const QString &message); void info(const QString &message); private: QWidget *parent; ProfileModel *profile_model; CDDAModel *cdda_model; EncoderWrapper *encoder_wrapper; CDDAExtractThread *cdda_extract_thread; AudexJobs *jobs; WaveFileWriter *wave_file_writer; TmpDir *tmp_dir; QString p_profile_name; QString p_suffix; bool p_single_file; bool construct_target_filename(QString &targetFilename, int trackno, int cdno, int nooftracks, int gindex, const QString &artist, const QString &title, const QString &tartist, const QString &ttitle, const QString &date, const QString &genre, const QString &ext, const QString &basepath, bool fat_compatible, bool replacespaceswithunderscores, bool _2digitstracknum, bool overwrite_existing_files, bool is_first_track); bool construct_target_filename_for_singlefile(QString &targetFilename, int cdno, int nooftracks, const QString &artist, const QString &title, const QString &date, const QString &genre, const QString &ext, const QString &basepath, bool overwrite_existing_files); bool check(); QString tmp_path; QString target_dir; bool _finished; bool _finished_successful; void request_finish(bool successful); void execute_finish(); int process_counter; bool timeout_done; int timeout_counter; /*PROCESS 1: EXTRACTING*/ QString ex_track_source_filename; QString ex_track_target_filename; int ex_track_index; int ex_track_count; QTimer *timer_extract; int current_sector; int last_measuring_point_sector; int overall_frames; /*PROCESS 2: ENCODING*/ QString en_track_filename; QString en_track_target_filename; int en_track_index; int en_track_count; QTimer *timer_encode; int current_encoder_percent; int last_measuring_point_encoder_percent; bool p_prepare_dir(QString &filename, const QString &targetDirIfRelative, const bool overwrite = false); bool p_mkdir(const QString &absoluteFilePath); qreal p_size_of_all_files(const QStringList &filenames) const; }; #endif diff --git a/dialogs/cddaheaderdatadialog.h b/dialogs/cddaheaderdatadialog.h index 742d638..6f64e63 100644 --- a/dialogs/cddaheaderdatadialog.h +++ b/dialogs/cddaheaderdatadialog.h @@ -1,56 +1,56 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef CDDAHEADERDATADIALOG_H #define CDDAHEADERDATADIALOG_H #include #include #include #include #include "models/cddamodel.h" #include "utils/discidcalculator.h" #include "ui_cddaheaderdatawidgetUI.h" class CDDAHeaderDataDialog : public QDialog { Q_OBJECT public: explicit CDDAHeaderDataDialog(CDDAModel *cddaModel, QWidget *parent = 0); - ~CDDAHeaderDataDialog(); + ~CDDAHeaderDataDialog() override; private slots: void save(); void trigger_changed(); void enable_checkbox_multicd(bool enabled); void slotAccepted(); void slotApplied(); private: Ui::CDDAHeaderDataWidgetUI ui; CDDAModel *cdda_model; QPushButton *okButton; QPushButton *applyButton; }; #endif diff --git a/dialogs/commandwizarddialog.h b/dialogs/commandwizarddialog.h index 3c2d050..09a830c 100644 --- a/dialogs/commandwizarddialog.h +++ b/dialogs/commandwizarddialog.h @@ -1,75 +1,75 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef COMMANDWIZARDDIALOG_H #define COMMANDWIZARDDIALOG_H #include #include #include #include #include "utils/patternparser.h" #include "ui_commandwizardwidgetUI.h" class CommandWizardDialog : public QDialog { Q_OBJECT public: explicit CommandWizardDialog(const QString &command, QWidget *parent = 0); - ~CommandWizardDialog(); + ~CommandWizardDialog() override; QString command; private slots: void trigger_changed(); void about_commandline_schemes(); void about_parameters(); void insAlbumArtist(); void insAlbumTitle(); void insTrackArtist(); void insTrackTitle(); void insTrackNo(); void insCDNo(); void insDate(); void insGenre(); void insCoverFile(); void insNoOfTracks(); void insInFile(); void insOutFile(); void update_example(); void slotAccepted(); void slotApplied(); private: Ui::CommandWizardWidgetUI ui; bool save(); QPushButton *okButton; QPushButton *applyButton; }; #endif diff --git a/dialogs/coverbrowserdialog.h b/dialogs/coverbrowserdialog.h index ef32b40..62df21e 100644 --- a/dialogs/coverbrowserdialog.h +++ b/dialogs/coverbrowserdialog.h @@ -1,81 +1,81 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef COVERBROWSERDIALOG_H #define COVERBROWSERDIALOG_H #include #include #include #include #include #include "preferences.h" #include "dialogs/errordialog.h" #include "utils/coverfetcher.h" #include "ui_coverbrowserwidgetUI.h" class CoverBrowserDialog : public QDialog { Q_OBJECT public: explicit CoverBrowserDialog(QWidget *parent = 0); - ~CoverBrowserDialog(); + ~CoverBrowserDialog() override; inline int count() { return cover_fetcher.count(); } public slots: void fetchThumbnails(const QString &searchstring, const int fetchCount = 0); void startFetchCover(const int no); signals: void coverFetched(const QByteArray &cover); void allCoverThumbnailsFetched(); void nothingFetched(); private slots: void select_this(QListWidgetItem *item); void enable_select_button(); void add_item(const QByteArray &cover, const QString &caption, int no); void all_fetched(); void nothing_fetched(); void cover_fetched(const QByteArray &cover); void error(const QString &description, const QString &solution); void slotAccepted(); private: Ui::CoverBrowserWidgetUI ui; CoverFetcher cover_fetcher; QPushButton *okButton; void setup(); }; #endif diff --git a/dialogs/extractingprogressdialog.h b/dialogs/extractingprogressdialog.h index abb2743..2a8d509 100644 --- a/dialogs/extractingprogressdialog.h +++ b/dialogs/extractingprogressdialog.h @@ -1,111 +1,111 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef EXTRACTINGPROGRESSDIALOG_H #define EXTRACTINGPROGRESSDIALOG_H #include #include #include #include #include #include #include #include #include #include #include #include "core/audex.h" #include "models/cddamodel.h" #include "models/profilemodel.h" #include "protocoldialog.h" #include "ui_extractingprogresswidgetUI.h" class ExtractingProgressDialog : public QDialog { Q_OBJECT public: ExtractingProgressDialog(ProfileModel *profile_model, CDDAModel *cdda_model, QWidget *parent = 0); - ~ExtractingProgressDialog(); + ~ExtractingProgressDialog() override; public slots: - int exec(); + int exec() override; private slots: void toggle_details(); void cancel(); void slotCancel(); void slotClose(); void slotEncoderProtocol(); void slotExtractProtocol(); void show_changed_extract_track(int no, int total, const QString &artist, const QString &title); void show_changed_encode_track(int no, int total, const QString &filename); void show_progress_extract_track(int percent); void show_progress_extract_overall(int percent); void show_progress_encode_track(int percent); void show_progress_encode_overall(int percent); void show_speed_encode(double speed); void show_speed_extract(double speed); void conclusion(bool successful); void show_info(const QString &message); void show_warning(const QString &message); void show_error(const QString &message, const QString &details); void ask_timeout(); private: QVBoxLayout *mainLayout; QDialogButtonBox *buttonBox; QPushButton *cancelButton; void calc_overall_progress(); void open_encoder_protocol_dialog(); void open_extract_protocol_dialog(); void update_unity(); private: Ui::ExtractingProgressWidgetUI ui; Audex *audex; ProfileModel *profile_model; CDDAModel *cdda_model; bool finished; bool progressbar_np_flag; int current_encode_overall; int current_extract_overall; unsigned int current_track; bool p_single_file; QDBusMessage unity_message; }; #endif diff --git a/dialogs/patternwizarddialog.h b/dialogs/patternwizarddialog.h index d3df51f..20139bc 100644 --- a/dialogs/patternwizarddialog.h +++ b/dialogs/patternwizarddialog.h @@ -1,72 +1,72 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PATTERNWIZARDDIALOG_H #define PATTERNWIZARDDIALOG_H #include #include #include #include #include "utils/patternparser.h" #include "ui_patternwizardwidgetUI.h" class PatternWizardDialog : public QDialog { Q_OBJECT public: explicit PatternWizardDialog(const QString &pattern, QWidget *parent = 0); - ~PatternWizardDialog(); + ~PatternWizardDialog() override; QString pattern; private slots: void trigger_changed(); void about_filename_schemes(); void about_parameters(); void insAlbumArtist(); void insAlbumTitle(); void insTrackArtist(); void insTrackTitle(); void insTrackNo(); void insCDNo(); void insDate(); void insGenre(); void insSuffix(); void insNoOfTracks(); void update_example(); void slotAccepted(); void slotApplied(); private: Ui::PatternWizardWidgetUI ui; bool save(); QPushButton *applyButton; }; #endif diff --git a/dialogs/profiledatacoverdialog.h b/dialogs/profiledatacoverdialog.h index 0f0a615..abb90da 100644 --- a/dialogs/profiledatacoverdialog.h +++ b/dialogs/profiledatacoverdialog.h @@ -1,61 +1,61 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROFILEDATACOVERDIALOG_H #define PROFILEDATACOVERDIALOG_H #include #include #include #include "simplepatternwizarddialog.h" #include "ui_profiledatacoverwidgetUI.h" class ProfileDataCoverDialog : public QDialog { Q_OBJECT public: ProfileDataCoverDialog(const bool scale, const QSize &size, const QString &format, const QString &pattern, QWidget *parent = 0); - ~ProfileDataCoverDialog(); + ~ProfileDataCoverDialog() override; bool scale; QSize size; QString format; QString pattern; protected slots: void pattern_wizard(); private slots: void trigger_changed(); void enable_scale(bool enabled); void slotAccepted(); void slotApplied(); private: Ui::ProfileDataCoverWidgetUI ui; QPushButton *applyButton; bool save(); }; #endif diff --git a/dialogs/profiledatacuesheetdialog.h b/dialogs/profiledatacuesheetdialog.h index 01634d8..3261b46 100644 --- a/dialogs/profiledatacuesheetdialog.h +++ b/dialogs/profiledatacuesheetdialog.h @@ -1,57 +1,57 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROFILEDATACUESHEETDIALOG_H #define PROFILEDATACUESHEETDIALOG_H #include #include #include #include "simplepatternwizarddialog.h" #include "ui_profiledatacuesheetwidgetUI.h" class ProfileDataCueSheetDialog : public QDialog { Q_OBJECT public: explicit ProfileDataCueSheetDialog(const QString &pattern, QWidget *parent = 0); - ~ProfileDataCueSheetDialog(); + ~ProfileDataCueSheetDialog() override; QString pattern; protected slots: void pattern_wizard(); private slots: void trigger_changed(); void slotAccepted(); void slotApplied(); private: Ui::ProfileDataCueSheetWidgetUI ui; QPushButton *applyButton; bool save(); }; #endif diff --git a/dialogs/profiledatadialog.h b/dialogs/profiledatadialog.h index ea1b208..506abc5 100644 --- a/dialogs/profiledatadialog.h +++ b/dialogs/profiledatadialog.h @@ -1,133 +1,133 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROFILEDATADIALOG_H #define PROFILEDATADIALOG_H #include #include #include #include #include "models/profilemodel.h" #include "utils/encoderassistant.h" #include "widgets/customwidget.h" #include "widgets/faacwidget.h" #include "widgets/flacwidget.h" #include "widgets/lamewidget.h" #include "widgets/oggencwidget.h" #include "widgets/wavewidget.h" #include "dialogs/errordialog.h" #include "dialogs/patternwizarddialog.h" #include "dialogs/profiledatacoverdialog.h" #include "dialogs/profiledatacuesheetdialog.h" #include "dialogs/profiledatahashlistdialog.h" #include "dialogs/profiledatainfodialog.h" #include "dialogs/profiledataplaylistdialog.h" #include "dialogs/profiledatasinglefiledialog.h" #include "ui_profiledatawidgetUI.h" class ProfileDataDialog : public QDialog { Q_OBJECT public: ProfileDataDialog(ProfileModel *profileModel, const int profileRow, QWidget *parent = 0); - ~ProfileDataDialog(); + ~ProfileDataDialog() override; private slots: void set_encoder(const int encoder); void set_encoder_by_combobox(const int index); void trigger_changed(); void enable_settings_cover(bool enabled); void enable_settings_playlist(bool enabled); void enable_settings_info(bool enabled); void enable_settings_hashlist(bool enabled); void enable_settings_cuesheet(bool enabled); void enable_settings_singlefile(bool enabled); void disable_playlist(bool disabled); void enable_filenames(bool enabled); void disable_filenames(bool disabled); void pattern_wizard(); void cover_settings(); void playlist_settings(); void info_settings(); void hashlist_settings(); void cuesheet_settings(); void singlefile_settings(); void slotAccepted(); void slotApplied(); private: Ui::ProfileDataWidgetUI ui; ProfileModel *profile_model; QPushButton *applyButton; int profile_row; lameWidget *lame_widget; Parameters lame_parameters; oggencWidget *oggenc_widget; Parameters oggenc_parameters; flacWidget *flac_widget; Parameters flac_parameters; faacWidget *faac_widget; Parameters faac_parameters; waveWidget *wave_widget; Parameters wave_parameters; customWidget *custom_widget; Parameters custom_parameters; void set_encoder_widget(const EncoderAssistant::Encoder encoder); bool pdcd_scale; QSize pdcd_size; QString pdcd_format; QString pdcd_pattern; QString pdpd_format; QString pdpd_pattern; bool pdpd_abs_file_path; bool pdpd_utf8; QStringList pdid_text; QString pdid_pattern; QString pdid_suffix; QString pdhd_format; QString pdhd_pattern; QString pdud_pattern; QString pdsd_pattern; bool save(); Error error; }; #endif diff --git a/dialogs/profiledatahashlistdialog.h b/dialogs/profiledatahashlistdialog.h index df62f68..4e7be09 100644 --- a/dialogs/profiledatahashlistdialog.h +++ b/dialogs/profiledatahashlistdialog.h @@ -1,58 +1,58 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROFILEDATAHASHLISTDIALOG_H #define PROFILEDATAHASHLISTDIALOG_H #include #include #include #include "simplepatternwizarddialog.h" #include "ui_profiledatahashlistwidgetUI.h" class ProfileDataHashlistDialog : public QDialog { Q_OBJECT public: ProfileDataHashlistDialog(const QString &pattern, const QString &format, QWidget *parent = 0); - ~ProfileDataHashlistDialog(); + ~ProfileDataHashlistDialog() override; QString format; QString pattern; protected slots: void pattern_wizard(); private slots: void trigger_changed(); void slotAccepted(); void slotApplied(); private: Ui::ProfileDataHashlistWidgetUI ui; QPushButton *applyButton; bool save(); }; #endif diff --git a/dialogs/profiledatainfodialog.h b/dialogs/profiledatainfodialog.h index afe0249..003c008 100644 --- a/dialogs/profiledatainfodialog.h +++ b/dialogs/profiledatainfodialog.h @@ -1,67 +1,67 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROFILEDATAINFODIALOG_H #define PROFILEDATAINFODIALOG_H #include #include #include #include #include #include "simplepatternwizarddialog.h" #include "ui_profiledatainfowidgetUI.h" class ProfileDataInfoDialog : public QDialog { Q_OBJECT public: ProfileDataInfoDialog(const QStringList &text, const QString &pattern, const QString &suffix, QWidget *parent = 0); - ~ProfileDataInfoDialog(); + ~ProfileDataInfoDialog() override; QStringList text; QString pattern; QString suffix; protected slots: void pattern_wizard(); private slots: void trigger_changed(); void about_variables(); void load_text(); void save_text(); void slotAccepted(); void slotApplied(); private: Ui::ProfileDataInfoWidgetUI ui; QVBoxLayout *mainLayout; QPushButton *applyButton; bool save(); }; #endif diff --git a/dialogs/profiledataplaylistdialog.h b/dialogs/profiledataplaylistdialog.h index 418a371..7f4991d 100644 --- a/dialogs/profiledataplaylistdialog.h +++ b/dialogs/profiledataplaylistdialog.h @@ -1,62 +1,62 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROFILEDATAPLAYLISTDIALOG_H #define PROFILEDATAPLAYLISTDIALOG_H #include #include #include #include "simplepatternwizarddialog.h" #include "ui_profiledataplaylistwidgetUI.h" class ProfileDataPlaylistDialog : public QDialog { Q_OBJECT public: ProfileDataPlaylistDialog(const QString &format, const QString &pattern, const bool absFilePath, const bool utf8, QWidget *parent = 0); - ~ProfileDataPlaylistDialog(); + ~ProfileDataPlaylistDialog() override; QString format; QString pattern; bool absFilePath; bool utf8; protected slots: void pattern_wizard(); private slots: void trigger_changed(); void enable_abs_file_path(bool enabled); void enable_utf8(bool enabled); void slotAccepted(); void slotApplied(); private: Ui::ProfileDataPlaylistWidgetUI ui; QPushButton *applyButton; bool save(); }; #endif diff --git a/dialogs/profiledatasinglefiledialog.h b/dialogs/profiledatasinglefiledialog.h index f41b54f..eb3e212 100644 --- a/dialogs/profiledatasinglefiledialog.h +++ b/dialogs/profiledatasinglefiledialog.h @@ -1,57 +1,57 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROFILEDATASINGLEFILEDIALOG_H #define PROFILEDATASINGLEFILEDIALOG_H #include #include #include #include "simplepatternwizarddialog.h" #include "ui_profiledatasinglefilewidgetUI.h" class ProfileDataSingleFileDialog : public QDialog { Q_OBJECT public: explicit ProfileDataSingleFileDialog(const QString &pattern, QWidget *parent = 0); - ~ProfileDataSingleFileDialog(); + ~ProfileDataSingleFileDialog() override; QString pattern; protected slots: void pattern_wizard(); private slots: void trigger_changed(); void slotAccepted(); void slotApplied(); private: Ui::ProfileDataSingleFileWidgetUI ui; QPushButton *applyButton; bool save(); }; #endif diff --git a/dialogs/protocoldialog.h b/dialogs/protocoldialog.h index c34230b..08df6a1 100644 --- a/dialogs/protocoldialog.h +++ b/dialogs/protocoldialog.h @@ -1,49 +1,49 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROTOCOLDIALOG_H #define PROTOCOLDIALOG_H #include #include #include #include "ui_protocolwidgetUI.h" class ProtocolDialog : public QDialog { Q_OBJECT public: ProtocolDialog(const QStringList &protocol, const QString &title, QWidget *parent = 0); - ~ProtocolDialog(); + ~ProtocolDialog() override; private slots: void slotSaveProtocol(); void slotClosed(); void save(); private: Ui::ProtocolWidgetUI ui; QStringList protocol; QString title; }; #endif diff --git a/dialogs/simplepatternwizarddialog.h b/dialogs/simplepatternwizarddialog.h index a337dd6..207069e 100644 --- a/dialogs/simplepatternwizarddialog.h +++ b/dialogs/simplepatternwizarddialog.h @@ -1,68 +1,68 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef SIMPLEPATTERNWIZARDDIALOG_H #define SIMPLEPATTERNWIZARDDIALOG_H #include #include #include #include "utils/patternparser.h" #include "ui_simplepatternwizardwidgetUI.h" class SimplePatternWizardDialog : public QDialog { Q_OBJECT public: SimplePatternWizardDialog(const QString &pattern, const QString &suffix, QWidget *parent = 0); - ~SimplePatternWizardDialog(); + ~SimplePatternWizardDialog() override; QString pattern; private slots: void trigger_changed(); void about_schemes(); void about_parameters(); void insAlbumArtist(); void insAlbumTitle(); void insCDNo(); void insDate(); void insGenre(); void insSuffix(); void insNoOfTracks(); void update_example(); void slotAccepted(); void slotApplied(); private: Ui::SimplePatternWizardWidgetUI ui; QString suffix; QPushButton *applyButton; bool save(); }; #endif diff --git a/mainwindow.h b/mainwindow.h index 6b2b45c..0089a01 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -1,135 +1,135 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "utils/cuesheetwriter.h" #include "utils/error.h" #include "models/cddamodel.h" #include "models/profilemodel.h" #include "preferences.h" #include "widgets/cddaheaderwidget.h" #include "widgets/devicewidget.h" #include "widgets/generalsettingswidget.h" #include "widgets/profilewidget.h" #include "widgets/remoteserversettingswidget.h" #include "dialogs/errordialog.h" #include "dialogs/extractingprogressdialog.h" #include "utils/encoderassistant.h" class MainWindow : public KXmlGuiWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); + ~MainWindow() override; private: bool firstStart(); private Q_SLOTS: void eject(); void cddb_lookup(); void cddb_submit(); void rip(); void configure(); void new_audio_disc_detected(); void audio_disc_removed(); void cddb_lookup_start(); void cddb_lookup_done(const bool successful); void update_layout(); void enable_layout(bool enabled); void enable_submit(bool enabled = true); void disable_submit(); void configuration_updated(const QString &dialog_name); void current_profile_updated_from_ui(int row); void update_profile_action(int index); void update_profile_action(); void split_titles(); void swap_artists_and_titles(); void capitalize(); void auto_fill_artists(); void toggle(const QModelIndex &idx); void resizeColumns(); void select_all(); void select_none(); void invert_selection(); void cdda_context_menu(const QPoint &pos); void selection_changed(const int num_selected); private: CDDAModel *cdda_model; ProfileModel *profile_model; QLabel *profile_label; KComboBox *profile_combobox; void setup_actions(); void setup_layout(); QTreeView *cdda_tree_view; QDockWidget *cdda_header_dock; CDDAHeaderWidget *cdda_header_widget; bool layout_enabled; int current_profile_index; void set_profile(int profile_index); }; #endif diff --git a/models/cddamodel.h b/models/cddamodel.h index 1b8eabe..0436125 100644 --- a/models/cddamodel.h +++ b/models/cddamodel.h @@ -1,230 +1,230 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef CDDAMODEL_H #define CDDAMODEL_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "utils/cachedimage.h" #include "utils/cddadevices.h" #include "utils/cddaparanoia.h" #include "utils/error.h" #define CDDA_MODEL_COLUMN_RIP_LABEL i18n("Rip") #define CDDA_MODEL_COLUMN_TRACK_LABEL i18n("Track") #define CDDA_MODEL_COLUMN_ARTIST_LABEL i18n("Artist") #define CDDA_MODEL_COLUMN_TITLE_LABEL i18n("Title") #define CDDA_MODEL_COLUMN_LENGTH_LABEL i18n("Length") enum CDDAColumms { CDDA_MODEL_COLUMN_RIP_INDEX = 0, CDDA_MODEL_COLUMN_TRACK_INDEX, CDDA_MODEL_COLUMN_ARTIST_INDEX, CDDA_MODEL_COLUMN_TITLE_INDEX, CDDA_MODEL_COLUMN_LENGTH_INDEX, CDDA_MODEL_COLUMN_COUNT }; #define CDDA_MODEL_INTERNAL_ROLE 1982 /** kde audio disc model **/ class CDDAModel : public QAbstractTableModel { Q_OBJECT public: explicit CDDAModel(QObject *parent = 0); - ~CDDAModel(); + ~CDDAModel() override; inline CDDAParanoia *paranoia() const { return pn; } inline const QString &device() const { return _device; } - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const override; void setArtist(const QString &a); const QString artist() const; void setTitle(const QString &t); const QString title() const; // category must be cddb compatible //(blues, classical, country, data, // folk, jazz, misc, newage, reggae, // rock, soundtrack) void setCategory(const QString &c); const QString category() const; void setGenre(const QString &g); const QString genre() const; void setYear(const QString &year); const QString year() const; void setExtendedData(const QStringList &e); const QStringList extendedData() const; void setCDNum(const int n); int cdNum() const; void setTrackOffset(const int n); int trackOffset() const; int guessMultiCD(QString &newTitle) const; void setMultiCD(const bool multi); bool isMultiCD() const; void setCustomData(const QString &type, const QVariant &data); const QVariant customData(const QString &type) const; void setCustomDataPerTrack(const int n, const QString &type, const QVariant &data); const QVariant getCustomDataPerTrack(const int n, const QString &type); CachedImage *cover() const; const QImage coverImage() const; quint16 coverChecksum() const; bool setCover(const QByteArray &data); bool setCover(const QString &filename); bool saveCoverToFile(const QString &filename); bool isCoverEmpty() const; void clearCover(); const QString coverSupportedMimeTypeList() const; bool guessVarious() const; void setVarious(bool various); bool isVarious(); void swapArtistAndTitleOfTracks(); void swapArtistAndTitle(); void splitTitleOfTracks(const QString ÷r); void capitalizeTracks(); void capitalizeHeader(); void setTitleArtistsFromHeader(); int numOfTracks() const; int numOfAudioTracks() const; int numOfAudioTracksInSelection() const; int length() const; int lengthOfAudioTracks() const; int lengthOfAudioTracksInSelection() const; int lengthOfTrack(int n) const; const QList discSignature() const; bool isAudioTrack(int n) const; void clear(); inline bool empty() { return _empty; } inline const QSet &selectedTracks() const { return sel_tracks; } void toggle(int row); bool isTrackInSelection(int n) const; void invertSelection(); void selectAll(); void selectNone(); bool isModified() const; void confirm(); Error lastError() const; public slots: void lookupCDDB(); bool submitCDDB(); void eject(); signals: void audioDiscDetected(); void audioDiscRemoved(); void cddbLookupStarted(); void cddbLookupDone(const bool successful); void cddbDataModified(); void cddbDataSubmited(const bool successful); void hasSelection(bool has_selection); void selectionChanged(const int num_selected); private slots: void new_audio_disc_available(const QString &udi); void audio_disc_removed(const QString &udi); void disc_information_modified(); void lookup_cddb_done(KCDDB::Result result); private: QString _device; QString _udi; CDDAParanoia *pn; CDDADevices *devices; KCDDB::Client *cddb; KCDDB::CDInfo cd_info; CachedImage *_cover; bool modified; bool _empty; // no metadata available yet Error error; bool cddb_transaction_pending; QSet sel_tracks; void _toggle(const unsigned int track); const QString capitalize(const QString &s); void set_default_values(); void modify(); }; #endif diff --git a/models/profilemodel.h b/models/profilemodel.h index 87b2ad6..08db7b5 100644 --- a/models/profilemodel.h +++ b/models/profilemodel.h @@ -1,246 +1,246 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROFILEMODEL_HEADER #define PROFILEMODEL_HEADER #include #include #include #include #include #include #include #include "utils/encoderassistant.h" #include "utils/error.h" #define DEFAULT_PROFILEINDEX -1 #define DEFAULT_NAME "" #define DEFAULT_ICON "audio-x-generic" #define DEFAULT_ENCODER_SELECTED 0 #define DEFAULT_ENCODER_PARAMETERS "" #define DEFAULT_PATTERN "$" VAR_ALBUM_ARTIST "/$" VAR_ALBUM_TITLE "/$" VAR_TRACK_NO " - $" VAR_TRACK_TITLE ".$" VAR_SUFFIX #define DEFAULT_FAT32 false #define DEFAULT_UNDERSCORE false #define DEFAULT_2DIGITSTRACKNUM true #define DEFAULT_SC true #define DEFAULT_SC_SCALE false #define DEFAULT_SC_SIZE QSize(600, 600) #define DEFAULT_SC_FORMAT "JPEG" #define DEFAULT_SC_NAME "$" VAR_ALBUM_TITLE ".$" VAR_SUFFIX #define DEFAULT_PL true #define DEFAULT_PL_FORMAT "M3U" #define DEFAULT_PL_NAME "$" VAR_ALBUM_TITLE ".$" VAR_SUFFIX #define DEFAULT_PL_ABS_FILE_PATH false #define DEFAULT_PL_UTF8 true #define DEFAULT_INF false #define DEFAULT_INF_TEXT QStringList() #define DEFAULT_INF_NAME "info" #define DEFAULT_INF_SUFFIX "nfo" #define DEFAULT_HL false #define DEFAULT_HL_FORMAT "SFV" #define DEFAULT_HL_NAME "checksums.$" VAR_SUFFIX #define DEFAULT_CUE false #define DEFAULT_CUE_NAME "$" VAR_ALBUM_ARTIST " - $" VAR_ALBUM_TITLE ".$" VAR_SUFFIX #define DEFAULT_SF false #define DEFAULT_SF_NAME "$" VAR_ALBUM_ARTIST "/$" VAR_ALBUM_TITLE "/$" VAR_ALBUM_ARTIST " - $" VAR_ALBUM_TITLE ".$" VAR_SUFFIX enum ProfileColumns { PROFILE_MODEL_COLUMN_PROFILEINDEX_INDEX = 0, PROFILE_MODEL_COLUMN_NAME_INDEX, PROFILE_MODEL_COLUMN_ICON_INDEX, PROFILE_MODEL_COLUMN_ENCODER_SELECTED_INDEX, PROFILE_MODEL_COLUMN_PATTERN_INDEX, PROFILE_MODEL_COLUMN_FAT32COMPATIBLE_INDEX, PROFILE_MODEL_COLUMN_UNDERSCORE_INDEX, PROFILE_MODEL_COLUMN_2DIGITSTRACKNUM_INDEX, PROFILE_MODEL_COLUMN_SC_INDEX, PROFILE_MODEL_COLUMN_SC_SCALE_INDEX, PROFILE_MODEL_COLUMN_SC_SIZE_INDEX, PROFILE_MODEL_COLUMN_SC_FORMAT_INDEX, PROFILE_MODEL_COLUMN_SC_NAME_INDEX, PROFILE_MODEL_COLUMN_PL_INDEX, PROFILE_MODEL_COLUMN_PL_FORMAT_INDEX, PROFILE_MODEL_COLUMN_PL_NAME_INDEX, PROFILE_MODEL_COLUMN_PL_ABS_FILE_PATH_INDEX, PROFILE_MODEL_COLUMN_PL_UTF8_INDEX, PROFILE_MODEL_COLUMN_INF_INDEX, PROFILE_MODEL_COLUMN_INF_TEXT_INDEX, PROFILE_MODEL_COLUMN_INF_NAME_INDEX, PROFILE_MODEL_COLUMN_INF_SUFFIX_INDEX, PROFILE_MODEL_COLUMN_HL_INDEX, PROFILE_MODEL_COLUMN_HL_FORMAT_INDEX, PROFILE_MODEL_COLUMN_HL_NAME_INDEX, PROFILE_MODEL_COLUMN_CUE_INDEX, PROFILE_MODEL_COLUMN_CUE_NAME_INDEX, PROFILE_MODEL_COLUMN_SF_INDEX, PROFILE_MODEL_COLUMN_SF_NAME_INDEX, PROFILE_MODEL_COLUMN_ENCODER_LAME_PARAMETERS_INDEX, PROFILE_MODEL_COLUMN_ENCODER_OGGENC_PARAMETERS_INDEX, PROFILE_MODEL_COLUMN_ENCODER_FLAC_PARAMETERS_INDEX, PROFILE_MODEL_COLUMN_ENCODER_FAAC_PARAMETERS_INDEX, PROFILE_MODEL_COLUMN_ENCODER_WAVE_PARAMETERS_INDEX, PROFILE_MODEL_COLUMN_ENCODER_CUSTOM_PARAMETERS_INDEX, PROFILE_MODEL_COLUMN_NUM }; #define PROFILE_MODEL_PROFILEINDEX_KEY "profile_key" #define PROFILE_MODEL_NAME_KEY "name" #define PROFILE_MODEL_ICON_KEY "icon" #define PROFILE_MODEL_ENCODER_SELECTED_KEY "current_encoder" #define PROFILE_MODEL_PATTERN_KEY "pattern" #define PROFILE_MODEL_FAT32COMPATIBLE_KEY "fat32_compatible" #define PROFILE_MODEL_UNDERSCORE_KEY "underscore" #define PROFILE_MODEL_2DIGITSTRACKNUM_KEY "2_digits_tracknum" #define PROFILE_MODEL_SC_KEY "sc" #define PROFILE_MODEL_SC_SCALE_KEY "sc_scale" #define PROFILE_MODEL_SC_SIZE_KEY "sc_size" #define PROFILE_MODEL_SC_FORMAT_KEY "sc_format" #define PROFILE_MODEL_SC_NAME_KEY "sc_name" #define PROFILE_MODEL_PL_KEY "pl" #define PROFILE_MODEL_PL_FORMAT_KEY "pl_format" #define PROFILE_MODEL_PL_NAME_KEY "pl_name" #define PROFILE_MODEL_PL_ABS_FILE_PATH_KEY "pl_abs_file_path" #define PROFILE_MODEL_PL_UTF8_KEY "pl_utf8" #define PROFILE_MODEL_INF_KEY "inf" #define PROFILE_MODEL_INF_TEXT_KEY "inf_text" #define PROFILE_MODEL_INF_NAME_KEY "inf_name" #define PROFILE_MODEL_INF_SUFFIX_KEY "inf_suffix" #define PROFILE_MODEL_HL_KEY "hl" #define PROFILE_MODEL_HL_FORMAT_KEY "hl_format" #define PROFILE_MODEL_HL_NAME_KEY "hl_name" #define PROFILE_MODEL_CUE_KEY "cue" #define PROFILE_MODEL_CUE_NAME_KEY "cue_name" #define PROFILE_MODEL_SF_KEY "sf" #define PROFILE_MODEL_SF_NAME_KEY "sf_name" #define PROFILE_MODEL_COLUMN_ENCODER_LAME_PARAMETERS_KEY "lame_parameters" #define PROFILE_MODEL_COLUMN_ENCODER_OGGENC_PARAMETERS_KEY "oggenc_parameters" #define PROFILE_MODEL_COLUMN_ENCODER_FLAC_PARAMETERS_KEY "flac_parameters" #define PROFILE_MODEL_COLUMN_ENCODER_FAAC_PARAMETERS_KEY "faac_parameters" #define PROFILE_MODEL_COLUMN_ENCODER_WAVE_PARAMETERS_KEY "wave_parameters" #define PROFILE_MODEL_COLUMN_ENCODER_CUSTOM_PARAMETERS_KEY "custom_parameters" #define LABEL_MOBILE_QUALITY i18n(" (Mobile Quality)") #define LABEL_NORMAL_QUALITY i18n(" (Normal Quality)") #define LABEL_EXTREME_QUALITY i18n(" (Extreme Quality)") typedef QMap Profile; /** audex profile model **/ class ProfileModel : public QAbstractTableModel { Q_OBJECT public: explicit ProfileModel(QObject *parent = 0); - ~ProfileModel(); + ~ProfileModel() override; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); - bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); - bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()); + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; + bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; + bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; int currentProfileIndex() const; int currentProfileRow() const; int getRowByIndex(int profile_index) const; void clear(); bool nameExists(const QString &name) const; bool indexExists(int profile_index) const; int getNewIndex() const; void sortItems(); /**BEGIN: EncoderAssistant related */ void autoCreate(); // scans the system for encoders and create standard profiles EncoderAssistant::Encoder getSelectedEncoderFromCurrentIndex(); const Parameters getSelectedEncoderParametersFromCurrentIndex(); const QString getSelectedEncoderPatternFromCurrentIndex(); const QString getSelectedEncoderSuffixFromCurrentIndex(); const QString getSelectedEncoderNameAndVersion(); /**END: EncoderAssistant related */ Error lastError() const; public slots: void commit(); - void revert(); + void revert() override; int copy(const int profileRow); bool saveProfilesToFile(const QString &filename); bool loadProfilesFromFile(const QString &filename); void setCurrentProfileIndex(int profile_index); int setRowAsCurrentProfileIndex(int row); // returns profile index signals: void profilesRemovedOrInserted(); void currentProfileIndexChanged(int index); private: const Profile p_new_profile(); QList p_cache; int p_current_profile_index; Error p_error; void p_new_name(QString &name); void p_save(KConfig *config); void p_load(KConfig *config); }; #endif diff --git a/utils/cddadevices.h b/utils/cddadevices.h index 79b242a..1517d22 100644 --- a/utils/cddadevices.h +++ b/utils/cddadevices.h @@ -1,83 +1,83 @@ /* * AUDEX CDDA EXTRACTOR * * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . * */ #ifndef CDDADEVICES_H #define CDDADEVICES_H #include #include #include #include #include #include #include #include #include #include #include #include #include struct OpticalAudioDisc { QString name; Solid::Device device; }; class CDDADevices : public QObject { Q_OBJECT public: explicit CDDADevices(QObject *parent = 0); - ~CDDADevices(); + ~CDDADevices() override; const QString blockDevice(const QString &udi) const; const QStringList udiList() const; int discCount() const; public slots: void scanBus(); void eject(const QString &udi); // set display name void setName(const QString &udi, const QString &name); signals: void audioDiscDetected(const QString &udi); void audioDiscRemoved(const QString &udi); private slots: void p_solid_device_added(const QString &udi); void p_solid_device_removed(const QString &udi); private: QHash p_discs; bool p_is_optical_audio_disc(const Solid::Device &device) const; void p_clear(); }; #endif diff --git a/utils/cddaextractthread.h b/utils/cddaextractthread.h index b917ffd..132ab2c 100644 --- a/utils/cddaextractthread.h +++ b/utils/cddaextractthread.h @@ -1,126 +1,126 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef CDDAEXTRACTTHREAD_HEADER #define CDDAEXTRACTTHREAD_HEADER #include #include #include #include "cddaparanoia.h" class CDDAExtractThread : public QThread { Q_OBJECT public: CDDAExtractThread(QObject *parent, CDDAParanoia *_paranoia); - ~CDDAExtractThread(); + ~CDDAExtractThread() override; public slots: void start(); void cancel(); void setParanoiaMode(int mode) { paranoia_mode = mode; } void setMaxRetries(int r) { paranoia_retries = r; } void setNeverSkip(bool b) { never_skip = b; } void setSampleOffset(const int offset) { sample_offset = offset; } void setTrackToRip(unsigned int t) { track = t; } // if t==0 rip whole cd void skipTrack(unsigned int t) { overall_sectors_read += paranoia->numOfFramesOfTrack(t); } bool isProcessing(); const QStringList &protocol(); CDDAParanoia *cddaParanoia() { return paranoia; } private slots: void slot_error(const QString &message, const QString &details); signals: void output(const QByteArray &); void progress(const int percent, const int sector, const int sectorsOverall); void error(const QString &message, const QString &details = QString()); void warning(const QString &message); void info(const QString &message); protected: /** reimplemented from QThread. Does the work */ - void run(); + void run() override; private: CDDAParanoia *paranoia; long first_sector; long current_sector; long last_sector; unsigned long sectors_read; unsigned long overall_sectors_read; unsigned long sectors_all; int paranoia_mode; int paranoia_retries; bool never_skip; int sample_offset; bool sample_offset_done; unsigned int track; bool b_interrupt; bool b_error; QStringList extract_protocol; void createStatus(long, int); // status variables long last_read_sector; long overlap; long read_sectors; bool read_error; bool scratch_detected; // this friend function will call createStatus(long, int) friend void paranoiaCallback(long, int); }; #endif diff --git a/utils/cddaparanoia.h b/utils/cddaparanoia.h index 71f8475..121a8d0 100644 --- a/utils/cddaparanoia.h +++ b/utils/cddaparanoia.h @@ -1,120 +1,120 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef CDDAPARANOIA_HEADER #define CDDAPARANOIA_HEADER #include #include #include #include extern "C" { #include #include } // from cdda_interface.h #define CD_FRAMESIZE_RAW 2352 #define CDROM_FRAMESIZE_RAW 2048 #define PREGAP 150 // from cdda_paranoia.h #define PARANOIA_CB_READ 0 #define PARANOIA_CB_VERIFY 1 #define PARANOIA_CB_FIXUP_EDGE 2 #define PARANOIA_CB_FIXUP_ATOM 3 #define PARANOIA_CB_SCRATCH 4 #define PARANOIA_CB_REPAIR 5 #define PARANOIA_CB_SKIP 6 #define PARANOIA_CB_DRIFT 7 #define PARANOIA_CB_BACKOFF 8 #define PARANOIA_CB_OVERLAP 9 #define PARANOIA_CB_FIXUP_DROPPED 10 #define PARANOIA_CB_FIXUP_DUPED 11 #define PARANOIA_CB_READERR 12 class CDDAParanoia : public QObject { Q_OBJECT public: explicit CDDAParanoia(QObject *parent = 0); - ~CDDAParanoia(); + ~CDDAParanoia() override; bool setDevice(const QString &device = "/dev/cdrom"); QString device() const; void setParanoiaMode(int mode); /* default: 3 */ void setNeverSkip(bool b); void setMaxRetries(int m); /* default: 20 */ qint16 *paranoiaRead(void (*callback)(long, int)); int paranoiaSeek(long sector, int mode); int firstSectorOfTrack(int track); int lastSectorOfTrack(int track); int firstSectorOfDisc(); int lastSectorOfDisc(); void sampleOffset(const int offset); int numOfTracks(); int numOfAudioTracks(); int length(); int numOfFrames(); // whole disc int lengthOfAudioTracks(); // length of all audio tracks int numOfFramesOfAudioTracks(); /*sum skipped (because it is an audio track) frames usually used to calculate overall percent*/ int numOfSkippedFrames(int n = 100); int lengthOfTrack(int n); int numOfFramesOfTrack(int n); double sizeOfTrack(int n); // in MiB int frameOffsetOfTrack(int n); bool isAudioTrack(int n); // First element is first track after lead-in, list of offsets, last element offset of lead-out // PREGAP is 150 frames = 2 seconds QList discSignature(const qint32 pregap = PREGAP); void reset(); signals: void error(const QString &message, const QString &details = QString()); private: QMutex mutex; QString _device; cdrom_drive *paranoia_drive; cdrom_paranoia *paranoia; int paranoia_mode; bool paranoia_never_skip; int paranoia_max_retries; bool _paranoia_init(); void _paranoia_free(); }; #endif diff --git a/utils/coverfetcher.h b/utils/coverfetcher.h index e41a19e..d54cbee 100644 --- a/utils/coverfetcher.h +++ b/utils/coverfetcher.h @@ -1,98 +1,98 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef COVERFETCHER_HEADER #define COVERFETCHER_HEADER #include #include #include #include #include #include #include class CoverFetcher : public QObject { Q_OBJECT public: explicit CoverFetcher(QObject *parent = 0); - ~CoverFetcher(); + ~CoverFetcher() override; void startFetchThumbnails(const QString &searchstring, const int fetchNo = 8); void stopFetchThumbnails(); void startFetchCover(const int no); const QByteArray thumbnail(int index); const QString caption(int index); const QString tbnid(int index); inline int count() { return cover_names.count(); } enum Status { NOS, SEARCHING, FETCHING_THUMBNAIL, FETCHING_COVER }; inline Status status() const { return _status; } signals: void fetchedThumbnail(const QByteArray &thumbnail, const QString &caption, int no); void allCoverThumbnailsFetched(); void fetchedCover(const QByteArray &cover); void nothingFetched(); void statusChanged(CoverFetcher::Status status); void error(const QString &description, const QString &solution = QString()); void warning(const QString &description); void info(const QString &description); private slots: void fetched_html_data(KJob *job); void fetched_external_ip(KJob *job); private: int fetch_no; QStringList cover_urls_thumbnails; QStringList cover_urls; QStringList cover_names; QStringList cover_tbnids; QList cover_thumbnails; void clear() { cover_thumbnails.clear(); } KIO::TransferJob *job; Status _status; int f_i; QString external_ip; QString search_string; void parse_html_response(const QString &html); bool fetch_cover_thumbnail(); bool fetch_cover(const int no); }; #endif diff --git a/utils/cuesheetwriter.h b/utils/cuesheetwriter.h index 10ad342..4a0ea4e 100644 --- a/utils/cuesheetwriter.h +++ b/utils/cuesheetwriter.h @@ -1,49 +1,49 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef CUESHEETWRITER_H #define CUESHEETWRITER_H #include #include #include #include #include "../models/cddamodel.h" #include "config.h" #define FRAMES2SEC(frames) ((frames) / 75) class CueSheetWriter : public QObject { Q_OBJECT public: explicit CueSheetWriter(CDDAModel *model); - ~CueSheetWriter(); + ~CueSheetWriter() override; QStringList cueSheet(const QString &binFilename) const; QStringList cueSheet(const QStringList &filenames) const; private: CDDAModel *model; QString p_filetype(const QString &filename) const; }; #endif diff --git a/utils/encoderwrapper.h b/utils/encoderwrapper.h index a23fdb7..9891367 100644 --- a/utils/encoderwrapper.h +++ b/utils/encoderwrapper.h @@ -1,92 +1,92 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef ENCODERWRAPPER_HEADER #define ENCODERWRAPPER_HEADER #include #include #include #include #include "utils/cachedimage.h" #include "utils/patternparser.h" class EncoderWrapper : public QObject { Q_OBJECT public: explicit EncoderWrapper(QObject *parent = 0, const QString &commandPattern = "", const QString &encoderName = "", const bool deleteFractionFiles = true); - ~EncoderWrapper(); + ~EncoderWrapper() override; bool isProcessing(); const QStringList &protocol(); public slots: bool encode(int n, int cdno, int trackoffset, int nooftracks, const QString &artist, const QString &album, const QString &tartist, const QString &ttitle, const QString &genre, const QString &date, const QString &suffix, CachedImage *cover, bool fat_compatible, const QString &tmppath, const QString &input, const QString &output); void cancel(); private slots: void parseOutput(); void processFinished(int exitCode, QProcess::ExitStatus exitStatus); void processError(QProcess::ProcessError err); signals: void progress(int percent_of_track); void finished(); void error(const QString &message, const QString &details = QString()); void warning(const QString &message); void info(const QString &message); private: QString command_pattern; QString encoder_name; bool delete_fraction_files; QString encoder; QStringList _protocol; QString processing_filename; bool termination; int processing; KProcess proc; int not_found_counter; }; #endif diff --git a/utils/patternparser.h b/utils/patternparser.h index d36ad2f..47554c3 100644 --- a/utils/patternparser.h +++ b/utils/patternparser.h @@ -1,277 +1,277 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PATTERNPARSER_H #define PATTERNPARSER_H #include #include #include #include #include #include #include #include #include #include "config.h" #include "utils/cachedimage.h" #define IS_TRUE(val) (((val.toLower() == "true") || (val == "1") || (val.toLower() == "on")) ? true : false) #define VAR_FILENAME_PATTERN "filenamepattern" #define VAR_COMMAND_PATTERN "commandpattern" #define VAR_SIMPLE_PATTERN "simplepattern" #define VAR_TEXT_PATTERN "textpattern" #define VAR_ALBUM_ARTIST "artist" #define VAR_ALBUM_TITLE "title" #define VAR_TRACK_ARTIST "tartist" #define VAR_TRACK_TITLE "ttitle" #define VAR_TRACK_NO "trackno" #define VAR_CD_NO "cdno" #define VAR_DATE "date" #define VAR_GENRE "genre" #define VAR_SUFFIX "suffix" #define VAR_ENCODER "encoder" #define VAR_INPUT_FILE "i" #define VAR_OUTPUT_FILE "o" #define VAR_COVER_FILE "cover" #define VAR_DISCID "discid" #define VAR_CD_SIZE "size" #define VAR_CD_LENGTH "length" #define VAR_TODAY "today" #define VAR_NOW "now" #define VAR_LINEBREAK "br" #define VAR_AUDEX "audex" #define VAR_NO_OF_TRACKS "nooftracks" #define STANDARD_EMBED_COVER_FORMAT "jpg" class SaxHandler : public QXmlDefaultHandler { public: SaxHandler(); - ~SaxHandler(); + ~SaxHandler() override; - bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts); - bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName); - bool characters(const QString &ch); - bool fatalError(const QXmlParseException &exception); + bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts) override; + bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName) override; + bool characters(const QString &ch) override; + bool fatalError(const QXmlParseException &exception) override; void setInputFile(const QString &input) { this->input = input; } void setOutputFile(const QString &output) { this->output = output; } void setTrackNo(const int trackno) { this->trackno = trackno; } void setCDNo(const int cdno) { this->cdno = cdno; } void setTrackOffset(const int trackoffset) { this->trackoffset = trackoffset; } void setArtist(const QString &artist) { this->artist = artist; } void setTitle(const QString &title) { this->title = title; } void setTrackArtist(const QString &tartist) { this->tartist = tartist; } void setTrackTitle(const QString &ttitle) { this->ttitle = ttitle; } void setDate(const QString &date) { this->date = date; } void setGenre(const QString &genre) { this->genre = genre; } void setSuffix(const QString &suffix) { this->suffix = suffix; } void setCover(CachedImage *cover) { this->cover = cover; } void setFAT32Compatible(const bool fat32compatible) { this->fat32compatible = fat32compatible; } void setReplaceSpacesWithUnderscores(const bool replacespaceswithunderscores) { this->replacespaceswithunderscores = replacespaceswithunderscores; } void set2DigitsTrackNum(const bool _2digitstracknum) { this->_2digitstracknum = _2digitstracknum; } void setTMPPath(const QString &tmppath) { this->tmppath = tmppath; } void setDiscid(const quint32 discid) { this->discid = discid; } void setSize(const qreal size) { this->size = size; } void setLength(const int length) { this->length = length; } void setNoOfTracks(const int nooftracks) { this->nooftracks = nooftracks; } void setDemoMode(const bool demomode) { this->demomode = demomode; } void setEncoder(const QString &encoder) { this->encoder = encoder; } inline const QString text() const { return p_text; } private: QString pattern; QString input; QString output; int trackno; int cdno; int trackoffset; QString artist; QString title; QString tartist; QString ttitle; QString date; QString genre; QString suffix; CachedImage *cover; bool fat32compatible; bool replacespaceswithunderscores; bool _2digitstracknum; QString tmppath; quint32 discid; qreal size; int length; int nooftracks; QString encoder; bool demomode; /*TEMP*/ bool found_suffix; QString p_text; QString p_element; bool is_filename_pattern; bool is_command_pattern; bool is_simple_pattern; bool is_text_pattern; const QString make_compatible(const QString &string); const QString make_compatible_2(const QString &string); const QString make_fat32_compatible(const QString &string); const QString replace_spaces_with_underscores(const QString &string); const QString replace_char_list(const QXmlAttributes &atts, const QString &string); }; class PatternParser : public QObject { Q_OBJECT public: explicit PatternParser(QObject *parent = 0); - ~PatternParser(); + ~PatternParser() override; const QString parseFilenamePattern(const QString &pattern, int trackno, int cdno, int trackoffset, int nooftracks, const QString &artist, const QString &title, const QString &tartist, const QString &ttitle, const QString &date, const QString &genre, const QString &suffix, bool fat32compatible, bool replacespaceswithunderscores, bool _2digitstracknum); const QString parseCommandPattern(const QString &pattern, const QString &input, const QString &output, int trackno, int cdno, int trackoffset, int nooftracks, const QString &artist, const QString &title, const QString &tartist, const QString &ttitle, const QString &date, const QString &genre, const QString &suffix, CachedImage *cover, bool fat32compatible, const QString &tmppath, const QString &encoder, const bool demomode = false); const QString parseSimplePattern(const QString &pattern, int cdno, int nooftracks, const QString &artist, const QString &title, const QString &date, const QString &genre, const QString &suffix, bool fat32compatible); void parseInfoText(QStringList &text, const QString &artist, const QString &title, const QString &date, const QString &genre, const quint32 discid, const qreal size, const int length, const int nooftracks); signals: void error(const QString &message, const QString &details = QString()); private: const QString p_xmlize_pattern(const QString &pattern); }; #endif diff --git a/utils/tmpdir.h b/utils/tmpdir.h index d211216..fbc5386 100644 --- a/utils/tmpdir.h +++ b/utils/tmpdir.h @@ -1,62 +1,62 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef TMPDIR_H #define TMPDIR_H #include #include #include #include #include #include #include "utils/pid.h" class TmpDir : public QObject { Q_OBJECT public: explicit TmpDir(const QString &appName, const QString &sub = ""); - ~TmpDir(); + ~TmpDir() override; const QString tmpPath(); inline const QString tmpPathBase() const { return p_tmp_path_base; } inline bool error() const { return p_error; } quint64 freeSpace() const; private: QString p_tmp_path_base; // e.g. /var/tmp QString p_tmp_path_app; // e.g. /var/tmp/audex.1234 QString p_tmp_path; // e.g. /car/tmp/audex.1234/sub bool p_error; bool p_create_dir(const QString &dirName); bool p_remove_dir(const QString &dirName); }; #endif diff --git a/utils/upload.h b/utils/upload.h index 7374ca3..40d9f96 100644 --- a/utils/upload.h +++ b/utils/upload.h @@ -1,50 +1,50 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef UPLOAD_H #define UPLOAD_H #include #include #include #include #include #include #include #include class Upload : public QObject { Q_OBJECT public: explicit Upload(const QUrl &url, QObject *parent = 0); - ~Upload(); + ~Upload() override; void upload(const QString &targetpath, const QStringList &filelist); signals: void error(const QString &message, const QString &solution = QString()); void warning(const QString &message); void info(const QString &message); private: QUrl base_url; }; #endif diff --git a/utils/wavefilewriter.h b/utils/wavefilewriter.h index 2d51ab6..920b78e 100644 --- a/utils/wavefilewriter.h +++ b/utils/wavefilewriter.h @@ -1,78 +1,78 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef WAVEFILEWRITER_HEADER #define WAVEFILEWRITER_HEADER #include #include #include #include class WaveFileWriter : public QObject { Q_OBJECT public: WaveFileWriter(); - ~WaveFileWriter(); + ~WaveFileWriter() override; enum Endianess { BigEndian, LittleEndian }; /** * open a new wave file. * closes any opened file. */ bool open(const QString &filename); bool isOpen(); QString filename() const; void setEndianess(const Endianess e); Endianess endianess(); /** * closes the file. * Length of the wave file will be written into the header. * If no data has been written to the file except the header * it will be removed. */ void close(); public slots: /** * write 16bit samples to the file. */ void write(const QByteArray &data); signals: void error(const QString &errorstr); private: void p_write_empty_header(); void p_update_header(); Endianess p_endianess; QFile p_output_file; QDataStream p_output_stream; QString p_filename; long p_data_written; }; #endif diff --git a/widgets/cddaheaderwidget.h b/widgets/cddaheaderwidget.h index 3b127d6..a7c78d2 100644 --- a/widgets/cddaheaderwidget.h +++ b/widgets/cddaheaderwidget.h @@ -1,147 +1,147 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef CDDAHEADERWIDGET_H #define CDDAHEADERWIDGET_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "preferences.h" #include "dialogs/cddaheaderdatadialog.h" #include "dialogs/coverbrowserdialog.h" #include "dialogs/errordialog.h" #include "models/cddamodel.h" #include "utils/cachedimage.h" #include "utils/coverfetcher.h" #include "utils/tmpdir.h" // fixed point defines #define FP_BITS 10 #define FP_FACTOR (1 << FP_BITS) enum FadeStyle { NoFade, FadeDown, FadeRight, FadeUp, FadeLeft }; enum MirrorStyle { NoMirror, MirrorOverX, MirrorOverY }; class CDDAHeaderWidget : public QWidget { Q_OBJECT public: explicit CDDAHeaderWidget(CDDAModel *cddaModel, QWidget *parent = 0, const int coverSize = 128, const int padding = 20); - ~CDDAHeaderWidget(); - QSize sizeHint() const; + ~CDDAHeaderWidget() override; + QSize sizeHint() const override; void setCover(CachedImage *cover); bool isEnabled() const; public slots: void setEnabled(bool enabled); void googleAuto(); signals: void headerDataChanged(); void coverUp(); void coverDown(); protected: - void paintEvent(QPaintEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); + void paintEvent(QPaintEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; void fetchCoverFinished(bool showDialog); private slots: void update(); void trigger_repaint(); void cover_is_down(); void google(); void load(); void save(); void view_cover(); void remove(); void edit_data(); void wikipedia(); void set_cover(const QByteArray &cover); void fetch_first_cover(); void fetch_cover_failed(); void auto_fetch_cover_failed(); void context_menu(const QPoint &point); private: CDDAModel *cdda_model; KActionCollection *action_collection; int cover_size; int padding; quint16 i_cover_checksum; QImage i_cover; QImage i_cover_holding; QTimer timer; bool animation_up; bool animation_down; qreal scale_factor; bool scale_up; bool scale_down; qreal opacity_factor; bool fade_in; bool fade_out; QRect cover_rect; bool cursor_on_cover; QRect link1_rect; bool cursor_on_link1; QRect link2_rect; bool cursor_on_link2; void setup_actions(); bool enabled; bool fetching_cover_in_progress; CoverBrowserDialog *cover_browser_dialog; TmpDir *tmp_dir; }; #endif diff --git a/widgets/customwidget.h b/widgets/customwidget.h index 91696c6..df7adc6 100644 --- a/widgets/customwidget.h +++ b/widgets/customwidget.h @@ -1,71 +1,71 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef CUSTOMWIDGET_H #define CUSTOMWIDGET_H #include #include #include "utils/encoderassistant.h" #include "utils/error.h" #include "utils/parameters.h" #include "dialogs/commandwizarddialog.h" #include "ui_customwidgetUI.h" class customWidgetUI : public QWidget, public Ui::CustomWidgetUI { public: explicit customWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class customWidget : public customWidgetUI { Q_OBJECT public: explicit customWidget(Parameters *parameters, QWidget *parent = 0); - ~customWidget(); + ~customWidget() override; Error lastError() const { return error; } inline bool isChanged() const { return changed; } public slots: bool save(); void pattern_wizard(); signals: void triggerChanged(); private slots: void trigger_changed(); private: Parameters *parameters; Error error; bool changed; }; #endif diff --git a/widgets/devicewidget.h b/widgets/devicewidget.h index f466cf5..98ba6cf 100644 --- a/widgets/devicewidget.h +++ b/widgets/devicewidget.h @@ -1,48 +1,48 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef DEVICEWIDGET_H #define DEVICEWIDGET_H #include #include #include "preferences.h" #include "ui_devicewidgetUI.h" class deviceWidgetUI : public QWidget, public Ui::DeviceWidgetUI { public: explicit deviceWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class deviceWidget : public deviceWidgetUI { Q_OBJECT public: explicit deviceWidget(QWidget *parent = 0); - ~deviceWidget(); + ~deviceWidget() override; }; #endif diff --git a/widgets/faacwidget.h b/widgets/faacwidget.h index 7f63ee1..a4175cd 100644 --- a/widgets/faacwidget.h +++ b/widgets/faacwidget.h @@ -1,70 +1,70 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef FAACWIDGET_H #define FAACWIDGET_H #include #include #include "utils/encoderassistant.h" #include "utils/error.h" #include "utils/parameters.h" #include "ui_faacwidgetUI.h" class faacWidgetUI : public QWidget, public Ui::FAACWidgetUI { public: explicit faacWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class faacWidget : public faacWidgetUI { Q_OBJECT public: explicit faacWidget(Parameters *parameters, QWidget *parent = 0); - ~faacWidget(); + ~faacWidget() override; Error lastError() const { return error; } inline bool isChanged() const { return changed; } public slots: bool save(); signals: void triggerChanged(); private slots: void quality_changed_by_slider(int quality); void quality_changed_by_spinbox(int quality); void trigger_changed(); private: Parameters *parameters; Error error; bool changed; }; #endif diff --git a/widgets/flacwidget.h b/widgets/flacwidget.h index fadf936..3823005 100644 --- a/widgets/flacwidget.h +++ b/widgets/flacwidget.h @@ -1,70 +1,70 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef FLACWIDGET_H #define FLACWIDGET_H #include #include #include "utils/encoderassistant.h" #include "utils/error.h" #include "utils/parameters.h" #include "ui_flacwidgetUI.h" class flacWidgetUI : public QWidget, public Ui::FLACWidgetUI { public: explicit flacWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class flacWidget : public flacWidgetUI { Q_OBJECT public: explicit flacWidget(Parameters *parameters, QWidget *parent = 0); - ~flacWidget(); + ~flacWidget() override; inline Error lastError() const { return error; } inline bool isChanged() const { return changed; } public slots: bool save(); signals: void triggerChanged(); private slots: void compression_changed_by_slider(int compression); void compression_changed_by_spinbox(int compression); void trigger_changed(); private: Parameters *parameters; Error error; bool changed; }; #endif diff --git a/widgets/generalsettingswidget.h b/widgets/generalsettingswidget.h index 55b9a41..b830892 100644 --- a/widgets/generalsettingswidget.h +++ b/widgets/generalsettingswidget.h @@ -1,48 +1,48 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef GENERALSETTINGSWIDGET_H #define GENERALSETTINGSWIDGET_H #include #include #include "preferences.h" #include "ui_generalsettingswidgetUI.h" class generalSettingsWidgetUI : public QWidget, public Ui::GeneralSettingsWidgetUI { public: explicit generalSettingsWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class generalSettingsWidget : public generalSettingsWidgetUI { Q_OBJECT public: explicit generalSettingsWidget(QWidget *parent = 0); - ~generalSettingsWidget(); + ~generalSettingsWidget() override; }; #endif diff --git a/widgets/lamewidget.h b/widgets/lamewidget.h index 9354843..29b74d8 100644 --- a/widgets/lamewidget.h +++ b/widgets/lamewidget.h @@ -1,80 +1,80 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef LAMEWIDGET_H #define LAMEWIDGET_H #include #include #include "utils/encoderassistant.h" #include "utils/error.h" #include "utils/parameters.h" #include "ui_lamewidgetUI.h" class lameWidgetUI : public QWidget, public Ui::LAMEWidgetUI { public: explicit lameWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class lameWidget : public lameWidgetUI { Q_OBJECT public: explicit lameWidget(Parameters *parameters, QWidget *parent = 0); - ~lameWidget(); + ~lameWidget() override; inline Error lastError() const { return error; } inline bool isChanged() const { return changed; } signals: void triggerChanged(); public slots: bool save(); private slots: void enable_medium(bool enable); void enable_standard(bool enable); void enable_extreme(bool enable); void enable_insane(bool enable); void enable_custom(bool enable); void enable_CBR(bool enable); void bitrate_changed_by_slider(int bitrate); void bitrate_changed_by_spinbox(int bitrate); void trigger_changed(); private: Parameters *parameters; Error error; bool changed; bool p_cbr_flag; QList bitrates; int real_bitrate; int preset; }; #endif diff --git a/widgets/oggencwidget.h b/widgets/oggencwidget.h index 2e53b3b..464dc00 100644 --- a/widgets/oggencwidget.h +++ b/widgets/oggencwidget.h @@ -1,75 +1,75 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef OGGENCWIDGET_H #define OGGENCWIDGET_H #include #include #include "utils/encoderassistant.h" #include "utils/error.h" #include "utils/parameters.h" #include "ui_oggencwidgetUI.h" class oggencWidgetUI : public QWidget, public Ui::OggEncWidgetUI { public: explicit oggencWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class oggencWidget : public oggencWidgetUI { Q_OBJECT public: explicit oggencWidget(Parameters *parameters, QWidget *parent = 0); - ~oggencWidget(); + ~oggencWidget() override; inline Error lastError() const { return error; } inline bool isChanged() const { return changed; } public slots: bool save(); signals: void triggerChanged(); private slots: void quality_changed_by_slider(int quality); void quality_changed_by_spinbox(double quality); void set_bitrate(float quality); void enable_min_bitrate(bool enable); void set_minbitrate(int bitrate); void enable_max_bitrate(bool enable); void set_maxbitrate(int bitrate); void trigger_changed(); private: Parameters *parameters; Error error; bool changed; }; #endif diff --git a/widgets/profilewidget.h b/widgets/profilewidget.h index 2495d8e..6a883fd 100644 --- a/widgets/profilewidget.h +++ b/widgets/profilewidget.h @@ -1,63 +1,63 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef PROFILEWIDGET_H #define PROFILEWIDGET_H #include #include #include #include "dialogs/profiledatadialog.h" #include "models/profilemodel.h" #include "ui_profilewidgetUI.h" class profileWidgetUI : public QWidget, public Ui::ProfileWidgetUI { public: explicit profileWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class profileWidget : public profileWidgetUI { Q_OBJECT public: explicit profileWidget(ProfileModel *profileModel, QWidget *parent = 0); - ~profileWidget(); + ~profileWidget() override; private slots: void _update(); void add_profile(); void rem_profile(); void mod_profile(const QModelIndex &index); void mod_profile(); void copy_profile(); void save_profiles(); void load_profiles(); void init_profiles(); private: ProfileModel *profile_model; }; #endif diff --git a/widgets/remoteserversettingswidget.h b/widgets/remoteserversettingswidget.h index 558c729..e9b694a 100644 --- a/widgets/remoteserversettingswidget.h +++ b/widgets/remoteserversettingswidget.h @@ -1,47 +1,47 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef REMOTESERVERSETTINGSWIDGET_H #define REMOTESERVERSETTINGSWIDGET_H #include #include #include "ui_remoteserversettingswidgetUI.h" class remoteServerSettingsWidgetUI : public QWidget, public Ui::RemoteServerSettingsWidgetUI { public: explicit remoteServerSettingsWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class remoteServerSettingsWidget : public remoteServerSettingsWidgetUI { Q_OBJECT public: explicit remoteServerSettingsWidget(QWidget *parent = 0); - ~remoteServerSettingsWidget(); + ~remoteServerSettingsWidget() override; private slots: void toggle_upload(bool enabled); }; #endif diff --git a/widgets/wavewidget.h b/widgets/wavewidget.h index f3b7928..ec8001f 100644 --- a/widgets/wavewidget.h +++ b/widgets/wavewidget.h @@ -1,68 +1,68 @@ /* AUDEX CDDA EXTRACTOR * Copyright (C) 2007-2015 Marco Nelles (audex@maniatek.com) * * * 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 3 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, see . */ #ifndef WAVEWIDGET_H #define WAVEWIDGET_H #include #include #include "utils/encoderassistant.h" #include "utils/error.h" #include "utils/parameters.h" #include "ui_wavewidgetUI.h" class waveWidgetUI : public QWidget, public Ui::WAVEWidgetUI { public: explicit waveWidgetUI(QWidget *parent) : QWidget(parent) { setupUi(this); } }; class waveWidget : public waveWidgetUI { Q_OBJECT public: explicit waveWidget(Parameters *parameters, QWidget *parent = 0); - ~waveWidget(); + ~waveWidget() override; Error lastError() const { return error; } inline bool isChanged() const { return changed; } public slots: bool save(); signals: void triggerChanged(); private slots: void trigger_changed(); private: Parameters *parameters; Error error; bool changed; }; #endif