@@ -78,7 +78,8 @@ Ret ConverterController::batchConvert(const muse::io::path_t& batchJobFile, cons
7878 progress->progress (current, total, job.in .toStdString ());
7979 }
8080
81- Ret ret = fileConvert (job.in , job.out , openParams, soundProfile, extensionUri, job.transposeOptions , job.pageNum );
81+ Ret ret = fileConvert (job.in , job.out , openParams, soundProfile, extensionUri, job.transposeOptions , job.pageNum , job.visibleParts ,
82+ job.copyright );
8283 if (!ret) {
8384 errors.emplace_back (String (u" failed convert, err: %1, in: %2, out: %3" )
8485 .arg (String::fromStdString (ret.toString ())).arg (job.in .toString ()).arg (job.out .toString ()));
@@ -125,7 +126,8 @@ Ret ConverterController::fileConvert(const muse::io::path_t& in, const muse::io:
125126 const String& soundProfile,
126127 const muse::UriQuery& extensionUri,
127128 const std::optional<notation::TransposeOptions>& transposeOptions,
128- const std::optional<size_t >& pageNum)
129+ const std::optional<size_t >& pageNum, const std::vector<size_t >& visibleParts,
130+ const muse::String& copyright)
129131{
130132 TRACEFUNC;
131133
@@ -162,6 +164,16 @@ Ret ConverterController::fileConvert(const muse::io::path_t& in, const muse::io:
162164 }
163165 }
164166
167+ if (!visibleParts.empty ()) {
168+ ConverterUtils::setVisibleParts (notationProject->masterNotation ()->notation (), visibleParts);
169+ }
170+
171+ if (!copyright.isEmpty ()) {
172+ ProjectMeta meta = notationProject->metaInfo ();
173+ meta.copyright += copyright;
174+ notationProject->setMetaInfo (meta);
175+ }
176+
165177 globalContext ()->setCurrentProject (notationProject);
166178
167179 DEFER {
@@ -298,6 +310,33 @@ RetVal<ConverterController::BatchJob> ConverterController::parseBatchJob(const m
298310 job.pageNum = pageVal.toInt () - 1 ;
299311 }
300312
313+ QJsonValue visibleParts = obj[u" visibleParts" ];
314+ if (!visibleParts.isUndefined ()) {
315+ if (visibleParts.isArray ()) {
316+ const QJsonArray partsArray = visibleParts.toArray ();
317+ for (const auto part : partsArray) {
318+ if (part.isDouble ()) {
319+ job.visibleParts .push_back (part.toInt ());
320+ } else {
321+ LOGE () << " Visible parts value must be a Number" ;
322+ }
323+ }
324+ } else {
325+ rv.ret = make_ret (Err::BatchJobFileFailedParse, err.errorString ().toStdString ());
326+ return rv;
327+ }
328+ }
329+
330+ QJsonValue copyright = obj[u" copyright" ];
331+ if (!copyright.isUndefined ()) {
332+ if (copyright.isString ()) {
333+ job.copyright = copyright.toString ();
334+ } else {
335+ rv.ret = make_ret (Err::BatchJobFileFailedParse, err.errorString ().toStdString ());
336+ return rv;
337+ }
338+ }
339+
301340 const QJsonValue outValue = obj[u" out" ];
302341 if (outValue.isString ()) {
303342 job.out = correctUserInputPath (outValue.toString ());
0 commit comments