Skip to content

Commit cb1bce2

Browse files
committed
moved app base logic to base app
1 parent 4e25547 commit cb1bce2

22 files changed

+1216
-985
lines changed

src/app/appfactory.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,18 +279,18 @@
279279
using namespace muse;
280280
using namespace mu::app;
281281

282-
std::shared_ptr<muse::IApplication> AppFactory::newApp(const CmdOptions& options) const
282+
std::shared_ptr<muse::IApplication> AppFactory::newApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
283283
{
284-
if (options.runMode == IApplication::RunMode::GuiApp) {
284+
if (options->runMode == IApplication::RunMode::GuiApp) {
285285
return newGuiApp(options);
286286
} else {
287287
return newConsoleApp(options);
288288
}
289289
}
290290

291-
std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const CmdOptions& options) const
291+
std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
292292
{
293-
std::shared_ptr<GuiApp> app = std::make_shared<GuiApp>(options);
293+
std::shared_ptr<MuseScoreGuiApp> app = std::make_shared<MuseScoreGuiApp>(options);
294294

295295
#ifdef MUSE_MODULE_DIAGNOSTICS
296296
//! NOTE `diagnostics` must be first, because it installs the crash handler.
@@ -429,7 +429,7 @@ std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const CmdOptions& opti
429429
return app;
430430
}
431431

432-
static void addConsoleModules(std::shared_ptr<ConsoleApp> app)
432+
static void addConsoleModules(std::shared_ptr<MuseScoreConsoleApp> app)
433433
{
434434
#ifdef MUSE_MODULE_DIAGNOSTICS
435435
//! NOTE `diagnostics` must be first, because it installs the crash handler.
@@ -530,7 +530,7 @@ static void addConsoleModules(std::shared_ptr<ConsoleApp> app)
530530
app->addModule(new mu::notation::NotationSceneModule());
531531
}
532532

533-
static void addAudioPluginRegistrationModules(std::shared_ptr<ConsoleApp> app)
533+
static void addAudioPluginRegistrationModules(std::shared_ptr<MuseScoreConsoleApp> app)
534534
{
535535
app->addModule(new muse::audio::AudioModule());
536536

@@ -543,15 +543,15 @@ static void addAudioPluginRegistrationModules(std::shared_ptr<ConsoleApp> app)
543543
#endif
544544
}
545545

546-
std::shared_ptr<muse::IApplication> AppFactory::newConsoleApp(const CmdOptions& options) const
546+
std::shared_ptr<muse::IApplication> AppFactory::newConsoleApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
547547
{
548548
#ifdef MUE_ENABLE_CONSOLEAPP
549549

550-
std::shared_ptr<ConsoleApp> app = std::make_shared<ConsoleApp>(options);
550+
std::shared_ptr<MuseScoreConsoleApp> app = std::make_shared<MuseScoreConsoleApp>(options);
551551

552-
if (options.runMode == muse::IApplication::RunMode::ConsoleApp) {
552+
if (options->runMode == muse::IApplication::RunMode::ConsoleApp) {
553553
addConsoleModules(app);
554-
} else if (options.runMode == muse::IApplication::RunMode::AudioPluginRegistration) {
554+
} else if (options->runMode == muse::IApplication::RunMode::AudioPluginRegistration) {
555555
addAudioPluginRegistrationModules(app);
556556
}
557557

src/app/appfactory.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class AppFactory
1010
public:
1111
AppFactory() = default;
1212

13-
std::shared_ptr<muse::IApplication> newApp(const CmdOptions& options) const;
13+
std::shared_ptr<muse::IApplication> newApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const;
1414

1515
private:
16-
std::shared_ptr<muse::IApplication> newGuiApp(const CmdOptions& options) const;
17-
std::shared_ptr<muse::IApplication> newConsoleApp(const CmdOptions& options) const;
16+
std::shared_ptr<muse::IApplication> newGuiApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const;
17+
std::shared_ptr<muse::IApplication> newConsoleApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const;
1818
};
1919
}

src/app/cmdoptions.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#include <string>
66

77
#include "global/io/path.h"
8-
#include "global/iapplication.h"
98
#include "global/logger.h"
9+
#include "global/internal/cmdoptions.h"
1010

1111
namespace mu::app {
1212
enum class ConvertType {
@@ -31,7 +31,7 @@ enum class DiagnosticType {
3131
DrawDiffToPng
3232
};
3333

34-
struct CmdOptions {
34+
struct MuseScoreCmdOptions : public muse::CmdOptions {
3535
enum class ParamKey {
3636
HighlightConfigPath,
3737
StylePath,
@@ -47,12 +47,6 @@ struct CmdOptions {
4747
ScoreRegion,
4848
};
4949

50-
muse::IApplication::RunMode runMode = muse::IApplication::RunMode::GuiApp;
51-
52-
struct {
53-
std::optional<double> physicalDotsPerInch;
54-
} ui;
55-
5650
struct {
5751
std::optional<bool> templateModeEnabled;
5852
std::optional<bool> testModeEnabled;
@@ -94,7 +88,6 @@ struct CmdOptions {
9488

9589
struct {
9690
std::optional<bool> revertToFactorySettings;
97-
std::optional<muse::logger::Level> loggerLevel;
9891
} app;
9992

10093
struct {

0 commit comments

Comments
 (0)