@@ -67,7 +67,6 @@ static const std::string META_DATA_NAME = "metadata";
6767static const std::string DEV_INFO_NAME = " devinfo" ;
6868
6969static constexpr bool ADD_SEPARATOR = true ;
70- static constexpr auto NO_STYLE = " " ;
7170
7271static ScoreElementScanner::Options parseScoreElementScannerOptions (const std::string& json)
7372{
@@ -104,13 +103,11 @@ static ScoreElementScanner::Options parseScoreElementScannerOptions(const std::s
104103}
105104
106105Ret BackendApi::exportScoreMedia (const muse::io::path_t & in, const muse::io::path_t & out, const muse::io::path_t & highlightConfigPath,
107- const muse::io::path_t & stylePath,
108- bool forceMode,
109- bool unrollRepeats)
106+ const OpenParams& openParams)
110107{
111108 TRACEFUNC
112109
113- RetVal<INotationProjectPtr> prj = openProject (in, stylePath, forceMode, unrollRepeats );
110+ RetVal<INotationProjectPtr> prj = openProject (in, openParams );
114111 if (!prj.ret ) {
115112 return prj.ret ;
116113 }
@@ -139,12 +136,11 @@ Ret BackendApi::exportScoreMedia(const muse::io::path_t& in, const muse::io::pat
139136 return result ? make_ret (Ret::Code::Ok) : make_ret (Ret::Code::InternalError);
140137}
141138
142- Ret BackendApi::exportScoreMeta (const muse::io::path_t & in, const muse::io::path_t & out, const muse::io::path_t & stylePath,
143- bool forceMode, bool unrollRepeats)
139+ Ret BackendApi::exportScoreMeta (const muse::io::path_t & in, const muse::io::path_t & out, const OpenParams& openParams)
144140{
145141 TRACEFUNC
146142
147- RetVal<INotationProjectPtr> prj = openProject (in, stylePath, forceMode, unrollRepeats );
143+ RetVal<INotationProjectPtr> prj = openProject (in, openParams );
148144 if (!prj.ret ) {
149145 return prj.ret ;
150146 }
@@ -161,12 +157,11 @@ Ret BackendApi::exportScoreMeta(const muse::io::path_t& in, const muse::io::path
161157 return result ? make_ret (Ret::Code::Ok) : make_ret (Ret::Code::InternalError);
162158}
163159
164- Ret BackendApi::exportScoreParts (const muse::io::path_t & in, const muse::io::path_t & out, const muse::io::path_t & stylePath,
165- bool forceMode, bool unrollRepeats)
160+ Ret BackendApi::exportScoreParts (const muse::io::path_t & in, const muse::io::path_t & out, const OpenParams& openParams)
166161{
167162 TRACEFUNC
168163
169- RetVal<INotationProjectPtr> prj = openProject (in, stylePath, forceMode, unrollRepeats );
164+ RetVal<INotationProjectPtr> prj = openProject (in, openParams );
170165 if (!prj.ret ) {
171166 return prj.ret ;
172167 }
@@ -181,12 +176,11 @@ Ret BackendApi::exportScoreParts(const muse::io::path_t& in, const muse::io::pat
181176 return ret;
182177}
183178
184- Ret BackendApi::exportScorePartsPdfs (const muse::io::path_t & in, const muse::io::path_t & out, const muse::io::path_t & stylePath,
185- bool forceMode, bool unrollRepeats)
179+ Ret BackendApi::exportScorePartsPdfs (const muse::io::path_t & in, const muse::io::path_t & out, const OpenParams& openParams)
186180{
187181 TRACEFUNC
188182
189- RetVal<INotationProjectPtr> prj = openProject (in, stylePath, forceMode, unrollRepeats );
183+ RetVal<INotationProjectPtr> prj = openProject (in, openParams );
190184 if (!prj.ret ) {
191185 return prj.ret ;
192186 }
@@ -204,12 +198,11 @@ Ret BackendApi::exportScorePartsPdfs(const muse::io::path_t& in, const muse::io:
204198}
205199
206200Ret BackendApi::exportScoreTranspose (const muse::io::path_t & in, const muse::io::path_t & out, const std::string& optionsJson,
207- const muse::io::path_t & stylePath,
208- bool forceMode, bool unrollRepeats)
201+ const OpenParams& openParams)
209202{
210203 TRACEFUNC
211204
212- RetVal<INotationProjectPtr> prj = openProject (in, stylePath, forceMode, unrollRepeats );
205+ RetVal<INotationProjectPtr> prj = openProject (in, openParams );
213206 if (!prj.ret ) {
214207 return prj.ret ;
215208 }
@@ -232,11 +225,11 @@ Ret BackendApi::exportScoreTranspose(const muse::io::path_t& in, const muse::io:
232225}
233226
234227Ret BackendApi::exportScoreElements (const muse::io::path_t & in, const muse::io::path_t & out, const std::string& optionsJson,
235- const muse::io:: path_t & stylePath, bool forceMode )
228+ const OpenParams& openParams )
236229{
237230 TRACEFUNC;
238231
239- RetVal<INotationProjectPtr> prj = openProject (in, stylePath, forceMode );
232+ RetVal<INotationProjectPtr> prj = openProject (in, openParams );
240233 if (!prj.ret ) {
241234 return prj.ret ;
242235 }
@@ -262,10 +255,7 @@ Ret BackendApi::openOutputFile(QFile& file, const muse::io::path_t& out)
262255 return ok ? make_ret (Ret::Code::Ok) : make_ret (Ret::Code::InternalError);
263256}
264257
265- RetVal<project::INotationProjectPtr> BackendApi::openProject (const muse::io::path_t & path,
266- const muse::io::path_t & stylePath,
267- bool forceMode,
268- bool unrollRepeats)
258+ RetVal<project::INotationProjectPtr> BackendApi::openProject (const muse::io::path_t & path, const OpenParams& params)
269259{
270260 TRACEFUNC
271261
@@ -274,7 +264,7 @@ RetVal<project::INotationProjectPtr> BackendApi::openProject(const muse::io::pat
274264 return make_ret (Ret::Code::InternalError);
275265 }
276266
277- Ret ret = notationProject->load (path, stylePath, forceMode, unrollRepeats );
267+ Ret ret = notationProject->load (path, params );
278268 if (!ret) {
279269 LOGE () << " failed load: " << path << " , ret: " << ret.toString ();
280270 return make_ret (Ret::Code::InternalError);
@@ -840,7 +830,10 @@ void BackendApi::initPotentialExcerpts(notation::IMasterNotationPtr masterNotati
840830
841831Ret BackendApi::updateSource (const muse::io::path_t & in, const std::string& newSource, bool forceMode)
842832{
843- RetVal<INotationProjectPtr> project = openProject (in, NO_STYLE, forceMode);
833+ OpenParams openParams;
834+ openParams.forceMode = forceMode;
835+
836+ RetVal<INotationProjectPtr> project = openProject (in, openParams);
844837 if (!project.ret ) {
845838 return project.ret ;
846839 }
0 commit comments