-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEinzelbeitrag.h
158 lines (94 loc) · 3.42 KB
/
Einzelbeitrag.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#ifndef EINZELBEITRAG_H
#define EINZELBEITRAG_H
#include <QWidget>
class LsFileList;
class lsGlobalSettings;
class lsKeyAndFilterListEditor;
class lsMp3Converter;
class MainWindow;
class QLabel;
#include <QDate>
#include <QFileInfo>
#include <QPointer>
#include <QtSql>
namespace Ui {
class Einzelbeitrag;
}
class Einzelbeitrag : public QWidget
{
Q_OBJECT
enum eState
{
eStateReady,
eStateName,
eStateNonExit
};
public:
explicit Einzelbeitrag(MainWindow* parentWindow, QWidget *parent = 0);
explicit Einzelbeitrag( const QSqlRecord& record, const QString& subPath, lsGlobalSettings* settings, LsFileList* fileList, MainWindow* parentWindow, QWidget* parent = NULL);
Einzelbeitrag( const QString& fileName, int title, lsKeyAndFilterListEditor* names, lsKeyAndFilterListEditor* types, lsKeyAndFilterListEditor* bible, const QString& subPath, lsGlobalSettings* settings, LsFileList* fileList, MainWindow* parentWindow, QWidget* parent );
~Einzelbeitrag();
QString art() const;
QString bibelstelle() const;
const QDate& getDate() const { return this->date; }
QDate detDate() const;
QString detFullPath( const QString& basePath );
QString fileName() const;
void fillWithRecord(const QSqlRecord &record);
QString findBestMatch( const QString& fileName, const QStringList& list, QLineEdit* lineEdit );
QString getBeitragsart() const;
const QString& getSubPath() const { return this->subPath; }
QString name() const;
QString newFileName() const;
void reReadNames( bool isReadFromServer );
void reReadWords( bool isReadFromServer );
void setAutoCompleteDatabase( QSqlDatabase db );
void setFileName( const QFileInfo& file );
void setTitleNr( int newNumber );
QString text() const;
int titelNr() const;
void reRead();
void setId3Tag();
void setFileList( LsFileList* newFileList ) { this->fileList = newFileList; }
bool insertId3Tag( const QString& path, const QHash<int, QString>& names );
static void correctForbiddenChars( QString& toCorrect );
static QString correctForbiddenChars(const QString& rawFileName);
public slots:
void slotMp3Progress( int percent );
void slotMp3ConvertFinished( lsMp3Converter* converter );
signals:
void signalConvertToMp3( Einzelbeitrag* );
void signalRemoveThis( Einzelbeitrag* );
void signalRename( Einzelbeitrag* );
void signalAddNextTo( Einzelbeitrag* );
void signalPlay( QString fileName );
private slots:
void slotUpdateStates();
void on_toolButtonRemoveThis_clicked();
void on_toolButtonAnnNext_clicked();
void on_toolButtonStartPlay_clicked();
void on_toolButtonMp3_clicked();
void on_toolButtonRename_clicked();
void on_toolButtonReread_clicked();
void on_toolButtonSetId3Tag_clicked();
private:
QString intUpdateState(eState& curState, QLabel* label, QHash<int,QString> files, int titleNr, QString rightFileName , const QString& path);
void intUpdateState(QLabel* label, eState& curState, const QString& path, eState nonExistState, const QString& extension);
void log( const QString& logText );
private:
Ui::Einzelbeitrag *ui;
QPointer<lsKeyAndFilterListEditor> names;
QPointer<lsKeyAndFilterListEditor> types;
QPointer<lsKeyAndFilterListEditor> bible;
eState stateCapture;
eState stateLocal;
eState stateServer;
QDate date;
QString subPath;
lsGlobalSettings* globalSettings;
LsFileList* fileList;
MainWindow* parentWindow;
QTimer* timerUpdate;
QElapsedTimer id3Time;
};
#endif // EINZELBEITRAG_H