Line data Source code
1 : #include "appfactory.h"
2 :
3 : #include "internal/guiapp.h"
4 : #include "internal/consoleapp.h"
5 :
6 : #include "global/runtime.h"
7 :
8 : #include "muse_framework_config.h"
9 : #include "app_config.h"
10 :
11 : #ifdef MUSE_MODULE_ACCESSIBILITY
12 : #include "framework/accessibility/accessibilitymodule.h"
13 : #else
14 : #include "framework/stubs/accessibility/accessibilitystubmodule.h"
15 : #endif
16 :
17 : #include "framework/actions/actionsmodule.h"
18 : #include "framework/rcommand/rcommandmodule.h"
19 : #include "framework/rcontrol/rcontrolmodule.h"
20 :
21 : #ifdef MUSE_MODULE_AUDIO
22 : #include "framework/audio/main/audiomodule.h"
23 : #else
24 : #include "framework/stubs/audio/audiostubmodule.h"
25 : #endif
26 :
27 : #ifdef MUSE_MODULE_AUDIOPLUGINS
28 : #include "framework/audioplugins/audiopluginsmodule.h"
29 : #endif
30 :
31 : #ifdef MUSE_MODULE_CLOUD
32 : #include "framework/cloud/cloudmodule.h"
33 : #else
34 : #include "framework/stubs/cloud/cloudstubmodule.h"
35 : #endif
36 :
37 : #include "framework/draw/drawmodule.h"
38 :
39 : #ifdef MUSE_MODULE_DIAGNOSTICS
40 : #include "diagnostics/diagnosticsmodule.h"
41 : #endif
42 :
43 : #ifdef MUSE_MODULE_LANGUAGES
44 : #include "framework/languages/languagesmodule.h"
45 : #else
46 : #include "framework/stubs/languages/languagesstubmodule.h"
47 : #endif
48 :
49 : #ifdef MUSE_MODULE_LEARN
50 : #include "framework/learn/learnmodule.h"
51 : #else
52 : #include "framework/stubs/learn/learnmodule.h"
53 : #endif
54 :
55 : #ifdef MUSE_MODULE_MEDIA
56 : #include "framework/media/mediamodule.h"
57 : #else
58 : #include "framework/stubs/media/mediastubmodule.h"
59 : #endif
60 :
61 : #ifdef MUSE_MODULE_MIDI
62 : #include "framework/midi/midimodule.h"
63 : #else
64 : #include "framework/stubs/midi/midistubmodule.h"
65 : #endif
66 :
67 : #ifdef MUSE_MODULE_MIDIREMOTE
68 : #include "framework/midiremote/midiremotemodule.h"
69 : #else
70 : #include "framework/stubs/midiremote/midiremotestubmodule.h"
71 : #endif
72 :
73 : #ifdef MUSE_MODULE_MPE
74 : #include "framework/mpe/mpemodule.h"
75 : #else
76 : #include "framework/stubs/mpe/mpestubmodule.h"
77 : #endif
78 :
79 : #ifdef MUSE_MODULE_MULTIWINDOWS
80 : #include "framework/multiwindows/multiwindowsmodule.h"
81 : #else
82 : #include "framework/stubs/multiwindows/multiwindowsstubmodule.h"
83 : #endif
84 :
85 : #ifdef MUSE_MODULE_MUSESAMPLER
86 : #include "framework/musesampler/musesamplermodule.h"
87 : #endif
88 :
89 : #ifdef MUSE_MODULE_NETWORK
90 : #include "framework/network/networkmodule.h"
91 : #else
92 : #include "framework/stubs/network/networkstubmodule.h"
93 : #endif
94 :
95 : #ifdef MUSE_MODULE_SHORTCUTS
96 : #include "framework/shortcuts_v2/shortcutsmodule.h"
97 : #else
98 : #include "framework/stubs/shortcuts_v2/shortcutsstubmodule.h"
99 : #endif
100 :
101 : #ifdef MUSE_MODULE_TOAST
102 : #include "framework/toast/toastmodule.h"
103 : #endif
104 :
105 : #ifdef MUSE_MODULE_TOURS
106 : #include "framework/tours/toursmodule.h"
107 : #else
108 : #include "framework/stubs/tours/toursstubmodule.h"
109 : #endif
110 :
111 : #ifdef MUSE_MODULE_UI
112 : #include "framework/ui/uimodule.h"
113 : #include "framework/uicomponents/uicomponentsmodule.h"
114 : #endif
115 :
116 : #ifdef MUSE_MODULE_DOCKWINDOW
117 : #include "framework/dockwindow/dockmodule.h"
118 : #endif
119 :
120 : #ifdef MUSE_MODULE_UPDATE
121 : #include "update/updatemodule.h"
122 : #else
123 : #include "framework/stubs/update/updatestubmodule.h"
124 : #endif
125 :
126 : #ifdef MUSE_MODULE_VST
127 : #include "framework/vst/vstmodule.h"
128 : #else
129 : #include "framework/stubs/vst/vststubmodule.h"
130 : #endif
131 :
132 : #ifdef MUSE_MODULE_WORKSPACE
133 : #include "framework/workspace/workspacemodule.h"
134 : #else
135 : #include "framework/stubs/workspace/workspacestubmodule.h"
136 : #endif
137 :
138 : #ifdef MUSE_MODULE_EXTENSIONS
139 : #include "framework/extensions/extensionsmodule.h"
140 : #else
141 : #include "framework/stubs/extensions/extensionsstubmodule.h"
142 : #endif
143 :
144 : #ifdef MUSE_MODULE_INTERACTIVE
145 : #include "framework/interactive/interactivemodule.h"
146 : #endif
147 :
148 : // Modules
149 : #include "appshell/appshellmodule.h"
150 :
151 : #ifdef MUSE_MODULE_TESTFLOW
152 : #include "testflow/testflowmodule.h"
153 : #endif
154 :
155 : #ifdef MUSE_MODULE_AUTOMATION
156 : #include "framework/automation/automationmodule.h"
157 : #else
158 : #include "framework/stubs/automation/automationstubmodule.h"
159 : #endif
160 :
161 : #ifdef MUE_BUILD_BRAILLE_MODULE
162 : #include "braille/braillemodule.h"
163 : #else
164 : #include "stubs/braille/braillestubmodule.h"
165 : #endif
166 :
167 : #ifdef MUE_BUILD_CONVERTER_MODULE
168 : #include "converter/convertermodule.h"
169 : #endif
170 :
171 : #include "engraving/engravingmodule.h"
172 :
173 : #ifdef MUE_BUILD_IMPEXP_BB_MODULE
174 : #include "importexport/bb/bbmodule.h"
175 : #endif
176 : #ifdef MUE_BUILD_IMPEXP_BWW_MODULE
177 : #include "importexport/bww/bwwmodule.h"
178 : #endif
179 : #ifdef MUE_BUILD_IMPEXP_CAPELLA_MODULE
180 : #include "importexport/capella/capellamodule.h"
181 : #endif
182 : #ifdef MUE_BUILD_IMPEXP_MIDI_MODULE
183 : #include "importexport/midi/midimodule.h"
184 : #else
185 : #include "stubs/importexport/midi/midimodule.h"
186 : #endif
187 : #ifdef MUE_BUILD_IMPEXP_MLSCORE_MODULE
188 : #include "importexport/mlscore/mlscoremodule.h"
189 : #endif
190 : #ifdef MUE_BUILD_IMPEXP_MNX_MODULE
191 : #include "importexport/mnx/mnxmodule.h"
192 : #else
193 : #include "stubs/importexport/mnx/mnxmodule.h"
194 : #endif
195 : #ifdef MUE_BUILD_IMPEXP_MUSEDATA_MODULE
196 : #include "importexport/musedata/musedatamodule.h"
197 : #endif
198 : #ifdef MUE_BUILD_IMPEXP_MUSICXML_MODULE
199 : #include "importexport/musicxml/musicxmlmodule.h"
200 : #else
201 : #include "stubs/importexport/musicxml/musicxmlmodule.h"
202 : #endif
203 : #ifdef MUE_BUILD_IMPEXP_OVE_MODULE
204 : #include "importexport/ove/ovemodule.h"
205 : #else
206 : #include "stubs/importexport/ove/ovemodule.h"
207 : #endif
208 : #ifdef MUE_BUILD_IMPEXP_AUDIOEXPORT_MODULE
209 : #include "importexport/audioexport/audioexportmodule.h"
210 : #endif
211 : #ifdef MUE_BUILD_IMPEXP_IMAGESEXPORT_MODULE
212 : #include "importexport/imagesexport/imagesexportmodule.h"
213 : #endif
214 : #ifdef MUE_BUILD_IMPEXP_GUITARPRO_MODULE
215 : #include "importexport/guitarpro/guitarpromodule.h"
216 : #endif
217 : #ifdef MUE_BUILD_IMPEXP_MEI_MODULE
218 : #include "importexport/mei/meimodule.h"
219 : #else
220 : #include "stubs/importexport/mei/meimodule.h"
221 : #endif
222 :
223 : #ifdef MUE_BUILD_IMPEXP_VIDEOEXPORT_MODULE
224 : #include "importexport/videoexport/videoexportmodule.h"
225 : #endif
226 : #ifdef MUE_BUILD_IMPEXP_TABLEDIT_MODULE
227 : #include "importexport/tabledit/tableditmodule.h"
228 : #endif
229 : #ifdef MUE_BUILD_IMPEXP_LYRICS_MODULE
230 : #include "importexport/lyricsexport/lyricsexportmodule.h"
231 : #endif
232 :
233 : #include "propertiespanel/propertiespanelmodule.h"
234 :
235 : #ifdef MUE_BUILD_INSTRUMENTSSCENE_MODULE
236 : #include "instrumentsscene/instrumentsscenemodule.h"
237 : #else
238 : #include "stubs/instrumentsscene/instrumentsscenestubmodule.h"
239 : #endif
240 :
241 : #ifdef MUE_BUILD_MUSESOUNDS_MODULE
242 : #include "musesounds/musesoundsmodule.h"
243 : #else
244 : #include "stubs/musesounds/musesoundsstubmodule.h"
245 : #endif
246 :
247 : #ifdef MUE_BUILD_NOTATION_MODULE
248 : #include "notation/notationmodule.h"
249 : #else
250 : #include "stubs/notation/notationstubmodule.h"
251 : #endif
252 :
253 : #ifdef MUE_BUILD_NOTATIONSCENE_MODULE
254 : #include "notationscene/notationscenemodule.h"
255 : #else
256 : #include "stubs/notationscene/notationscenestubmodule.h"
257 : #endif
258 :
259 : #ifdef MUE_BUILD_PALETTE_MODULE
260 : #include "palette/palettemodule.h"
261 : #else
262 : #include "stubs/palette/palettestubmodule.h"
263 : #endif
264 :
265 : #ifdef MUE_BUILD_PLAYBACK_MODULE
266 : #include "playback/playbackmodule.h"
267 : #else
268 : #include "stubs/playback/playbackstubmodule.h"
269 : #endif
270 :
271 : #ifdef MUE_BUILD_PREFERENCES_MODULE
272 : #include "preferences/preferencesmodule.h"
273 : #endif
274 :
275 : #ifdef MUE_BUILD_PRINT_MODULE
276 : #include "print/printmodule.h"
277 : #endif
278 :
279 : #ifdef MUE_BUILD_PROJECT_MODULE
280 : #include "project/projectmodule.h"
281 : #else
282 : #include "stubs/project/projectstubmodule.h"
283 : #endif
284 :
285 : #ifdef MUE_CONFIGURATION_IS_APPWEB
286 : #include "web/appjs/appjsmodule.h"
287 : #endif
288 :
289 : using namespace muse;
290 : using namespace mu::app;
291 :
292 0 : std::shared_ptr<muse::IApplication> AppFactory::newApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
293 : {
294 0 : IF_ASSERT_FAILED(options) {
295 0 : return nullptr;
296 : }
297 :
298 0 : if (options->runMode == IApplication::RunMode::GuiApp) {
299 0 : return newGuiApp(options);
300 : } else {
301 0 : return newConsoleApp(options);
302 : }
303 : }
304 :
305 0 : std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
306 : {
307 0 : std::shared_ptr<MuseScoreGuiApp> app = std::make_shared<MuseScoreGuiApp>(options);
308 :
309 : #ifdef MUSE_MODULE_DIAGNOSTICS
310 : //! NOTE `diagnostics` must be first, because it installs the crash handler.
311 : //! For other modules, the order is (and should be) unimportant.
312 0 : app->addModule(new muse::diagnostics::DiagnosticsModule());
313 : #endif
314 :
315 : // framework
316 0 : app->addModule(new muse::accessibility::AccessibilityModule());
317 0 : app->addModule(new muse::actions::ActionsModule());
318 0 : app->addModule(new muse::rcommand::RCommandModule());
319 0 : app->addModule(new muse::rcontrol::RControlModule());
320 0 : app->addModule(new muse::audio::AudioModule());
321 : #ifdef MUSE_MODULE_AUDIOPLUGINS
322 0 : app->addModule(new muse::audioplugins::AudioPluginsModule());
323 : #endif
324 0 : app->addModule(new muse::automation::AutomationModule());
325 0 : app->addModule(new muse::draw::DrawModule());
326 : #ifdef MUSE_MODULE_INTERACTIVE
327 0 : app->addModule(new muse::interactive::InteractiveModule());
328 : #endif
329 0 : app->addModule(new muse::midi::MidiModule());
330 0 : app->addModule(new muse::midiremote::MidiRemoteModule());
331 0 : app->addModule(new muse::mpe::MpeModule());
332 :
333 : #ifdef MUSE_MODULE_MUSESAMPLER
334 0 : bool shouldAddMuseSamplerModule = true;
335 : #ifndef MUSE_MODULE_MUSESAMPLER_LOAD_IN_DEBUG
336 0 : if (runtime::isDebug()) {
337 0 : shouldAddMuseSamplerModule = false;
338 0 : LOGI() << "Not adding MuseSampler module in a debug build";
339 : }
340 : #endif
341 :
342 0 : if (shouldAddMuseSamplerModule) {
343 0 : app->addModule(new muse::musesampler::MuseSamplerModule());
344 : }
345 : #endif
346 :
347 0 : app->addModule(new muse::network::NetworkModule());
348 0 : app->addModule(new muse::shortcuts::ShortcutsModule());
349 : #ifdef MUSE_MODULE_UI
350 0 : app->addModule(new muse::ui::UiModule());
351 0 : app->addModule(new muse::uicomponents::UiComponentsModule());
352 : #endif
353 :
354 : #ifdef MUSE_MODULE_DOCKWINDOW
355 0 : app->addModule(new muse::dock::DockModule());
356 : #endif
357 : #ifdef MUSE_MODULE_TOAST
358 0 : app->addModule(new muse::toast::ToastModule());
359 : #endif
360 0 : app->addModule(new muse::tours::ToursModule());
361 0 : app->addModule(new muse::vst::VSTModule());
362 0 : app->addModule(new muse::media::MediaModule());
363 :
364 : // modules
365 : #ifdef MUE_BUILD_APPSHELL_MODULE
366 0 : app->addModule(new mu::appshell::AppShellModule());
367 : #endif
368 :
369 : #ifdef MUSE_MODULE_TESTFLOW
370 : app->addModule(new muse::testflow::TestflowModule());
371 : #endif
372 :
373 0 : app->addModule(new mu::braille::BrailleModule());
374 :
375 0 : app->addModule(new muse::cloud::CloudModule());
376 :
377 : #ifdef MUE_BUILD_CONVERTER_MODULE
378 0 : app->addModule(new mu::converter::ConverterModule());
379 : #endif
380 :
381 0 : app->addModule(new mu::engraving::EngravingModule());
382 :
383 : #ifdef MUE_BUILD_IMPEXP_BB_MODULE
384 0 : app->addModule(new mu::iex::bb::BBModule());
385 : #endif
386 : #ifdef MUE_BUILD_IMPEXP_BWW_MODULE
387 0 : app->addModule(new mu::iex::bww::BwwModule());
388 : #endif
389 : #ifdef MUE_BUILD_IMPEXP_CAPELLA_MODULE
390 0 : app->addModule(new mu::iex::capella::CapellaModule());
391 : #endif
392 0 : app->addModule(new mu::iex::midi::MidiModule());
393 : #ifdef MUE_BUILD_IMPEXP_MLSCORE_MODULE
394 : app->addModule(new mu::iex::mlscore::MlScoreModule());
395 : #endif
396 0 : app->addModule(new mu::iex::mnxio::MnxModule());
397 : #ifdef MUE_BUILD_IMPEXP_MUSEDATA_MODULE
398 0 : app->addModule(new mu::iex::musedata::MuseDataModule());
399 : #endif
400 0 : app->addModule(new mu::iex::musicxml::MusicXmlModule());
401 0 : app->addModule(new mu::iex::ove::OveModule());
402 : #ifdef MUE_BUILD_IMPEXP_AUDIOEXPORT_MODULE
403 0 : app->addModule(new mu::iex::audioexport::AudioExportModule());
404 : #endif
405 : #ifdef MUE_BUILD_IMPEXP_IMAGESEXPORT_MODULE
406 0 : app->addModule(new mu::iex::imagesexport::ImagesExportModule());
407 : #endif
408 : #ifdef MUE_BUILD_IMPEXP_GUITARPRO_MODULE
409 0 : app->addModule(new mu::iex::guitarpro::GuitarProModule());
410 : #endif
411 0 : app->addModule(new mu::iex::mei::MeiModule());
412 : #ifdef MUE_BUILD_IMPEXP_VIDEOEXPORT_MODULE
413 0 : app->addModule(new mu::iex::videoexport::VideoExportModule());
414 : #endif
415 : #ifdef MUE_BUILD_IMPEXP_TABLEDIT_MODULE
416 0 : app->addModule(new mu::iex::tabledit::TablEditModule());
417 : #endif
418 : #ifdef MUE_BUILD_IMPEXP_LYRICS_MODULE
419 0 : app->addModule(new mu::iex::lrcexport::LyricsExportModule());
420 : #endif
421 :
422 0 : app->addModule(new mu::propertiespanel::PropertiesPanelModule());
423 0 : app->addModule(new mu::instrumentsscene::InstrumentsSceneModule());
424 0 : app->addModule(new muse::extensions::ExtensionsModule());
425 0 : app->addModule(new muse::languages::LanguagesModule());
426 0 : app->addModule(new muse::learn::LearnModule());
427 0 : app->addModule(new muse::mi::MultiWindowsModule());
428 0 : app->addModule(new mu::musesounds::MuseSoundsModule());
429 0 : app->addModule(new mu::notation::NotationModule());
430 0 : app->addModule(new mu::notation::NotationSceneModule());
431 0 : app->addModule(new mu::palette::PaletteModule());
432 0 : app->addModule(new mu::playback::PlaybackModule());
433 : #ifdef MUE_BUILD_PREFERENCES_MODULE
434 0 : app->addModule(new mu::preferences::PreferencesModule());
435 : #endif
436 :
437 : #ifdef MUE_BUILD_PRINT_MODULE
438 0 : app->addModule(new mu::print::PrintModule());
439 : #endif
440 0 : app->addModule(new mu::project::ProjectModule());
441 0 : app->addModule(new muse::update::UpdateModule());
442 0 : app->addModule(new muse::workspace::WorkspaceModule());
443 :
444 : #ifdef MUE_CONFIGURATION_IS_APPWEB
445 : app->addModule(new mu::appjs::AppJsModule());
446 : #endif
447 :
448 0 : return app;
449 0 : }
450 :
451 0 : static void addConsoleModules(std::shared_ptr<MuseScoreConsoleApp> app)
452 : {
453 : #ifdef MUSE_MODULE_DIAGNOSTICS
454 : //! NOTE `diagnostics` must be first, because it installs the crash handler.
455 : //! For other modules, the order is (an should be) unimportant.
456 0 : app->addModule(new muse::diagnostics::DiagnosticsModule());
457 : #endif
458 :
459 : //! TODO Some modules can be removed
460 :
461 : // framework
462 0 : app->addModule(new muse::actions::ActionsModule());
463 0 : app->addModule(new muse::rcommand::RCommandModule());
464 0 : app->addModule(new muse::rcontrol::RControlModule());
465 0 : app->addModule(new muse::audio::AudioModule());
466 : #ifdef MUSE_MODULE_AUDIOPLUGINS
467 0 : app->addModule(new muse::audioplugins::AudioPluginsModule());
468 : #endif
469 0 : app->addModule(new muse::draw::DrawModule());
470 0 : app->addModule(new muse::midi::MidiModule());
471 0 : app->addModule(new muse::mpe::MpeModule());
472 :
473 : #ifdef MUSE_MODULE_MUSESAMPLER
474 0 : bool shouldAddMuseSamplerModule = true;
475 : #ifndef MUSE_MODULE_MUSESAMPLER_LOAD_IN_DEBUG
476 0 : if (runtime::isDebug()) {
477 0 : shouldAddMuseSamplerModule = false;
478 0 : LOGI() << "Not adding MuseSampler module in a debug build";
479 : }
480 : #endif
481 :
482 0 : if (shouldAddMuseSamplerModule) {
483 0 : app->addModule(new muse::musesampler::MuseSamplerModule());
484 : }
485 : #endif
486 :
487 : #ifdef MUSE_MODULE_UI
488 0 : app->addModule(new muse::ui::UiModule());
489 : #endif
490 :
491 : #ifdef MUSE_MODULE_VST
492 0 : app->addModule(new muse::vst::VSTModule());
493 : #endif
494 :
495 0 : app->addModule(new muse::media::MediaModule());
496 :
497 : #ifdef MUSE_MODULE_TESTFLOW
498 : app->addModule(new muse::testflow::TestflowModule());
499 : #endif
500 :
501 : #ifdef MUE_BUILD_CONVERTER_MODULE
502 0 : app->addModule(new mu::converter::ConverterModule());
503 : #endif
504 :
505 0 : app->addModule(new mu::engraving::EngravingModule());
506 :
507 : #ifdef MUE_BUILD_IMPEXP_BB_MODULE
508 0 : app->addModule(new mu::iex::bb::BBModule());
509 : #endif
510 : #ifdef MUE_BUILD_IMPEXP_BWW_MODULE
511 0 : app->addModule(new mu::iex::bww::BwwModule());
512 : #endif
513 : #ifdef MUE_BUILD_IMPEXP_CAPELLA_MODULE
514 0 : app->addModule(new mu::iex::capella::CapellaModule());
515 : #endif
516 0 : app->addModule(new mu::iex::midi::MidiModule());
517 : #ifdef MUE_BUILD_IMPEXP_MLSCORE_MODULE
518 : app->addModule(new mu::iex::mlscore::MlScoreModule());
519 : #endif
520 0 : app->addModule(new mu::iex::mnxio::MnxModule());
521 : #ifdef MUE_BUILD_IMPEXP_MUSEDATA_MODULE
522 0 : app->addModule(new mu::iex::musedata::MuseDataModule());
523 : #endif
524 0 : app->addModule(new mu::iex::musicxml::MusicXmlModule());
525 0 : app->addModule(new mu::iex::ove::OveModule());
526 : #ifdef MUE_BUILD_IMPEXP_AUDIOEXPORT_MODULE
527 0 : app->addModule(new mu::iex::audioexport::AudioExportModule());
528 : #endif
529 : #ifdef MUE_BUILD_IMPEXP_IMAGESEXPORT_MODULE
530 0 : app->addModule(new mu::iex::imagesexport::ImagesExportModule());
531 : #endif
532 : #ifdef MUE_BUILD_IMPEXP_GUITARPRO_MODULE
533 0 : app->addModule(new mu::iex::guitarpro::GuitarProModule());
534 : #endif
535 0 : app->addModule(new mu::iex::mei::MeiModule());
536 : #ifdef MUE_BUILD_IMPEXP_VIDEOEXPORT_MODULE
537 0 : app->addModule(new mu::iex::videoexport::VideoExportModule());
538 : #endif
539 : #ifdef MUE_BUILD_IMPEXP_TABLEDIT_MODULE
540 0 : app->addModule(new mu::iex::tabledit::TablEditModule());
541 : #endif
542 : #ifdef MUE_BUILD_IMPEXP_LYRICS_MODULE
543 0 : app->addModule(new mu::iex::lrcexport::LyricsExportModule());
544 : #endif
545 :
546 0 : app->addModule(new muse::mi::MultiWindowsModule());
547 0 : app->addModule(new mu::notation::NotationModule());
548 0 : app->addModule(new mu::playback::PlaybackModule());
549 0 : app->addModule(new mu::project::ProjectModule());
550 0 : app->addModule(new muse::extensions::ExtensionsModule());
551 0 : app->addModule(new mu::notation::NotationSceneModule());
552 0 : }
553 :
554 0 : static void addAudioPluginRegistrationModules(std::shared_ptr<MuseScoreConsoleApp> app)
555 : {
556 0 : app->addModule(new muse::audio::AudioModule());
557 :
558 : #ifdef MUSE_MODULE_AUDIOPLUGINS
559 0 : app->addModule(new muse::audioplugins::AudioPluginsModule());
560 : #endif
561 :
562 : #ifdef MUSE_MODULE_VST
563 0 : app->addModule(new muse::vst::VSTModule());
564 : #endif
565 0 : }
566 :
567 0 : std::shared_ptr<muse::IApplication> AppFactory::newConsoleApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
568 : {
569 : #ifdef MUE_ENABLE_CONSOLEAPP
570 :
571 0 : std::shared_ptr<MuseScoreConsoleApp> app = std::make_shared<MuseScoreConsoleApp>(options);
572 :
573 0 : if (options->runMode == muse::IApplication::RunMode::ConsoleApp) {
574 0 : addConsoleModules(app);
575 0 : } else if (options->runMode == muse::IApplication::RunMode::AudioPluginRegistration) {
576 0 : addAudioPluginRegistrationModules(app);
577 : }
578 :
579 0 : return app;
580 :
581 : #else // MUE_ENABLE_CONSOLEAPP
582 :
583 : UNUSED(options);
584 : return nullptr;
585 :
586 : #endif
587 0 : }
|