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 : #ifdef MUE_CONFIGURATION_IS_APPWEB
150 : #include "web/appshell/appshellmodule.h"
151 : #else
152 : #include "appshell/appshellmodule.h"
153 : #endif
154 :
155 : #ifdef MUSE_MODULE_TESTFLOW
156 : #include "testflow/testflowmodule.h"
157 : #endif
158 :
159 : #ifdef MUSE_MODULE_AUTOMATION
160 : #include "framework/automation/automationmodule.h"
161 : #else
162 : #include "framework/stubs/automation/automationstubmodule.h"
163 : #endif
164 :
165 : #ifdef MUE_BUILD_BRAILLE_MODULE
166 : #include "braille/braillemodule.h"
167 : #else
168 : #include "stubs/braille/braillestubmodule.h"
169 : #endif
170 :
171 : #ifdef MUE_BUILD_CONVERTER_MODULE
172 : #include "converter/convertermodule.h"
173 : #endif
174 :
175 : #include "engraving/engravingmodule.h"
176 :
177 : #ifdef MUE_BUILD_IMPEXP_BB_MODULE
178 : #include "importexport/bb/bbmodule.h"
179 : #endif
180 : #ifdef MUE_BUILD_IMPEXP_BWW_MODULE
181 : #include "importexport/bww/bwwmodule.h"
182 : #endif
183 : #ifdef MUE_BUILD_IMPEXP_CAPELLA_MODULE
184 : #include "importexport/capella/capellamodule.h"
185 : #endif
186 : #ifdef MUE_BUILD_IMPEXP_MIDI_MODULE
187 : #include "importexport/midi/midimodule.h"
188 : #else
189 : #include "stubs/importexport/midi/midimodule.h"
190 : #endif
191 : #ifdef MUE_BUILD_IMPEXP_MLSCORE_MODULE
192 : #include "importexport/mlscore/mlscoremodule.h"
193 : #endif
194 : #ifdef MUE_BUILD_IMPEXP_MNX_MODULE
195 : #include "importexport/mnx/mnxmodule.h"
196 : #else
197 : #include "stubs/importexport/mnx/mnxmodule.h"
198 : #endif
199 : #ifdef MUE_BUILD_IMPEXP_MUSEDATA_MODULE
200 : #include "importexport/musedata/musedatamodule.h"
201 : #endif
202 : #ifdef MUE_BUILD_IMPEXP_MUSICXML_MODULE
203 : #include "importexport/musicxml/musicxmlmodule.h"
204 : #else
205 : #include "stubs/importexport/musicxml/musicxmlmodule.h"
206 : #endif
207 : #ifdef MUE_BUILD_IMPEXP_OVE_MODULE
208 : #include "importexport/ove/ovemodule.h"
209 : #else
210 : #include "stubs/importexport/ove/ovemodule.h"
211 : #endif
212 : #ifdef MUE_BUILD_IMPEXP_AUDIOEXPORT_MODULE
213 : #include "importexport/audioexport/audioexportmodule.h"
214 : #endif
215 : #ifdef MUE_BUILD_IMPEXP_IMAGESEXPORT_MODULE
216 : #include "importexport/imagesexport/imagesexportmodule.h"
217 : #endif
218 : #ifdef MUE_BUILD_IMPEXP_GUITARPRO_MODULE
219 : #include "importexport/guitarpro/guitarpromodule.h"
220 : #endif
221 : #ifdef MUE_BUILD_IMPEXP_MEI_MODULE
222 : #include "importexport/mei/meimodule.h"
223 : #else
224 : #include "stubs/importexport/mei/meimodule.h"
225 : #endif
226 :
227 : #ifdef MUE_BUILD_IMPEXP_VIDEOEXPORT_MODULE
228 : #include "importexport/videoexport/videoexportmodule.h"
229 : #endif
230 : #ifdef MUE_BUILD_IMPEXP_TABLEDIT_MODULE
231 : #include "importexport/tabledit/tableditmodule.h"
232 : #endif
233 : #ifdef MUE_BUILD_IMPEXP_LYRICS_MODULE
234 : #include "importexport/lyricsexport/lyricsexportmodule.h"
235 : #endif
236 :
237 : #include "propertiespanel/propertiespanelmodule.h"
238 :
239 : #ifdef MUE_BUILD_INSTRUMENTSSCENE_MODULE
240 : #include "instrumentsscene/instrumentsscenemodule.h"
241 : #else
242 : #include "stubs/instrumentsscene/instrumentsscenestubmodule.h"
243 : #endif
244 :
245 : #ifdef MUE_BUILD_MUSESOUNDS_MODULE
246 : #include "musesounds/musesoundsmodule.h"
247 : #else
248 : #include "stubs/musesounds/musesoundsstubmodule.h"
249 : #endif
250 :
251 : #ifdef MUE_BUILD_NOTATION_MODULE
252 : #include "notation/notationmodule.h"
253 : #else
254 : #include "stubs/notation/notationstubmodule.h"
255 : #endif
256 :
257 : #ifdef MUE_BUILD_NOTATIONSCENE_MODULE
258 : #include "notationscene/notationscenemodule.h"
259 : #else
260 : #include "stubs/notationscene/notationscenestubmodule.h"
261 : #endif
262 :
263 : #ifdef MUE_BUILD_PALETTE_MODULE
264 : #include "palette/palettemodule.h"
265 : #else
266 : #include "stubs/palette/palettestubmodule.h"
267 : #endif
268 :
269 : #ifdef MUE_BUILD_PLAYBACK_MODULE
270 : #include "playback/playbackmodule.h"
271 : #else
272 : #include "stubs/playback/playbackstubmodule.h"
273 : #endif
274 :
275 : #ifdef MUE_BUILD_PREFERENCES_MODULE
276 : #include "preferences/preferencesmodule.h"
277 : #endif
278 :
279 : #ifdef MUE_BUILD_PRINT_MODULE
280 : #include "print/printmodule.h"
281 : #endif
282 :
283 : #ifdef MUE_BUILD_PROJECT_MODULE
284 : #include "project/projectmodule.h"
285 : #else
286 : #include "stubs/project/projectstubmodule.h"
287 : #endif
288 :
289 : #ifdef MUE_CONFIGURATION_IS_APPWEB
290 : #include "web/appjs/appjsmodule.h"
291 : #endif
292 :
293 : using namespace muse;
294 : using namespace mu::app;
295 :
296 0 : std::shared_ptr<muse::IApplication> AppFactory::newApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
297 : {
298 0 : IF_ASSERT_FAILED(options) {
299 0 : return nullptr;
300 : }
301 :
302 0 : if (options->runMode == IApplication::RunMode::GuiApp) {
303 0 : return newGuiApp(options);
304 : } else {
305 0 : return newConsoleApp(options);
306 : }
307 : }
308 :
309 0 : std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
310 : {
311 0 : std::shared_ptr<MuseScoreGuiApp> app = std::make_shared<MuseScoreGuiApp>(options);
312 :
313 : #ifdef MUSE_MODULE_DIAGNOSTICS
314 : //! NOTE `diagnostics` must be first, because it installs the crash handler.
315 : //! For other modules, the order is (and should be) unimportant.
316 0 : app->addModule(new muse::diagnostics::DiagnosticsModule());
317 : #endif
318 :
319 : // framework
320 0 : app->addModule(new muse::accessibility::AccessibilityModule());
321 0 : app->addModule(new muse::actions::ActionsModule());
322 0 : app->addModule(new muse::rcommand::RCommandModule());
323 0 : app->addModule(new muse::rcontrol::RControlModule());
324 0 : app->addModule(new muse::audio::AudioModule());
325 : #ifdef MUSE_MODULE_AUDIOPLUGINS
326 0 : app->addModule(new muse::audioplugins::AudioPluginsModule());
327 : #endif
328 0 : app->addModule(new muse::automation::AutomationModule());
329 0 : app->addModule(new muse::draw::DrawModule());
330 : #ifdef MUSE_MODULE_INTERACTIVE
331 0 : app->addModule(new muse::interactive::InteractiveModule());
332 : #endif
333 0 : app->addModule(new muse::midi::MidiModule());
334 0 : app->addModule(new muse::midiremote::MidiRemoteModule());
335 0 : app->addModule(new muse::mpe::MpeModule());
336 :
337 : #ifdef MUSE_MODULE_MUSESAMPLER
338 0 : bool shouldAddMuseSamplerModule = true;
339 : #ifndef MUSE_MODULE_MUSESAMPLER_LOAD_IN_DEBUG
340 0 : if (runtime::isDebug()) {
341 0 : shouldAddMuseSamplerModule = false;
342 0 : LOGI() << "Not adding MuseSampler module in a debug build";
343 : }
344 : #endif
345 :
346 0 : if (shouldAddMuseSamplerModule) {
347 0 : app->addModule(new muse::musesampler::MuseSamplerModule());
348 : }
349 : #endif
350 :
351 0 : app->addModule(new muse::network::NetworkModule());
352 0 : app->addModule(new muse::shortcuts::ShortcutsModule());
353 : #ifdef MUSE_MODULE_UI
354 0 : app->addModule(new muse::ui::UiModule());
355 0 : app->addModule(new muse::uicomponents::UiComponentsModule());
356 : #endif
357 :
358 : #ifdef MUSE_MODULE_DOCKWINDOW
359 0 : app->addModule(new muse::dock::DockModule());
360 : #endif
361 : #ifdef MUSE_MODULE_TOAST
362 0 : app->addModule(new muse::toast::ToastModule());
363 : #endif
364 0 : app->addModule(new muse::tours::ToursModule());
365 0 : app->addModule(new muse::vst::VSTModule());
366 0 : app->addModule(new muse::media::MediaModule());
367 :
368 : // modules
369 : #ifdef MUE_BUILD_APPSHELL_MODULE
370 0 : app->addModule(new mu::appshell::AppShellModule());
371 : #endif
372 :
373 : #ifdef MUSE_MODULE_TESTFLOW
374 : app->addModule(new muse::testflow::TestflowModule());
375 : #endif
376 :
377 0 : app->addModule(new mu::braille::BrailleModule());
378 :
379 0 : app->addModule(new muse::cloud::CloudModule());
380 :
381 : #ifdef MUE_BUILD_CONVERTER_MODULE
382 0 : app->addModule(new mu::converter::ConverterModule());
383 : #endif
384 :
385 0 : app->addModule(new mu::engraving::EngravingModule());
386 :
387 : #ifdef MUE_BUILD_IMPEXP_BB_MODULE
388 0 : app->addModule(new mu::iex::bb::BBModule());
389 : #endif
390 : #ifdef MUE_BUILD_IMPEXP_BWW_MODULE
391 0 : app->addModule(new mu::iex::bww::BwwModule());
392 : #endif
393 : #ifdef MUE_BUILD_IMPEXP_CAPELLA_MODULE
394 0 : app->addModule(new mu::iex::capella::CapellaModule());
395 : #endif
396 0 : app->addModule(new mu::iex::midi::MidiModule());
397 : #ifdef MUE_BUILD_IMPEXP_MLSCORE_MODULE
398 : app->addModule(new mu::iex::mlscore::MlScoreModule());
399 : #endif
400 0 : app->addModule(new mu::iex::mnxio::MnxModule());
401 : #ifdef MUE_BUILD_IMPEXP_MUSEDATA_MODULE
402 0 : app->addModule(new mu::iex::musedata::MuseDataModule());
403 : #endif
404 0 : app->addModule(new mu::iex::musicxml::MusicXmlModule());
405 0 : app->addModule(new mu::iex::ove::OveModule());
406 : #ifdef MUE_BUILD_IMPEXP_AUDIOEXPORT_MODULE
407 0 : app->addModule(new mu::iex::audioexport::AudioExportModule());
408 : #endif
409 : #ifdef MUE_BUILD_IMPEXP_IMAGESEXPORT_MODULE
410 0 : app->addModule(new mu::iex::imagesexport::ImagesExportModule());
411 : #endif
412 : #ifdef MUE_BUILD_IMPEXP_GUITARPRO_MODULE
413 0 : app->addModule(new mu::iex::guitarpro::GuitarProModule());
414 : #endif
415 0 : app->addModule(new mu::iex::mei::MeiModule());
416 : #ifdef MUE_BUILD_IMPEXP_VIDEOEXPORT_MODULE
417 0 : app->addModule(new mu::iex::videoexport::VideoExportModule());
418 : #endif
419 : #ifdef MUE_BUILD_IMPEXP_TABLEDIT_MODULE
420 0 : app->addModule(new mu::iex::tabledit::TablEditModule());
421 : #endif
422 : #ifdef MUE_BUILD_IMPEXP_LYRICS_MODULE
423 0 : app->addModule(new mu::iex::lrcexport::LyricsExportModule());
424 : #endif
425 :
426 0 : app->addModule(new mu::propertiespanel::PropertiesPanelModule());
427 0 : app->addModule(new mu::instrumentsscene::InstrumentsSceneModule());
428 0 : app->addModule(new muse::extensions::ExtensionsModule());
429 0 : app->addModule(new muse::languages::LanguagesModule());
430 0 : app->addModule(new muse::learn::LearnModule());
431 0 : app->addModule(new muse::mi::MultiWindowsModule());
432 0 : app->addModule(new mu::musesounds::MuseSoundsModule());
433 0 : app->addModule(new mu::notation::NotationModule());
434 0 : app->addModule(new mu::notation::NotationSceneModule());
435 0 : app->addModule(new mu::palette::PaletteModule());
436 0 : app->addModule(new mu::playback::PlaybackModule());
437 : #ifdef MUE_BUILD_PREFERENCES_MODULE
438 0 : app->addModule(new mu::preferences::PreferencesModule());
439 : #endif
440 :
441 : #ifdef MUE_BUILD_PRINT_MODULE
442 0 : app->addModule(new mu::print::PrintModule());
443 : #endif
444 0 : app->addModule(new mu::project::ProjectModule());
445 0 : app->addModule(new muse::update::UpdateModule());
446 0 : app->addModule(new muse::workspace::WorkspaceModule());
447 :
448 : #ifdef MUE_CONFIGURATION_IS_APPWEB
449 : app->addModule(new mu::appjs::AppJsModule());
450 : #endif
451 :
452 0 : return app;
453 0 : }
454 :
455 0 : static void addConsoleModules(std::shared_ptr<MuseScoreConsoleApp> app)
456 : {
457 : #ifdef MUSE_MODULE_DIAGNOSTICS
458 : //! NOTE `diagnostics` must be first, because it installs the crash handler.
459 : //! For other modules, the order is (an should be) unimportant.
460 0 : app->addModule(new muse::diagnostics::DiagnosticsModule());
461 : #endif
462 :
463 : //! TODO Some modules can be removed
464 :
465 : // framework
466 0 : app->addModule(new muse::actions::ActionsModule());
467 0 : app->addModule(new muse::rcommand::RCommandModule());
468 0 : app->addModule(new muse::rcontrol::RControlModule());
469 0 : app->addModule(new muse::audio::AudioModule());
470 : #ifdef MUSE_MODULE_AUDIOPLUGINS
471 0 : app->addModule(new muse::audioplugins::AudioPluginsModule());
472 : #endif
473 0 : app->addModule(new muse::draw::DrawModule());
474 0 : app->addModule(new muse::midi::MidiModule());
475 0 : app->addModule(new muse::mpe::MpeModule());
476 :
477 : #ifdef MUSE_MODULE_MUSESAMPLER
478 0 : bool shouldAddMuseSamplerModule = true;
479 : #ifndef MUSE_MODULE_MUSESAMPLER_LOAD_IN_DEBUG
480 0 : if (runtime::isDebug()) {
481 0 : shouldAddMuseSamplerModule = false;
482 0 : LOGI() << "Not adding MuseSampler module in a debug build";
483 : }
484 : #endif
485 :
486 0 : if (shouldAddMuseSamplerModule) {
487 0 : app->addModule(new muse::musesampler::MuseSamplerModule());
488 : }
489 : #endif
490 :
491 : #ifdef MUSE_MODULE_UI
492 0 : app->addModule(new muse::ui::UiModule());
493 : #endif
494 :
495 : #ifdef MUSE_MODULE_VST
496 0 : app->addModule(new muse::vst::VSTModule());
497 : #endif
498 :
499 0 : app->addModule(new muse::media::MediaModule());
500 :
501 : #ifdef MUSE_MODULE_TESTFLOW
502 : app->addModule(new muse::testflow::TestflowModule());
503 : #endif
504 :
505 : #ifdef MUE_BUILD_CONVERTER_MODULE
506 0 : app->addModule(new mu::converter::ConverterModule());
507 : #endif
508 :
509 0 : app->addModule(new mu::engraving::EngravingModule());
510 :
511 : #ifdef MUE_BUILD_IMPEXP_BB_MODULE
512 0 : app->addModule(new mu::iex::bb::BBModule());
513 : #endif
514 : #ifdef MUE_BUILD_IMPEXP_BWW_MODULE
515 0 : app->addModule(new mu::iex::bww::BwwModule());
516 : #endif
517 : #ifdef MUE_BUILD_IMPEXP_CAPELLA_MODULE
518 0 : app->addModule(new mu::iex::capella::CapellaModule());
519 : #endif
520 0 : app->addModule(new mu::iex::midi::MidiModule());
521 : #ifdef MUE_BUILD_IMPEXP_MLSCORE_MODULE
522 : app->addModule(new mu::iex::mlscore::MlScoreModule());
523 : #endif
524 0 : app->addModule(new mu::iex::mnxio::MnxModule());
525 : #ifdef MUE_BUILD_IMPEXP_MUSEDATA_MODULE
526 0 : app->addModule(new mu::iex::musedata::MuseDataModule());
527 : #endif
528 0 : app->addModule(new mu::iex::musicxml::MusicXmlModule());
529 0 : app->addModule(new mu::iex::ove::OveModule());
530 : #ifdef MUE_BUILD_IMPEXP_AUDIOEXPORT_MODULE
531 0 : app->addModule(new mu::iex::audioexport::AudioExportModule());
532 : #endif
533 : #ifdef MUE_BUILD_IMPEXP_IMAGESEXPORT_MODULE
534 0 : app->addModule(new mu::iex::imagesexport::ImagesExportModule());
535 : #endif
536 : #ifdef MUE_BUILD_IMPEXP_GUITARPRO_MODULE
537 0 : app->addModule(new mu::iex::guitarpro::GuitarProModule());
538 : #endif
539 0 : app->addModule(new mu::iex::mei::MeiModule());
540 : #ifdef MUE_BUILD_IMPEXP_VIDEOEXPORT_MODULE
541 0 : app->addModule(new mu::iex::videoexport::VideoExportModule());
542 : #endif
543 : #ifdef MUE_BUILD_IMPEXP_TABLEDIT_MODULE
544 0 : app->addModule(new mu::iex::tabledit::TablEditModule());
545 : #endif
546 : #ifdef MUE_BUILD_IMPEXP_LYRICS_MODULE
547 0 : app->addModule(new mu::iex::lrcexport::LyricsExportModule());
548 : #endif
549 :
550 0 : app->addModule(new muse::mi::MultiWindowsModule());
551 0 : app->addModule(new mu::notation::NotationModule());
552 0 : app->addModule(new mu::playback::PlaybackModule());
553 0 : app->addModule(new mu::project::ProjectModule());
554 0 : app->addModule(new muse::extensions::ExtensionsModule());
555 0 : app->addModule(new mu::notation::NotationSceneModule());
556 0 : }
557 :
558 0 : static void addAudioPluginRegistrationModules(std::shared_ptr<MuseScoreConsoleApp> app)
559 : {
560 0 : app->addModule(new muse::audio::AudioModule());
561 :
562 : #ifdef MUSE_MODULE_AUDIOPLUGINS
563 0 : app->addModule(new muse::audioplugins::AudioPluginsModule());
564 : #endif
565 :
566 : #ifdef MUSE_MODULE_VST
567 0 : app->addModule(new muse::vst::VSTModule());
568 : #endif
569 0 : }
570 :
571 0 : std::shared_ptr<muse::IApplication> AppFactory::newConsoleApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
572 : {
573 : #ifdef MUE_ENABLE_CONSOLEAPP
574 :
575 0 : std::shared_ptr<MuseScoreConsoleApp> app = std::make_shared<MuseScoreConsoleApp>(options);
576 :
577 0 : if (options->runMode == muse::IApplication::RunMode::ConsoleApp) {
578 0 : addConsoleModules(app);
579 0 : } else if (options->runMode == muse::IApplication::RunMode::AudioPluginRegistration) {
580 0 : addAudioPluginRegistrationModules(app);
581 : }
582 :
583 0 : return app;
584 :
585 : #else // MUE_ENABLE_CONSOLEAPP
586 :
587 : UNUSED(options);
588 : return nullptr;
589 :
590 : #endif
591 0 : }
|