-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdictentry.cpp
43 lines (39 loc) · 1.36 KB
/
dictentry.cpp
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
#include "dictentry.h"
#include "utils.h"
#include <QFile>
#include <QFileInfo>
#include <QDebug>
#include <QTime>
DictEntry::DictEntry(QObject *parent,
QString _word,
QString _transcription,
QString _translation,
QString _soundFilename,
QString _soundDescription,
QString _praatFilenameMarkup,
QString _praatFilenameSound,
QString _praatDescription) :
QObject(parent),
word(_word),
transcription(_transcription),
translation(_translation),
soundFilename(_soundFilename),
soundDescription(_soundDescription),
praatFilenameMarkup(_praatFilenameMarkup),
praatFilenameSound(_praatFilenameSound),
praatDescription(_praatDescription)
{
// here we need to read files and compress them to push them into blobs
QFileInfo soundFileInfo(soundFilename);
QFileInfo praatMarkupFileInfo(praatFilenameMarkup);
QFileInfo praatSoundFileInfo(praatFilenameSound);
if (soundFileInfo.exists()) {
readAndCompress(soundFilename, soundCompressed);
qDebug() << soundCompressed.size();
}
if (praatMarkupFileInfo.exists() && praatSoundFileInfo.exists()) {
readAndCompress(praatFilenameMarkup, praatMarkupCompressed);
readAndCompress(praatFilenameSound, praatSoundCompressed);
}
return;
}