Finale PDK Framework 0.77
Power Up Your Finale Music Software
Loading...
Searching...
No Matches
fflua_luaiterator.h
1/*
2 * File: fflua_luaiterator.h
3 *
4 * Created by Jari Williamsson on 2015-11-04.
5 *
6 * ******* IMPORTANT!!! ******
7 * Although this file is available in the PDK Framework folder, it should NOT be used in
8 * the PDK Framework umbrella. This file is placed in the framework folder purely ONLY to
9 * provide online documentation for the FCLuaIterator class!
10 *
11 * (The file will ONLY make sense in the context of the specific
12 * LuaBridge connection implementation.)
13 *
14 * The following class implementation is for the special FCLuaIterator class in JW and RGP Lua. Since
15 * a limitation of LuaBridge is that the include file can only be included at one place,
16 * this work-around is used.
17 *
18 * If you include this header you must provide a LuaRun_ExceptionAbort function that prints the error
19 * in the Lua output stream, disconnects and disposes of the Lua state, and displays the message to the user.
20 * You can use lua_getstack to determine if LuaRun_ExceptionAbort is running under Lua and should throw the exception
21 * up the chain rather than taking other actions.
22 */
23
24#ifndef jwlua_fflua_luaiterator_h
25#define jwlua_fflua_luaiterator_h
26
78class FCLuaIterator : public __FCBase
79{
80public:
81 const char* ClassName() const override { return "FCLuaIterator"; }
82
158
181
182
199
200private:
201 enum CLASS_APPROACHES
202 {
203 CLASSAPPROACH_NONE = 0,
204 CLASSAPPROACH_ENTRYDETAILS, /* Entry-attached data */
205 CLASSAPPROACH_NOTEDETAILS, /* Note-attached data */
206 CLASSAPPROACH_MEASUREDETAILS, /* Measure-attached data*/
207 CLASSAPPROACH_CELLDETAILS /* Cell-attached data */
208 };
209
210
211
212 /*********************************************/
213 /* Classes for adding/removing entry filters */
214 /*********************************************/
215
216 class _FCLuaIterEntryFilter : public __FCBase
217 {
218 LUAITERATOR_ENTRYFILTERS _entryfilter;
219 public:
220 const char* ClassName() const override { return "_FCLuaIterEntryFilter"; }
221
222 _FCLuaIterEntryFilter(LUAITERATOR_ENTRYFILTERS value) : __FCBase() { _entryfilter = value; }
223
224 LUAITERATOR_ENTRYFILTERS GetFilter() { return _entryfilter; }
225 };
226
227 class _FCLuaIterEntryFilters : public __FCCollection
228 {
229 public:
230 const char* ClassName() const override { return "_FCLuaIterEntryFilters"; }
231
232 _FCLuaIterEntryFilters() : __FCCollection() {}
233
234
235 _FCLuaIterEntryFilter* GetItemAt(int index) const { return (_FCLuaIterEntryFilter*)__FCCollection::GetItemAt(index); }
236
237 _FCLuaIterEntryFilter* Find(LUAITERATOR_ENTRYFILTERS filter)
238 {
239 for (int i = 0; i < GetCount(); i++)
240 {
241 _FCLuaIterEntryFilter* pItem = GetItemAt(i);
242 if (pItem->GetFilter() == filter) return pItem;
243 }
244 return NULL;
245 }
246
247 bool AddFilter(LUAITERATOR_ENTRYFILTERS filter)
248 {
249 if (Find(filter)) return false;
250 Add(new _FCLuaIterEntryFilter(filter));
251 return true;
252 }
253
254 bool RemoveFilter(LUAITERATOR_ENTRYFILTERS filter)
255 {
256 _FCLuaIterEntryFilter* pItem = Find(filter);
257 if (!pItem) return false;
258 int index = GetIndexOf(pItem);
259 if (index == -1) return false; /* Should never occur, but to be safe... */
260 ClearItemAt(index);
261 return true;
262 }
263 };
264
265 /********************************************/
266 /* Classes for adding/removing note filters */
267 /********************************************/
268
269 class _FCLuaIterNoteFilter : public __FCBase
270 {
271 LUAITERATOR_NOTEFILTERS _notefilter;
272 public:
273 const char* ClassName() const override { return "_FCLuaIterNoteFilter"; }
274
275 _FCLuaIterNoteFilter(LUAITERATOR_NOTEFILTERS value) : __FCBase() { _notefilter = value; }
276
277 LUAITERATOR_NOTEFILTERS GetFilter() { return _notefilter; }
278 };
279
280 class _FCLuaIterNoteFilters : public __FCCollection
281 {
282 public:
283 const char* ClassName() const override { return "_FCLuaIterNoteFilters"; }
284
285 _FCLuaIterNoteFilters() : __FCCollection() {}
286
287
288 _FCLuaIterNoteFilter* GetItemAt(int index) const { return (_FCLuaIterNoteFilter*)__FCCollection::GetItemAt(index); }
289
290 _FCLuaIterNoteFilter* Find(LUAITERATOR_NOTEFILTERS filter)
291 {
292 for (int i = 0; i < GetCount(); i++)
293 {
294 _FCLuaIterNoteFilter* pItem = GetItemAt(i);
295 if (pItem->GetFilter() == filter) return pItem;
296 }
297 return NULL;
298 }
299
300 bool AddFilter(LUAITERATOR_NOTEFILTERS filter)
301 {
302 if (Find(filter)) return false;
303 Add(new _FCLuaIterNoteFilter(filter));
304 return true;
305 }
306
307 bool RemoveFilter(LUAITERATOR_NOTEFILTERS filter)
308 {
309 _FCLuaIterNoteFilter* pItem = Find(filter);
310 if (!pItem) return false;
311 int index = GetIndexOf(pItem);
312 if (index == -1) return false; /* Should never occur, but to be safe... */
313 ClearItemAt(index);
314 return true;
315 }
316 };
317
318
319 /**********************************************************/
320 /* Classes for adding/removing alternate notation filters */
321 /**********************************************************/
322 class _FCLuaIterAltNotationFilter : public __FCBase
323 {
324 __FCStaffBase::ALTERNATE_STAFF _altnotationfilter;
325 public:
326 const char* ClassName() const override { return "_FCLuaIterAltNotationFilter"; }
327
328 _FCLuaIterAltNotationFilter(__FCStaffBase::ALTERNATE_STAFF value) : __FCBase() { _altnotationfilter = value; }
329
330 __FCStaffBase::ALTERNATE_STAFF GetFilter() { return _altnotationfilter; }
331 };
332
333 class _FCLuaIterAltNotationFilters : public __FCCollection
334 {
335 public:
336 const char* ClassName() const override { return "_FCLuaIterAltNotationFilters"; }
337
338 _FCLuaIterAltNotationFilters() : __FCCollection() {}
339
340 _FCLuaIterAltNotationFilter* GetItemAt(int index) const { return (_FCLuaIterAltNotationFilter*)__FCCollection::GetItemAt(index); }
341
342 _FCLuaIterAltNotationFilter* Find(__FCStaffBase::ALTERNATE_STAFF filter)
343 {
344 for (int i = 0; i < GetCount(); i++)
345 {
346 _FCLuaIterAltNotationFilter* pItem = GetItemAt(i);
347 if (pItem->GetFilter() == filter) return pItem;
348 }
349 return NULL;
350 }
351
352 bool AddFilter(__FCStaffBase::ALTERNATE_STAFF filter)
353 {
354 if (Find(filter)) return false;
355 Add(new _FCLuaIterAltNotationFilter(filter));
356 return true;
357 }
358
359 bool RemoveFilter(__FCStaffBase::ALTERNATE_STAFF filter)
360 {
361 _FCLuaIterAltNotationFilter* pItem = Find(filter);
362 if (!pItem) return false;
363 int index = GetIndexOf(pItem);
364 if (index == -1) return false; /* Should never occur, but to be safe... */
365 ClearItemAt(index);
366 return true;
367 }
368 };
369
370 /******************************************************/
371 /* Classes for adding/removing notation style filters */
372 /******************************************************/
373 class _FCLuaIterNotationStyleFilter : public __FCBase
374 {
375 __FCStaffBase::STAFFNOTATION_STYLE _notationstylefilter;
376 public:
377 const char* ClassName() const override { return "_FCLuaIterNotationStyleFilter"; }
378
379 _FCLuaIterNotationStyleFilter(__FCStaffBase::STAFFNOTATION_STYLE value) : __FCBase() { _notationstylefilter = value; }
380
381 __FCStaffBase::STAFFNOTATION_STYLE GetFilter() { return _notationstylefilter; }
382 };
383
384 class _FCLuaIterNotationStyleFilters : public __FCCollection
385 {
386 public:
387 const char* ClassName() const override { return "_FCLuaIterNotationStyleFilters"; }
388
389 _FCLuaIterNotationStyleFilters() : __FCCollection() {}
390
391 _FCLuaIterNotationStyleFilter* GetItemAt(int index) const { return (_FCLuaIterNotationStyleFilter*)__FCCollection::GetItemAt(index); }
392
393 _FCLuaIterNotationStyleFilter* Find(__FCStaffBase::STAFFNOTATION_STYLE filter)
394 {
395 for (int i = 0; i < GetCount(); i++)
396 {
397 _FCLuaIterNotationStyleFilter* pItem = GetItemAt(i);
398 if (pItem->GetFilter() == filter) return pItem;
399 }
400 return NULL;
401 }
402
403 bool AddFilter(__FCStaffBase::STAFFNOTATION_STYLE filter)
404 {
405 if (Find(filter)) return false;
406 Add(new _FCLuaIterNotationStyleFilter(filter));
407 return true;
408 }
409
410 bool RemoveFilter(__FCStaffBase::STAFFNOTATION_STYLE filter)
411 {
412 _FCLuaIterNotationStyleFilter* pItem = Find(filter);
413 if (!pItem) return false;
414 int index = GetIndexOf(pItem);
415 if (index == -1) return false; /* Should never occur, but to be safe... */
416 ClearItemAt(index);
417 return true;
418 }
419 };
420
421 _FCLuaIterEntryFilters _entryfilters_AND;
422 _FCLuaIterEntryFilters _entryfilters_OR;
423 _FCLuaIterEntryFilters _entryfilters_NOT;
424
425 _FCLuaIterNoteFilters _notefilters_AND;
426 _FCLuaIterNoteFilters _notefilters_OR;
427 _FCLuaIterNoteFilters _notefilters_NOT;
428
429 _FCLuaIterAltNotationFilters _altnotationfilters_AND;
430 _FCLuaIterAltNotationFilters _altnotationfilters_OR;
431 _FCLuaIterAltNotationFilters _altnotationfilters_NOT;
432
433 _FCLuaIterNotationStyleFilters _notationstylefilters_AND;
434 _FCLuaIterNotationStyleFilters _notationstylefilters_OR;
435 _FCLuaIterNotationStyleFilters _notationstylefilters_NOT;
436
437 bool _nullregionequalsall;
438
439 bool _forwardprocessing;
440 bool _downwardprocessing;
441 bool _partialmeasureselections;
442
443 double _timingstart, _timingend;
444 bool _useprogressbar;
445 bool _abortableprogressbar;
446 bool _progressbar_useraborted;
447 int _progressfrequency; /* How often the meter should update. */
448 int _loadlayermode;
449 bool _processscorepart;
450 bool _processcurrentpart;
451 bool _processcurrentdoc;
452
453 /************************/
454 /* Check entry filters. */
455 /************************/
456
457 bool EntryFilterCheck(FCNoteEntry* pEntry, LUAITERATOR_ENTRYFILTERS filter)
458 {
459 switch (filter)
460 {
461 case LIEFILTER_NOTE:
462 return pEntry->IsNote();
463 case LIEFILTER_REST:
464 return pEntry->IsRest();
465 case LIEFILTER_CHORD:
466 return (pEntry->IsNote() && (pEntry->GetCount() >= 2));
468 return (pEntry->IsNote() && (pEntry->GetCount() == 1));
470 return pEntry->GetArticulationFlag();
472 return pEntry->GetSmartShapeFlag();
474 return pEntry->GetNoteDetailFlag();
476 return pEntry->GetPerformanceDataFlag();
478 return pEntry->GetSpecialAltsFlag();
480 return pEntry->GetTupletStartFlag();
482 return pEntry->GetLyricFlag();
484 return pEntry->GetStemDetailFlag();
486 return pEntry->GetSecondaryBeamFlag();
488 return pEntry->GetGraceNote();
489 case LIEFILTER_DOTTED:
490 return pEntry->IsDotted();
492 return (pEntry->CalcNondottedDuration() == FCNoteEntry::WHOLE_NOTE);
494 return (pEntry->CalcNondottedDuration() == FCNoteEntry::HALF_NOTE);
496 return (pEntry->CalcNondottedDuration() == FCNoteEntry::QUARTER_NOTE);
497 case LIEFILTER_DUR8TH:
498 return (pEntry->CalcNondottedDuration() == FCNoteEntry::EIGHTH_NOTE);
500 return (pEntry->CalcNondottedDuration() == FCNoteEntry::SIXTEENTH_NOTE);
502 return (pEntry->CalcNondottedDuration() == FCNoteEntry::THIRTYSECOND_NOTE);
504 return (pEntry->CalcNondottedDuration() == FCNoteEntry::SIXTYFOURTH_NOTE);
505 default:
506#ifdef PDK_FRAMEWORK_DIAGNOSE
507 DebugOutInt("Error: Unknown '_entryfiltermode' in FCLuaIterator:EntryMatchesFilter(): ", (int)filter);
508#endif
509 return false;
510 }
511 return false;
512 }
513
514 bool EntryMatchesANDFilters(FCNoteEntry* pEntry)
515 {
516 if (_entryfilters_AND.GetCount() == 0) return true;
517 for (int i = 0; i < _entryfilters_AND.GetCount(); i++)
518 {
519 LUAITERATOR_ENTRYFILTERS filter = _entryfilters_AND.GetItemAt(i)->GetFilter();
520 if (!EntryFilterCheck(pEntry, filter)) return false;
521 }
522 return true;
523 }
524
525 bool EntryMatchesORFilters(FCNoteEntry* pEntry)
526 {
527 if (_entryfilters_OR.GetCount() == 0) return true;
528 for (int i = 0; i < _entryfilters_OR.GetCount(); i++)
529 {
530 LUAITERATOR_ENTRYFILTERS filter = _entryfilters_OR.GetItemAt(i)->GetFilter();
531 if (EntryFilterCheck(pEntry, filter)) return true;
532 }
533 return false;
534 }
535
536 bool EntryMatchesNOTFilters(FCNoteEntry* pEntry)
537 {
538 if (_entryfilters_NOT.GetCount() == 0) return true;
539 for (int i = 0; i < _entryfilters_NOT.GetCount(); i++)
540 {
541 LUAITERATOR_ENTRYFILTERS filter = _entryfilters_NOT.GetItemAt(i)->GetFilter();
542 if (EntryFilterCheck(pEntry, filter)) return false;
543 }
544 return true;
545 }
546
547 bool EntryMatchesFilters(FCNoteEntry* pEntry)
548 {
549 if (!EntryMatchesANDFilters(pEntry)) return false;
550 if (!EntryMatchesORFilters(pEntry)) return false;
551 if (!EntryMatchesNOTFilters(pEntry)) return false;
552 return true;
553 }
554
555 /*********************************/
556 /* Check notation style filters. */
557 /*********************************/
558
559 bool NotationStyleFilterCheck(FCCurrentStaffSpec* pStaffSpec, __FCStaffBase::STAFFNOTATION_STYLE filter)
560 {
561 return (pStaffSpec->GetNotationStyle() == filter);
562 }
563
564 bool NotationStyleMatchesANDFilters(FCCurrentStaffSpec* pStaffSpec)
565 {
566 if (_notationstylefilters_AND.GetCount() == 0) return true;
567 for (int i = 0; i < _notationstylefilters_AND.GetCount(); i++)
568 {
569 __FCStaffBase::STAFFNOTATION_STYLE filter = _notationstylefilters_AND.GetItemAt(i)->GetFilter();
570 if (!NotationStyleFilterCheck(pStaffSpec, filter)) return false;
571 }
572 return true;
573 }
574
575 bool NotationStyleMatchesORFilters(FCCurrentStaffSpec* pStaffSpec)
576 {
577 if (_notationstylefilters_OR.GetCount() == 0) return true;
578 for (int i = 0; i < _notationstylefilters_OR.GetCount(); i++)
579 {
580 __FCStaffBase::STAFFNOTATION_STYLE filter = _notationstylefilters_OR.GetItemAt(i)->GetFilter();
581 if (NotationStyleFilterCheck(pStaffSpec, filter)) return true;
582 }
583 return false;
584 }
585
586 bool NotationStyleMatchesNOTFilters(FCCurrentStaffSpec* pStaffSpec)
587 {
588 if (_notationstylefilters_NOT.GetCount() == 0) return true;
589 for (int i = 0; i < _notationstylefilters_NOT.GetCount(); i++)
590 {
591 __FCStaffBase::STAFFNOTATION_STYLE filter = _notationstylefilters_NOT.GetItemAt(i)->GetFilter();
592 if (NotationStyleFilterCheck(pStaffSpec, filter)) return false;
593 }
594 return true;
595 }
596
597 /* Entry method version to check notation style */
598 bool NotationStyleMatchesFilters(FCNoteEntry* pEntry)
599 {
600 if ((_notationstylefilters_AND.GetCount() == 0) &&
601 (_notationstylefilters_OR.GetCount() == 0) &&
602 (_notationstylefilters_NOT.GetCount() == 0))
603 return true;
604 FCCurrentStaffSpec staffspec;
605 if (!staffspec.LoadForEntry(pEntry)) return false;
606 if (!NotationStyleMatchesANDFilters(&staffspec)) return false;
607 if (!NotationStyleMatchesORFilters(&staffspec)) return false;
608 if (!NotationStyleMatchesNOTFilters(&staffspec)) return false;
609 return true;
610 }
611
612 /* Cell method version to check notation style */
613 bool NotationStyleMatchesFilters(eMeas measure, eStaff staff, TimeEdu32 measurepos)
614 {
615 if ((_notationstylefilters_AND.GetCount() == 0) &&
616 (_notationstylefilters_OR.GetCount() == 0) &&
617 (_notationstylefilters_NOT.GetCount() == 0))
618 return true;
619 FCCurrentStaffSpec staffspec;
620 FCCell cell(measure, staff);
621 if (!staffspec.LoadForCell(&cell, measurepos)) return false;
622 if (!NotationStyleMatchesANDFilters(&staffspec)) return false;
623 if (!NotationStyleMatchesORFilters(&staffspec)) return false;
624 if (!NotationStyleMatchesNOTFilters(&staffspec)) return false;
625 return true;
626 }
627
628 /************************************/
629 /* Check alternate notation filters */
630 /************************************/
631
632 bool AltNotationFilterCheck(FCCurrentStaffSpec* pStaffSpec, __FCStaffBase::ALTERNATE_STAFF filter)
633 {
634 return (pStaffSpec->GetAltNotationStyle() == filter);
635 }
636
637 bool AltNotationMatchesANDFilters(FCCurrentStaffSpec* pStaffSpec)
638 {
639 if (_altnotationfilters_AND.GetCount() == 0) return true;
640 for (int i = 0; i < _altnotationfilters_AND.GetCount(); i++)
641 {
642 __FCStaffBase::ALTERNATE_STAFF filter = _altnotationfilters_AND.GetItemAt(i)->GetFilter();
643 if (!AltNotationFilterCheck(pStaffSpec, filter)) return false;
644 }
645 return true;
646 }
647
648 bool AltNotationMatchesORFilters(FCCurrentStaffSpec* pStaffSpec)
649 {
650 if (_altnotationfilters_OR.GetCount() == 0) return true;
651 for (int i = 0; i < _altnotationfilters_OR.GetCount(); i++)
652 {
653 __FCStaffBase::ALTERNATE_STAFF filter = _altnotationfilters_OR.GetItemAt(i)->GetFilter();
654 if (AltNotationFilterCheck(pStaffSpec, filter)) return true;
655 }
656 return false;
657 }
658
659 bool AltNotationMatchesNOTFilters(FCCurrentStaffSpec* pStaffSpec)
660 {
661 if (_altnotationfilters_NOT.GetCount() == 0) return true;
662 for (int i = 0; i < _altnotationfilters_NOT.GetCount(); i++)
663 {
664 __FCStaffBase::ALTERNATE_STAFF filter = _altnotationfilters_NOT.GetItemAt(i)->GetFilter();
665 if (AltNotationFilterCheck(pStaffSpec, filter)) return false;
666 }
667 return true;
668 }
669
670 /* Entry method version to check alternate notation */
671 bool AlternateNotationMatchesFilters(FCNoteEntry* pEntry)
672 {
673 if ((_altnotationfilters_AND.GetCount() == 0) &&
674 (_altnotationfilters_OR.GetCount() == 0) &&
675 (_altnotationfilters_NOT.GetCount() == 0))
676 return true;
677 FCCurrentStaffSpec staffspec;
678 if (!staffspec.LoadForEntry(pEntry)) return false;
679 if (!AltNotationMatchesANDFilters(&staffspec)) return false;
680 if (!AltNotationMatchesORFilters(&staffspec)) return false;
681 if (!AltNotationMatchesNOTFilters(&staffspec)) return false;
682 return true;
683 }
684
685 /* Cell method version to check alternate notation */
686 bool AlternateNotationMatchesFilters(eMeas measure, eStaff staff, TimeEdu32 measurepos)
687 {
688 if ((_altnotationfilters_AND.GetCount() == 0) &&
689 (_altnotationfilters_OR.GetCount() == 0) &&
690 (_altnotationfilters_NOT.GetCount() == 0))
691 return true;
692 FCCurrentStaffSpec staffspec;
693 FCCell cell(measure, staff);
694 if (!staffspec.LoadForCell(&cell, measurepos)) return false;
695 if (!AltNotationMatchesANDFilters(&staffspec)) return false;
696 if (!AltNotationMatchesORFilters(&staffspec)) return false;
697 if (!AltNotationMatchesNOTFilters(&staffspec)) return false;
698 return true;
699 }
700
701
702 /**********************/
703 /* Check note filters */
704 /**********************/
705
706 bool NoteFilterCheck(FCNote* pNote, LUAITERATOR_NOTEFILTERS filter)
707 {
708 switch (filter)
709 {
710 case LINFILTER_TIE:
711 return pNote->GetTie();
713 return pNote->CalcAccidental();
715 return pNote->GetAccidentalParentheses();
717 return pNote->GetAccidentalFreeze();
718 default:
719#ifdef PDK_FRAMEWORK_DIAGNOSE
720 DebugOutInt("Error: Unknown '_notfiltermode' in FCLuaIterator:NoteMatchesFilter(): ", (int)filter);
721#endif
722 return false;
723 }
724 }
725
726 bool NoteMatchesANDFilters(FCNote* pNote)
727 {
728 if (_notefilters_AND.GetCount() == 0) return true;
729 for (int i = 0; i < _notefilters_AND.GetCount(); i++)
730 {
731 LUAITERATOR_NOTEFILTERS filter = _notefilters_AND.GetItemAt(i)->GetFilter();
732 if (!NoteFilterCheck(pNote, filter)) return false;
733 }
734 return true;
735 }
736
737 bool NoteMatchesORFilters(FCNote* pNote)
738 {
739 if (_notefilters_OR.GetCount() == 0) return true;
740 for (int i = 0; i < _notefilters_OR.GetCount(); i++)
741 {
742 LUAITERATOR_NOTEFILTERS filter = _notefilters_OR.GetItemAt(i)->GetFilter();
743 if (NoteFilterCheck(pNote, filter)) return true;
744 }
745 return false;
746 }
747
748 bool NoteMatchesNOTFilters(FCNote* pNote)
749 {
750 if (_notefilters_NOT.GetCount() == 0) return true;
751 for (int i = 0; i < _notefilters_NOT.GetCount(); i++)
752 {
753 LUAITERATOR_NOTEFILTERS filter = _notefilters_NOT.GetItemAt(i)->GetFilter();
754 if (NoteFilterCheck(pNote, filter)) return false;
755 }
756 return true;
757 }
758
759 bool NoteMatchesFilters(FCNote* pNote)
760 {
761 if (!NoteMatchesANDFilters(pNote)) return false;
762 if (!NoteMatchesORFilters(pNote)) return false;
763 if (!NoteMatchesNOTFilters(pNote)) return false;
764 return true;
765 }
766
767
768
769 /* Sends an Lua exception error to the console output.
770 Called from _ProcessObjectCallback. */
771 void HandleExceptionError(luabridge::LuaException &e, EProgressDataP *ppProgressBarData)
772 {
773 EndProgressBar(ppProgressBarData, true);
774 LuaRun_ExceptionAbort(e);
775 }
776
777 /* Executes the Lua callback function for a ForEach...() iterator. */
778 template <typename... Args>
779 bool ExecuteCallback(luabridge::LuaRef& lua_callback_function, EProgressDataP *ppProgressBarData, Args&&... args)
780 {
781 bool continueflag = true;
782 try
783 {
784 #if LUABRIDGE_MAJOR_VERSION >= 3
785 luabridge::LuaResult returnvalue = lua_callback_function.callWithHandler(LuaRun_ErrorFunction, std::forward<Args>(args)...);
786 if (!returnvalue) returnvalue.raiseException();
787 if (returnvalue.size() > 0 && returnvalue[0].isValid() && returnvalue[0].isBool())
788 continueflag = returnvalue[0];
789 #else
790 luabridge::LuaRef returnvalue = lua_callback_function(std::forward<Args>(args)...);
791 if (returnvalue.type() == LUA_TBOOLEAN) continueflag = returnvalue.cast<bool>();
792 #endif
793 if (!continueflag)
794 {
795 // Don't roll back changes if callback exits with false
796 EndProgressBar(ppProgressBarData, false);
797 return false;
798 }
799 }
800 catch (luabridge::LuaException e)
801 {
802 HandleExceptionError(e, ppProgressBarData);
803 return false;
804 }
805 return true;
806 }
807
808 int ProcessRegionEntries(FCMusicRegion* pRegion, luabridge::LuaRef &lua_callback_function, bool shouldsave)
809 {
810 FCMusicRegion fullregion;
811 if (!pRegion || pRegion->IsEmptyAndNotSinglePos())
812 {
813 if (!_nullregionequalsall) return 0;
814 if (!fullregion.SetFullDocument()) return 0;
815 pRegion = &fullregion;
816 }
817 if (!lua_callback_function.isFunction()) return 0;
818 if (pRegion->IsEmptyAndNotSinglePos()) return 0;
819 int count = 0;
820 int progressupdatecount;
821 EProgressDataP pProgressBarData;
822
823 StartProgressBar(&pProgressBarData, pRegion->CalcMeasureSpan() * pRegion->CalcStaffSpan(), &progressupdatecount);
824
825 int meas = 0;
826 if (_forwardprocessing)
827 meas = pRegion->GetStartMeasure();
828 else
829 meas = pRegion->GetEndMeasure();
830
831 while (meas >= pRegion->GetStartMeasure() && meas <= pRegion->GetEndMeasure())
832 {
833 while (true)
834 {
835 if ((!_partialmeasureselections) && pRegion->IsMeasurePartial(meas)) break;
836 int slot = 0;
837 if (_downwardprocessing)
838 slot = pRegion->GetStartSlot();
839 else
840 slot = pRegion->GetEndSlot();
841 while (slot >= pRegion->GetStartSlot() && slot <= pRegion->GetEndSlot())
842 {
843 while (true)
844 {
845 /* Handle the progress bar */
846 if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
847 {
848 return count;
849 }
850
851 FCNoteEntryCell entrycell(meas, pRegion->CalcStaffNumber(slot));
852 entrycell.SetLoadLayerMode(_loadlayermode);
853 entrycell.Load();
854
855 bool entriesprocessed = false;
856 /* Process the entries in the FCNoteEntryCell collection */
857 int entryidx = 0;
858 if (_forwardprocessing)
859 entryidx = 0;
860 else
861 entryidx = entrycell.GetCount() - 1;
862 while (entryidx >= 0 && entryidx < entrycell.GetCount())
863 {
864 while (true)
865 {
866 FCNoteEntry* pEntry = entrycell.GetItemAt(entryidx);
867 if (!pRegion->IsEntryPosWithin(pEntry)) break;
868 if (!EntryMatchesFilters(pEntry)) break;
869 if (!NotationStyleMatchesFilters(pEntry)) break;
870 if (!AlternateNotationMatchesFilters(pEntry)) break;
871 /* Send entry to Lua callback */
872 entriesprocessed = true;
873 count++;
874 if (!ExecuteCallback(lua_callback_function, &pProgressBarData, pEntry))
875 {
876 return count;
877 }
878 break;
879 } /* while (true) */
880 if (_forwardprocessing) entryidx++; else entryidx--;
881 }
882 /* Save back */
883 if (shouldsave && entriesprocessed) entrycell.Save();
884 break;
885 } /* while (true) */
886 if (_downwardprocessing) slot++; else slot--;
887 }
888 break;
889 } /* while (true) */
890 if (_forwardprocessing) meas++; else meas--;
891 }
892 EndProgressBar(&pProgressBarData, false);
893 return count;
894 }
895
896 __FCCollectionData* LoadCollectionForClassID(PDKFRAMEWORK_CLASSID classID)
897 {
898 __FCCollectionData* pCollectionData = NULL;
899 switch (classID)
900 {
901 case FCID_ARTICULATIONDEF:
902 pCollectionData = new FCArticulationDefs();
903 break;
904 case FCID_CATEGORYDEF:
905 pCollectionData = new FCCategoryDefs();
906 break;
907 case FCID_CHORD:
908 pCollectionData = new FCChords();
909 break;
910 case FCID_CLEFDEF:
911 pCollectionData = new FCClefDefs();
912 break;
913 case FCID_CUSTOMSMARTLINEDEF:
914 pCollectionData = new FCCustomSmartLineDefs();
915 break;
916 case FCID_EXECUTABLESHAPEDEF:
917 pCollectionData = new FCExecutableShapeDefs();
918 break;
919 case FCID_FRETBOARDSTYLEDEF:
920 pCollectionData = new FCFretboardStyleDefs();
921 break;
922 case FCID_FRETBOARDGROUPDEF:
923 pCollectionData = new FCFretboardGroupDefs();
924 break;
925 case FCID_FRETINSTRUMENTDEF:
926 pCollectionData = new FCFretInstrumentDefs();
927 break;
928 case FCID_GROUP:
929 pCollectionData = new FCGroups();
930 break;
931 case FCID_INSTRUMENTDEF:
932 pCollectionData = new FCInstrumentDefs();
933 break;
934 case FCID_MEASURE:
935 pCollectionData = new FCMeasures();
936 break;
937 case FCID_MEASURENUMBERREGION:
938 pCollectionData = new FCMeasureNumberRegions();
939 break;
940 case FCID_MULTIMEASUREREST:
941 pCollectionData = new FCMultiMeasureRests();
942 break;
943 case FCID_MULTISTAFFINSTRUMENT:
944 pCollectionData = new FCMultiStaffInstruments();
945 break;
946 case FCID_PAGE:
947 pCollectionData = new FCPages();
948 break;
949 case FCID_PAGEGRAPHIC:
950 pCollectionData = new FCPageGraphics();
951 break;
952 case FCID_PAGETEXT:
953 pCollectionData = new FCPageTexts();
954 break;
955#ifdef PDK_FRAMEWORK_SHAPES
956 case FCID_SHAPEDEF:
957 pCollectionData = new FCShapeDefs();
958 break;
959#endif
960 case FCID_SHAPEEXPRESSIONDEF:
961 pCollectionData = new FCShapeExpressionDefs();
962 break;
963 case FCID_SMARTSHAPE:
964 pCollectionData = new FCSmartShapes();
965 break;
966 case FCID_STAFF:
967 pCollectionData = new FCStaves();
968 break;
969 case FCID_STAFFSTYLEDEF:
970 pCollectionData = new FCStaffStyleDefs();
971 break;
972 case FCID_STAFFSYSTEM:
973 pCollectionData = new FCStaffSystems();
974 break;
975 case FCID_TEXTEXPRESSIONDEF:
976 pCollectionData = new FCTextExpressionDefs();
977 break;
978 case FCID_TEXTREPEATDEF:
979 pCollectionData = new FCTextRepeatDefs();
980 break;
981 default:
982 break;
983 }
984 if (!pCollectionData) return NULL;
985 pCollectionData->LoadAll();
986 return pCollectionData;
987 }
988
989 int ProcessRegionNotes(FCMusicRegion* pRegion, luabridge::LuaRef &lua_callback_function, bool shouldsave)
990 {
991 FCMusicRegion fullregion;
992 if (!pRegion || pRegion->IsEmptyAndNotSinglePos())
993 {
994 if (!_nullregionequalsall) return 0;
995 if (!fullregion.SetFullDocument()) return 0;
996 pRegion = &fullregion;
997 }
998 if (!lua_callback_function.isFunction()) return 0;
999 if (pRegion->IsEmptyAndNotSinglePos()) return 0;
1000 int count = 0;
1001 int progressupdatecount;
1002 EProgressDataP pProgressBarData;
1003
1004 StartProgressBar(&pProgressBarData, pRegion->CalcMeasureSpan() * pRegion->CalcStaffSpan(), &progressupdatecount);
1005
1006 int meas = 0;
1007 if (_forwardprocessing)
1008 meas = pRegion->GetStartMeasure();
1009 else
1010 meas = pRegion->GetEndMeasure();
1011
1012 while (meas >= pRegion->GetStartMeasure() && meas <= pRegion->GetEndMeasure())
1013 {
1014 while (true)
1015 {
1016 if ((!_partialmeasureselections) && pRegion->IsMeasurePartial(meas)) break;
1017 int slot = 0;
1018 if (_downwardprocessing)
1019 slot = pRegion->GetStartSlot();
1020 else
1021 slot = pRegion->GetEndSlot();
1022
1023 while (slot >= pRegion->GetStartSlot() && slot <= pRegion->GetEndSlot())
1024 {
1025 while (true)
1026 {
1027 /* Handle the progress bar */
1028 if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
1029 {
1030 return count;
1031 }
1032
1033 FCNoteEntryCell entrycell(meas, pRegion->CalcStaffNumber(slot));
1034 entrycell.SetLoadLayerMode(_loadlayermode);
1035 entrycell.Load();
1036
1037 bool entriesprocessed = false;
1038
1039 int entryidx = 0;
1040 if (_forwardprocessing)
1041 entryidx = 0;
1042 else
1043 entryidx = entrycell.GetCount() - 1;
1044 /* Process the entries in the FCNoteEntryCell collection */
1045 while (entryidx >= 0 && entryidx < entrycell.GetCount())
1046 {
1047 while (true)
1048 {
1049 FCNoteEntry* pEntry = entrycell.GetItemAt(entryidx);
1050 if (pEntry->IsRest()) break;
1051 if (!pRegion->IsEntryPosWithin(pEntry)) break;
1052 if (!EntryMatchesFilters(pEntry)) break;
1053 if (!NotationStyleMatchesFilters(pEntry)) break;
1054 if (!AlternateNotationMatchesFilters(pEntry)) break;
1055
1056 int noteidx = 0;
1057 if (_forwardprocessing)
1058 noteidx = 0;
1059 else
1060 noteidx = pEntry->GetCount() - 1;
1061 /* Browse throúgh the notes in the chord */
1062 while (noteidx >= 0 && noteidx < pEntry->GetCount())
1063 {
1064 while (true)
1065 {
1066 FCNote* pNote = pEntry->GetItemAt(noteidx);
1067 if (!NoteMatchesFilters(pNote)) break;
1068 /* Send entry to Lua callback */
1069 entriesprocessed = true;
1070 count++;
1071 if (!ExecuteCallback(lua_callback_function, &pProgressBarData, pNote))
1072 {
1073 return count;
1074 }
1075 break;
1076 } /* while (true) */
1077 if (_forwardprocessing) noteidx++; else noteidx--;
1078 }
1079 break;
1080 } /* while (true) */
1081 if (_forwardprocessing) entryidx ++; else entryidx --;
1082 }
1083 /* Save back */
1084 if (shouldsave && entriesprocessed) entrycell.Save();
1085 break;
1086 } /* while (true) */
1087 if (_downwardprocessing) slot++; else slot--;
1088 } /* while (slot ... */
1089 break;
1090 } /* while (true) */
1091 if (_forwardprocessing) meas++; else meas--;
1092 }
1093 EndProgressBar(&pProgressBarData, false);
1094 return count;
1095 }
1096
1097 /* The main processing method for ForEachCell(). */
1098 int ProcessForEachCell(FCMusicRegion* pRegion, luabridge::LuaRef& lua_callback_function)
1099 {
1100 FCMusicRegion fullregion;
1101 if (!pRegion || pRegion->IsEmptyAndNotSinglePos())
1102 {
1103 if (!_nullregionequalsall) return 0;
1104 if (!fullregion.SetFullDocument()) return 0;
1105 pRegion = &fullregion;
1106 }
1107 if (!lua_callback_function.isFunction()) return 0;
1108 if (pRegion->IsEmptyAndNotSinglePos()) return 0;
1109 int count = 0;
1110 int progressupdatecount;
1111 EProgressDataP pProgressBarData;
1112
1113 StartProgressBar(&pProgressBarData, pRegion->CalcMeasureSpan() * pRegion->CalcStaffSpan(), &progressupdatecount);
1114
1115 int meas = 0;
1116 if (_forwardprocessing)
1117 meas = pRegion->GetStartMeasure();
1118 else
1119 meas = pRegion->GetEndMeasure();
1120
1121 while (meas >= pRegion->GetStartMeasure() && meas <= pRegion->GetEndMeasure())
1122 {
1123 while (true)
1124 {
1125 if ((!_partialmeasureselections) && pRegion->IsMeasurePartial(meas)) break;
1126 int slot = 0;
1127 if (_downwardprocessing)
1128 slot = pRegion->GetStartSlot();
1129 else
1130 slot = pRegion->GetEndSlot();
1131 while (slot >= pRegion->GetStartSlot() && slot <= pRegion->GetEndSlot())
1132 {
1133 while (true)
1134 {
1135 /* Handle the progress bar */
1136 if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
1137 {
1138 return count;
1139 }
1140 eStaff staff = pRegion->CalcStaffNumber(slot);
1141 if (!NotationStyleMatchesFilters(meas, staff, 0)) break;
1142 if (!AlternateNotationMatchesFilters(meas, staff, 0)) break;
1143 count++;
1144 /* User callback */
1145 if (!ExecuteCallback(lua_callback_function, &pProgressBarData, meas, staff))
1146 {
1147 return count;
1148 }
1149 break;
1150 }
1151 if (_downwardprocessing) slot++; else slot--;
1152 }
1153 break;
1154 }
1155 if (_forwardprocessing) meas++; else meas--;
1156 }
1157 EndProgressBar(&pProgressBarData, false);
1158 return count;
1159 }
1160
1161 /* The main processing method for ForEachPart(). */
1162 int ProcessForEachPart(luabridge::LuaRef& lua_callback_function)
1163 {
1164 if (!lua_callback_function.isFunction()) return 0;
1165 int count = 0;
1166 int progressupdatecount;
1167 EProgressDataP pProgressBarData;
1168
1169 lua_State * pLuaState = lua_callback_function.state();
1170
1171 FCParts allparts;
1172 allparts.LoadAll();
1173 StartProgressBar(&pProgressBarData, allparts.GetCount(), &progressupdatecount);
1174
1175 int partidx = 0;
1176 if (_forwardprocessing)
1177 partidx = 0;
1178 else
1179 partidx = allparts.GetCount() - 1;
1180 while (partidx >= 0 && partidx < allparts.GetCount())
1181 {
1182 while (true)
1183 {
1184 /* Handle the progress bar */
1185 if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount)) return count;
1186
1187 /* Get the part and switch focus */
1188 FCPart* pPart = allparts.GetItemAt(partidx);
1189 if (!_processscorepart && pPart->IsScore()) break;
1190 if (!_processcurrentpart && pPart->IsCurrent()) break;
1191
1192 /* User callback */
1193 pPart->SwitchTo();
1194 luabridge::LuaRef parameter(pLuaState, pPart);
1195 count++;
1196 bool callbackreturn = ExecuteCallback(lua_callback_function, &pProgressBarData, parameter);
1197 pPart->SwitchBack();
1198
1199 if (!callbackreturn) return count;
1200 break;
1201 }
1202 if (_forwardprocessing)
1203 partidx++;
1204 else
1205 partidx--;
1206 }
1207
1208 EndProgressBar(&pProgressBarData, false);
1209 return count;
1210 }
1211
1212 /* The main method for "ForEach()". The start/stop of the timer are handled
1213 * outside of this method. */
1214 int ProcessForEach(__FCCollectionData* pCollection, luabridge::LuaRef& lua_callback_function, bool shouldsave)
1215 {
1216 if (!pCollection) return 0;
1217 if (pCollection->GetCount() == 0) return 0;
1218 if (!lua_callback_function.isFunction()) return 0;
1219 int count = 0;
1220 int progressupdatecount;
1221 EProgressDataP pProgressBarData;
1222
1223 StartProgressBar(&pProgressBarData, pCollection->GetCount(), &progressupdatecount);
1224
1225 lua_State * pLuaState = lua_callback_function.state();
1226
1227 luabridge::LuaRef parameter(pLuaState);
1228 /* Ideally, a base object should be created once as a LuaRef and data cloned, since
1229 * that would be much faster. However, there are too many issues with linked objects
1230 * to be safe. */
1231
1232 int i = 0;
1233 if (_forwardprocessing)
1234 i = 0;
1235 else
1236 i = pCollection->GetCount() - 1;
1237
1238 while (i >= 0 && i < pCollection->GetCount())
1239 {
1240 while (true)
1241 {
1242 /* Handle the progress bar */
1243 if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
1244 {
1245 return count;
1246 }
1247
1248 /* Get the item data to process */
1249 __FCBaseData* pObject = (__FCBaseData*)pCollection->GetItemAt(i);
1250 if (!pObject) break;
1251 if (!SetupCorrectCppClass(pObject, parameter))
1252 {
1253 EndProgressBar(&pProgressBarData, false);
1254 return count;
1255 }
1256
1257 /* Execute the callback */
1258 count++;
1259 if (!ExecuteCallback(lua_callback_function, &pProgressBarData, parameter))
1260 {
1261 return count;
1262 }
1263 if (shouldsave) pObject->Save();
1264 break;
1265 } /* while (true) */
1266 if (_forwardprocessing) i++; else i--;
1267 }
1268 EndProgressBar(&pProgressBarData, false);
1269 return count;
1270
1271 if (_forwardprocessing) i++; else i--;
1272 }
1273
1274 struct EACH_REGION_OBJECT_DATA
1275 {
1276 FCMusicRegion* pRegion;
1277 int count;
1278 __FCBaseData* pObject;
1279 EProgressDataP pProgressBarData;
1280 CLASS_APPROACHES classapproach;
1281 bool shouldsave;
1282 int progressupdatecount;
1283 };
1284
1285 /* Handles the Lua callback to note entry details for ForEachRegionObject
1286 and ForEachRegionObjectSaved.
1287
1288 Objects must be based on __FCEntryDetail.
1289 */
1290 bool ProcessEntryDetailsCell(eMeas meas, eStaff staff, luabridge::LuaRef& lua_callback_function, luabridge::LuaRef &parameter, EACH_REGION_OBJECT_DATA* pERData)
1291 {
1292 __FCEntryDetail* pEntryObject = (__FCEntryDetail*) pERData->pObject;
1293 FCNoteEntryCell entrycell(meas, staff);
1294 entrycell.SetLoadLayerMode(_loadlayermode);
1295 entrycell.Load();
1296 int entryidx = 0;
1297 if (_forwardprocessing)
1298 entryidx = 0;
1299 else
1300 entryidx = entrycell.GetCount() - 1;
1301 while (entryidx >= 0 && entryidx < entrycell.GetCount())
1302 {
1303 while (true)
1304 {
1305 FCNoteEntry* pEntry = entrycell.GetItemAt(entryidx);
1306 if (!pERData->pRegion->IsEntryPosWithin(pEntry)) break;
1307 if (!EntryMatchesFilters(pEntry)) break;
1308 if (!NotationStyleMatchesFilters(pEntry)) break;
1309 if (!AlternateNotationMatchesFilters(pEntry)) break;
1310 pEntryObject->SetNoteEntry(pEntry);
1311 if (_forwardprocessing)
1312 {
1313 twobyte currentinci = 0;
1314 while (pEntryObject->Load(pEntry->GetEntryNumber(), currentinci))
1315 {
1316 /* Call the Lua callback function */
1317 pERData->count++;
1318 if (!ExecuteCallback(lua_callback_function, &pERData->pProgressBarData, parameter))
1319 {
1320 return false;
1321 }
1322 if (pERData->shouldsave) pEntryObject->Save();
1323 currentinci++;
1324 }
1325 }
1326 else
1327 {
1328 /* Parse backwards - Find last inci. */
1329 twobyte lastinci = pEntryObject->CalcLastInci();
1330 if (lastinci == kNewInci) break;
1331 while (lastinci >= 0)
1332 {
1333 if (pEntryObject->Load(pEntry->GetEntryNumber(), lastinci))
1334 {
1335 /* Call the Lua callback function */
1336 pERData->count++;
1337 if (!ExecuteCallback(lua_callback_function, &pERData->pProgressBarData, parameter))
1338 {
1339 return false;
1340 }
1341 if (pERData->shouldsave) pEntryObject->Save();
1342 }
1343 lastinci--;
1344 }
1345 }
1346 break;
1347 } /* while (true) ... */
1348 if (_forwardprocessing) entryidx++; else entryidx--;
1349 }
1350 return true;
1351 }
1352
1353 /* Handles the Lua callback to measure-attached details for ForEachRegionObject
1354 and ForEachRegionObjectSaved.
1355
1356 The object must be based on a __FCInciOther child class, and the "other" value
1357 must be the measure. And the virtual methods GetMeasure()/GetMeasurePos()/GetStaff() must
1358 be implemented in the class.
1359 */
1360 bool ProcessMeasureDetailsCell(eMeas meas, eStaff staff, luabridge::LuaRef& lua_callback_function, luabridge::LuaRef &parameter, EACH_REGION_OBJECT_DATA* pERData)
1361 {
1362 __FCInciOther* pMeasureObject = (__FCInciOther*) pERData->pObject;
1363
1364 twobyte inci = 0;
1365 twobyte incdec = 1;
1366 if (!_forwardprocessing) inci = pMeasureObject->CalcLastInci();
1367 if (inci == kNewInci) return true;
1368 while (pMeasureObject->Load(meas, inci))
1369 {
1370 while (true)
1371 {
1372 /* Check if the object is in range */
1373 if (pMeasureObject->HasStaffValue() && (staff != pMeasureObject->GetStaff())) break;
1374 if (meas != pMeasureObject->GetMeasure()) break;
1375 FCCell cell(meas, staff);
1376 if (!pERData->pRegion->IsCellPosWithin(&cell, pMeasureObject->GetMeasurePos())) break;
1377 /* Check filter matches */
1378 if (!NotationStyleMatchesFilters(meas, staff, pMeasureObject->GetMeasurePos())) break;
1379 if (!AlternateNotationMatchesFilters(meas, staff, pMeasureObject->GetMeasurePos())) break;
1380
1381 /* Call the Lua callback function */
1382 pERData->count++;
1383 if (!ExecuteCallback(lua_callback_function, &pERData->pProgressBarData, parameter))
1384 {
1385 return false;
1386 }
1387 if (pERData->shouldsave) pMeasureObject->Save();
1388 break;
1389 } /* while (true) */
1390 inci += incdec;
1391 /* Check for incis < 0 separately. Don't know if it's necessary, but it's a bit nicer. */
1392 if (inci < 0) return true;
1393 }
1394 return true;
1395 }
1396
1397 /* Handles the Lua callback to cell-attached details for ForEachRegionObject
1398 and ForEachRegionObjectSaved.
1399
1400 The object must be based on a __FCCellDetail child class, and requires an
1401 implemented GetMeasurePos() method.
1402 */
1403 bool ProcessCellDetailsCell(eMeas meas, eStaff staff, luabridge::LuaRef& lua_callback_function, luabridge::LuaRef &parameter, EACH_REGION_OBJECT_DATA* pERData)
1404 {
1405 __FCCellDetail* pCellObject = (__FCCellDetail*) pERData->pObject;
1406
1407 FCCell cell(meas, staff);
1408 pCellObject->ConnectCell(&cell);
1409
1410 bool success = _forwardprocessing ? pCellObject->LoadFirst() : pCellObject->LoadLast();
1411 while (success)
1412 {
1413 while (true)
1414 {
1415 /* Check if the object is in range */
1416 if (!pERData->pRegion->IsCellPosWithin(&cell, pCellObject->GetMeasurePos())) break;
1417 /* Check filter matches */
1418 if (!NotationStyleMatchesFilters(meas, staff, pCellObject->GetMeasurePos())) break;
1419 if (!AlternateNotationMatchesFilters(meas, staff, pCellObject->GetMeasurePos())) break;
1420
1421 /* Call the Lua callback function */
1422 pERData->count++;
1423 if (!ExecuteCallback(lua_callback_function, &pERData->pProgressBarData, parameter))
1424 {
1425 return false;
1426 }
1427 if (pERData->shouldsave) pCellObject->Save();
1428 break;
1429 } /* while (true) */
1430 success = _forwardprocessing ? pCellObject->LoadNext() : pCellObject->LoadPrevious();
1431 }
1432 return true;
1433 }
1434
1435 /* Main processing method for ForEachRegionObject and ForEachRegionObjectSave.
1436 *
1437 * It parses through the cells and redirects the call to the poper method.
1438 */
1439 int ProcessForEachRegionObject(FCMusicRegion* pRegion, int classID, luabridge::LuaRef lua_callback_function, bool shouldsave)
1440 {
1441 FCMusicRegion fullregion;
1442 if (!pRegion || pRegion->IsEmptyAndNotSinglePos())
1443 {
1444 if (!_nullregionequalsall) return 0;
1445 if (!fullregion.SetFullDocument()) return 0;
1446 pRegion = &fullregion;
1447 }
1448 if (!lua_callback_function.isFunction()) return 0;
1449 if (pRegion->IsEmptyAndNotSinglePos()) return 0;
1450
1451 /* Set up struct info */
1452 EACH_REGION_OBJECT_DATA erdata;
1453 erdata.pRegion = pRegion;
1454 erdata.progressupdatecount = 0;
1455 erdata.shouldsave = shouldsave;
1456 erdata.pObject = MapRegionClassApproach((PDKFRAMEWORK_CLASSID) classID, &erdata.classapproach);
1457 if (erdata.classapproach == CLASSAPPROACH_NONE) return 0;
1458 erdata.count = 0;
1459
1460 lua_State * pLuaState = lua_callback_function.state();
1461
1462 StartProgressBar(&erdata.pProgressBarData, pRegion->CalcMeasureSpan() * pRegion->CalcStaffSpan(), &erdata.progressupdatecount);
1463
1464 /* Set up parameter that will contain the object that is sent to the Lua callback
1465 * function. Keeping a single parameter LuaRef object like this will be
1466 * considerably faster! */
1467 luabridge::LuaRef parameter(pLuaState);
1468 if (!SetupCorrectCppClass(erdata.pObject, parameter))
1469 {
1470 EndProgressBar(&erdata.pProgressBarData, false);
1471 return 0;
1472 }
1473
1474 /* Browse through all cells in the selection */
1475 int meas = 0;
1476 if (_forwardprocessing)
1477 meas = pRegion->GetStartMeasure();
1478 else
1479 meas = pRegion->GetEndMeasure();
1480 while (meas >= pRegion->GetStartMeasure() && meas <= pRegion->GetEndMeasure())
1481 {
1482 while (true)
1483 {
1484 if ((!_partialmeasureselections) && pRegion->IsMeasurePartial(meas)) break;
1485 int slot = 0;
1486 if (_downwardprocessing)
1487 slot = pRegion->GetStartSlot();
1488 else
1489 slot = pRegion->GetEndSlot();
1490 while (slot >= pRegion->GetStartSlot() && slot <= pRegion->GetEndSlot())
1491 {
1492 while (true)
1493 {
1494 /* Handle the progress bar */
1495 if (!UpdateProgressBar(&erdata.pProgressBarData, &erdata.progressupdatecount))
1496 {
1497 delete erdata.pObject;
1498 return erdata.count;
1499 }
1500 eStaff staff = pRegion->CalcStaffNumber(slot);
1501
1502 /* Don't check for notation styles here, since the
1503 position check is different depending on entry-based
1504 or measure-based, etc.
1505 Make the check in each individual object parser instead. */
1506
1507 /* User callback */
1508 bool continueflag = false;
1509 switch (erdata.classapproach)
1510 {
1511 case CLASSAPPROACH_ENTRYDETAILS:
1512 case CLASSAPPROACH_NOTEDETAILS:
1513 /* **********************/
1514 /* Handle entry details */
1515 /* **********************/
1516 continueflag = ProcessEntryDetailsCell(meas, staff, lua_callback_function, parameter, &erdata);
1517 break;
1518 case CLASSAPPROACH_MEASUREDETAILS:
1519 /* ************************/
1520 /* Handle measure details */
1521 /* ************************/
1522 continueflag = ProcessMeasureDetailsCell(meas, staff, lua_callback_function, parameter, &erdata);
1523 break;
1524 case CLASSAPPROACH_CELLDETAILS:
1525 /* *********************/
1526 /* Handle cell details */
1527 /* *********************/
1528 continueflag = ProcessCellDetailsCell(meas, staff, lua_callback_function, parameter, &erdata);
1529 break;
1530 default:
1531 break;
1532 }
1533 if (!continueflag)
1534 {
1535 delete erdata.pObject;
1536 return erdata.count;
1537 }
1538 break;
1539 } /* while (true) */
1540 if (_downwardprocessing) slot++; else slot--;
1541 }
1542 break;
1543 } /* while (true) */
1544 if (_forwardprocessing) meas++; else meas--;
1545 }
1546 delete erdata.pObject;
1547 EndProgressBar(&erdata.pProgressBarData, false);
1548 return erdata.count;
1549 }
1550
1551 /* Main method for ForEachDocument() and ForEachDocumentSaved().
1552 For ForEachDocumentSaved(), documents are only saved if a file
1553 name exists.
1554 */
1555 int ProcessForEachDocument(luabridge::LuaRef lua_callback_function, bool shouldsave)
1556 {
1557 if (!lua_callback_function.isFunction()) return 0;
1558 int count = 0;
1559 int progressupdatecount;
1560 EProgressDataP pProgressBarData;
1561
1562 FCDocuments alldocs;
1563 alldocs.LoadAll();
1564 StartProgressBar(&pProgressBarData, alldocs.GetCount(), &progressupdatecount);
1565
1566 int docidx = 0;
1567 if (_forwardprocessing)
1568 docidx = 0;
1569 else
1570 docidx = alldocs.GetCount() - 1;
1571
1572 lua_State * pLuaState = lua_callback_function.state();
1573
1574 FCUndoController& undo = FCUndoController::GetUndoController(lua_callback_function.state());
1575
1576 while (docidx >= 0 && docidx < alldocs.GetCount())
1577 {
1578 while (true)
1579 {
1580 /* Handle the progress bar */
1581 if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
1582 {
1583 return count;
1584 }
1585
1586 /* Get the document and switch focus */
1587 FCDocument* pDoc = alldocs.GetItemAt(docidx);
1588 if (!_processcurrentdoc && pDoc->IsCurrent()) break;
1589
1590 pDoc->SwitchTo(nullptr, true, lua_callback_function.state());
1591 luabridge::LuaRef parameter(pLuaState, pDoc);
1592 count++;
1593
1594 /* User callback */
1595 if (!ExecuteCallback(lua_callback_function, &pProgressBarData, parameter))
1596 {
1597 pDoc->SwitchBack(true, pLuaState);
1598 return count;
1599 }
1600 if (shouldsave && (!pDoc->IsUntitled()) && !undo.GetSandboxMode())
1601 {
1602 undo.EndUndo(true);
1603 pDoc->Save();
1604 }
1605 pDoc->SwitchBack(true, pLuaState);
1606 break;
1607 }
1608 if (_forwardprocessing)
1609 docidx++;
1610 else
1611 docidx--;
1612 }
1613
1614 EndProgressBar(&pProgressBarData, false);
1615 return count;
1616 }
1617
1618 /* Processing method for ForEachFile and ForEachFileSaved. */
1619 int ProcessForEachFile(FCStrings* pFileStrings, luabridge::LuaRef lua_callback_function, bool shouldsave)
1620 {
1621 if (!pFileStrings) return 0;
1622 if (pFileStrings->GetCount() == 0) return 0;
1623 int count = 0;
1624
1625 int progressupdatecount;
1626 EProgressDataP pProgressBarData;
1627 StartProgressBar(&pProgressBarData, pFileStrings->GetCount(), &progressupdatecount);
1628
1629 lua_State * pLuaState = lua_callback_function.state();
1630
1632
1633 int filenameidx = 0;
1634 if (_forwardprocessing)
1635 filenameidx = 0;
1636 else
1637 filenameidx = pFileStrings->GetCount() - 1;
1638 while (filenameidx >= 0 && filenameidx < pFileStrings->GetCount())
1639 {
1640 bool executereturn = true;
1641 while (true)
1642 {
1643 FCString* pString = pFileStrings->GetItemAt(filenameidx);
1644 if (!pString) break;
1645 if (pString->IsEmpty()) break;
1646 FCDocument document; // initializes to current document
1647 count++;
1648 /* There seems to be an issue with saving documents without
1649 * a window, so if save should be made, a document window is opened as well. */
1650 if (document.Open(pString, shouldsave, nullptr, true, false, true, pLuaState)) // true: save any current edits (replicates previous behavior before refactoring)
1651 {
1652 /* Document is now in focus */
1653 executereturn = ExecuteCallback(lua_callback_function, &pProgressBarData, &document, pString);
1654 if (executereturn && shouldsave && !undo.GetSandboxMode())
1655 {
1656 undo.EndUndo(true); // this replicates previous calls to FX_EndFinaleEdit in Close and CloseCurrentDocumentAndWindow.
1657 document.Save();
1658 }
1659 document.SetDirty(false);
1660 if (shouldsave)
1661 document.CloseCurrentDocumentAndWindow(pLuaState);
1662 else
1663 document.Close(pLuaState);
1664 }
1665 else
1666 {
1667 /* File couldn't be opened - send nil to the callback */
1668 luabridge::LuaRef parameter(pLuaState, NULL);
1669 executereturn = ExecuteCallback(lua_callback_function, &pProgressBarData, &document, nullptr);
1670 }
1671 document.SwitchBack(true, pLuaState);
1672 break;
1673 } /* while (true) */
1674 if (!executereturn) break;
1675 if (_forwardprocessing) filenameidx++; else filenameidx--;
1676 }
1677 EndProgressBar(&pProgressBarData, false);
1678 return count;
1679 }
1680
1681 /* Processing method for ForEachInteger. */
1682 int ProcessForEachInteger(int integer1, int integer2, luabridge::LuaRef lua_callback_function)
1683 {
1684 int count = 0;
1685 int incdec = 1;
1686
1687 if (integer1 > integer2) incdec = -1;
1688
1689 integer1 -= incdec;
1690
1691 int progressupdatecount;
1692 EProgressDataP pProgressBarData;
1693
1694 /* Multiplying difference with incdec to assure positive difference. */
1695 StartProgressBar(&pProgressBarData, (integer2 - integer1) * incdec + 1, &progressupdatecount);
1696
1697 for (int i = integer1; i != integer2; i += incdec)
1698 {
1699 /* Handle the progress bar */
1700 if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount)) return count;
1701
1702 count ++;
1703 bool executereturn = ExecuteCallback(lua_callback_function, &pProgressBarData, i + incdec);
1704 if (!executereturn) return count;
1705 }
1706 EndProgressBar(&pProgressBarData, false);
1707 return count;
1708 }
1709
1710
1711 /* Preparation method for ForEachRegionObject(Saved). Creates a data object of the
1712 correct class, and defines the approach to use for the class. */
1713 __FCBaseData* MapRegionClassApproach(PDKFRAMEWORK_CLASSID classID, CLASS_APPROACHES* pClassApproach)
1714 {
1715 switch (classID)
1716 {
1717 case FCID_ACCIDENTALMOD:
1718 *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1719 return new FCAccidentalMod();
1720 case FCID_ARTICULATION:
1721 *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1722 return new FCArticulation();
1723 case FCID_BEATCHARTELEMENT:
1724 *pClassApproach = CLASSAPPROACH_MEASUREDETAILS;
1725 return new FCBeatChartElement();
1726 case FCID_BROKENBEAMMOD:
1727 *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1728 return new FCBrokenBeamMod();
1729 case FCID_CELLGRAPHIC:
1730 *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1731 return new FCCellGraphic();
1732 case FCID_CELLTEXT:
1733 *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1734 return new FCCellText();
1735 case FCID_CHORD:
1736 *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1737 return new FCChord();
1738 case FCID_CROSSSTAFFMOD:
1739 *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1740 return new FCCrossStaffMod();
1741 case FCID_CUSTOMSTEMMOD:
1742 *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1743 return new FCCustomStemMod();
1744 case FCID_DOTMOD:
1745 *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1746 return new FCDotMod();
1747 case FCID_ENTRYALTERMOD:
1748 *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1749 return new FCEntryAlterMod();
1750 case FCID_EXPRESSION:
1751 *pClassApproach = CLASSAPPROACH_MEASUREDETAILS;
1752 return new FCExpression();
1753 case FCID_MIDIEXPRESSION:
1754 *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1755 return new FCMidiExpression();
1756 case FCID_NOTEHEADMOD:
1757 *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1758 return new FCNoteheadMod();
1759 case FCID_PERCUSSIONNOTEMOD:
1760 *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1761 return new FCPercussionNoteMod();
1762 case FCID_PERFORMANCEMOD:
1763 *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1764 return new FCPerformanceMod();
1765 case FCID_SECONDARYBEAMBREAKMOD:
1766 *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1767 return new FCSecondaryBeamBreakMod();
1768 case FCID_SEPARATEMEASURENUMBER:
1769 *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1770 return new FCSeparateMeasureNumber();
1771 case FCID_SEPARATEPLACEMENT:
1772 *pClassApproach = CLASSAPPROACH_MEASUREDETAILS;
1773 return new FCSeparatePlacement();
1774 case FCID_SMARTSHAPEENTRYMARK:
1775 *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1776 return new FCSmartShapeEntryMark();
1777 case FCID_STEMMOD:
1778 *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1779 return new FCStemMod();
1780 case FCID_SYLLABLEENTRYMOD:
1781 *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1782 return new FCSyllableEntryMod();
1783 case FCID_TABLATURENOTEMOD:
1784 *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1785 return new FCTablatureNoteMod();
1786 case FCID_TUPLET:
1787 *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1788 return new FCTuplet();
1789 default:
1790 *pClassApproach = CLASSAPPROACH_NONE;
1791 return NULL;
1792 }
1793 }
1794
1795
1796 void StartTiming()
1797 {
1798 _timingstart = 0;
1799 _timingend = 0;
1800 _timingstart = FCUI::GetHiResTimer();
1801 }
1802
1803 void EndTiming()
1804 {
1805 _timingend = FCUI::GetHiResTimer();
1806 }
1807
1808 /* Initializes Finale's progress bar.
1809 *
1810 * The progress bar info is not stored in the class data, to make sure that stacked iterators should be able to run
1811 * from the same iterator.
1812 */
1813 void StartProgressBar(EProgressDataP *ppProgressBarData, int count, int* pProgressUpdateCount)
1814 {
1815 _progressbar_useraborted = false;
1816 *pProgressUpdateCount = 0;
1817 if (!_useprogressbar) return;
1818 *ppProgressBarData = FX_StartMassEdit(NULL, count);
1819 }
1820
1821 /* Updates Finale's progress bar and checks for user iterrupts.
1822 *
1823 * The progress bar info is not stored in the class data, to make sure
1824 * that stacked iterators should be able to run
1825 * from the same iterator.
1826 *
1827 * Returns false if user aborts the progressbar
1828 */
1829 bool UpdateProgressBar(EProgressDataP *ppProgressBarData, int* pProgressUpdateCount)
1830 {
1831 if (!_useprogressbar) return true;
1832 if (!*ppProgressBarData) return true;
1833 (*pProgressUpdateCount)++;
1834 if (*pProgressUpdateCount < _progressfrequency) return true;
1835
1836 bool continueflag = (FX_MassEditProgress(*ppProgressBarData, _progressfrequency, 0, 0, 0) != 0);
1837 if ((!continueflag) && _abortableprogressbar)
1838 {
1839 _progressbar_useraborted = true;
1840 FX_EndMassEdit(*ppProgressBarData, true);
1841 return false;
1842 }
1843 return true;
1844 }
1845
1846 /* Destroys Finale's progress bar.
1847 *
1848 * The progress bar info is not stored in the class data, to make sure that stacked iterators should be able to run
1849 * from the same iterator.
1850 */
1851 void EndProgressBar(EProgressDataP *ppProgressBarData, bool abortprogress)
1852 {
1853 if (!_useprogressbar) return;
1854 if (!*ppProgressBarData) return;
1855 FX_EndMassEdit(*ppProgressBarData, abortprogress);
1856 *ppProgressBarData = NULL;
1857 }
1858
1859 /* Set up the LuaRef for the correct object type */
1860 bool SetupCorrectCppClass(__FCBaseData* pProcessObject, luabridge::LuaRef &parameter)
1861 {
1862 lua_State * pLuaState = parameter.state();
1863
1864 switch (pProcessObject->GetClassID())
1865 {
1866 case FCID_ACCIDENTALMOD:
1867 parameter = luabridge::LuaRef(pLuaState, (FCAccidentalMod*)pProcessObject);
1868 return true;
1869 case FCID_ALLOTMENT:
1870 parameter = luabridge::LuaRef(pLuaState, (FCAllotment*)pProcessObject);
1871 return true;
1872 case FCID_ARTICULATION:
1873 parameter = luabridge::LuaRef(pLuaState, (FCArticulation*)pProcessObject);
1874 return true;
1875 case FCID_ARTICULATIONDEF:
1876 parameter = luabridge::LuaRef(pLuaState, (FCArticulationDef*)pProcessObject);
1877 return true;
1878 case FCID_BACKWARDREPEAT:
1879 parameter = luabridge::LuaRef(pLuaState, (FCBackwardRepeat*)pProcessObject);
1880 return true;
1881 case FCID_BASELINE:
1882 parameter = luabridge::LuaRef(pLuaState, (FCBaseline*)pProcessObject);
1883 return true;
1884 case FCID_BEAMMOD:
1885 parameter = luabridge::LuaRef(pLuaState, (FCBeamMod*)pProcessObject);
1886 return true;
1887 case FCID_BEATCHARTELEMENT:
1888 parameter = luabridge::LuaRef(pLuaState, (FCBeatChartElement*)pProcessObject);
1889 return true;
1890 case FCID_BROKENBEAMMOD:
1891 parameter = luabridge::LuaRef(pLuaState, (FCBrokenBeamMod*)pProcessObject);
1892 return true;
1893 case FCID_CATEGORYDEF:
1894 parameter = luabridge::LuaRef(pLuaState, (FCCategoryDef*)pProcessObject);
1895 return true;
1896 case FCID_CELLCLEFCHANGE:
1897 parameter = luabridge::LuaRef(pLuaState, (FCCellClefChange*)pProcessObject);
1898 return true;
1899 case FCID_CELLFRAMEHOLD:
1900 parameter = luabridge::LuaRef(pLuaState, (FCCellFrameHold*)pProcessObject);
1901 return true;
1902 case FCID_CELLGRAPHIC:
1903 parameter = luabridge::LuaRef(pLuaState, (FCCellGraphic*)pProcessObject);
1904 return true;
1905 case FCID_CELLTEXT:
1906 parameter = luabridge::LuaRef(pLuaState, (FCCellText*)pProcessObject);
1907 return true;
1908 case FCID_CENTERSMARTSHAPE:
1909 parameter = luabridge::LuaRef(pLuaState, (FCCenterSmartShape*)pProcessObject);
1910 return true;
1911 case FCID_CHORD:
1912 parameter = luabridge::LuaRef(pLuaState, (FCChord*)pProcessObject);
1913 return true;
1914 case FCID_CHORDSUFFIXELEMENT:
1915 parameter = luabridge::LuaRef(pLuaState, (FCChordSuffixElement*)pProcessObject);
1916 return true;
1917 case FCID_CHORUSSYLLABLE:
1918 parameter = luabridge::LuaRef(pLuaState, (FCChorusSyllable*)pProcessObject);
1919 return true;
1920 case FCID_CLEFDEF:
1921 parameter = luabridge::LuaRef(pLuaState, (FCClefDef*)pProcessObject);
1922 return true;
1923 case FCID_CROSSSTAFFMOD:
1924 parameter = luabridge::LuaRef(pLuaState, (FCCrossStaffMod*)pProcessObject);
1925 return true;
1926 case FCID_CUSTOMSMARTLINEDEF:
1927 parameter = luabridge::LuaRef(pLuaState, (FCCustomSmartLineDef*)pProcessObject);
1928 return true;
1929 case FCID_CUSTOMSTEMMOD:
1930 parameter = luabridge::LuaRef(pLuaState, (FCCustomStemMod*)pProcessObject);
1931 return true;
1932 case FCID_DOTMOD:
1933 parameter = luabridge::LuaRef(pLuaState, (FCDotMod*)pProcessObject);
1934 return true;
1935 case FCID_ENCLOSURE:
1936 parameter = luabridge::LuaRef(pLuaState, (FCEnclosure*)pProcessObject);
1937 return true;
1938 case FCID_ENDINGREPEAT:
1939 parameter = luabridge::LuaRef(pLuaState, (FCEndingRepeat*)pProcessObject);
1940 return true;
1941 case FCID_ENTRYALTERMOD:
1942 parameter = luabridge::LuaRef(pLuaState, (FCEntryAlterMod*)pProcessObject);
1943 return true;
1944 case FCID_EXECUTABLESHAPEDEF:
1945 parameter = luabridge::LuaRef(pLuaState, (FCExecutableShapeDef*)pProcessObject);
1946 return true;
1947 case FCID_EXPRESSION:
1948 parameter = luabridge::LuaRef(pLuaState, (FCExpression*)pProcessObject);
1949 return true;
1950 case FCID_FREEZESYSTEM:
1951 parameter = luabridge::LuaRef(pLuaState, (FCFreezeSystem*)pProcessObject);
1952 return true;
1953 case FCID_FRETBOARDSTYLEDEF:
1954 parameter = luabridge::LuaRef(pLuaState, (FCFretboardStyleDef*)pProcessObject);
1955 return true;
1956 case FCID_FRETBOARDGROUPDEF:
1957 parameter = luabridge::LuaRef(pLuaState, (FCFretboardGroupDef*)pProcessObject);
1958 return true;
1959 case FCID_FRETINSTRUMENTDEF:
1960 parameter = luabridge::LuaRef(pLuaState, (FCFretInstrumentDef*)pProcessObject);
1961 return true;
1962 case FCID_GROUP:
1963 parameter = luabridge::LuaRef(pLuaState, (FCGroup*)pProcessObject);
1964 return true;
1965 case FCID_INDEPENDENTCELLDETAIL:
1966 parameter = luabridge::LuaRef(pLuaState, (FCIndependentCellDetail*)pProcessObject);
1967 return true;
1968 case FCID_INSTRUMENTDEF:
1969 parameter = luabridge::LuaRef(pLuaState, (FCInstrumentDef*)pProcessObject);
1970 return true;
1971 case FCID_INSTRUMENTPLAYBACKDATA:
1972 parameter = luabridge::LuaRef(pLuaState, (FCInstrumentPlaybackData*)pProcessObject);
1973 return true;
1974 case FCID_MEASURE:
1975 parameter = luabridge::LuaRef(pLuaState, (FCMeasure*)pProcessObject);
1976 return true;
1977 case FCID_MEASURENUMBERREGION:
1978 parameter = luabridge::LuaRef(pLuaState, (FCMeasureNumberRegion*)pProcessObject);
1979 return true;
1980 case FCID_METATOOLASSIGNMENT:
1981 parameter = luabridge::LuaRef(pLuaState, (FCMetatoolAssignment*)pProcessObject);
1982 return true;
1983 case FCID_MIDIEXPRESSION:
1984 parameter = luabridge::LuaRef(pLuaState, (FCMidiExpression*)pProcessObject);
1985 return true;
1986 case FCID_MULTIMEASUREREST:
1987 parameter = luabridge::LuaRef(pLuaState, (FCMultiMeasureRest*)pProcessObject);
1988 return true;
1989 case FCID_MULTISTAFFINSTRUMENT:
1990 parameter = luabridge::LuaRef(pLuaState, (FCMultiStaffInstrument*)pProcessObject);
1991 return true;
1992 case FCID_NOTEHEADMOD:
1993 parameter = luabridge::LuaRef(pLuaState, (FCNoteheadMod*)pProcessObject);
1994 return true;
1995 case FCID_PERCUSSIONLAYOUTNOTE:
1996 parameter = luabridge::LuaRef(pLuaState, (FCPercussionLayoutNote*)pProcessObject);
1997 return true;
1998 case FCID_PERCUSSIONSTAFF:
1999 parameter = luabridge::LuaRef(pLuaState, (FCPercussionStaff*)pProcessObject);
2000 return true;
2001 case FCID_PERFORMANCEMOD:
2002 parameter = luabridge::LuaRef(pLuaState, (FCPerformanceMod*)pProcessObject);
2003 return true;
2004 case FCID_PAGE:
2005 parameter = luabridge::LuaRef(pLuaState, (FCPage*)pProcessObject);
2006 return true;
2007 case FCID_PAGEGRAPHIC:
2008 parameter = luabridge::LuaRef(pLuaState, (FCPageGraphic*)pProcessObject);
2009 return true;
2010 case FCID_PAGETEXT:
2011 parameter = luabridge::LuaRef(pLuaState, (FCPageText*)pProcessObject);
2012 return true;
2013 case FCID_PERCUSSIONNOTEMOD:
2014 parameter = luabridge::LuaRef(pLuaState, (FCPercussionNoteMod*)pProcessObject);
2015 return true;
2016 case FCID_RAWTEXT:
2017 parameter = luabridge::LuaRef(pLuaState, (FCRawText*)pProcessObject);
2018 return true;
2019 case FCID_SECONDARYBEAMBREAKMOD:
2020 parameter = luabridge::LuaRef(pLuaState, (FCSecondaryBeamBreakMod*)pProcessObject);
2021 return true;
2022 case FCID_SECTIONSYLLABLE:
2023 parameter = luabridge::LuaRef(pLuaState, (FCSectionSyllable*)pProcessObject);
2024 return true;
2025 case FCID_SEPARATEMEASURENUMBER:
2026 parameter = luabridge::LuaRef(pLuaState, (FCSeparateMeasureNumber*)pProcessObject);
2027 return true;
2028 case FCID_SEPARATEPLACEMENT:
2029 parameter = luabridge::LuaRef(pLuaState, (FCSeparatePlacement*)pProcessObject);
2030 return true;
2031#ifdef PDK_FRAMEWORK_SHAPES
2032 case FCID_SHAPEDEF:
2033 parameter = luabridge::LuaRef(pLuaState, (FCShapeDef*)pProcessObject);
2034 return true;
2035#endif
2036 case FCID_SHAPEEXPRESSIONDEF:
2037 parameter = luabridge::LuaRef(pLuaState, (FCShapeExpressionDef*)pProcessObject);
2038 return true;
2039 case FCID_SMARTSHAPE:
2040 parameter = luabridge::LuaRef(pLuaState, (FCSmartShape*)pProcessObject);
2041 return true;
2042 case FCID_SMARTSHAPEENTRYMARK:
2043 parameter = luabridge::LuaRef(pLuaState, (FCSmartShapeEntryMark*)pProcessObject);
2044 return true;
2045 case FCID_SMARTSHAPEMEASUREMARK:
2046 parameter = luabridge::LuaRef(pLuaState, (FCSmartShapeMeasureMark*)pProcessObject);
2047 return true;
2048 case FCID_STAFF:
2049 parameter = luabridge::LuaRef(pLuaState, (FCStaff*)pProcessObject);
2050 return true;
2051 case FCID_STAFFLIST:
2052 parameter = luabridge::LuaRef(pLuaState, (FCStaffList*)pProcessObject);
2053 return true;
2054 case FCID_STAFFNAMEPOSITION:
2055 parameter = luabridge::LuaRef(pLuaState, (FCStaffNamePosition*)pProcessObject);
2056 return true;
2057 case FCID_STAFFSTYLEASSIGN:
2058 parameter = luabridge::LuaRef(pLuaState, (FCStaffStyleAssign*)pProcessObject);
2059 return true;
2060 case FCID_STAFFSTYLEDEF:
2061 parameter = luabridge::LuaRef(pLuaState, (FCStaffStyleDef*)pProcessObject);
2062 return true;
2063 case FCID_STAFFSYSTEM:
2064 parameter = luabridge::LuaRef(pLuaState, (FCStaffSystem*)pProcessObject);
2065 return true;
2066 case FCID_STEMMOD:
2067 parameter = luabridge::LuaRef(pLuaState, (FCStemMod*)pProcessObject);
2068 return true;
2069 case FCID_SYLLABLEENTRYMOD:
2070 parameter = luabridge::LuaRef(pLuaState, (FCSyllableEntryMod*)pProcessObject);
2071 return true;
2072 case FCID_SYSTEMSTAFF:
2073 parameter = luabridge::LuaRef(pLuaState, (FCSystemStaff*)pProcessObject);
2074 return true;
2075 case FCID_TABLATURENOTEMOD:
2076 parameter = luabridge::LuaRef(pLuaState, (FCTablatureNoteMod*)pProcessObject);
2077 return true;
2078 case FCID_TEMPOELEMENT:
2079 parameter = luabridge::LuaRef(pLuaState, (FCTempoElement*)pProcessObject);
2080 return true;
2081 case FCID_TEXTBLOCK:
2082 parameter = luabridge::LuaRef(pLuaState, (FCTextBlock*)pProcessObject);
2083 return true;
2084 case FCID_TEXTEXPRESSIONDEF:
2085 parameter = luabridge::LuaRef(pLuaState, (FCTextExpressionDef*)pProcessObject);
2086 return true;
2087 case FCID_TEXTREPEAT:
2088 parameter = luabridge::LuaRef(pLuaState, (FCTextRepeat*)pProcessObject);
2089 return true;
2090 case FCID_TEXTREPEATDEF:
2091 parameter = luabridge::LuaRef(pLuaState, (FCTextRepeatDef*)pProcessObject);
2092 return true;
2093 case FCID_TIEMOD:
2094 parameter = luabridge::LuaRef(pLuaState, (FCTieMod*)pProcessObject);
2095 return true;
2096 case FCID_TUPLET:
2097 parameter = luabridge::LuaRef(pLuaState, (FCTuplet*)pProcessObject);
2098 return true;
2099 case FCID_VERSESYLLABLE:
2100 parameter = luabridge::LuaRef(pLuaState, (FCVerseSyllable*)pProcessObject);
2101 return true;
2102
2103 default:
2104#ifdef PDK_FRAMEWORK_DIAGNOSE
2105 DebugOutInt("Error in FCLuaIterator - unhandled class: ", pProcessObject->GetClassID());
2106#endif
2107 return false;
2108 }
2109 }
2110public:
2116 {
2117 _progressfrequency = 20;
2118 _timingstart = _timingend = 0;
2119 _forwardprocessing = true;
2120 _downwardprocessing = true;
2121 _partialmeasureselections = true;
2122 _nullregionequalsall = false;
2123 _useprogressbar = false;
2124 _abortableprogressbar = false;
2125 _progressbar_useraborted = false;
2126 _loadlayermode = 0;
2127 _processscorepart = true;
2128 _processcurrentpart = true;
2129 _processcurrentdoc = true;
2130 }
2131
2162 int ForEach(__FCCollectionData* pCollection, luabridge::LuaRef lua_callback_function)
2163 {
2164 StartTiming();
2165 int count = ProcessForEach(pCollection, lua_callback_function, false);
2166 EndTiming();
2167 return count;
2168 }
2169
2198 int ForEachSaved(__FCCollectionData* pCollection, luabridge::LuaRef lua_callback_function)
2199 {
2200 StartTiming();
2201 int count = ProcessForEach(pCollection, lua_callback_function, true);
2202 EndTiming();
2203 return count;
2204 }
2205
2227 int ForEachEntry(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2228 {
2229 StartTiming();
2230 int count = ProcessRegionEntries(pRegion, lua_callback_function, false);
2231 EndTiming();
2232 return count;
2233 }
2234
2270 int ForEachEntrySaved(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2271 {
2272 StartTiming();
2273 int count = ProcessRegionEntries(pRegion, lua_callback_function, true);
2274 EndTiming();
2275 return count;
2276 }
2277
2319 int ForEachNote(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2320 {
2321 StartTiming();
2322 int count = ProcessRegionNotes(pRegion, lua_callback_function, false);
2323 EndTiming();
2324 return count;
2325 }
2326
2359 int ForEachNoteSaved(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2360 {
2361 StartTiming();
2362 int count = ProcessRegionNotes(pRegion, lua_callback_function, true);
2363 EndTiming();
2364 return count;
2365 }
2366
2391 int ForEachCell(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2392 {
2393 StartTiming();
2394 int count = ProcessForEachCell(pRegion, lua_callback_function);
2395 EndTiming();
2396 return count;
2397 }
2398
2418 int ForEachPart(luabridge::LuaRef lua_callback_function)
2419 {
2420 StartTiming();
2421 int count = ProcessForEachPart(lua_callback_function);
2422 EndTiming();
2423 return count;
2424 }
2425
2486 int ForEachObject(int classID, luabridge::LuaRef lua_callback_function)
2487 {
2488 if (!lua_callback_function.isFunction()) return 0;
2489 StartTiming();
2490 __FCCollectionData* pCollection = LoadCollectionForClassID((PDKFRAMEWORK_CLASSID) classID);
2491 if (!pCollection)
2492 {
2493 EndTiming();
2494 return 0;
2495 }
2496 int count = ProcessForEach(pCollection, lua_callback_function, false);
2497 delete pCollection;
2498 EndTiming();
2499 return count;
2500 }
2501
2528 int ForEachObjectSaved(int classID, luabridge::LuaRef lua_callback_function)
2529 {
2530 if (!lua_callback_function.isFunction()) return 0;
2531 StartTiming();
2532 __FCCollectionData* pCollection = LoadCollectionForClassID((PDKFRAMEWORK_CLASSID) classID);
2533 if (!pCollection)
2534 {
2535 EndTiming();
2536 return 0;
2537 }
2538 int count = ProcessForEach(pCollection, lua_callback_function, true);
2539 delete pCollection;
2540 EndTiming();
2541 return count;
2542 }
2543
2588 int ForEachRegionObject(FCMusicRegion* pRegion, int classID, luabridge::LuaRef lua_callback_function)
2589 {
2590 StartTiming();
2591 int count = ProcessForEachRegionObject(pRegion, classID, lua_callback_function, false);
2592 EndTiming();
2593 return count;
2594 }
2595
2619 int ForEachRegionObjectSaved(FCMusicRegion* pRegion, int classID, luabridge::LuaRef lua_callback_function)
2620 {
2621 StartTiming();
2622 int count = ProcessForEachRegionObject(pRegion, classID, lua_callback_function, true);
2623 EndTiming();
2624 return count;
2625 }
2626
2660 int ForEachDocument(luabridge::LuaRef lua_callback_function)
2661 {
2662 StartTiming();
2663 int count = ProcessForEachDocument(lua_callback_function, false);
2664 EndTiming();
2665 return count;
2666 }
2667
2704 int ForEachDocumentSaved(luabridge::LuaRef lua_callback_function)
2705 {
2706 StartTiming();
2707 int count = ProcessForEachDocument(lua_callback_function, true);
2708 EndTiming();
2709 return count;
2710 }
2711
2752 int ForEachFile(FCStrings* pFileStrings, luabridge::LuaRef lua_callback_function)
2753 {
2754 StartTiming();
2755 int count = ProcessForEachFile(pFileStrings, lua_callback_function, false);
2756 EndTiming();
2757 return count;
2758 }
2759
2804 int ForEachFileSaved(FCStrings* pFileStrings, luabridge::LuaRef lua_callback_function)
2805 {
2806 StartTiming();
2807 int count = ProcessForEachFile(pFileStrings, lua_callback_function, true);
2808 EndTiming();
2809 return count;
2810 }
2811
2842 int ForEachInteger(int integer1, int integer2, luabridge::LuaRef lua_callback_function)
2843 {
2844 StartTiming();
2845 int count = ProcessForEachInteger(integer1, integer2, lua_callback_function);
2846 EndTiming();
2847 return count;
2848 }
2849
2854 bool GetUseProgressBar() const { return _useprogressbar; }
2855
2861 {
2862 return _progressfrequency;
2863 }
2864
2870 {
2871 return _abortableprogressbar;
2872 }
2873
2879 bool GetProgressBarUserAborted() const { return _progressbar_useraborted; }
2880
2889 {
2890 return _loadlayermode;
2891 }
2892
2898 bool GetProcessScorePart() const { return _processscorepart; }
2899
2904 bool GetProcessCurrentPart() const { return _processcurrentpart; }
2905
2911 bool GetProcessCurrentDocument() const { return _processcurrentdoc; }
2912
2918 bool GetNullRegionEqualsAll() const { return _nullregionequalsall; }
2919
2930 bool GetForwardProcessing() const { return _forwardprocessing; }
2931
2938 bool GetDownwardProcessing() const { return _downwardprocessing; }
2939
2947 bool GetPartialMeasureSelections() const { return _partialmeasureselections; }
2948
2956 void SetUseProgressBar(bool use) { _useprogressbar = use; }
2957
2970 {
2971 if (freq < 1) return;
2972 _progressfrequency = freq;
2973 }
2974
2979 void SetAbortableProgressBar(bool state) { _abortableprogressbar = state; }
2980
2988 void SetLoadLayerMode(int loadlayermode) { _loadlayermode = loadlayermode; }
2989
2994 void SetProcessScorePart(bool state) { _processscorepart = state; }
2995
3000 void SetProcessCurrentPart(bool state) { _processcurrentpart = state; }
3001
3007 void SetProcessCurrentDocument(bool state) { _processcurrentdoc = state; }
3008
3014 void SetNullRegionEqualsAll(bool state) { _nullregionequalsall = state; }
3015
3029 void SetForwardProcessing(bool forward) { _forwardprocessing = forward; }
3030
3039 void SetDownwardProcessing(bool downward) { _downwardprocessing = downward; }
3040
3048 void SetPartialMeasureSelections(bool partialselections) { _partialmeasureselections = partialselections; }
3049
3060 bool AddEntryFilter(int filter, int logicmode)
3061 {
3062 switch (logicmode)
3063 {
3064 case LILOGIC_AND:
3065 return _entryfilters_AND.AddFilter((LUAITERATOR_ENTRYFILTERS)filter);
3066 case LILOGIC_OR:
3067 return _entryfilters_OR.AddFilter((LUAITERATOR_ENTRYFILTERS)filter);
3068 case LILOGIC_NOT:
3069 return _entryfilters_NOT.AddFilter((LUAITERATOR_ENTRYFILTERS)filter);
3070 }
3071 return false;
3072 }
3073
3086 bool RemoveEntryFilter(int filter, int logicmode)
3087 {
3088 switch (logicmode)
3089 {
3090 case LILOGIC_AND:
3091 return _entryfilters_AND.RemoveFilter((LUAITERATOR_ENTRYFILTERS)filter);
3092 case LILOGIC_OR:
3093 return _entryfilters_OR.RemoveFilter((LUAITERATOR_ENTRYFILTERS)filter);
3094 case LILOGIC_NOT:
3095 return _entryfilters_NOT.RemoveFilter((LUAITERATOR_ENTRYFILTERS)filter);
3096 }
3097 return false;
3098 }
3099
3105 {
3106 _entryfilters_AND.ClearAll();
3107 _entryfilters_OR.ClearAll();
3108 _entryfilters_NOT.ClearAll();
3109 }
3110
3121 bool IsEntryFilterAdded(int filter, int logicmode)
3122 {
3123 switch (logicmode)
3124 {
3125 case LILOGIC_AND:
3126 return (_entryfilters_AND.Find((LUAITERATOR_ENTRYFILTERS)filter) != NULL);
3127 case LILOGIC_OR:
3128 return (_entryfilters_OR.Find((LUAITERATOR_ENTRYFILTERS)filter) != NULL);
3129 case LILOGIC_NOT:
3130 return (_entryfilters_NOT.Find((LUAITERATOR_ENTRYFILTERS)filter) != NULL);
3131 }
3132 return false;
3133 }
3134
3145 bool AddNoteFilter(int filter, int logicmode)
3146 {
3147 switch (logicmode)
3148 {
3149 case LILOGIC_AND:
3150 return _notefilters_AND.AddFilter((LUAITERATOR_NOTEFILTERS)filter);
3151 case LILOGIC_OR:
3152 return _notefilters_OR.AddFilter((LUAITERATOR_NOTEFILTERS)filter);
3153 case LILOGIC_NOT:
3154 return _notefilters_NOT.AddFilter((LUAITERATOR_NOTEFILTERS)filter);
3155 }
3156 return false;
3157 }
3158
3171 bool RemoveNoteFilter(int filter, int logicmode)
3172 {
3173 switch (logicmode)
3174 {
3175 case LILOGIC_AND:
3176 return _notefilters_AND.RemoveFilter((LUAITERATOR_NOTEFILTERS)filter);
3177 case LILOGIC_OR:
3178 return _notefilters_OR.RemoveFilter((LUAITERATOR_NOTEFILTERS)filter);
3179 case LILOGIC_NOT:
3180 return _notefilters_NOT.RemoveFilter((LUAITERATOR_NOTEFILTERS)filter);
3181 }
3182 return false;
3183 }
3184
3190 {
3191 _notefilters_AND.ClearAll();
3192 _notefilters_OR.ClearAll();
3193 _notefilters_NOT.ClearAll();
3194 }
3195
3206 bool IsNoteFilterAdded(int filter, int logicmode)
3207 {
3208 switch (logicmode)
3209 {
3210 case LILOGIC_AND:
3211 return (_notefilters_AND.Find((LUAITERATOR_NOTEFILTERS)filter) != NULL);
3212 case LILOGIC_OR:
3213 return (_notefilters_OR.Find((LUAITERATOR_NOTEFILTERS)filter) != NULL);
3214 case LILOGIC_NOT:
3215 return (_notefilters_NOT.Find((LUAITERATOR_NOTEFILTERS)filter) != NULL);
3216 }
3217 return false;
3218 }
3219
3230 bool AddAltNotationFilter(int filter, int logicmode)
3231 {
3232 switch (logicmode)
3233 {
3234 case LILOGIC_AND:
3235 return _altnotationfilters_AND.AddFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3236 case LILOGIC_OR:
3237 return _altnotationfilters_OR.AddFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3238 case LILOGIC_NOT:
3239 return _altnotationfilters_NOT.AddFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3240 }
3241 return false;
3242 }
3243
3257 bool RemoveAltNotationFilter(int filter, int logicmode)
3258 {
3259 switch (logicmode)
3260 {
3261 case LILOGIC_AND:
3262 return _altnotationfilters_AND.RemoveFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3263 case LILOGIC_OR:
3264 return _altnotationfilters_OR.RemoveFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3265 case LILOGIC_NOT:
3266 return _altnotationfilters_NOT.RemoveFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3267 }
3268 return false;
3269 }
3270
3276 {
3277 _altnotationfilters_AND.ClearAll();
3278 _altnotationfilters_OR.ClearAll();
3279 _altnotationfilters_NOT.ClearAll();
3280 }
3281
3293 bool IsAltNotationFilterAdded(int filter, int logicmode)
3294 {
3295 switch (logicmode)
3296 {
3297 case LILOGIC_AND:
3298 return (_altnotationfilters_AND.Find((__FCStaffBase::ALTERNATE_STAFF)filter) != NULL);
3299 case LILOGIC_OR:
3300 return (_altnotationfilters_OR.Find((__FCStaffBase::ALTERNATE_STAFF)filter) != NULL);
3301 case LILOGIC_NOT:
3302 return (_altnotationfilters_NOT.Find((__FCStaffBase::ALTERNATE_STAFF)filter) != NULL);
3303 }
3304 return false;
3305 }
3306
3317 bool AddNotationStyleFilter(int filter, int logicmode)
3318 {
3319 switch (logicmode)
3320 {
3321 case LILOGIC_AND:
3322 return _notationstylefilters_AND.AddFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3323 case LILOGIC_OR:
3324 return _notationstylefilters_OR.AddFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3325 case LILOGIC_NOT:
3326 return _notationstylefilters_NOT.AddFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3327 }
3328 return false;
3329 }
3330
3344 bool RemoveNotationStyleFilter(int filter, int logicmode)
3345 {
3346 switch (logicmode)
3347 {
3348 case LILOGIC_AND:
3349 return _notationstylefilters_AND.RemoveFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3350 case LILOGIC_OR:
3351 return _notationstylefilters_OR.RemoveFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3352 case LILOGIC_NOT:
3353 return _notationstylefilters_NOT.RemoveFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3354 }
3355 return false;
3356 }
3357
3363 {
3364 _notationstylefilters_AND.ClearAll();
3365 _notationstylefilters_OR.ClearAll();
3366 _notationstylefilters_NOT.ClearAll();
3367 }
3368
3379 bool IsNotationStyleFilterAdded(int filter, int logicmode)
3380 {
3381 switch (logicmode)
3382 {
3383 case LILOGIC_AND:
3384 return (_notationstylefilters_AND.Find((__FCStaffBase::STAFFNOTATION_STYLE)filter) != NULL);
3385 case LILOGIC_OR:
3386 return (_notationstylefilters_OR.Find((__FCStaffBase::STAFFNOTATION_STYLE)filter) != NULL);
3387 case LILOGIC_NOT:
3388 return (_notationstylefilters_NOT.Find((__FCStaffBase::STAFFNOTATION_STYLE)filter) != NULL);
3389 }
3390 return false;
3391 }
3392
3404 {
3405 if (_timingend == 0) return 0;
3406 return (_timingend - _timingstart);
3407 }
3408};
3409
3410#endif // jwlua_fflua_luaiterator_h
Base class for all data-related classes (that handles Finale data).
Definition ff_base.h:676
const PDKFRAMEWORK_CLASSID GetClassID() const override=0
Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has...
virtual bool Save()
Saves the currently loaded to its current location.
Definition finaleframework.cpp:951
Base class for the Finale Framework classes.
Definition ff_base.h:71
PDKFRAMEWORK_CLASSID
Constants for the GetClassID method.
Definition ff_base.h:84
static void DebugOutInt(const char *pszPrefixText, int i)
Static method that outputs a line for debugging purposes. The text appears with the extra digit (in d...
Definition finaleframework.cpp:335
Base class for data that attach to cells. A call to the ConnectCell method is required prior to loadi...
Definition ff_celldetails.h:27
Base class for all collections based on decendants from __FCBaseData.
Definition ff_basecollection.h:606
virtual int LoadAll()
Loads all available data into the collection.
Definition finaleframework.cpp:13964
Base class for all collection classes. A collection is a storage that can store multiple objects of s...
Definition ff_basecollection.h:26
int GetIndexOf(__FCBase *pObject) const
Returns the 0-based order index for the object within the collection.
Definition finaleframework.cpp:13775
void Add(__FCBase *pNewItem)
Adds an element to the end of the collection.
Definition finaleframework.cpp:13726
bool ClearItemAt(int index)
Deletes the object at the index position and disposes the object. Index is 0-based.
Definition finaleframework.cpp:13791
int GetCount() const
Returns the number of elements of the collection.
Definition ff_basecollection.h:102
__FCBase * GetItemAt(int index) const
Returns the object at the index position. Index is 0-based.
Definition finaleframework.cpp:13767
Base class that provides the basic functionality for entry detail data (such as Special Tools modific...
Definition ff_entrydetails.h:27
Base class for "other" (ot_*) data with incis.
Definition ff_other.h:63
STAFFNOTATION_STYLE
Styles for the FCStaff::GetNotationStyle() and FCStaff::SetNotationStyle() methods....
Definition ff_other.h:9308
__FCStaffBase::ALTERNATE_STAFF GetAltNotationStyle()
Returns the alternate notation style for the staff.
Definition ff_other.h:9901
ALTERNATE_STAFF
Alternate staff notation styles for FCStaff::GetAltNotationStyle() and FCStaff::SetAltNotationStyle()...
Definition ff_other.h:9341
STAFFNOTATION_STYLE GetNotationStyle() const
Returns the notation style for the staff.
Definition ff_other.h:9843
Class for acciental modifications (as in Finale's Special Tools).
Definition ff_entrydetails.h:3559
Class for allotment data (in the Document Options).
Definition ff_other.h:20147
The class for an articulation definition. On Finale 2012 and above, this class supports the Unicode c...
Definition ff_other.h:12287
Collection class for FCArticulationDef class objects.
Definition ff_othercollection.h:504
Class for attaching an articulation definition to an entry.
Definition ff_entrydetails.h:1839
The class for a backward repeat definition.
Definition ff_other.h:23156
Encapsulates baselines offset values for lyrics, expressions, fretboards and chords.
Definition ff_details.h:1096
Class for custom beam adjustments (in Finale's Special Tools).
Definition ff_entrydetails.h:4279
The class for one single beat chart element.
Definition ff_other.h:23615
Class for manually broken beam adjustments (in Finale's Special Tools).
Definition ff_entrydetails.h:5696
Class for a category definition.
Definition ff_other.h:13416
Collection class for FCCategoryDef class objects.
Definition ff_othercollection.h:765
Contains a clef change inside a cell. This is an item member in a FCCellClefChanges collection (creat...
Definition ff_other.h:25850
Class that holds the TGF frames and the clef changes of a TGF frame.
Definition ff_celldetails.h:956
Class for measure/cell-attached graphic objects. Currently, this class can only be used to edit exist...
Definition ff_celldetails.h:2045
The class that reference a cell (one measure on one staff) in the musical "grid".
Definition ff_cell.h:18
Class for measure-attached (cell-attached) text blocks. The ConnectCell method must be called prior t...
Definition ff_celldetails.h:2236
Class that contains data that appears in the middle of a long smart shape. This class is normally lin...
Definition ff_smartshapes.h:425
Class for chord assignments to a measure/staff.
Definition ff_celldetails.h:1289
Class that stores one record of a chord suffix definition.
Definition ff_other.h:21677
Collection class for FCChord class objects.
Definition ff_celldetails.h:2536
The class for a chorus syllable.
Definition ff_entrydetails.h:3222
Data class for the global clef definitions.
Definition ff_globals.h:51
Collection class for FCClefDef class objects.
Definition ff_globals.h:315
Class that specifies the cross-staff connection for a note.
Definition ff_entrydetails.h:1087
The class for a "current staff state" (the sum of staff changes and staff style changes) at a specifi...
Definition ff_other.h:12206
bool LoadForEntry(const FCNoteEntry *pNoteEntry)
Loads the staff spec data based on the position in the note entry.
Definition finaleframework.cpp:9322
bool LoadForCell(FCCell *pCell, TimeEdu32 durationpos)
Loads the staff spec data based on a position in a cell.
Definition finaleframework.cpp:9332
The class for a custom smart shape lines.
Definition ff_smartshapes.h:1889
Collection class for FCCustomSmartLineDef class objects.
Definition ff_smartshapes.h:3205
Class for custom stem shapes (in Finale's Special Tools). The data is connected to either an upstem o...
Definition ff_entrydetails.h:4177
Class for an opened Finale document. An opened Finale document has a 1-based ID and can be displayed ...
Definition ff_documents.h:28
bool Close(bool saveedits=true, _state_ptr S=nullptr)
Closes the document. Use this function to close a document if you did not open a document window when...
Definition finaleframework.cpp:32684
bool Save(const FCString *pFilePath=nullptr)
Saves the current document at the current document path or the specified document path.
Definition finaleframework.cpp:32572
void SetDirty(bool state)
Sets the "dirty" flag for the document (that indicates that the document needs to be saved).
Definition ff_documents.h:366
bool CloseCurrentDocumentAndWindow(bool saveedits=true, _state_ptr S=nullptr)
Closes the current document and any windows it has open. Use this function to close a document if you...
Definition finaleframework.cpp:32675
bool SwitchBack(bool saveedits, _state_ptr S=nullptr)
Ends the started edit block and switch back to the previous document.
Definition finaleframework.cpp:32514
bool SwitchTo(const FCString *pUndoString, bool saveedits, _state_ptr S=nullptr)
Switch document focus to this document and start a new undo/redo record, without closing the previous...
Definition finaleframework.cpp:32490
bool IsCurrent()
Returns true if the current document is the current document.
Definition ff_documents.h:75
bool IsUntitled()
Returns true if the document has no file connected to it.
Definition finaleframework.cpp:32697
bool Open(const FCString *pFilePath, bool createwindow, const FCString *pUndoString, bool saveedits, bool addtorecents, bool hidedialogs, _state_ptr S=nullptr)
Opens a file as a new Finale document. The new document automatically gets editing focus....
Definition finaleframework.cpp:32582
Class for a collection of documents. Usually used to get all the currently loaded documents in Finale...
Definition ff_documents.h:391
FCDocument * GetItemAt(int index) const
Overridden version of GetItemAt().
Definition ff_documents.h:443
int LoadAll()
Gets all open docs into the collection.
Definition finaleframework.cpp:32789
Class with adjustments to the augmentation dots (in Finale's Special Tools).
Definition ff_entrydetails.h:940
Class to encapsulate enclosures (available for example in expressions and measure numbers....
Definition ff_other.h:2872
The class for a start of repeat bracket in the document. There can only be one ending repeat in each ...
Definition ff_other.h:22668
Class for (what it seems) the sole purpose of note entry resize.
Definition ff_entrydetails.h:3459
The class for an executable shape definition.
Definition ff_other.h:21590
Collection class for FCExecutableShapeDef class objects.
Definition ff_othercollection.h:1414
Class for expression assignments to a measure/staff.
Definition ff_other.h:17641
Class for freezing a system at a specific measure.
Definition ff_other.h:14410
Class for tablature instruments definitions.
Definition ff_other.h:25427
Collection class for FCFretInstrumentDef class objects.
Definition ff_othercollection.h:1353
Class that stores one record of a fretboard chord definition.
Definition ff_other.h:22540
Collection class for FCFretboardGroupDef class objects.
Definition ff_othercollection.h:1514
The class for a fretboard style definition, which reflects the content the "Fretboard Style" dialog b...
Definition ff_other.h:21995
Collection class for FCFretboardStyleDef class objects.
Definition ff_othercollection.h:1490
Encapsulates a staff group.
Definition ff_details.h:79
Collection class for FCGroup class objects.
Definition ff_detailscollection.h:25
Class that contains independent key/time signatures for a cell.
Definition ff_celldetails.h:2568
The class for an instrument definition item (in the instrument list/Score Manager).
Definition ff_other.h:24413
Collection class for FCInstrumentDef class objects.
Definition ff_othercollection.h:1888
The class for instrument playback data. This is also the link between staves/staff styles and the FCI...
Definition ff_other.h:24668
Class for Lua callback iterators. This class is not part of the C++ PDK Framework.
Definition fflua_luaiterator.h:79
int ForEachPart(luabridge::LuaRef lua_callback_function)
Browses through all the parts in the current document, and passes the part to the callback function....
Definition fflua_luaiterator.h:2418
int GetProgressUpdateFrequency() const
Returns the update frequency for the progress bar.
Definition fflua_luaiterator.h:2860
void ClearAllAltNotationFilters()
Removes all filters for alternate notation. This will result in all items being processed.
Definition fflua_luaiterator.h:3275
int ForEachSaved(__FCCollectionData *pCollection, luabridge::LuaRef lua_callback_function)
Browses through the items in a collection. After the Lua callback function has processed the object,...
Definition fflua_luaiterator.h:2198
bool RemoveNotationStyleFilter(int filter, int logicmode)
Removes a notation style filter.
Definition fflua_luaiterator.h:3344
void SetProgressUpdateFrequency(int freq)
Sets the update frequency for the progress bar.
Definition fflua_luaiterator.h:2969
bool GetDownwardProcessing() const
Returns the vertical direction for processing staves in the iteration, for region-based iterators.
Definition fflua_luaiterator.h:2938
void SetProcessCurrentPart(bool state)
Sets if the part currently in editing focus should be processed in ForEachPart calls.
Definition fflua_luaiterator.h:3000
int ForEachFile(FCStrings *pFileStrings, luabridge::LuaRef lua_callback_function)
Opens all the files in a list of strings (as a FCStrings object), and passes the document to the Lua ...
Definition fflua_luaiterator.h:2752
void SetAbortableProgressBar(bool state)
Sets if the progress bar should be abortable (by the Esc key).
Definition fflua_luaiterator.h:2979
int ForEachObjectSaved(int classID, luabridge::LuaRef lua_callback_function)
Loads all the objects of a specific type and sends them to a Lua callback function....
Definition fflua_luaiterator.h:2528
bool IsAltNotationFilterAdded(int filter, int logicmode)
Returns true if a specific filter for alternate notation has been added/activated for the iterator.
Definition fflua_luaiterator.h:3293
int ForEachRegionObjectSaved(FCMusicRegion *pRegion, int classID, luabridge::LuaRef lua_callback_function)
Loads all the objects of a specific type that appears within a region and sends them to a Lua callbac...
Definition fflua_luaiterator.h:2619
bool GetUseProgressBar() const
Returns if the update progress bar should be used or not.
Definition fflua_luaiterator.h:2854
int ForEachRegionObject(FCMusicRegion *pRegion, int classID, luabridge::LuaRef lua_callback_function)
Loads all the objects of a specific type within a selected region and sends them to a Lua callback fu...
Definition fflua_luaiterator.h:2588
void SetDownwardProcessing(bool downward)
Sets the vertical direction for processing staves in the iteration, for region-based iterators.
Definition fflua_luaiterator.h:3039
bool IsNotationStyleFilterAdded(int filter, int logicmode)
Returns true if a specific filter for a notation style has been added/activated for the iterator.
Definition fflua_luaiterator.h:3379
bool GetProcessCurrentPart() const
Returns if the part currently in editing focus should be processed in ForEachPart calls.
Definition fflua_luaiterator.h:2904
void ClearAllEntryFilters()
Removes all entry filters. This will result in all entry being processed by the ForEachEntry and ForE...
Definition fflua_luaiterator.h:3104
void SetPartialMeasureSelections(bool partialselections)
Returns partially selected measures should be processed.
Definition fflua_luaiterator.h:3048
int ForEachDocument(luabridge::LuaRef lua_callback_function)
Browses through all the currently opened documents, and passes the document to the Lua callback funct...
Definition fflua_luaiterator.h:2660
bool RemoveNoteFilter(int filter, int logicmode)
Removes a note filter.
Definition fflua_luaiterator.h:3171
void SetLoadLayerMode(int loadlayermode)
Sets the load layer mode for the note entry iterators, such as ForEachEntry(), ForEachNote(),...
Definition fflua_luaiterator.h:2988
bool GetAbortableProgressBar() const
Returns if the progress bar should be abortable (by the Esc key).
Definition fflua_luaiterator.h:2869
void ClearAllNoteFilters()
Removes all note filters.
Definition fflua_luaiterator.h:3189
int ForEachDocumentSaved(luabridge::LuaRef lua_callback_function)
Browses through all the currently opened documents, passes the document to the Lua callback function,...
Definition fflua_luaiterator.h:2704
bool IsEntryFilterAdded(int filter, int logicmode)
Returns true if a specific note entry filter has been added/activated for the iterator.
Definition fflua_luaiterator.h:3121
void SetForwardProcessing(bool forward)
Sets the direction of the iteration.
Definition fflua_luaiterator.h:3029
bool GetPartialMeasureSelections() const
Returns partially selected measures should be processed.
Definition fflua_luaiterator.h:2947
FCLuaIterator()
The constructor.
Definition fflua_luaiterator.h:2115
bool RemoveAltNotationFilter(int filter, int logicmode)
Removes a alternate notation filter.
Definition fflua_luaiterator.h:3257
bool GetProcessCurrentDocument() const
Returns if the document currently in editing focus should be processed in ForEachDocument and ForEach...
Definition fflua_luaiterator.h:2911
int ForEachObject(int classID, luabridge::LuaRef lua_callback_function)
Loads all the objects of a specific type and sends them to a Lua callback function.
Definition fflua_luaiterator.h:2486
int ForEachNote(FCMusicRegion *pRegion, luabridge::LuaRef lua_callback_function)
Browses through all notes (as in noteheads) in a region. If a note entry consists of a chord with mul...
Definition fflua_luaiterator.h:2319
void SetUseProgressBar(bool use)
Sets if the update progress bar should be used or not.
Definition fflua_luaiterator.h:2956
double CalcLastDuration()
Reports the duration of the last iterator run.
Definition fflua_luaiterator.h:3403
int ForEachEntry(FCMusicRegion *pRegion, luabridge::LuaRef lua_callback_function)
Browses through the entries in a region, similar to the eachentry() iterator in JW Lua.
Definition fflua_luaiterator.h:2227
bool RemoveEntryFilter(int filter, int logicmode)
Removes a note entry filter.
Definition fflua_luaiterator.h:3086
int ForEach(__FCCollectionData *pCollection, luabridge::LuaRef lua_callback_function)
Browses through the items in a collection and sends the object to a Lua callback function,...
Definition fflua_luaiterator.h:2162
int ForEachFileSaved(FCStrings *pFileStrings, luabridge::LuaRef lua_callback_function)
Opens all the files in a list of strings (as a FCStrings object), passes the document to the Lua call...
Definition fflua_luaiterator.h:2804
bool GetNullRegionEqualsAll() const
Returns if NULL regions should automatically be interpreted as a full document region,...
Definition fflua_luaiterator.h:2918
void SetProcessCurrentDocument(bool state)
Sets if the document currently in editing focus should be processed in ForEachDocument and ForEachDoc...
Definition fflua_luaiterator.h:3007
bool IsNoteFilterAdded(int filter, int logicmode)
Returns true if a specific note filter has been added/activated for the iterator.
Definition fflua_luaiterator.h:3206
LUAITERATOR_LOGICMETHOD
Logical operators that are used for filters. If no filters are added/activated, all items are automat...
Definition fflua_luaiterator.h:189
@ LILOGIC_NOT
Definition fflua_luaiterator.h:197
@ LILOGIC_OR
Definition fflua_luaiterator.h:194
@ LILOGIC_AND
Definition fflua_luaiterator.h:191
int ForEachInteger(int integer1, int integer2, luabridge::LuaRef lua_callback_function)
Passes an integer range to the Lua callback function, one by one. This iterator automatically handles...
Definition fflua_luaiterator.h:2842
int ForEachCell(FCMusicRegion *pRegion, luabridge::LuaRef lua_callback_function)
Browses through each cell in a region, similar to the eachcell() iterator in JW Lua.
Definition fflua_luaiterator.h:2391
bool AddEntryFilter(int filter, int logicmode)
Adds/activates a note entry filter.
Definition fflua_luaiterator.h:3060
bool AddNoteFilter(int filter, int logicmode)
Adds/activates a note filter.
Definition fflua_luaiterator.h:3145
void ClearAllNotationStyleFilters()
Removes all filters for notation styles. This will result in all items being processed.
Definition fflua_luaiterator.h:3362
int ForEachEntrySaved(FCMusicRegion *pRegion, luabridge::LuaRef lua_callback_function)
Browses through and saves the entries in a region, similar to the eachentrysaved() iterator in JW Lua...
Definition fflua_luaiterator.h:2270
bool AddNotationStyleFilter(int filter, int logicmode)
Adds/activates an notation style filter.
Definition fflua_luaiterator.h:3317
int ForEachNoteSaved(FCMusicRegion *pRegion, luabridge::LuaRef lua_callback_function)
Browses through all notes (as in noteheads) in a region and saves the entries. If a note entry consis...
Definition fflua_luaiterator.h:2359
bool GetProgressBarUserAborted() const
Returns true if the processing was aborted by the user (using the Esc key) during the last processing...
Definition fflua_luaiterator.h:2879
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition fflua_luaiterator.h:81
LUAITERATOR_ENTRYFILTERS
Constants for the note entry filters.
Definition fflua_luaiterator.h:91
@ LIEFILTER_DURHALF
Definition fflua_luaiterator.h:141
@ LIEFILTER_DURQUARTER
Definition fflua_luaiterator.h:144
@ LIEFILTER_SECONDARYBEAMFLAG
Definition fflua_luaiterator.h:129
@ LIEFILTER_SINGLENOTE
Definition fflua_luaiterator.h:102
@ LIEFILTER_PERFORMANCEDATAFLAG
Definition fflua_luaiterator.h:114
@ LIEFILTER_REST
Definition fflua_luaiterator.h:96
@ LIEFILTER_TUPLETSTARTFLAG
Definition fflua_luaiterator.h:120
@ LIEFILTER_ARTICULATIONFLAG
Definition fflua_luaiterator.h:105
@ LIEFILTER_DOTTED
Definition fflua_luaiterator.h:135
@ LIEFILTER_GRACENOTE
Definition fflua_luaiterator.h:132
@ LIEFILTER_CHORD
Definition fflua_luaiterator.h:99
@ LIEFILTER_DUR8TH
Definition fflua_luaiterator.h:147
@ LIEFILTER_LYRICFLAG
Definition fflua_luaiterator.h:123
@ LIEFILTER_NOTEDETAILFLAG
Definition fflua_luaiterator.h:111
@ LIEFILTER_DUR32ND
Definition fflua_luaiterator.h:153
@ LIEFILTER_DUR64TH
Definition fflua_luaiterator.h:156
@ LIEFILTER_STEMDETAILFLAG
Definition fflua_luaiterator.h:126
@ LIEFILTER_NOTE
Definition fflua_luaiterator.h:93
@ LIEFILTER_DURWHOLE
Definition fflua_luaiterator.h:138
@ LIEFILTER_SPECIALALTSFLAG
Definition fflua_luaiterator.h:117
@ LIEFILTER_DUR16TH
Definition fflua_luaiterator.h:150
@ LIEFILTER_SMARTSHAPEFLAG
Definition fflua_luaiterator.h:108
LUAITERATOR_NOTEFILTERS
Constants for the note filters.
Definition fflua_luaiterator.h:167
@ LINFILTER_ACCIDENTAL
Definition fflua_luaiterator.h:172
@ LINFILTER_ACCIDENTALPARENTHESES
Definition fflua_luaiterator.h:176
@ LINFILTER_ACCIDENTALFREEZE
Definition fflua_luaiterator.h:179
@ LINFILTER_TIE
Definition fflua_luaiterator.h:169
int GetLoadLayerMode() const
Returns the load layer mode for the note entry iterators, such as ForEachEntry(), ForEachNote(),...
Definition fflua_luaiterator.h:2888
bool AddAltNotationFilter(int filter, int logicmode)
Adds/activates an alternate notation filter.
Definition fflua_luaiterator.h:3230
bool GetProcessScorePart() const
Returns if the score part (the part with part ID 0) should be processed in ForEachPart calls.
Definition fflua_luaiterator.h:2898
void SetNullRegionEqualsAll(bool state)
Sets if NULL regions should automatically be interpreted as a full document region,...
Definition fflua_luaiterator.h:3014
void SetProcessScorePart(bool state)
Sets if the score part (the part with part ID 0) should be processed in ForEachPart calls.
Definition fflua_luaiterator.h:2994
bool GetForwardProcessing() const
Returns the direction of the iteration.
Definition fflua_luaiterator.h:2930
The class for a measure (the full vertical measure stack) in the document. It maps the Measure Attrib...
Definition ff_other.h:4221
The class for a measure number region.
Definition ff_other.h:5494
Collection class for FCMeasureNumberRegion class objects.
Definition ff_othercollection.h:370
Collection class for FCMeasure class objects.
Definition ff_othercollection.h:228
Class for a metatool key assignment.
Definition ff_other.h:26108
Encapsulates the continous MIDI data in a cell.
Definition ff_celldetails.h:265
Class for a multi-measure rest instance.
Definition ff_other.h:19613
Collection class for FCMultiMeasureRest class objects.
Definition ff_othercollection.h:1164
Class for a multi-staff instrument defined in the Score Manager.
Definition ff_other.h:19933
Collection class for FCMultiStaffInstrument class objects.
Definition ff_othercollection.h:1211
Class that encapsulates EREGION and provides additional functionality to region handling.
Definition ff_region.h:25
twobyte GetStartMeasure() const
Returns the start measure for the region.
Definition ff_region.h:411
bool SetFullDocument()
Sets the region to span the full document.
Definition finaleframework.cpp:15590
twobyte GetStartSlot() const
Returns the start slot (staff) for the region.
Definition ff_region.h:445
bool IsMeasurePartial(eMeas measure)
Returns true if a specific measure is partially selected.
Definition finaleframework.cpp:15749
int CalcStaffSpan()
Calculates the number of staves in the region.
Definition ff_region.h:521
int CalcMeasureSpan()
Calculates the number of measures in the region.
Definition ff_region.h:509
bool IsEmptyAndNotSinglePos() const
Returns true if the region is empty and it is not a single-position region. Finale itself treats sing...
Definition ff_region.h:151
twobyte GetEndMeasure() const
Returns the end measure for the region.
Definition ff_region.h:419
twobyte CalcStaffNumber(twobyte slot)
Calculates the staff number, based on the region's slot number.
Definition ff_region.h:536
twobyte GetEndSlot() const
Returns the end slot (staff) for the region.
Definition ff_region.h:458
bool IsEntryPosWithin(const FCNoteEntry *pEntry)
Checks if a entry is within the region. This checks for partial measures.
Definition finaleframework.cpp:15725
Class that encapsulate a cell of note entries.
Definition ff_noteframe.h:3133
Encapsulates a note entry from an owner class (for example FCNoteEntryCell, FCNoteEntryLayer) class.
Definition ff_noteframe.h:940
bool GetNoteDetailFlag() const
Returns true for existing note detail records.
Definition ff_noteframe.h:2246
bool GetSecondaryBeamFlag() const
Returns true for secondary beam detail records.
Definition ff_noteframe.h:2293
bool IsNote()
Returns true if entry is a note.
Definition ff_noteframe.h:2375
ENTNUM GetEntryNumber() const
Returns the internal entry number (ID) for the note entry.
Definition ff_noteframe.h:1319
bool IsDotted()
Returns true if it's a dotted entry.
Definition finaleframework.cpp:18472
bool GetArticulationFlag() const
Returns true if the entry is marked to contain articulations.
Definition ff_noteframe.h:2308
bool GetGraceNote() const
Gets the grace note state of the note entry.
Definition ff_noteframe.h:1828
bool GetTupletStartFlag() const
Returns true if the entry is marked to start a tuplet.
Definition ff_noteframe.h:2271
bool GetLyricFlag() const
Returns the flag that marks that an entry has syllable attached to it.
Definition ff_noteframe.h:2277
bool IsRest() const
Returns true if entry is a rest.
Definition ff_noteframe.h:2383
bool GetSmartShapeFlag() const
Returns true if the entry is marked to contain smart shapes.
Definition ff_noteframe.h:2315
TimeEdu32 CalcNondottedDuration()
Returns the non-dotted symbolic duration of the entry.
Definition ff_noteframe.h:1919
bool GetStemDetailFlag() const
Gets the flag state for stem detail records.
Definition ff_noteframe.h:2285
bool GetPerformanceDataFlag() const
Returns true for existing performance data records.
Definition ff_noteframe.h:2256
FCNote * GetItemAt(int index) const
Overload version of GetItemAt(), which returns a note object (if available) for the note entry.
Definition ff_noteframe.h:1053
bool GetSpecialAltsFlag() const
Returns true for existing special alteration records.
Definition ff_noteframe.h:2264
Encapsulates one note in a note entry (from the FCNoteEntry class).
Definition ff_noteframe.h:29
bool GetAccidentalParentheses() const
Returns the parentheses accidental state.
Definition ff_noteframe.h:110
bool GetTie() const
Gets the tie start state for the note.
Definition ff_noteframe.h:175
bool GetAccidentalFreeze() const
Returns the freezed accidental state.
Definition ff_noteframe.h:104
bool CalcAccidental() const
Returns the displayed state of an accidental. This is the method that should be used to find out if a...
Definition finaleframework.cpp:17074
Class for notehead modifications (as in Finale's Special Tools).
Definition ff_entrydetails.h:337
Class for page-assigned graphics. Currently, this class can only be used to edit existing page graphi...
Definition ff_other.h:20251
Collection class for FCPageGraphic class objects.
Definition ff_othercollection.h:1290
The class representing a physical page in Finale.
Definition ff_other.h:3398
Class for a page-connected text block.
Definition ff_other.h:16687
Collection class for FCPageText class objects.
Definition ff_othercollection.h:955
Collection class for FCPage class objects.
Definition ff_othercollection.h:66
Class that represents one linked part in a document. The class also provides methods to switch betwee...
Definition ff_parts.h:119
bool SwitchBack()
Switches back yo the "original" current part, that was in focus at the call to SwitchTo.
Definition ff_parts.h:308
bool IsCurrent()
Returns true if the part is the very same as the current part in the editing focus.
Definition ff_parts.h:360
bool SwitchTo()
Sets the focus to this part (but does not set it in view).
Definition ff_parts.h:292
bool IsScore()
Returns true if the part is the score.
Definition ff_parts.h:341
Collection class for FCPart objects.
Definition ff_parts.h:572
int LoadAll()
Loads all parts (including the "score part") for the document.
Definition finaleframework.cpp:32395
FCPart * GetItemAt(int index) const
Definition ff_parts.h:646
The class for a note definition in a percussion layout.
Definition ff_other.h:24811
Class for percussion note modification.
Definition ff_entrydetails.h:4094
Class that stores the information for drum mapping, either for a staff or staff style.
Definition ff_other.h:7106
Class for performance/playback modifications attached to note entires (as in Finale's MIDI Tool)....
Definition ff_entrydetails.h:4785
The class for raw text objects. All other text classes are based on this class, but it can also be us...
Definition ff_text.h:17
Class for secondary beam breaks (in Finale's Special Tools).
Definition ff_entrydetails.h:1197
The class for a section syllable.
Definition ff_entrydetails.h:3241
Class for a manually added or edited measure number in a cell.
Definition ff_celldetails.h:663
Class that handles separate placement for repeats.
Definition ff_other.h:17270
Class for a shape definition (as in Finale's Shape selection dialog).
Definition ff_other.h:2233
Collection class for FCShapeDef class objects, which defines the shape definitions in the document.
Definition ff_othercollection.h:1434
Class for a shape expression definition.
Definition ff_other.h:15488
Collection class for FCShapeExpressionDef class objects.
Definition ff_othercollection.h:859
Class for smartshape assignments/connections to an entry.
Definition ff_smartshapes.h:310
A record that represents a smart shape in the score. It is connected to the score through FCSmartShap...
Definition ff_smartshapes.h:958
Class for smartshape assignments to a measure.
Definition ff_smartshapes.h:194
Collection class for FCSmartShape class objects.
Definition ff_smartshapes.h:3235
The class for a staff in the score. It is also a base class for staff styles.
Definition ff_other.h:11503
An object that contains one staff list section (out of 4). Before data is loaded/saved,...
Definition ff_other.h:25043
Class for staff (or staff style) name positioning data.
Definition ff_other.h:7202
Class for staff style assignments to a staff.
Definition ff_other.h:19437
Class for a staff style definition.
Definition ff_other.h:18244
Collection class for FCStaffStyleDef class objects.
Definition ff_othercollection.h:1122
The class for a staff system on a page.
Definition ff_other.h:3715
Collection class for FCStaffSystem class objects. A collection typically contains all staff systems f...
Definition ff_othercollection.h:164
Collection class for FCStaff class objects.
Definition ff_othercollection.h:319
Class for manual stem adjustments (in Finale's Special Tools).
Definition ff_entrydetails.h:1702
Class that provides storage for text. This is to achieve platform-transparent text handling,...
Definition ff_base.h:1877
bool IsEmpty() const
Returns true if the string is empty.
Definition ff_base.h:3179
Collection class for FCString class objects.
Definition ff_basecollection.h:1085
FCString * GetItemAt(int index) const
Overridden GetItemAt() method.
Definition ff_basecollection.h:1118
Class for controlling justification/alignment for all syllables that are connected to an entry.
Definition ff_entrydetails.h:3265
Class that stores one "inci" of a staff list (for a system or for the global list of staves).
Definition ff_other.h:6952
Class with info about one tablature note.
Definition ff_entrydetails.h:5792
The class for a single tempo change in the Tempo Tool. The tempo elements should be stored in measure...
Definition ff_other.h:23987
Class for a text block.
Definition ff_other.h:16048
Class for a text expression definition.
Definition ff_other.h:14515
Collection class for FCTextExpressionDef class objects.
Definition ff_othercollection.h:830
The class for a text repeat definition.
Definition ff_other.h:20797
Collection class for FCTextRepeatDef class objects.
Definition ff_othercollection.h:1322
Class for text repeat assignments to a measure. The assignment is connected with a FCTextRepeatDef de...
Definition ff_other.h:21128
Class with adjustments to the ties (in Finale's Special Tools).
Definition ff_entrydetails.h:4987
Class for attaching an tuplet to an entry.
Definition ff_entrydetails.h:2153
static double GetHiResTimer()
Returns a high-resolution timer value, mainly for use with internal profilers.
Definition finaleframework.cpp:24286
Class that handles Undo records for modeless plug-in interfaces.
Definition ff_undo.h:54
bool GetSandboxMode() const
Return current sandbox mode.
Definition ff_undo.h:209
static FCUndoController & GetUndoController(_state_ptr S=nullptr)
Gets the undo block for the session, creating it if there is not already one,.
Definition ff_undo.h:89
void EndUndo(bool savecurrent=false)
Ends an undo session.
Definition ff_undo.h:137
The class for a verse syllable.
Definition ff_entrydetails.h:3202