-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
OpenSoundMeter.pro
582 lines (517 loc) · 17.3 KB
/
OpenSoundMeter.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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
TEMPLATE = app
QT += qml quick quickcontrols2 core
CONFIG += c++1z
CONFIG += sdk_no_version_check
CONFIG += qmltypes
QML_IMPORT_NAME = OpenSoundMeterModule
QML_IMPORT_MAJOR_VERSION = 1
SOURCES += src/main.cpp \
src/audio/client.cpp \
src/audio/deviceinfo.cpp \
src/audio/devicemodel.cpp \
src/audio/format.cpp \
src/audio/plugin.cpp \
src/audio/stream.cpp \
src/chart/crestfactorplot.cpp \
src/chart/cursorhelper.cpp \
src/chart/frequencybasedplot.cpp \
src/chart/frequencybasedserieshelper.cpp \
src/chart/groupdelayplot.cpp \
src/chart/levelobject.cpp \
src/chart/levelplot.cpp \
src/chart/meterplot.cpp \
src/chart/nyquistplot.cpp \
src/chart/palette.cpp \
src/chart/phasedelayplot.cpp \
src/chart/seriesesitem.cpp \
src/chart/spectrogramplot.cpp \
src/chart/stepplot.cpp \
src/chart/coherenceplot.cpp \
src/common/autosaver.cpp \
src/common/recentfilesmodel.cpp \
src/common/wavfile.cpp \
src/common/workingfolder.cpp \
src/filesystem/dialog.cpp \
src/filesystem/dialogPlugin.cpp \
src/filesystem/plugins/widgetdialogplugin.cpp \
src/filtersource.cpp \
src/generator/brownnoise.cpp \
src/generator/burstnoise.cpp \
src/generator/channelmodel.cpp \
src/generator/mlsplus.cpp \
src/generator/musicnoise.cpp \
src/generator/sinburst.cpp \
src/generator/wav.cpp \
src/inputdevice.cpp \
src/common/appearance.cpp \
src/common/logger.cpp \
src/generator/mnoise.cpp \
src/common/notifier.cpp \
src/common/profiler.cpp \
src/math/bandpass.cpp \
src/math/biquad.cpp \
src/math/equalloudnesscontour.cpp \
src/math/integration_tree.cpp \
src/math/leq.cpp \
src/math/notch.cpp \
src/math/weighting.cpp \
src/meta/metabase.cpp \
src/meta/metafilter.cpp \
src/meta/metameasurement.cpp \
src/meta/metastored.cpp \
src/meta/metawindowing.cpp \
src/metertablemodel.cpp \
src/remote/generatorremote.cpp \
src/remote/item.cpp \
src/remote/items/groupitem.cpp \
src/remote/items/measurementitem.cpp \
src/remote/items/storeditem.cpp \
src/remote/network.cpp \
src/remote/remoteclient.cpp \
src/remote/server.cpp \
src/remote/tcpreciever.cpp \
src/source/group.cpp \
src/source/source_abstract.cpp \
src/source/source_shared.cpp \
src/source/sourcewindowing.cpp \
src/sourcelist.cpp \
src/sourcemodel.cpp \
src/standardline.cpp \
src/targettrace.cpp \
src/union.cpp \
src/generator/generator.cpp \
src/generator/generatorthread.cpp \
src/generator/pinknoise.cpp \
src/generator/outputdevice.cpp \
src/generator/whitenoise.cpp \
src/generator/sinnoise.cpp \
src/generator/sinsweep.cpp \
src/stored.cpp \
src/chart/axis.cpp \
src/chart/painteditem.cpp \
src/measurement.cpp \
src/common/settings.cpp \
src/chart/variablechart.cpp \
src/chart/plot.cpp \
src/chart/rtaplot.cpp \
src/chart/impulseplot.cpp \
src/chart/phaseplot.cpp \
src/chart/magnitudeplot.cpp \
src/chart/xyplot.cpp \
src/math/meter.cpp \
src/math/coherence.cpp \
src/math/averaging.cpp \
src/math/complex.cpp \
src/math/fouriertransform.cpp \
src/math/windowfunction.cpp \
src/math/deconvolution.cpp \
RESOURCES += qml.qrc \
audio/noises.qrc \
fonts/fonts.qrc \
images.qrc \
shaders/shaders.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = qml
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use 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
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
INCLUDEPATH += \
src \
src/meta \
src/chart \
src/common \
src/remote \
src/generator \
src/source
HEADERS += \
src/audio/client.h \
src/audio/deviceinfo.h \
src/audio/devicemodel.h \
src/audio/format.h \
src/audio/plugin.h \
src/audio/stream.h \
src/chart/crestfactorplot.h \
src/chart/cursorhelper.h \
src/chart/frequencybasedplot.h \
src/chart/frequencybasedserieshelper.h \
src/chart/groupdelayplot.h \
src/chart/levelobject.h \
src/chart/levelplot.h \
src/chart/meterplot.h \
src/chart/nyquistplot.h \
src/chart/palette.h \
src/chart/phasedelayplot.h \
src/chart/plotpadding.h \
src/chart/seriesesitem.h \
src/chart/seriesitem.h \
src/chart/spectrogramplot.h \
src/chart/stepplot.h \
src/chart/coherenceplot.h \
src/common/atomic.h \
src/common/autosaver.h \
src/common/recentfilesmodel.h \
src/common/wavfile.h \
src/common/workingfolder.h \
src/filesystem/dialog.h \
src/filesystem/dialogPlugin.h \
src/filesystem/plugins/widgetdialogplugin.h \
src/filtersource.h \
src/generator/brownnoise.h \
src/generator/burstnoise.h \
src/generator/channelmodel.h \
src/generator/mlsplus.h \
src/generator/musicnoise.h \
src/generator/sinburst.h \
src/generator/wav.h \
src/inputdevice.h \
src/common/appearance.h \
src/common/logger.h \
src/generator/mnoise.h \
src/common/notifier.h \
src/common/profiler.h \
src/math/bandpass.h \
src/math/bessellpf.h \
src/math/biquad.h \
src/math/equalloudnesscontour.h \
src/math/filter.h \
src/math/integration_tree.h \
src/math/leq.h \
src/math/notch.h \
src/math/weighting.h \
src/meta/metabase.h \
src/meta/metafilter.h \
src/meta/metagroup.h \
src/meta/metameasurement.h \
src/meta/metastored.h \
src/meta/metawindowing.h \
src/metertablemodel.h \
src/remote/generatorremote.h \
src/remote/item.h \
src/remote/items/groupitem.h \
src/remote/items/measurementitem.h \
src/remote/items/storeditem.h \
src/remote/network.h \
src/remote/remoteclient.h \
src/remote/server.h \
src/remote/tcpreciever.h \
src/source/group.h \
src/source/source_abstract.h \
src/source/source_shared.h \
src/source/sourcewindowing.h \
src/sourcelist.h \
src/sourcemodel.h \
src/standardline.h \
src/targettrace.h \
src/union.h \
src/generator/generator.h \
src/generator/generatorthread.h \
src/generator/pinknoise.h \
src/generator/outputdevice.h \
src/generator/whitenoise.h \
src/generator/sinnoise.h \
src/generator/sinsweep.h \
src/generator/sample.h \
src/stored.h \
src/chart/axis.h \
src/chart/painteditem.h \
src/chart/type.h \
src/measurement.h \
src/common/settings.h \
src/chart/variablechart.h \
src/chart/plot.h \
src/chart/rtaplot.h \
src/chart/impulseplot.h \
src/chart/phaseplot.h \
src/chart/magnitudeplot.h \
src/chart/xyplot.h \
src/math/meter.h \
src/math/coherence.h \
src/math/averaging.h \
src/math/complex.h \
src/math/fouriertransform.h \
src/math/deconvolution.h \
src/math/windowfunction.h \
src/math/deconvolution.h \
src/container/fifo.h \
src/container/circular.h \
src/container/array.h
#math
equals(QT_ARCH, "arm64") {
message("Building for: ARM64")
HEADERS += src/armmath.h
} else {
message("Building for: x64")
HEADERS += src/math/ssemath.h
SOURCES += src/math/ssemath.cpp
}
#dialogs
ios: {
QMAKE_IOS_DEPLOYMENT_TARGET = 12.0
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2 #iPhone,iPad
QMAKE_IOS_DEVICE_ARCHS = "arm64"
DEFINES += SUPPORT_64_BIT_IOS
HEADERS += src/filesystem/plugins/iosdialogplugin.h
SOURCES += src/filesystem/plugins/iosdialogplugin.mm
}
APP_GIT_VERSION = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ describe --tags $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ rev-list --tags --max-count=1))
DEFINES += APP_GIT_VERSION=\\\"$$APP_GIT_VERSION\\\"
#logger
DEFINES += QT_MESSAGELOGCONTEXT
#audio plugins:
macx {
HEADERS += \
src/audio/plugins/coreaudio.h
SOURCES += \
src/audio/plugins/coreaudio.cpp
LIBS += \
-framework CoreAudio \
-framework AudioToolbox
}
ios {
HEADERS += \
src/audio/plugins/audiosession.h
SOURCES += \
src/audio/plugins/audiosession.mm
LIBS += \
-framework AVFoundation
}
win32 {
HEADERS += \
src/audio/plugins/wasapi.h
SOURCES += \
src/audio/plugins/wasapi.cpp
LIBS += ole32.lib
exists($$PWD/../asiosdk/*) {
DEFINES += USE_ASIO
message("Add ASIO driver Support")
INCLUDEPATH += \
$$PWD/../asiosdk/common \
$$PWD/../asiosdk/host \
$$PWD/../asiosdk/host/pc
HEADERS += \
src/audio/plugins/asioplugin.h \
$$PWD/../asiosdk/common/asio.h \
$$PWD/../asiosdk/common/asiosys.h \
$$PWD/../asiosdk/host/asiodrivers.h \
$$PWD/../asiosdk/host/pc/asiolist.h
SOURCES += \
src/audio/plugins/asioplugin.cpp \
$$PWD/../asiosdk/common/asio.cpp \
$$PWD/../asiosdk/host/asiodrivers.cpp \
$$PWD/../asiosdk/host/pc/asiolist.cpp
LIBS += Advapi32.lib
}
}
unix:!macx:!ios {
HEADERS += \
src/audio/plugins/alsa.h
SOURCES += \
src/audio/plugins/alsa.cpp
LIBS += -lasound
}
GRAPH = $$(GRAPH_BACKEND)
isEmpty(GRAPH) {
GRAPH = "OPENGL"
}
isEqual(GRAPH, "METAL") {
message("use metal")
QT += widgets
DEFINES += GRAPH_METAL
INCLUDEPATH += src/chart/metal
HEADERS += \
src/chart/metal/coherenceseriesnode.h \
src/chart/metal/groupdelayseriesnode.h \
src/chart/metal/phasedelayseriesnode.h \
src/chart/metal/impulseseriesnode.h \
src/chart/metal/magnitudeseriesnode.h \
src/chart/metal/phaseseriesnode.h \
src/chart/metal/seriesnode.h \
src/chart/metal/spectrogramseriesnode.h \
src/chart/metal/crestfactorseriesnode.h \
src/chart/metal/levelseriesnode.h \
src/chart/metal/nyquistseriesnode.h \
src/chart/metal/stepseriesnode.h \
src/chart/metal/xyseriesnode.h \
src/chart/metal/rtaseriesnode.h \
src/chart/metal/seriesitem.h \
SOURCES += \
src/chart/metal/rtaseriesnode.mm \
src/chart/metal/coherenceseriesnode.mm \
src/chart/metal/groupdelayseriesnode.mm \
src/chart/metal/phasedelayseriesnode.mm \
src/chart/metal/impulseseriesnode.mm \
src/chart/metal/magnitudeseriesnode.mm \
src/chart/metal/phaseseriesnode.mm \
src/chart/metal/seriesnode.mm \
src/chart/metal/spectrogramseriesnode.mm \
src/chart/metal/crestfactorseriesnode.mm \
src/chart/metal/levelseriesnode.mm \
src/chart/metal/nyquistseriesnode.mm \
src/chart/metal/stepseriesnode.mm \
src/chart/metal/xyseriesnode.mm \
src/chart/metal/seriesitem.cpp \
src/chart/metal/plotseriescreator.cpp \
METAL_SOURCES += \
src/chart/metal/shaders.metal \
LIBS += -framework Metal
macx {
METAL_SDK = "macosx"
METAL_STD = "macos-metal1.0"
METAL_TARGET = "-mmacosx-version-min=10.13"
}
ios {
METAL_SDK = "iphoneos"
METAL_STD = "ios-metal1.0"
METAL_TARGET = "-mios-version-min=12.0"
}
metal_command = echo "build metal"
for (METAL_SOURCE, METAL_SOURCES) {
AIR_FILE = $$basename(METAL_SOURCE)
AIR_FILE = $$OUT_PWD/$$replace(AIR_FILE, .metal, .air)
AIR_FILES += $$AIR_FILE
metal_command += && xcrun -sdk $$METAL_SDK metal $$METAL_TARGET -std=$$METAL_STD -c $$PWD/$$METAL_SOURCE -o $$AIR_FILE
}
metal_command += && xcrun -sdk $$METAL_SDK metallib $$AIR_FILES -o $$OUT_PWD/lib.metallib
metal_target.target = metal
metal_target.commands = $$metal_command
QMAKE_EXTRA_TARGETS += metal_target
PRE_TARGETDEPS += metal
metal_install.target = metal
metal_install.files += $$OUT_PWD/lib.metallib
metal_install.path = Contents/Resources
metal_install.CONFIG += no_check_exist
#runs before build
#QMAKE_BUNDLE_DATA += metal_install
#QMAKE_POST_LINK and PRE_TARGETDEPS - takes no effect on Xcode projects
QMAKE_POST_LINK = cp $$OUT_PWD/lib.metallib $$OUT_PWD/OpenSoundMeter.app/Contents/Resources/lib.metallib
QMAKE_CLEAN += *.air
QMAKE_CLEAN += *.metallib
}
isEqual(GRAPH, "OPENGL") {
message("use OpenGL")
QT += opengl
DEFINES += GRAPH_OPENGL
INCLUDEPATH += src/chart/opengl
HEADERS += \
src/chart/opengl/seriesfbo.h \
src/chart/opengl/rtaseriesrenderer.h \
src/chart/opengl/seriesrenderer.h \
src/chart/opengl/impulseseriesrenderer.h \
src/chart/opengl/phaseseriesrenderer.h \
src/chart/opengl/magnitudeseriesrenderer.h \
src/chart/opengl/frequencybasedseriesrenderer.h \
src/chart/opengl/xyseriesrenderer.h \
src/chart/opengl/coherenceseriesrenderer.h \
src/chart/opengl/groupdelayseriesrenderer.h \
src/chart/opengl/phasedelayseriesrenderer.h \
src/chart/opengl/spectrogramseriesrenderer.h \
src/chart/opengl/crestfactorseriesrenderer.h \
src/chart/opengl/nyquistseriesrenderer.h \
src/chart/opengl/levelseriesrenderer.h \
src/chart/opengl/stepseriesrenderer.h
SOURCES += \
src/chart/opengl/plotseriescreator.cpp \
src/chart/opengl/seriesfbo.cpp \
src/chart/opengl/rtaseriesrenderer.cpp \
src/chart/opengl/seriesrenderer.cpp \
src/chart/opengl/impulseseriesrenderer.cpp \
src/chart/opengl/phaseseriesrenderer.cpp \
src/chart/opengl/magnitudeseriesrenderer.cpp \
src/chart/opengl/frequencybasedseriesrenderer.cpp \
src/chart/opengl/xyseriesrenderer.cpp \
src/chart/opengl/coherenceseriesrenderer.cpp \
src/chart/opengl/groupdelayseriesrenderer.cpp \
src/chart/opengl/phasedelayseriesrenderer.cpp \
src/chart/opengl/spectrogramseriesrenderer.cpp \
src/chart/opengl/crestfactorseriesrenderer.cpp \
src/chart/opengl/nyquistseriesrenderer.cpp \
src/chart/opengl/levelseriesrenderer.cpp \
src/chart/opengl/stepseriesrenderer.cpp
}
#TODO: finish this
#unix:!macx:!ios {
# #Add Glibc wrapper for older platforms
# #./LibcWrapGenerator --target 2.14 --libdir /lib --output libcwrap.h
## CONFIG += cmdline precompile_header
## PRECOMPILED_HEADER = ../libcwrap.h
# QMAKE_CXXFLAGS += -U_FORTIFY_SOURCE -include ../libcwrap.h
# HEADERS += ../libcwrap.h
#}
# Special rules for deployment on Linux for AppImage
unix:!macx:!ios:CONFIG(release, debug|release) {
QMAKE_POST_LINK += $$QMAKE_COPY $$PWD/OpenSoundMeter.desktop $$OUT_PWD/OpenSoundMeter_\\"$$APP_GIT_VERSION\\".desktop
QMAKE_POST_LINK += && $$QMAKE_COPY $$PWD/icons/white.png $$OUT_PWD
QMAKE_POST_LINK += && $$QMAKE_COPY $$PWD/linuxdeployosm.sh $$OUT_PWD
QMAKE_POST_LINK += && chmod u+x $$OUT_PWD/linuxdeployosm.sh && $$OUT_PWD/linuxdeployosm.sh $$APP_GIT_VERSION $$PWD $$[QT_INSTALL_BINS]
QMAKE_CXXFLAGS_RELEASE += -fno-fast-math
}
!isEqual(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 15) {
error(OpenSoundMeter $$APP_GIT_VERSION requires Qt 5.15 or newer but Qt $$[QT_VERSION] was detected.)
}
FORMS +=
#win32:QMAKE_CXXFLAGS += -m64 -msse2
#QMAKE_CXXFLAGS_RELEASE -= -O2
#QMAKE_CXXFLAGS_RELEASE += -Ofast
QMAKE_INFO_PLIST = $$PWD/Info.plist
macx {
APP_ENTITLEMENTS.files = info.entitlements
APP_ENTITLEMENTS.path = Contents/Resources
QMAKE_BUNDLE_DATA += APP_ENTITLEMENTS
}
macx {
isEqual(GRAPH, "METAL") {
QMAKE_POST_LINK += &&
}
QMAKE_POST_LINK += plutil -replace NSMicrophoneUsageDescription -string \"Audio measurement\" $${TARGET}.app/Contents/Info.plist
}
ios {
QMAKE_POST_LINK += plutil -replace NSMicrophoneUsageDescription -string \"Audio measurement.\" Info.plist
ios_icon.files = $$files($$PWD/icons/ios/*.png)
QMAKE_BUNDLE_DATA += ios_icon
}
DISTFILES += \
OpenSoundMeter.desktop \
README.md \
future.tasks \
linuxdeployosm.sh \
list.tasks \
shaders/coherence.frag \
shaders/coherence.geom \
shaders/coherence.vert \
shaders/fragment.frag \
shaders/groupdelay.frag \
shaders/groupdelay.geom \
shaders/groupdelay.vert \
shaders/line.geom \
shaders/logx.vert \
shaders/magnitude.geom \
shaders/magnitude.vert \
shaders/phase.geom \
shaders/phase.geom \
shaders/color.frag \
shaders/magnitude.frag \
shaders/phase.vert \
shaders/pos.vert \
shaders/spectrogram.frag \
shaders/spectrogram.vert \
style.astylerc
ICON = icons/white.icns
win32:RC_ICONS = icons/white.ico
pvs_studio.target = pvs
pvs_studio.output = true
pvs_studio.args = --dump-files
pvs_studio.cxxflags = -std=c++1z
pvs_studio.sources = $${SOURCES}
include(PVS-Studio.pri)