-
Notifications
You must be signed in to change notification settings - Fork 6
/
ZXTapeReviver.pro
133 lines (113 loc) · 5.27 KB
/
ZXTapeReviver.pro
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
#*******************************************************************************
# ZX Tape Reviver
#-----------------
#
# Author: Leonid Golouz
# E-mail: [email protected]
# YouTube channel: https://www.youtube.com/channel/UCz_ktTqWVekT0P4zVW8Xgcg
# YouTube channel e-mail: [email protected]
#
# Code modification and distribution of any kind is not allowed without direct
# permission of the Author.
#*******************************************************************************
QT += quick gui quickcontrols2 multimedia
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
CONFIG += c++17
#Dynamically generate translation names and country codes based on AVAILABLE_TRANSLATIONS variable
AVAILABLE_TRANSLATIONS = English:en_US Russian:ru_RU
TRANSLATION_FILENAME = zxtapereviver_
TRANSLATIONS_PATH = ./qml/translations/
for (T, AVAILABLE_TRANSLATIONS) {
S = $$split(T, ":")
TRANSLATION_LANGUAGE = $$take_first(S)
COUNTRY_CODE = $$take_last(S)
TRANSLATION_ID = ID_$${TRANSLATION_LANGUAGE}_LANGUAGE
TRANSLATION_ID_UPPER = $$upper($${TRANSLATION_ID})
TRANSLATION_ID_LOWER = $$lower($${TRANSLATION_ID})
TRANSLATION_ID_HEADER = "extern const char* $${TRANSLATION_ID_UPPER};"
TRANSLATION_ID_CODE = "const char* $${TRANSLATION_ID_UPPER}=QT_TRID_NOOP(\"$${TRANSLATION_ID_LOWER}\");"
isEmpty(DEFINED_TRANSLATIONS) {
COUNTRY_CODES = $${COUNTRY_CODE}
DEFINED_TRANSLATIONS = $${T}
}
else {
COUNTRY_CODES = $${COUNTRY_CODES},$${COUNTRY_CODE}
DEFINED_TRANSLATIONS = $${DEFINED_TRANSLATIONS};$${T}
}
TRANSLATION_IDS_HEADER = $${TRANSLATION_IDS_HEADER} $${TRANSLATION_ID_HEADER}
TRANSLATION_IDS_CODE = $${TRANSLATION_IDS_CODE} $${TRANSLATION_ID_CODE}
system($$[QT_INSTALL_BINS]/lrelease -idbased $${TRANSLATIONS_PATH}/$${TRANSLATION_FILENAME}$${COUNTRY_CODE}.xlf -qm $${TRANSLATIONS_PATH}/$${TRANSLATION_FILENAME}$${COUNTRY_CODE}.qm)
}
DEFINES += AVAILABLE_TRANSLATIONS=\"\\\"$${DEFINED_TRANSLATIONS}\\\"\" \
COUNTRY_CODES=$${COUNTRY_CODES}
TRANSLATIONS_GENERATED_FILENAME = $${PWD}/generated/translations_generated
TRANSLATIONS_GENERATED_FILENAME_H = $${TRANSLATIONS_GENERATED_FILENAME}.h
TRANSLATIONS_GENERATED_FILENAME_CPP = $${TRANSLATIONS_GENERATED_FILENAME}.cpp
write_file($${TRANSLATIONS_GENERATED_FILENAME_H}, TRANSLATION_IDS_HEADER)
write_file($${TRANSLATIONS_GENERATED_FILENAME_CPP}, TRANSLATION_IDS_CODE)
contains(QMAKE_HOST.os, Windows) {
GIT_CMD = \"$$system(where git)\"
}
else {
GIT_CMD = $$system(which git)
}
ZXTAPEREVIVER_VERSION = $$system($${GIT_CMD} --git-dir $${PWD}/.git --work-tree $${PWD} describe --always --tags)
DEFINES += TRANSLATION_IDS_HEADER="\\\"$${TRANSLATIONS_GENERATED_FILENAME_H}\\\"" \
TRANSLATION_IDS_CODE="\\\"$${TRANSLATIONS_GENERATED_FILENAME_CPP}\\\"" \
ZXTAPEREVIVER_VERSION=\\\"$${ZXTAPEREVIVER_VERSION}\\\"
SOURCES += \
sources/actions/actionbase.cpp \
sources/actions/editsampleaction.cpp \
sources/actions/shiftwaveformaction.cpp \
sources/core/parseddata.cpp \
sources/main.cpp \
sources/models/actionsmodel.cpp \
sources/models/dataplayermodel.cpp \
sources/models/fileworkermodel.cpp \
sources/controls/waveformcontrol.cpp \
sources/core/waveformparser.cpp \
sources/core/wavreader.cpp \
sources/models/parsersettingsmodel.cpp \
sources/models/suspiciouspointsmodel.cpp \
sources/models/waveformmodel.cpp \
sources/translations/translationmanager.cpp \
sources/translations/translations.cpp \
sources/util/enummetainfo.cpp \
sources/configuration/configurationmanager.cpp
HEADERS += \
sources/actions/actionbase.h \
sources/actions/editsampleaction.h \
sources/actions/shiftwaveformaction.h \
sources/core/parseddata.h \
sources/defines.h \
sources/models/actionsmodel.h \
sources/models/dataplayermodel.h \
sources/models/fileworkermodel.h \
sources/controls/waveformcontrol.h \
sources/core/waveformparser.h \
sources/core/wavreader.h \
sources/models/parsersettingsmodel.h \
sources/models/suspiciouspointsmodel.h \
sources/models/waveformmodel.h \
sources/translations/translationmanager.h \
sources/translations/translations.h \
sources/util/enummetainfo.h \
sources/configuration/configurationmanager.h
RESOURCES += qml/qml.qrc
RC_ICONS = icon.ico
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target