|
101 | 101 | #include "zerberus/zerberus.h" |
102 | 102 | #endif |
103 | 103 |
|
104 | | -#ifdef USE_JACK |
105 | | -#include "jackaudio.h" |
106 | | -#endif |
107 | | - |
108 | | -#ifdef USE_PULSEAUDIO |
109 | | -extern Driver* getPulseAudioDriver(Seq*); |
110 | | -#endif |
111 | | - |
112 | | -#ifdef USE_ALSA |
113 | | -#include "alsa.h" |
114 | | -#endif |
115 | | -#ifdef USE_PORTAUDIO |
116 | | -#include "pa.h" |
117 | | -#endif |
118 | | - |
119 | 104 | MuseScore* mscore; |
120 | 105 | MuseScoreCore* mscoreCore; |
121 | 106 | MasterSynthesizer* synti; |
@@ -2211,84 +2196,6 @@ printf("sound font <%s>\n", qPrintable(preferences.defaultSf)); |
2211 | 2196 | return ms; |
2212 | 2197 | } |
2213 | 2198 |
|
2214 | | -//--------------------------------------------------------- |
2215 | | -// driverFactory |
2216 | | -//--------------------------------------------------------- |
2217 | | - |
2218 | | -Driver* driverFactory(Seq* seq) |
2219 | | - { |
2220 | | - Driver* driver = 0; |
2221 | | - |
2222 | | -#define useJackFlag (preferences.useJackAudio || preferences.useJackMidi) |
2223 | | -#define useAlsaFlag preferences.useAlsaAudio |
2224 | | -#define usePortaudioFlag preferences.usePortaudioAudio |
2225 | | -#define usePulseAudioFlag preferences.usePulseAudio |
2226 | | - |
2227 | | -#ifdef USE_PULSEAUDIO |
2228 | | - if (MScore::debugMode) |
2229 | | - qDebug("usePulseAudioFlag %d\n", usePulseAudioFlag); |
2230 | | - if (usePulseAudioFlag) { |
2231 | | - driver = getPulseAudioDriver(seq); |
2232 | | - if (!driver->init()) { |
2233 | | - qDebug("init PulseAudio failed"); |
2234 | | - delete driver; |
2235 | | - driver = 0; |
2236 | | - } |
2237 | | - else |
2238 | | - usePortaudio = true; |
2239 | | - } |
2240 | | -#endif |
2241 | | -#ifdef USE_PORTAUDIO |
2242 | | - if (MScore::debugMode) |
2243 | | - qDebug("usePortaudioFlag %d\n", usePortaudioFlag); |
2244 | | - if (usePortaudioFlag) { |
2245 | | - driver = new Portaudio(seq); |
2246 | | - if (!driver->init()) { |
2247 | | - qDebug("init PortAudio failed"); |
2248 | | - delete driver; |
2249 | | - driver = 0; |
2250 | | - } |
2251 | | - else |
2252 | | - usePortaudio = true; |
2253 | | - } |
2254 | | -#endif |
2255 | | -#ifdef USE_ALSA |
2256 | | - if (MScore::debugMode) |
2257 | | - qDebug("useAlsaFlag %d\n", useAlsaFlag); |
2258 | | - if (driver == 0 && useAlsaFlag) { |
2259 | | - driver = new AlsaAudio(seq); |
2260 | | - if (!driver->init()) { |
2261 | | - qDebug("init ALSA driver failed\n"); |
2262 | | - delete driver; |
2263 | | - driver = 0; |
2264 | | - } |
2265 | | - else { |
2266 | | - useALSA = true; |
2267 | | - } |
2268 | | - } |
2269 | | -#endif |
2270 | | -#ifdef USE_JACK |
2271 | | - if (MScore::debugMode) |
2272 | | - qDebug("useJackFlag %d\n", useJackFlag); |
2273 | | - if (useJackFlag) { |
2274 | | - useAlsaFlag = false; |
2275 | | - usePortaudioFlag = false; |
2276 | | - driver = new JackAudio(seq); |
2277 | | - if (!driver->init()) { |
2278 | | - qDebug("no JACK server found\n"); |
2279 | | - delete driver; |
2280 | | - driver = 0; |
2281 | | - } |
2282 | | - else |
2283 | | - useJACK = true; |
2284 | | - } |
2285 | | -#endif |
2286 | | - if (driver == 0) |
2287 | | - qDebug("no audio driver found"); |
2288 | | - |
2289 | | - return driver; |
2290 | | - } |
2291 | | - |
2292 | 2199 | //--------------------------------------------------------- |
2293 | 2200 | // main |
2294 | 2201 | //--------------------------------------------------------- |
|
0 commit comments