Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FileTests_Exists_Append.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World!mimi
1 change: 1 addition & 0 deletions FileTests_Exists_ReadWrite.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mimio World!
1 change: 1 addition & 0 deletions FileTests_Exists_WriteOnly.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mimi
1 change: 1 addition & 0 deletions FileTests_RW.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World!
24 changes: 14 additions & 10 deletions src/app/appfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,22 @@
using namespace muse;
using namespace mu::app;

std::shared_ptr<muse::IApplication> AppFactory::newApp(const CmdOptions& options) const
std::shared_ptr<muse::IApplication> AppFactory::newApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
{
if (options.runMode == IApplication::RunMode::GuiApp) {
IF_ASSERT_FAILED(options) {
return nullptr;
}

if (options->runMode == IApplication::RunMode::GuiApp) {
return newGuiApp(options);
} else {
return newConsoleApp(options);
}
}

std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const CmdOptions& options) const
std::shared_ptr<muse::IApplication> AppFactory::newGuiApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
{
std::shared_ptr<GuiApp> app = std::make_shared<GuiApp>(options);
std::shared_ptr<MuseScoreGuiApp> app = std::make_shared<MuseScoreGuiApp>(options);

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

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

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

Expand All @@ -543,15 +547,15 @@ static void addAudioPluginRegistrationModules(std::shared_ptr<ConsoleApp> app)
#endif
}

std::shared_ptr<muse::IApplication> AppFactory::newConsoleApp(const CmdOptions& options) const
std::shared_ptr<muse::IApplication> AppFactory::newConsoleApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const
{
#ifdef MUE_ENABLE_CONSOLEAPP

std::shared_ptr<ConsoleApp> app = std::make_shared<ConsoleApp>(options);
std::shared_ptr<MuseScoreConsoleApp> app = std::make_shared<MuseScoreConsoleApp>(options);

if (options.runMode == muse::IApplication::RunMode::ConsoleApp) {
if (options->runMode == muse::IApplication::RunMode::ConsoleApp) {
addConsoleModules(app);
} else if (options.runMode == muse::IApplication::RunMode::AudioPluginRegistration) {
} else if (options->runMode == muse::IApplication::RunMode::AudioPluginRegistration) {
addAudioPluginRegistrationModules(app);
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/appfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class AppFactory
public:
AppFactory() = default;

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

private:
std::shared_ptr<muse::IApplication> newGuiApp(const CmdOptions& options) const;
std::shared_ptr<muse::IApplication> newConsoleApp(const CmdOptions& options) const;
std::shared_ptr<muse::IApplication> newGuiApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const;
std::shared_ptr<muse::IApplication> newConsoleApp(const std::shared_ptr<MuseScoreCmdOptions>& options) const;
};
}
11 changes: 2 additions & 9 deletions src/app/cmdoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <string>

#include "global/io/path.h"
#include "global/iapplication.h"
#include "global/logger.h"
#include "global/internal/cmdoptions.h"

namespace mu::app {
enum class ConvertType {
Expand All @@ -31,7 +31,7 @@ enum class DiagnosticType {
DrawDiffToPng
};

struct CmdOptions {
struct MuseScoreCmdOptions : public muse::CmdOptions {
enum class ParamKey {
HighlightConfigPath,
StylePath,
Expand All @@ -47,12 +47,6 @@ struct CmdOptions {
ScoreRegion,
};

muse::IApplication::RunMode runMode = muse::IApplication::RunMode::GuiApp;

struct {
std::optional<double> physicalDotsPerInch;
} ui;

struct {
std::optional<bool> templateModeEnabled;
std::optional<bool> testModeEnabled;
Expand Down Expand Up @@ -94,7 +88,6 @@ struct CmdOptions {

struct {
std::optional<bool> revertToFactorySettings;
std::optional<muse::logger::Level> loggerLevel;
} app;

struct {
Expand Down
Loading
Loading