|
25 | 25 | #include "iprojectfilescontroller.h" |
26 | 26 |
|
27 | 27 | #include <QObject> |
| 28 | +#include <QString> |
28 | 29 |
|
29 | 30 | #include "modularity/ioc.h" |
30 | 31 | #include "iinteractive.h" |
|
39 | 40 | #include "print/iprintprovider.h" |
40 | 41 | #include "iexportprojectscenario.h" |
41 | 42 | #include "inotationreadersregister.h" |
| 43 | +#include "inotationwritersregister.h" |
42 | 44 | #include "iopensaveprojectscenario.h" |
43 | 45 | #include "imscmetareader.h" |
44 | 46 | #include "io/ifilesystem.h" |
45 | 47 | #include "notation/inotationconfiguration.h" |
| 48 | +#include "engraving/iengraving.h" |
46 | 49 | #include "musesounds/imusesoundscheckupdatescenario.h" |
47 | 50 | #include "extensions/iextensionsprovider.h" |
48 | 51 | #include "tours/itoursservice.h" |
49 | 52 |
|
50 | 53 | #include "async/asyncable.h" |
51 | 54 |
|
| 55 | +#include "inotationwriter.h" |
52 | 56 | #include "iprojectconfiguration.h" |
53 | 57 | #include "iprojectcreator.h" |
54 | 58 | #include "irecentfilescontroller.h" |
55 | 59 | #include "iprojectautosaver.h" |
56 | 60 |
|
57 | 61 | namespace mu::project { |
58 | 62 | class ProjectActionsController : public IProjectFilesController, public muse::mi::IProjectProvider, public muse::Injectable, |
59 | | - public muse::actions::Actionable, public muse::async::Asyncable |
| 63 | + public muse::actions::Actionable, public muse::async::Asyncable, virtual public engraving::IEngraving |
60 | 64 | { |
61 | 65 | muse::Inject<IProjectConfiguration> configuration = { this }; |
62 | 66 | muse::Inject<INotationReadersRegister> readers = { this }; |
| 67 | + muse::Inject<INotationWritersRegister> writers = { this }; |
63 | 68 | muse::Inject<IProjectCreator> projectCreator = { this }; |
| 69 | + muse::Inject<IProjectFilesController> projectFilesController = { this }; |
64 | 70 | muse::Inject<IRecentFilesController> recentFilesController = { this }; |
65 | 71 | muse::Inject<IProjectAutoSaver> projectAutoSaver = { this }; |
66 | 72 | muse::Inject<IOpenSaveProjectScenario> openSaveProjectScenario = { this }; |
@@ -104,6 +110,11 @@ class ProjectActionsController : public IProjectFilesController, public muse::mi |
104 | 110 | const ProjectBeingDownloaded& projectBeingDownloaded() const override; |
105 | 111 | muse::async::Notification projectBeingDownloadedChanged() const override; |
106 | 112 |
|
| 113 | + // IEngraving interface (for plugin API) |
| 114 | + bool APIwriteScore(const QString& name, const QString& ext) override; |
| 115 | + mu::engraving::Score* APIreadScore(const QString& name) override; |
| 116 | + void APIcloseScore() override; |
| 117 | + |
107 | 118 | private: |
108 | 119 | void setupConnections(); |
109 | 120 |
|
@@ -218,6 +229,8 @@ class ProjectActionsController : public IProjectFilesController, public muse::mi |
218 | 229 |
|
219 | 230 | QUrl scoreManagerUrl() const; |
220 | 231 |
|
| 232 | + std::optional<INotationWriter::UnitType> determineWriterUnitType(const std::string& ext) const; |
| 233 | + |
221 | 234 | bool m_isProjectSaving = false; |
222 | 235 | bool m_isProjectClosing = false; |
223 | 236 | bool m_isProjectProcessing = false; |
|
0 commit comments