1 /***************************************************************************** 2 ** QNapi 3 ** Copyright (C) 2008-2017 Piotr Krzemiński <pio.krzeminski@gmail.com> 4 ** 5 ** This program is free software; you can redistribute it and/or modify 6 ** it under the terms of the GNU General Public License as published by 7 ** the Free Software Foundation; either version 2 of the License, or 8 ** (at your option) any later version. 9 ** 10 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12 ** 13 *****************************************************************************/ 14 15 #ifndef SUBTITLEINFO_H 16 #define SUBTITLEINFO_H 17 18 #include <QMetaType> 19 #include <QUuid> 20 21 // Orientacyjne okreslenie czy napisy na pewno pasuja lub nie do naszego filmu 22 enum SubtitleResolution { 23 // brak napisów 24 SUBTITLE_NONE, 25 // podejrzenie, ze napisy nie pasuja 26 // (np. zostaly oznaczone jako nieprawidlowe) 27 SUBTITLE_BAD, 28 // nie wiadomo (lub nie jestesmy pewni) 29 SUBTITLE_UNKNOWN, 30 // napisy prawdopodobnie pasuja (np. nazwa pliku czy releasu sie zgadza) 31 SUBTITLE_GOOD 32 }; 33 34 // struktura opisujaca napisy 35 class SubtitleInfo { 36 public: 37 SubtitleInfo(QString _lang = "", QString _engine = "", 38 QString _sourceLocation = "", QString _name = "", 39 QString _comment = "", QString _format = "", 40 SubtitleResolution _resolution = SUBTITLE_UNKNOWN) 41 : lang(_lang.toLower()), 42 engine(_engine), 43 sourceLocation(_sourceLocation), 44 name(_name), 45 comment(_comment), 46 format(_format), 47 resolution(_resolution), 48 id(QUuid::createUuid()) {} 49 50 QString lang; 51 QString engine; 52 QString sourceLocation; 53 QString name; 54 QString comment; 55 QString format; 56 SubtitleResolution resolution; 57 QUuid id; 58 59 bool operator<(const SubtitleInfo &other) const; 60 61 static SubtitleInfo fromFailed(const QString &name); 62 }; 63 64 Q_DECLARE_METATYPE(SubtitleInfo); 65 66 typedef QList<SubtitleInfo> SubtitleInfoList; 67 68 Q_DECLARE_METATYPE(SubtitleInfoList); 69 70 #endif 71