-
Notifications
You must be signed in to change notification settings - Fork 2
/
cmlib.pro
250 lines (208 loc) · 5.54 KB
/
cmlib.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
QT += gui sql
ANDROID_SYSROOT=/home/milang/Android/toolchain-ndk-android-24/sysroot
lessThan(QT_MAJOR_VERSION, 5): {
CONFIG += mobility
MOBILITY += multimedia
QT += declarative
} else {
QT += qml quick multimedia
# For Tray icon
QT += widgets
CONFIG += c++11
}
INCLUDEPATH += sources sinks player decoders
OTHER_FILES += test/*.qml test/qtquick1/*.qml test/qtquick2/*.qml
SOURCES += \
sources/cmbaseaudiosource.cpp \
scanner/cmmediascanner.cpp \
decoders/cmmediadecoder.cpp \
player/cmmediaplayer.cpp \
sinks/cmbaseaudiosink.cpp sinks/cmqtaudiosink.cpp \
sinks/cmfileaudiosink.cpp \
sinks/cmwavfileaudiosink.cpp \
sinks/cmbasethreadedaudiosink.cpp \
scanner/cmlibrarymodel.cpp
HEADERS += \
sources/cmbaseaudiosource.h \
scanner/cmmediascanner.h \
decoders/cmmediadecoder.h \
player/cmmediaplayer.h \
sinks/cmbaseaudiosink.h sinks/cmqtaudiosink.h \
sinks/cmfileaudiosink.h \
sinks/cmwavfileaudiosink.h \
sinks/cmbasethreadedaudiosink.h \
sinks/cmplaybackthread_p.h \
scanner/cmlibrarymodel.h
SOURCES += test/main.cpp
unix {
CONFIG +=link_pkgconfig
message(PKGCONFIG)
}
macx {
LIBS += -L/usr/local/lib
INCLUDEPATH += /usr/local/include
DEFINES += QTAUDIO
DEFINES -= ALSAAUDIO
QT_CONFIG -= no-pkg-config
QT_CONFIG += pkg-config
PKG_CONFIG = /usr/local/bin/pkg-config
# PKG_CONFIG = /opt/local/bin/pkg-config
CONFIG += link_pkgconfig
CONFIG += c++17
message(OSX)
}
link_pkgconfig {
packagesExist(alsa) {
DEFINES += ALSAAUDIO
PKGCONFIG += alsa
} else {
DEFINES += QTAUDIO
}
packagesExist(flac++) {
DEFINES += FLAC_DECODER
PKGCONFIG += flac++
message(FLAC)
}
packagesExist(opusfile) {
DEFINES += OPUS_DECODER
PKGCONFIG += opusfile
message(OPUS)
}
packagesExist(sc68) {
DEFINES += SC68_DECODER
PKGCONFIG += sc68
message(SC68)
}
packagesExist(libsidplayfp) {
DEFINES += SID_DECODER
PKGCONFIG += libsidplayfp
message(SIDPLAYFP)
}
lessThan(QT_MAJOR_VERSION, 5): {
packagesExist(libmodplug) {
DEFINES += MOD_DECODER
PKGCONFIG += libmodplug
}
} else {
packagesExist(libopenmpt) {
DEFINES += MTP_DECODER
PKGCONFIG += libopenmpt
CONFIG += c++11
message(OPENMTP)
}
}
# DEFINES += AY_DECODER
} else {
# Non-pkg-config environments
DEFINES += FLAC_DECODER
# DEFINES += SAP_DECODER
DEFINES += SID_DECODER
DEFINES += MOD_DECODER
DEFINES += MTP_DECODER
DEFINES += AY_DECODER
}
qnx:blackberry {
DEFINES += QNXAUDIO
LIBS += -L3rdparty/qnx-armv7/lib
LIBS += -lsidplayfp
LIBS += -lmodplug
LIBS += -lsc68 -lfile68 -lunice68
LIBS += ./3rdparty/qnx-armv7/lib/libasap.a
#./3party/lib/libayfly.a ./3party/lib/libayemu.a
INCLUDEPATH += 3rdparty/include
}
android {
#LIBS += -L3rdparty/android-armv7/lib
LIBS += -L$$ANDROID_SYSROOT/lib
INCLUDEPATH += $$ANDROID_SYSROOT/include
LIBS += -lsidplayfp
LIBS += -lmodplug
# LIBS += -lsc68 -lfile68 -lunice68
# LIBS += ./3rdparty/android-armv7/lib/libasap.a
DEFINES += QTAUDIO
contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
ANDROID_EXTRA_LIBS = $$ANDROID_SYSROOT/lib/libsidplayfp.so \
$$ANDROID_SYSROOT/lib/libmodplug.so
}
}
#######################################################################
# Sinks
# ALSA
contains(DEFINES,ALSAAUDIO) {
HEADERS += sinks/cmalsaaudiosink.h
SOURCES += sinks/cmalsaaudiosink.cpp
LIBS+=-lasound
}
# QNX
contains(DEFINES,QNXAUDIO) {
HEADERS += sinks/cmqsaaudiosink.h
SOURCES += sinks/cmqsaaudiosink.cpp
LIBS += -lasound -laudio_manager
}
#######################################################################
# Sources
# FLAC
# https://xiph.org/flac/
contains(DEFINES,FLAC_DECODER) {
HEADERS += sources/cmflacaudiosource.h
SOURCES += sources/cmflacaudiosource.cpp
LIBS += -lFLAC -lFLAC++
}
# Modplug
# https://github.com/Konstanty/libmodplug
contains(DEFINES,MOD_DECODER) {
HEADERS += sources/cmmodplugaudiosource.h
SOURCES += sources/cmmodplugaudiosource.cpp
}
# OpenMTP
# https://lib.openmpt.org/libopenmpt/
contains(DEFINES,MTP_DECODER) {
HEADERS += sources/cmopenmtpaudiosource.h
SOURCES += sources/cmopenmtpaudiosource.cpp
# LIBS += -lopenmtp
}
# SID
# https://sourceforge.net/p/sidplay-residfp/wiki/Home/
contains(DEFINES,SID_DECODER) {
HEADERS += sources/cmsidaudiosource.h
SOURCES += sources/cmsidaudiosource.cpp
}
# SC68
# https://sourceforge.net/projects/sc68/
contains(DEFINES,SC68_DECODER) {
HEADERS += sources/cmsc68audiosource.h
SOURCES += sources/cmsc68audiosource.cpp
}
# ASAP
# http://asap.sourceforge.net/
contains(DEFINES,SAP_DECODER) {
HEADERS += sources/cmsapaudiosource.h
SOURCES += sources/cmsapaudiosource.cpp
LIBS+= -lasap
}
# AYEMU
# https://github.com/asashnov/libayemu
contains(DEFINES,AY_DECODER) {
HEADERS += sources/cmayaudiosource.h
SOURCES += sources/cmayaudiosource.cpp
LIBS += -L/usr/local/lib -layemu
}
# Opus
#
contains(DEFINES,OPUS_DECODER) {
HEADERS += sources/cmopusaudiosource.h
SOURCES += sources/cmopusaudiosource.cpp
}
#######################################################################
DISTFILES += \
test/*.qml \
android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \
android/gradlew \
android/res/values/libs.xml \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew.bat
RESOURCES += \
test/test.qrc
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android