File indexing completed on 2024-05-12 16:20:56
0001 /*************************************************************************** 0002 * Copyright (C) 2008-2009 Jeff Mitchell <mitchell@kde.org> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify * 0005 * it under the terms of the GNU General Public License as published by * 0006 * the Free Software Foundation; either version 2 of the License, or * 0007 * (at your option) any later version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, * 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0012 * GNU General Public License for more details. * 0013 * * 0014 * You should have received a copy of the GNU General Public License * 0015 * along with this program; if not, write to the * 0016 * Free Software Foundation, Inc., * 0017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 0018 ***************************************************************************/ 0019 0020 #ifndef AFTTAGGER_H 0021 #define AFTTAGGER_H 0022 0023 #include <flacfile.h> 0024 #include <mp4file.h> 0025 #include <mpegfile.h> 0026 #include <mpcfile.h> 0027 #include <oggfile.h> 0028 #include <tfile.h> 0029 #include <xiphcomment.h> 0030 0031 #include <QCoreApplication> 0032 #include <QStringList> 0033 #include <QElapsedTimer> 0034 #include <QTextStream> 0035 0036 /** 0037 * @class AFTTagger 0038 * @short Inserts AFT tags into directories and files 0039 */ 0040 0041 class AFTTagger : public QCoreApplication 0042 { 0043 0044 public: 0045 AFTTagger( int &argc, char **argv ); 0046 0047 ~AFTTagger() override {} 0048 0049 void processPath( const QString &path ); 0050 bool handleMPEG( TagLib::MPEG::File *file ); 0051 bool handleMPC( TagLib::MPC::File *file ); 0052 bool handleMP4( TagLib::MP4::File *file ); 0053 bool handleOgg( TagLib::Ogg::File *file ); 0054 bool handleFLAC( TagLib::FLAC::File *file ); 0055 bool handleXiphComment( TagLib::Ogg::XiphComment *comment, TagLib::File *file ); 0056 QString createCurrentUID( TagLib::File *file ); 0057 QString createV1UID( TagLib::File *file ); 0058 QString upgradeUID( int version, const QString &currValue ); 0059 void readArgs(); 0060 void displayHelp(); 0061 0062 bool m_delete; 0063 bool m_newid; 0064 bool m_quiet; 0065 bool m_recurse; 0066 bool m_verbose; 0067 QStringList m_fileFolderList; 0068 QElapsedTimer m_time; 0069 QTextStream m_textStream; 0070 0071 }; 0072 0073 0074 #endif // AFTTAGGER_H 0075