Finale PDK Framework  0.54
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 * jwlua_luabridgeconnect.cpp implementation.)
13 *
14 * The following class implementation is for the special FCLuaIterator class in JW 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 
19 
20 
72 class FCLuaIterator : public __FCBase
73 {
74 public:
75 
84  {
87 
90 
93 
96 
99 
102 
105 
108 
111 
114 
117 
120 
123 
126 
129 
132 
135 
138 
141 
144 
147 
150  };
151 
160  {
163 
166 
170 
173  };
174 
175 
182  {
185 
188 
191  };
192 
193 private:
194  enum CLASS_APPROACHES
195  {
196  CLASSAPPROACH_NONE = 0,
197  CLASSAPPROACH_ENTRYDETAILS, /* Entry-attached data */
198  CLASSAPPROACH_NOTEDETAILS, /* Note-attached data */
199  CLASSAPPROACH_MEASUREDETAILS, /* Measure-attached data*/
200  CLASSAPPROACH_CELLDETAILS /* Cell-attached data */
201  };
202 
203 
204 
205  /*********************************************/
206  /* Classes for adding/removing entry filters */
207  /*********************************************/
208 
209  class _FCLuaIterEntryFilter : public __FCBase
210  {
211  LUAITERATOR_ENTRYFILTERS _entryfilter;
212  public:
213  _FCLuaIterEntryFilter(LUAITERATOR_ENTRYFILTERS value) : __FCBase() { _entryfilter = value; }
214 
215  LUAITERATOR_ENTRYFILTERS GetFilter() { return _entryfilter; }
216  };
217 
218  class _FCLuaIterEntryFilters : public __FCCollection
219  {
220  public:
221  _FCLuaIterEntryFilters() : __FCCollection() {}
222 
223 
224  _FCLuaIterEntryFilter* GetItemAt(int index) { return (_FCLuaIterEntryFilter*)__FCCollection::GetItemAt(index); }
225 
226  _FCLuaIterEntryFilter* Find(LUAITERATOR_ENTRYFILTERS filter)
227  {
228  for (int i = 0; i < GetCount(); i++)
229  {
230  _FCLuaIterEntryFilter* pItem = GetItemAt(i);
231  if (pItem->GetFilter() == filter) return pItem;
232  }
233  return NULL;
234  }
235 
236  bool AddFilter(LUAITERATOR_ENTRYFILTERS filter)
237  {
238  if (Find(filter)) return false;
239  Add(new _FCLuaIterEntryFilter(filter));
240  return true;
241  }
242 
243  bool RemoveFilter(LUAITERATOR_ENTRYFILTERS filter)
244  {
245  _FCLuaIterEntryFilter* pItem = Find(filter);
246  if (!pItem) return false;
247  int index = GetIndexOf(pItem);
248  if (index == -1) return false; /* Should never occur, but to be safe... */
249  ClearItemAt(index);
250  return true;
251  }
252  };
253 
254  /********************************************/
255  /* Classes for adding/removing note filters */
256  /********************************************/
257 
258  class _FCLuaIterNoteFilter : public __FCBase
259  {
260  LUAITERATOR_NOTEFILTERS _notefilter;
261  public:
262  _FCLuaIterNoteFilter(LUAITERATOR_NOTEFILTERS value) : __FCBase() { _notefilter = value; }
263 
264  LUAITERATOR_NOTEFILTERS GetFilter() { return _notefilter; }
265  };
266 
267  class _FCLuaIterNoteFilters : public __FCCollection
268  {
269  public:
270  _FCLuaIterNoteFilters() : __FCCollection() {}
271 
272 
273  _FCLuaIterNoteFilter* GetItemAt(int index) { return (_FCLuaIterNoteFilter*)__FCCollection::GetItemAt(index); }
274 
275  _FCLuaIterNoteFilter* Find(LUAITERATOR_NOTEFILTERS filter)
276  {
277  for (int i = 0; i < GetCount(); i++)
278  {
279  _FCLuaIterNoteFilter* pItem = GetItemAt(i);
280  if (pItem->GetFilter() == filter) return pItem;
281  }
282  return NULL;
283  }
284 
285  bool AddFilter(LUAITERATOR_NOTEFILTERS filter)
286  {
287  if (Find(filter)) return false;
288  Add(new _FCLuaIterNoteFilter(filter));
289  return true;
290  }
291 
292  bool RemoveFilter(LUAITERATOR_NOTEFILTERS filter)
293  {
294  _FCLuaIterNoteFilter* pItem = Find(filter);
295  if (!pItem) return false;
296  int index = GetIndexOf(pItem);
297  if (index == -1) return false; /* Should never occur, but to be safe... */
298  ClearItemAt(index);
299  return true;
300  }
301  };
302 
303 
304  /**********************************************************/
305  /* Classes for adding/removing alternate notation filters */
306  /**********************************************************/
307  class _FCLuaIterAltNotationFilter : public __FCBase
308  {
309  __FCStaffBase::ALTERNATE_STAFF _altnotationfilter;
310  public:
311  _FCLuaIterAltNotationFilter(__FCStaffBase::ALTERNATE_STAFF value) : __FCBase() { _altnotationfilter = value; }
312 
313  __FCStaffBase::ALTERNATE_STAFF GetFilter() { return _altnotationfilter; }
314  };
315 
316  class _FCLuaIterAltNotationFilters : public __FCCollection
317  {
318  public:
319  _FCLuaIterAltNotationFilters() : __FCCollection() {}
320 
321  _FCLuaIterAltNotationFilter* GetItemAt(int index) { return (_FCLuaIterAltNotationFilter*)__FCCollection::GetItemAt(index); }
322 
323  _FCLuaIterAltNotationFilter* Find(__FCStaffBase::ALTERNATE_STAFF filter)
324  {
325  for (int i = 0; i < GetCount(); i++)
326  {
327  _FCLuaIterAltNotationFilter* pItem = GetItemAt(i);
328  if (pItem->GetFilter() == filter) return pItem;
329  }
330  return NULL;
331  }
332 
333  bool AddFilter(__FCStaffBase::ALTERNATE_STAFF filter)
334  {
335  if (Find(filter)) return false;
336  Add(new _FCLuaIterAltNotationFilter(filter));
337  return true;
338  }
339 
340  bool RemoveFilter(__FCStaffBase::ALTERNATE_STAFF filter)
341  {
342  _FCLuaIterAltNotationFilter* pItem = Find(filter);
343  if (!pItem) return false;
344  int index = GetIndexOf(pItem);
345  if (index == -1) return false; /* Should never occur, but to be safe... */
346  ClearItemAt(index);
347  return true;
348  }
349  };
350 
351  /******************************************************/
352  /* Classes for adding/removing notation style filters */
353  /******************************************************/
354  class _FCLuaIterNotationStyleFilter : public __FCBase
355  {
356  __FCStaffBase::STAFFNOTATION_STYLE _notationstylefilter;
357  public:
358  _FCLuaIterNotationStyleFilter(__FCStaffBase::STAFFNOTATION_STYLE value) : __FCBase() { _notationstylefilter = value; }
359 
360  __FCStaffBase::STAFFNOTATION_STYLE GetFilter() { return _notationstylefilter; }
361  };
362 
363  class _FCLuaIterNotationStyleFilters : public __FCCollection
364  {
365  public:
366  _FCLuaIterNotationStyleFilters() : __FCCollection() {}
367 
368  _FCLuaIterNotationStyleFilter* GetItemAt(int index) { return (_FCLuaIterNotationStyleFilter*)__FCCollection::GetItemAt(index); }
369 
370  _FCLuaIterNotationStyleFilter* Find(__FCStaffBase::STAFFNOTATION_STYLE filter)
371  {
372  for (int i = 0; i < GetCount(); i++)
373  {
374  _FCLuaIterNotationStyleFilter* pItem = GetItemAt(i);
375  if (pItem->GetFilter() == filter) return pItem;
376  }
377  return NULL;
378  }
379 
380  bool AddFilter(__FCStaffBase::STAFFNOTATION_STYLE filter)
381  {
382  if (Find(filter)) return false;
383  Add(new _FCLuaIterNotationStyleFilter(filter));
384  return true;
385  }
386 
387  bool RemoveFilter(__FCStaffBase::STAFFNOTATION_STYLE filter)
388  {
389  _FCLuaIterNotationStyleFilter* pItem = Find(filter);
390  if (!pItem) return false;
391  int index = GetIndexOf(pItem);
392  if (index == -1) return false; /* Should never occur, but to be safe... */
393  ClearItemAt(index);
394  return true;
395  }
396  };
397 
398  _FCLuaIterEntryFilters _entryfilters_AND;
399  _FCLuaIterEntryFilters _entryfilters_OR;
400  _FCLuaIterEntryFilters _entryfilters_NOT;
401 
402  _FCLuaIterNoteFilters _notefilters_AND;
403  _FCLuaIterNoteFilters _notefilters_OR;
404  _FCLuaIterNoteFilters _notefilters_NOT;
405 
406  _FCLuaIterAltNotationFilters _altnotationfilters_AND;
407  _FCLuaIterAltNotationFilters _altnotationfilters_OR;
408  _FCLuaIterAltNotationFilters _altnotationfilters_NOT;
409 
410  _FCLuaIterNotationStyleFilters _notationstylefilters_AND;
411  _FCLuaIterNotationStyleFilters _notationstylefilters_OR;
412  _FCLuaIterNotationStyleFilters _notationstylefilters_NOT;
413 
414  bool _nullregionequalsall;
415 
416  bool _forwardprocessing;
417  bool _downwardprocessing;
418  bool _partialmeasureselections;
419 
420  double _timingstart, _timingend;
421  bool _useprogressbar;
422  bool _abortableprogressbar;
423  bool _progressbar_useraborted;
424  int _progressfrequency; /* How often the meter should update. */
425  int _loadlayermode;
426  bool _processscorepart;
427  bool _processcurrentpart;
428  bool _processcurrentdoc;
429 
430  /************************/
431  /* Check entry filters. */
432  /************************/
433 
434  bool EntryFilterCheck(FCNoteEntry* pEntry, LUAITERATOR_ENTRYFILTERS filter)
435  {
436  switch (filter)
437  {
438  case LIEFILTER_NOTE:
439  return pEntry->IsNote();
440  case LIEFILTER_REST:
441  return pEntry->IsRest();
442  case LIEFILTER_CHORD:
443  return (pEntry->IsNote() && (pEntry->GetCount() >= 2));
445  return (pEntry->IsNote() && (pEntry->GetCount() == 1));
447  return pEntry->GetArticulationFlag();
449  return pEntry->GetSmartShapeFlag();
451  return pEntry->GetNoteDetailFlag();
453  return pEntry->GetPerformanceDataFlag();
455  return pEntry->GetSpecialAltsFlag();
457  return pEntry->GetTupletStartFlag();
458  case LIEFILTER_LYRICFLAG:
459  return pEntry->GetLyricFlag();
461  return pEntry->GetStemDetailFlag();
463  return pEntry->GetSecondaryBeamFlag();
464  case LIEFILTER_GRACENOTE:
465  return pEntry->GetGraceNote();
466  case LIEFILTER_DOTTED:
467  return pEntry->IsDotted();
468  case LIEFILTER_DURWHOLE:
469  return (pEntry->CalcNondottedDuration() == FCNoteEntry::WHOLE_NOTE);
470  case LIEFILTER_DURHALF:
471  return (pEntry->CalcNondottedDuration() == FCNoteEntry::HALF_NOTE);
473  return (pEntry->CalcNondottedDuration() == FCNoteEntry::QUARTER_NOTE);
474  case LIEFILTER_DUR8TH:
475  return (pEntry->CalcNondottedDuration() == FCNoteEntry::EIGHTH_NOTE);
476  case LIEFILTER_DUR16TH:
477  return (pEntry->CalcNondottedDuration() == FCNoteEntry::SIXTEENTH_NOTE);
478  case LIEFILTER_DUR32ND:
479  return (pEntry->CalcNondottedDuration() == FCNoteEntry::THIRTYSECOND_NOTE);
480  case LIEFILTER_DUR64TH:
481  return (pEntry->CalcNondottedDuration() == FCNoteEntry::SIXTYFOURTH_NOTE);
482  default:
483 #ifdef PDK_FRAMEWORK_DIAGNOSE
484  DebugOutDigit("Error: Unknown '_entryfiltermode' in FCLuaIterator:EntryMatchesFilter(): ", (int)filter);
485 #endif
486  return false;
487  }
488  return false;
489  }
490 
491  bool EntryMatchesANDFilters(FCNoteEntry* pEntry)
492  {
493  if (_entryfilters_AND.GetCount() == 0) return true;
494  for (int i = 0; i < _entryfilters_AND.GetCount(); i++)
495  {
496  LUAITERATOR_ENTRYFILTERS filter = _entryfilters_AND.GetItemAt(i)->GetFilter();
497  if (!EntryFilterCheck(pEntry, filter)) return false;
498  }
499  return true;
500  }
501 
502  bool EntryMatchesORFilters(FCNoteEntry* pEntry)
503  {
504  if (_entryfilters_OR.GetCount() == 0) return true;
505  for (int i = 0; i < _entryfilters_OR.GetCount(); i++)
506  {
507  LUAITERATOR_ENTRYFILTERS filter = _entryfilters_OR.GetItemAt(i)->GetFilter();
508  if (EntryFilterCheck(pEntry, filter)) return true;
509  }
510  return false;
511  }
512 
513  bool EntryMatchesNOTFilters(FCNoteEntry* pEntry)
514  {
515  if (_entryfilters_NOT.GetCount() == 0) return true;
516  for (int i = 0; i < _entryfilters_NOT.GetCount(); i++)
517  {
518  LUAITERATOR_ENTRYFILTERS filter = _entryfilters_NOT.GetItemAt(i)->GetFilter();
519  if (EntryFilterCheck(pEntry, filter)) return false;
520  }
521  return true;
522  }
523 
524  bool EntryMatchesFilters(FCNoteEntry* pEntry)
525  {
526  if (!EntryMatchesANDFilters(pEntry)) return false;
527  if (!EntryMatchesORFilters(pEntry)) return false;
528  if (!EntryMatchesNOTFilters(pEntry)) return false;
529  return true;
530  }
531 
532  /*********************************/
533  /* Check notation style filters. */
534  /*********************************/
535 
536  bool NotationStyleFilterCheck(FCCurrentStaffSpec* pStaffSpec, __FCStaffBase::STAFFNOTATION_STYLE filter)
537  {
538  return (pStaffSpec->GetNotationStyle() == filter);
539  }
540 
541  bool NotationStyleMatchesANDFilters(FCCurrentStaffSpec* pStaffSpec)
542  {
543  if (_notationstylefilters_AND.GetCount() == 0) return true;
544  for (int i = 0; i < _notationstylefilters_AND.GetCount(); i++)
545  {
546  __FCStaffBase::STAFFNOTATION_STYLE filter = _notationstylefilters_AND.GetItemAt(i)->GetFilter();
547  if (!NotationStyleFilterCheck(pStaffSpec, filter)) return false;
548  }
549  return true;
550  }
551 
552  bool NotationStyleMatchesORFilters(FCCurrentStaffSpec* pStaffSpec)
553  {
554  if (_notationstylefilters_OR.GetCount() == 0) return true;
555  for (int i = 0; i < _notationstylefilters_OR.GetCount(); i++)
556  {
557  __FCStaffBase::STAFFNOTATION_STYLE filter = _notationstylefilters_OR.GetItemAt(i)->GetFilter();
558  if (NotationStyleFilterCheck(pStaffSpec, filter)) return true;
559  }
560  return false;
561  }
562 
563  bool NotationStyleMatchesNOTFilters(FCCurrentStaffSpec* pStaffSpec)
564  {
565  if (_notationstylefilters_NOT.GetCount() == 0) return true;
566  for (int i = 0; i < _notationstylefilters_NOT.GetCount(); i++)
567  {
568  __FCStaffBase::STAFFNOTATION_STYLE filter = _notationstylefilters_NOT.GetItemAt(i)->GetFilter();
569  if (NotationStyleFilterCheck(pStaffSpec, filter)) return false;
570  }
571  return true;
572  }
573 
574  /* Entry method version to check notation style */
575  bool NotationStyleMatchesFilters(FCNoteEntry* pEntry)
576  {
577  if ((_notationstylefilters_AND.GetCount() == 0) &&
578  (_notationstylefilters_OR.GetCount() == 0) &&
579  (_notationstylefilters_NOT.GetCount() == 0))
580  return true;
581  FCCurrentStaffSpec staffspec;
582  if (!staffspec.LoadForEntry(pEntry)) return false;
583  if (!NotationStyleMatchesANDFilters(&staffspec)) return false;
584  if (!NotationStyleMatchesORFilters(&staffspec)) return false;
585  if (!NotationStyleMatchesNOTFilters(&staffspec)) return false;
586  return true;
587  }
588 
589  /* Cell method version to check notation style */
590  bool NotationStyleMatchesFilters(eMeas measure, eStaff staff, TimeEdu32 measurepos)
591  {
592  if ((_notationstylefilters_AND.GetCount() == 0) &&
593  (_notationstylefilters_OR.GetCount() == 0) &&
594  (_notationstylefilters_NOT.GetCount() == 0))
595  return true;
596  FCCurrentStaffSpec staffspec;
597  FCCell cell(measure, staff);
598  if (!staffspec.LoadForCell(&cell, measurepos)) return false;
599  if (!NotationStyleMatchesANDFilters(&staffspec)) return false;
600  if (!NotationStyleMatchesORFilters(&staffspec)) return false;
601  if (!NotationStyleMatchesNOTFilters(&staffspec)) return false;
602  return true;
603  }
604 
605  /************************************/
606  /* Check alternate notation filters */
607  /************************************/
608 
609  bool AltNotationFilterCheck(FCCurrentStaffSpec* pStaffSpec, __FCStaffBase::ALTERNATE_STAFF filter)
610  {
611  return (pStaffSpec->GetAltNotationStyle() == filter);
612  }
613 
614  bool AltNotationMatchesANDFilters(FCCurrentStaffSpec* pStaffSpec)
615  {
616  if (_altnotationfilters_AND.GetCount() == 0) return true;
617  for (int i = 0; i < _altnotationfilters_AND.GetCount(); i++)
618  {
619  __FCStaffBase::ALTERNATE_STAFF filter = _altnotationfilters_AND.GetItemAt(i)->GetFilter();
620  if (!AltNotationFilterCheck(pStaffSpec, filter)) return false;
621  }
622  return true;
623  }
624 
625  bool AltNotationMatchesORFilters(FCCurrentStaffSpec* pStaffSpec)
626  {
627  if (_altnotationfilters_OR.GetCount() == 0) return true;
628  for (int i = 0; i < _altnotationfilters_OR.GetCount(); i++)
629  {
630  __FCStaffBase::ALTERNATE_STAFF filter = _altnotationfilters_OR.GetItemAt(i)->GetFilter();
631  if (AltNotationFilterCheck(pStaffSpec, filter)) return true;
632  }
633  return false;
634  }
635 
636  bool AltNotationMatchesNOTFilters(FCCurrentStaffSpec* pStaffSpec)
637  {
638  if (_altnotationfilters_NOT.GetCount() == 0) return true;
639  for (int i = 0; i < _altnotationfilters_NOT.GetCount(); i++)
640  {
641  __FCStaffBase::ALTERNATE_STAFF filter = _altnotationfilters_NOT.GetItemAt(i)->GetFilter();
642  if (AltNotationFilterCheck(pStaffSpec, filter)) return false;
643  }
644  return true;
645  }
646 
647  /* Entry method version to check alternate notation */
648  bool AlternateNotationMatchesFilters(FCNoteEntry* pEntry)
649  {
650  if ((_altnotationfilters_AND.GetCount() == 0) &&
651  (_altnotationfilters_OR.GetCount() == 0) &&
652  (_altnotationfilters_NOT.GetCount() == 0))
653  return true;
654  FCCurrentStaffSpec staffspec;
655  if (!staffspec.LoadForEntry(pEntry)) return false;
656  if (!AltNotationMatchesANDFilters(&staffspec)) return false;
657  if (!AltNotationMatchesORFilters(&staffspec)) return false;
658  if (!AltNotationMatchesNOTFilters(&staffspec)) return false;
659  return true;
660  }
661 
662  /* Cell method version to check alternate notation */
663  bool AlternateNotationMatchesFilters(eMeas measure, eStaff staff, TimeEdu32 measurepos)
664  {
665  if ((_altnotationfilters_AND.GetCount() == 0) &&
666  (_altnotationfilters_OR.GetCount() == 0) &&
667  (_altnotationfilters_NOT.GetCount() == 0))
668  return true;
669  FCCurrentStaffSpec staffspec;
670  FCCell cell(measure, staff);
671  if (!staffspec.LoadForCell(&cell, measurepos)) return false;
672  if (!AltNotationMatchesANDFilters(&staffspec)) return false;
673  if (!AltNotationMatchesORFilters(&staffspec)) return false;
674  if (!AltNotationMatchesNOTFilters(&staffspec)) return false;
675  return true;
676  }
677 
678 
679  /**********************/
680  /* Check note filters */
681  /**********************/
682 
683  bool NoteFilterCheck(FCNote* pNote, LUAITERATOR_NOTEFILTERS filter)
684  {
685  switch (filter)
686  {
687  case LINFILTER_TIE:
688  return pNote->GetTie();
690  return pNote->CalcAccidental();
692  return pNote->GetAccidentalParentheses();
694  return pNote->GetAccidentalFreeze();
695  default:
696 #ifdef PDK_FRAMEWORK_DIAGNOSE
697  DebugOutDigit("Error: Unknown '_notfiltermode' in FCLuaIterator:NoteMatchesFilter(): ", (int)filter);
698 #endif
699  return false;
700  }
701  }
702 
703  bool NoteMatchesANDFilters(FCNote* pNote)
704  {
705  if (_notefilters_AND.GetCount() == 0) return true;
706  for (int i = 0; i < _notefilters_AND.GetCount(); i++)
707  {
708  LUAITERATOR_NOTEFILTERS filter = _notefilters_AND.GetItemAt(i)->GetFilter();
709  if (!NoteFilterCheck(pNote, filter)) return false;
710  }
711  return true;
712  }
713 
714  bool NoteMatchesORFilters(FCNote* pNote)
715  {
716  if (_notefilters_OR.GetCount() == 0) return true;
717  for (int i = 0; i < _notefilters_OR.GetCount(); i++)
718  {
719  LUAITERATOR_NOTEFILTERS filter = _notefilters_OR.GetItemAt(i)->GetFilter();
720  if (NoteFilterCheck(pNote, filter)) return true;
721  }
722  return false;
723  }
724 
725  bool NoteMatchesNOTFilters(FCNote* pNote)
726  {
727  if (_notefilters_NOT.GetCount() == 0) return true;
728  for (int i = 0; i < _notefilters_NOT.GetCount(); i++)
729  {
730  LUAITERATOR_NOTEFILTERS filter = _notefilters_NOT.GetItemAt(i)->GetFilter();
731  if (NoteFilterCheck(pNote, filter)) return false;
732  }
733  return true;
734  }
735 
736  bool NoteMatchesFilters(FCNote* pNote)
737  {
738  if (!NoteMatchesANDFilters(pNote)) return false;
739  if (!NoteMatchesORFilters(pNote)) return false;
740  if (!NoteMatchesNOTFilters(pNote)) return false;
741  return true;
742  }
743 
744 
745 
746  /* Sends an Lua exception error to the console output.
747  Called from _ProcessObjectCallback. */
748  void OutputExceptionError(luabridge::LuaException e)
749  {
750  FCString errstring;
751  errstring.SetCString(e.what());
752  LuaRun_AppendLineToOutput(&errstring);
753  }
754 
755  /* Executes the Lua callback function */
756  bool ExecuteCallback(luabridge::LuaRef &lua_callback_function, luabridge::LuaRef &parameter, EProgressDataP *ppProgressBarData)
757  {
758  bool continueflag = true;
759  try
760  {
761  luabridge::LuaRef returnvalue = lua_callback_function(parameter);
762  if (returnvalue.type() == LUA_TBOOLEAN) continueflag = returnvalue.cast <bool>();
763  if (continueflag == false)
764  {
765  /* Don't roll back changes if callback exits with false */
766  EndProgressBar(ppProgressBarData, false);
767  return false;
768  }
769  }
770  /* Handle exceptions */
771  catch (luabridge::LuaException e)
772  {
773  OutputExceptionError(e);
774  EndProgressBar(ppProgressBarData, true);
775  return false;
776  }
777  return true;
778  }
779 
780  /* Executes the Lua callback function for the ForEachCell() iterator. */
781  bool ExecuteCellCallback(luabridge::LuaRef &lua_callback_function, int measure, int staff, EProgressDataP *ppProgressBarData)
782  {
783  bool continueflag = true;
784  try
785  {
786  luabridge::LuaRef returnvalue = lua_callback_function(measure, staff);
787  if (returnvalue.type() == LUA_TBOOLEAN) continueflag = returnvalue.cast <bool>();
788  if (continueflag == false)
789  {
790  /* Don't roll back changes if callback exits with false */
791  EndProgressBar(ppProgressBarData, false);
792  return false;
793  }
794  }
795  /* Handle exceptions */
796  catch (luabridge::LuaException e)
797  {
798  OutputExceptionError(e);
799  EndProgressBar(ppProgressBarData, true);
800  return false;
801  }
802  return true;
803  }
804 
805  /* Executes the Lua callback function for the ForEachFile() iterator. */
806  bool ExecuteFileCallback(luabridge::LuaRef &lua_callback_function, FCDocument* pDocument, FCString* pFileName, EProgressDataP *ppProgressBarData)
807  {
808  bool continueflag = true;
809  try
810  {
811  luabridge::LuaRef returnvalue = lua_callback_function(pDocument, pFileName);
812  if (returnvalue.type() == LUA_TBOOLEAN) continueflag = returnvalue.cast <bool>();
813  if (continueflag == false)
814  {
815  /* Don't roll back changes if callback exits with false */
816  EndProgressBar(ppProgressBarData, false);
817  return false;
818  }
819  }
820  /* Handle exceptions */
821  catch (luabridge::LuaException e)
822  {
823  OutputExceptionError(e);
824  EndProgressBar(ppProgressBarData, true);
825  return false;
826  }
827  return true;
828  }
829 
830  int ProcessRegionEntries(FCMusicRegion* pRegion, luabridge::LuaRef &lua_callback_function, bool shouldsave)
831  {
832  FCMusicRegion fullregion;
833  if (!pRegion || pRegion->IsEmpty())
834  {
835  if (!_nullregionequalsall) return 0;
836  if (!fullregion.SetFullDocument()) return 0;
837  pRegion = &fullregion;
838  }
839  if (!lua_callback_function.isFunction()) return 0;
840  if (pRegion->IsEmpty()) return 0;
841  int count = 0;
842  int progressupdatecount;
843  EProgressDataP pProgressBarData;
844 
845  StartProgressBar(&pProgressBarData, pRegion->CalcMeasureSpan() * pRegion->CalcStaffSpan(), &progressupdatecount);
846 
847  int meas = 0;
848  if (_forwardprocessing)
849  meas = pRegion->GetStartMeasure();
850  else
851  meas = pRegion->GetEndMeasure();
852 
853  while (meas >= pRegion->GetStartMeasure() && meas <= pRegion->GetEndMeasure())
854  {
855  while (true)
856  {
857  if ((!_partialmeasureselections) && pRegion->IsMeasurePartial(meas)) break;
858  int slot = 0;
859  if (_downwardprocessing)
860  slot = pRegion->GetStartSlot();
861  else
862  slot = pRegion->GetEndSlot();
863  while (slot >= pRegion->GetStartSlot() && slot <= pRegion->GetEndSlot())
864  {
865  while (true)
866  {
867  /* Handle the progress bar */
868  if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
869  {
870  return count;
871  }
872 
873  FCNoteEntryCell entrycell(meas, pRegion->CalcStaffNumber(slot));
874  entrycell.SetLoadLayerMode(_loadlayermode);
875  entrycell.Load();
876 
877  bool entriesprocessed = false;
878  /* Process the entries in the FCNoteEntryCell collection */
879  int entryidx = 0;
880  if (_forwardprocessing)
881  entryidx = 0;
882  else
883  entryidx = entrycell.GetCount() - 1;
884  while (entryidx >= 0 && entryidx < entrycell.GetCount())
885  {
886  while (true)
887  {
888  FCNoteEntry* pEntry = entrycell.GetItemAt(entryidx);
889  if (!pRegion->IsEntryPosWithin(pEntry)) break;
890  if (!EntryMatchesFilters(pEntry)) break;
891  if (!NotationStyleMatchesFilters(pEntry)) break;
892  if (!AlternateNotationMatchesFilters(pEntry)) break;
893  /* Send entry to Lua callback */
894  entriesprocessed = true;
895  luabridge::LuaRef parameter(_pGlobal_LuaState, pEntry);
896  count++;
897  if (!ExecuteCallback(lua_callback_function, parameter, &pProgressBarData))
898  {
899  return count;
900  }
901  break;
902  } /* while (true) */
903  if (_forwardprocessing) entryidx++; else entryidx--;
904  }
905  /* Save back */
906  if (shouldsave && entriesprocessed) entrycell.Save();
907  break;
908  } /* while (true) */
909  if (_downwardprocessing) slot++; else slot--;
910  }
911  break;
912  } /* while (true) */
913  if (_forwardprocessing) meas++; else meas--;
914  }
915  EndProgressBar(&pProgressBarData, false);
916  return count;
917  }
918 
919  __FCCollectionData* LoadCollectionForClassID(PDKFRAMEWORK_CLASSID classID)
920  {
921  __FCCollectionData* pCollectionData = NULL;
922  switch (classID)
923  {
924  case FCID_ARTICULATIONDEF:
925  pCollectionData = new FCArticulationDefs();
926  break;
927  case FCID_CATEGORYDEF:
928  pCollectionData = new FCCategoryDefs();
929  break;
930  case FCID_CHORD:
931  pCollectionData = new FCChords();
932  break;
933  case FCID_CLEFDEF:
934  pCollectionData = new FCClefDefs();
935  break;
936  case FCID_CUSTOMSMARTLINEDEF:
937  pCollectionData = new FCCustomSmartLineDefs();
938  break;
939  case FCID_EXECUTABLESHAPEDEF:
940  pCollectionData = new FCExecutableShapeDefs();
941  break;
942  case FCID_FRETBOARDSTYLEDEF:
943  pCollectionData = new FCFretboardStyleDefs();
944  break;
945  case FCID_FRETBOARDGROUPDEF:
946  pCollectionData = new FCFretboardGroupDefs();
947  break;
948  case FCID_FRETINSTRUMENTDEF:
949  pCollectionData = new FCFretInstrumentDefs();
950  break;
951  case FCID_GROUP:
952  pCollectionData = new FCGroups();
953  break;
954  case FCID_INSTRUMENTDEF:
955  pCollectionData = new FCInstrumentDefs();
956  break;
957  case FCID_MEASURE:
958  pCollectionData = new FCMeasures();
959  break;
960  case FCID_MEASURENUMBERREGION:
961  pCollectionData = new FCMeasureNumberRegions();
962  break;
963  case FCID_MULTIMEASUREREST:
964  pCollectionData = new FCMultiMeasureRests();
965  break;
966  case FCID_MULTISTAFFINSTRUMENT:
967  pCollectionData = new FCMultiStaffInstruments();
968  break;
969  case FCID_PAGE:
970  pCollectionData = new FCPages();
971  break;
972  case FCID_PAGEGRAPHIC:
973  pCollectionData = new FCPageGraphics();
974  break;
975  case FCID_PAGETEXT:
976  pCollectionData = new FCPageTexts();
977  break;
978  case FCID_SHAPEDEF:
979  pCollectionData = new FCShapeDefs();
980  break;
981  case FCID_SHAPEEXPRESSIONDEF:
982  pCollectionData = new FCShapeExpressionDefs();
983  break;
984  case FCID_SMARTSHAPE:
985  pCollectionData = new FCSmartShapes();
986  break;
987  case FCID_STAFF:
988  pCollectionData = new FCStaves();
989  break;
990  case FCID_STAFFSTYLEDEF:
991  pCollectionData = new FCStaffStyleDefs();
992  break;
993  case FCID_STAFFSYSTEM:
994  pCollectionData = new FCStaffSystems();
995  break;
996  case FCID_TEXTEXPRESSIONDEF:
997  pCollectionData = new FCTextExpressionDefs();
998  break;
999  case FCID_TEXTREPEATDEF:
1000  pCollectionData = new FCTextRepeatDefs();
1001  break;
1002  default:
1003  break;
1004  }
1005  if (!pCollectionData) return NULL;
1006  pCollectionData->LoadAll();
1007  return pCollectionData;
1008  }
1009 
1010  int ProcessRegionNotes(FCMusicRegion* pRegion, luabridge::LuaRef &lua_callback_function, bool shouldsave)
1011  {
1012  FCMusicRegion fullregion;
1013  if (!pRegion || pRegion->IsEmpty())
1014  {
1015  if (!_nullregionequalsall) return 0;
1016  if (!fullregion.SetFullDocument()) return 0;
1017  pRegion = &fullregion;
1018  }
1019  if (!lua_callback_function.isFunction()) return 0;
1020  if (pRegion->IsEmpty()) return 0;
1021  int count = 0;
1022  int progressupdatecount;
1023  EProgressDataP pProgressBarData;
1024 
1025  StartProgressBar(&pProgressBarData, pRegion->CalcMeasureSpan() * pRegion->CalcStaffSpan(), &progressupdatecount);
1026 
1027  int meas = 0;
1028  if (_forwardprocessing)
1029  meas = pRegion->GetStartMeasure();
1030  else
1031  meas = pRegion->GetEndMeasure();
1032 
1033  while (meas >= pRegion->GetStartMeasure() && meas <= pRegion->GetEndMeasure())
1034  {
1035  while (true)
1036  {
1037  if ((!_partialmeasureselections) && pRegion->IsMeasurePartial(meas)) break;
1038  int slot = 0;
1039  if (_downwardprocessing)
1040  slot = pRegion->GetStartSlot();
1041  else
1042  slot = pRegion->GetEndSlot();
1043 
1044  while (slot >= pRegion->GetStartSlot() && slot <= pRegion->GetEndSlot())
1045  {
1046  while (true)
1047  {
1048  /* Handle the progress bar */
1049  if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
1050  {
1051  return count;
1052  }
1053 
1054  FCNoteEntryCell entrycell(meas, pRegion->CalcStaffNumber(slot));
1055  entrycell.SetLoadLayerMode(_loadlayermode);
1056  entrycell.Load();
1057 
1058  bool entriesprocessed = false;
1059 
1060  int entryidx = 0;
1061  if (_forwardprocessing)
1062  entryidx = 0;
1063  else
1064  entryidx = entrycell.GetCount() - 1;
1065  /* Process the entries in the FCNoteEntryCell collection */
1066  while (entryidx >= 0 && entryidx < entrycell.GetCount())
1067  {
1068  while (true)
1069  {
1070  FCNoteEntry* pEntry = entrycell.GetItemAt(entryidx);
1071  if (pEntry->IsRest()) break;
1072  if (!pRegion->IsEntryPosWithin(pEntry)) break;
1073  if (!EntryMatchesFilters(pEntry)) break;
1074  if (!NotationStyleMatchesFilters(pEntry)) break;
1075  if (!AlternateNotationMatchesFilters(pEntry)) break;
1076 
1077  int noteidx = 0;
1078  if (_forwardprocessing)
1079  noteidx = 0;
1080  else
1081  noteidx = pEntry->GetCount() - 1;
1082  /* Browse throúgh the notes in the chord */
1083  while (noteidx >= 0 && noteidx < pEntry->GetCount())
1084  {
1085  while (true)
1086  {
1087  FCNote* pNote = pEntry->GetItemAt(noteidx);
1088  if (!NoteMatchesFilters(pNote)) break;
1089  /* Send entry to Lua callback */
1090  entriesprocessed = true;
1091  luabridge::LuaRef parameter(_pGlobal_LuaState, pNote);
1092  count++;
1093  if (!ExecuteCallback(lua_callback_function, parameter, &pProgressBarData))
1094  {
1095  return count;
1096  }
1097  break;
1098  } /* while (true) */
1099  if (_forwardprocessing) noteidx++; else noteidx--;
1100  }
1101  break;
1102  } /* while (true) */
1103  if (_forwardprocessing) entryidx ++; else entryidx --;
1104  }
1105  /* Save back */
1106  if (shouldsave && entriesprocessed) entrycell.Save();
1107  break;
1108  } /* while (true) */
1109  if (_downwardprocessing) slot++; else slot--;
1110  } /* while (slot ... */
1111  break;
1112  } /* while (true) */
1113  if (_forwardprocessing) meas++; else meas--;
1114  }
1115  EndProgressBar(&pProgressBarData, false);
1116  return count;
1117  }
1118 
1119  /* The main processing method for ForEachCell(). */
1120  int ProcessForEachCell(FCMusicRegion* pRegion, luabridge::LuaRef& lua_callback_function)
1121  {
1122  FCMusicRegion fullregion;
1123  if (!pRegion || pRegion->IsEmpty())
1124  {
1125  if (!_nullregionequalsall) return 0;
1126  if (!fullregion.SetFullDocument()) return 0;
1127  pRegion = &fullregion;
1128  }
1129  if (!lua_callback_function.isFunction()) return 0;
1130  if (pRegion->IsEmpty()) return 0;
1131  int count = 0;
1132  int progressupdatecount;
1133  EProgressDataP pProgressBarData;
1134 
1135  StartProgressBar(&pProgressBarData, pRegion->CalcMeasureSpan() * pRegion->CalcStaffSpan(), &progressupdatecount);
1136 
1137  int meas = 0;
1138  if (_forwardprocessing)
1139  meas = pRegion->GetStartMeasure();
1140  else
1141  meas = pRegion->GetEndMeasure();
1142 
1143  while (meas >= pRegion->GetStartMeasure() && meas <= pRegion->GetEndMeasure())
1144  {
1145  while (true)
1146  {
1147  if ((!_partialmeasureselections) && pRegion->IsMeasurePartial(meas)) break;
1148  int slot = 0;
1149  if (_downwardprocessing)
1150  slot = pRegion->GetStartSlot();
1151  else
1152  slot = pRegion->GetEndSlot();
1153  while (slot >= pRegion->GetStartSlot() && slot <= pRegion->GetEndSlot())
1154  {
1155  while (true)
1156  {
1157  /* Handle the progress bar */
1158  if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
1159  {
1160  return count;
1161  }
1162  eStaff staff = pRegion->CalcStaffNumber(slot);
1163  if (!NotationStyleMatchesFilters(meas, staff, 0)) break;
1164  if (!AlternateNotationMatchesFilters(meas, staff, 0)) break;
1165  count++;
1166  /* User callback */
1167  if (!ExecuteCellCallback(lua_callback_function, meas, staff, &pProgressBarData))
1168  {
1169  return count;
1170  }
1171  break;
1172  }
1173  if (_downwardprocessing) slot++; else slot--;
1174  }
1175  break;
1176  }
1177  if (_forwardprocessing) meas++; else meas--;
1178  }
1179  EndProgressBar(&pProgressBarData, false);
1180  return count;
1181  }
1182 
1183  /* The main processing method for ForEachPart(). */
1184  int ProcessForEachPart(luabridge::LuaRef& lua_callback_function)
1185  {
1186  if (!lua_callback_function.isFunction()) return 0;
1187  int count = 0;
1188  int progressupdatecount;
1189  EProgressDataP pProgressBarData;
1190 
1191  FCParts allparts;
1192  allparts.LoadAll();
1193  StartProgressBar(&pProgressBarData, allparts.GetCount(), &progressupdatecount);
1194 
1195  int partidx = 0;
1196  if (_forwardprocessing)
1197  partidx = 0;
1198  else
1199  partidx = allparts.GetCount() - 1;
1200  while (partidx >= 0 && partidx < allparts.GetCount())
1201  {
1202  while (true)
1203  {
1204  /* Handle the progress bar */
1205  if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount)) return count;
1206 
1207  /* Get the part and switch focus */
1208  FCPart* pPart = allparts.GetItemAt(partidx);
1209  if (!_processscorepart && pPart->IsScore()) break;
1210  if (!_processcurrentpart && pPart->IsCurrent()) break;
1211 
1212  /* User callback */
1213  pPart->SwitchTo();
1214  luabridge::LuaRef parameter(_pGlobal_LuaState, pPart);
1215  count++;
1216  bool callbackreturn = ExecuteCallback(lua_callback_function, parameter, &pProgressBarData);
1217  pPart->SwitchBack();
1218 
1219  if (!callbackreturn) return count;
1220  break;
1221  }
1222  if (_forwardprocessing)
1223  partidx++;
1224  else
1225  partidx--;
1226  }
1227 
1228  EndProgressBar(&pProgressBarData, false);
1229  return count;
1230  }
1231 
1232  /* The main method for "ForEach()". The start/stop of the timer are handled
1233  * outside of this method. */
1234  int ProcessForEach(__FCCollectionData* pCollection, luabridge::LuaRef& lua_callback_function, bool shouldsave)
1235  {
1236  if (!pCollection) return 0;
1237  if (pCollection->GetCount() == 0) return 0;
1238  if (!lua_callback_function.isFunction()) return 0;
1239  int count = 0;
1240  int progressupdatecount;
1241  EProgressDataP pProgressBarData;
1242 
1243  StartProgressBar(&pProgressBarData, pCollection->GetCount(), &progressupdatecount);
1244 
1245  luabridge::LuaRef parameter(_pGlobal_LuaState);
1246  /* Ideally, a base object should be created once as a LuaRef and data cloned, since
1247  * that would be much faster. However, there are too many issues with linked objects
1248  * to be safe. */
1249 
1250  int i = 0;
1251  if (_forwardprocessing)
1252  i = 0;
1253  else
1254  i = pCollection->GetCount() - 1;
1255 
1256  while (i >= 0 && i < pCollection->GetCount())
1257  {
1258  while (true)
1259  {
1260  /* Handle the progress bar */
1261  if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
1262  {
1263  return count;
1264  }
1265 
1266  /* Get the item data to process */
1267  __FCBaseData* pObject = (__FCBaseData*)pCollection->GetItemAt(i);
1268  if (!pObject) break;
1269  if (!SetupCorrectCppClass(pObject, parameter))
1270  {
1271  EndProgressBar(&pProgressBarData, false);
1272  return count;
1273  }
1274 
1275  /* Execute the callback */
1276  count++;
1277  if (!ExecuteCallback(lua_callback_function, parameter, &pProgressBarData))
1278  {
1279  return count;
1280  }
1281  if (shouldsave) pObject->Save();
1282  break;
1283  } /* while (true) */
1284  if (_forwardprocessing) i++; else i--;
1285  }
1286  EndProgressBar(&pProgressBarData, false);
1287  return count;
1288 
1289  if (_forwardprocessing) i++; else i--;
1290  }
1291 
1292  struct EACH_REGION_OBJECT_DATA
1293  {
1294  FCMusicRegion* pRegion;
1295  int count;
1296  __FCBaseData* pObject;
1297  EProgressDataP pProgressBarData;
1298  CLASS_APPROACHES classapproach;
1299  bool shouldsave;
1300  int progressupdatecount;
1301  };
1302 
1303  /* Handles the Lua callback to note entry details for ForEachRegionObject
1304  and ForEachRegionObjectSaved.
1305 
1306  Objects must be based on __FCEntryDetail.
1307  */
1308  bool ProcessEntryDetailsCell(eMeas meas, eStaff staff, luabridge::LuaRef& lua_callback_function, luabridge::LuaRef &parameter, EACH_REGION_OBJECT_DATA* pERData)
1309  {
1310  __FCEntryDetail* pEntryObject = (__FCEntryDetail*) pERData->pObject;
1311  FCNoteEntryCell entrycell(meas, staff);
1312  entrycell.SetLoadLayerMode(_loadlayermode);
1313  entrycell.Load();
1314  int entryidx = 0;
1315  if (_forwardprocessing)
1316  entryidx = 0;
1317  else
1318  entryidx = entrycell.GetCount() - 1;
1319  while (entryidx >= 0 && entryidx < entrycell.GetCount())
1320  {
1321  while (true)
1322  {
1323  FCNoteEntry* pEntry = entrycell.GetItemAt(entryidx);
1324  if (!pERData->pRegion->IsEntryPosWithin(pEntry)) break;
1325  if (!EntryMatchesFilters(pEntry)) break;
1326  if (!NotationStyleMatchesFilters(pEntry)) break;
1327  if (!AlternateNotationMatchesFilters(pEntry)) break;
1328  pEntryObject->SetNoteEntry(pEntry);
1329  if (_forwardprocessing)
1330  {
1331  twobyte currentinci = 0;
1332  while (pEntryObject->Load(pEntry->GetEntryNumber(), currentinci))
1333  {
1334  /* Call the Lua callback function */
1335  pERData->count++;
1336  if (!ExecuteCallback(lua_callback_function, parameter, &pERData->pProgressBarData))
1337  {
1338  return false;
1339  }
1340  if (pERData->shouldsave) pEntryObject->Save();
1341  currentinci++;
1342  }
1343  }
1344  else
1345  {
1346  /* Parse backwards - Find last inci. */
1347  twobyte lastinci = pEntryObject->CalcLastInci();
1348  if (lastinci == kNewInci) break;
1349  while (lastinci >= 0)
1350  {
1351  if (pEntryObject->Load(pEntry->GetEntryNumber(), lastinci))
1352  {
1353  /* Call the Lua callback function */
1354  pERData->count++;
1355  if (!ExecuteCallback(lua_callback_function, parameter, &pERData->pProgressBarData))
1356  {
1357  return false;
1358  }
1359  if (pERData->shouldsave) pEntryObject->Save();
1360  }
1361  lastinci--;
1362  }
1363  }
1364  break;
1365  } /* while (true) ... */
1366  if (_forwardprocessing) entryidx++; else entryidx--;
1367  }
1368  return true;
1369  }
1370 
1371  /* Handles the Lua callback to measure-attached details for ForEachRegionObject
1372  and ForEachRegionObjectSaved.
1373 
1374  The object must be based on a __FCInciOther child class, and the "other" value
1375  must be the measure. And the virtual methods GetMeasure()/GetMeasurePos()/GetStaff() must
1376  be implemented in the class.
1377  */
1378  bool ProcessMeasureDetailsCell(eMeas meas, eStaff staff, luabridge::LuaRef& lua_callback_function, luabridge::LuaRef &parameter, EACH_REGION_OBJECT_DATA* pERData)
1379  {
1380  __FCInciOther* pMeasureObject = (__FCInciOther*) pERData->pObject;
1381 
1382  twobyte inci = 0;
1383  twobyte incdec = 1;
1384  if (!_forwardprocessing) inci = pMeasureObject->CalcLastInci();
1385  if (inci == kNewInci) return true;
1386  while (pMeasureObject->Load(meas, inci))
1387  {
1388  while (true)
1389  {
1390  /* Check if the object is in range */
1391  if (pMeasureObject->HasStaffValue() && (staff != pMeasureObject->GetStaff())) break;
1392  if (meas != pMeasureObject->GetMeasure()) break;
1393  FCCell cell(meas, staff);
1394  if (!pERData->pRegion->IsCellPosWithin(&cell, pMeasureObject->GetMeasurePos())) break;
1395  /* Check filter matches */
1396  if (!NotationStyleMatchesFilters(meas, staff, pMeasureObject->GetMeasurePos())) break;
1397  if (!AlternateNotationMatchesFilters(meas, staff, pMeasureObject->GetMeasurePos())) break;
1398 
1399  /* Call the Lua callback function */
1400  pERData->count++;
1401  if (!ExecuteCallback(lua_callback_function, parameter, &pERData->pProgressBarData))
1402  {
1403  return false;
1404  }
1405  if (pERData->shouldsave) pMeasureObject->Save();
1406  break;
1407  } /* while (true) */
1408  inci += incdec;
1409  /* Check for incis < 0 separately. Don't know if it's necessary, but it's a bit nicer. */
1410  if (inci < 0) return true;
1411  }
1412  return true;
1413  }
1414 
1415  /* Handles the Lua callback to cell-attached details for ForEachRegionObject
1416  and ForEachRegionObjectSaved.
1417 
1418  The object must be based on a __FCCellDetail child class, and requires an
1419  implemented GetMeasurePos() method.
1420  */
1421  bool ProcessCellDetailsCell(eMeas meas, eStaff staff, luabridge::LuaRef& lua_callback_function, luabridge::LuaRef &parameter, EACH_REGION_OBJECT_DATA* pERData)
1422  {
1423  __FCCellDetail* pCellObject = (__FCCellDetail*) pERData->pObject;
1424 
1425  FCCell cell(meas, staff);
1426  pCellObject->ConnectCell(&cell);
1427 
1428  bool success = _forwardprocessing ? pCellObject->LoadFirst() : pCellObject->LoadLast();
1429  while (success)
1430  {
1431  while (true)
1432  {
1433  /* Check if the object is in range */
1434  if (!pERData->pRegion->IsCellPosWithin(&cell, pCellObject->GetMeasurePos())) break;
1435  /* Check filter matches */
1436  if (!NotationStyleMatchesFilters(meas, staff, pCellObject->GetMeasurePos())) break;
1437  if (!AlternateNotationMatchesFilters(meas, staff, pCellObject->GetMeasurePos())) break;
1438 
1439  /* Call the Lua callback function */
1440  pERData->count++;
1441  if (!ExecuteCallback(lua_callback_function, parameter, &pERData->pProgressBarData))
1442  {
1443  return false;
1444  }
1445  if (pERData->shouldsave) pCellObject->Save();
1446  break;
1447  } /* while (true) */
1448  success = _forwardprocessing ? pCellObject->LoadNext() : pCellObject->LoadPrevious();
1449  }
1450  return true;
1451  }
1452 
1453  /* Main processing method for ForEachRegionObject and ForEachRegionObjectSave.
1454  *
1455  * It parses through the cells and redirects the call to the poper method.
1456  */
1457  int ProcessForEachRegionObject(FCMusicRegion* pRegion, int classID, luabridge::LuaRef lua_callback_function, bool shouldsave)
1458  {
1459  FCMusicRegion fullregion;
1460  if (!pRegion || pRegion->IsEmpty())
1461  {
1462  if (!_nullregionequalsall) return 0;
1463  if (!fullregion.SetFullDocument()) return 0;
1464  pRegion = &fullregion;
1465  }
1466  if (!lua_callback_function.isFunction()) return 0;
1467  if (pRegion->IsEmpty()) return 0;
1468 
1469  /* Set up struct info */
1470  EACH_REGION_OBJECT_DATA erdata;
1471  erdata.pRegion = pRegion;
1472  erdata.progressupdatecount = 0;
1473  erdata.shouldsave = shouldsave;
1474  erdata.pObject = MapRegionClassApproach((PDKFRAMEWORK_CLASSID) classID, &erdata.classapproach);
1475  if (erdata.classapproach == CLASSAPPROACH_NONE) return 0;
1476  erdata.count = 0;
1477 
1478  StartProgressBar(&erdata.pProgressBarData, pRegion->CalcMeasureSpan() * pRegion->CalcStaffSpan(), &erdata.progressupdatecount);
1479 
1480  /* Set up parameter that will contain the object that is sent to the Lua callback
1481  * function. Keeping a single parameter LuaRef object like this will be
1482  * considerably faster! */
1483  luabridge::LuaRef parameter(_pGlobal_LuaState);
1484  if (!SetupCorrectCppClass(erdata.pObject, parameter))
1485  {
1486  EndProgressBar(&erdata.pProgressBarData, false);
1487  return 0;
1488  }
1489 
1490  /* Browse through all cells in the selection */
1491  int meas = 0;
1492  if (_forwardprocessing)
1493  meas = pRegion->GetStartMeasure();
1494  else
1495  meas = pRegion->GetEndMeasure();
1496  while (meas >= pRegion->GetStartMeasure() && meas <= pRegion->GetEndMeasure())
1497  {
1498  while (true)
1499  {
1500  if ((!_partialmeasureselections) && pRegion->IsMeasurePartial(meas)) break;
1501  int slot = 0;
1502  if (_downwardprocessing)
1503  slot = pRegion->GetStartSlot();
1504  else
1505  slot = pRegion->GetEndSlot();
1506  while (slot >= pRegion->GetStartSlot() && slot <= pRegion->GetEndSlot())
1507  {
1508  while (true)
1509  {
1510  /* Handle the progress bar */
1511  if (!UpdateProgressBar(&erdata.pProgressBarData, &erdata.progressupdatecount))
1512  {
1513  delete erdata.pObject;
1514  return erdata.count;
1515  }
1516  eStaff staff = pRegion->CalcStaffNumber(slot);
1517 
1518  /* Don't check for notation styles here, since the
1519  position check is different depending on entry-based
1520  or measure-based, etc.
1521  Make the check in each individual object parser instead. */
1522 
1523  /* User callback */
1524  bool continueflag = false;
1525  switch (erdata.classapproach)
1526  {
1527  case CLASSAPPROACH_ENTRYDETAILS:
1528  case CLASSAPPROACH_NOTEDETAILS:
1529  /************************/
1530  /* Handle entry details */
1531  /************************/
1532  continueflag = ProcessEntryDetailsCell(meas, staff, lua_callback_function, parameter, &erdata);
1533  break;
1534  case CLASSAPPROACH_MEASUREDETAILS:
1535  /**************************/
1536  /* Handle measure details */
1537  /**************************/
1538  continueflag = ProcessMeasureDetailsCell(meas, staff, lua_callback_function, parameter, &erdata);
1539  break;
1540  case CLASSAPPROACH_CELLDETAILS:
1541  /***********************/
1542  /* Handle cell details */
1543  /***********************/
1544  continueflag = ProcessCellDetailsCell(meas, staff, lua_callback_function, parameter, &erdata);
1545  break;
1546  default:
1547  break;
1548  }
1549  if (!continueflag)
1550  {
1551  delete erdata.pObject;
1552  return erdata.count;
1553  }
1554  break;
1555  } /* while (true) */
1556  if (_downwardprocessing) slot++; else slot--;
1557  }
1558  break;
1559  } /* while (true) */
1560  if (_forwardprocessing) meas++; else meas--;
1561  }
1562  delete erdata.pObject;
1563  EndProgressBar(&erdata.pProgressBarData, false);
1564  return erdata.count;
1565  }
1566 
1567  /* Main method for ForEachDocument() and ForEachDocumentSaved().
1568  For ForEachDocumentSaved(), documents are only saved if a file
1569  name exists.
1570  */
1571  int ProcessForEachDocument(luabridge::LuaRef lua_callback_function, bool shouldsave)
1572  {
1573  if (!lua_callback_function.isFunction()) return 0;
1574  int count = 0;
1575  int progressupdatecount;
1576  EProgressDataP pProgressBarData;
1577 
1578  FCDocuments alldocs;
1579  alldocs.LoadAll();
1580  StartProgressBar(&pProgressBarData, alldocs.GetCount(), &progressupdatecount);
1581 
1582  int docidx = 0;
1583  if (_forwardprocessing)
1584  docidx = 0;
1585  else
1586  docidx = alldocs.GetCount() - 1;
1587 
1588  while (docidx >= 0 && docidx < alldocs.GetCount())
1589  {
1590  while (true)
1591  {
1592  /* Handle the progress bar */
1593  if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount))
1594  {
1595  return count;
1596  }
1597 
1598  /* Get the document and switch focus */
1599  FCDocument* pDoc = alldocs.GetItemAt(docidx);
1600  if (!_processcurrentdoc && pDoc->IsCurrent()) break;
1601 
1602  FCString astring;
1604  pDoc->SwitchTo(&astring, true);
1605  luabridge::LuaRef parameter(_pGlobal_LuaState, pDoc);
1606  count++;
1607 
1608  /* User callback */
1609  if (!ExecuteCallback(lua_callback_function, parameter, &pProgressBarData))
1610  {
1611  pDoc->SwitchBack(true);
1612  return count;
1613  }
1614  if (shouldsave && (!pDoc->IsUntitled())) pDoc->Save();
1615  pDoc->SwitchBack(true);
1616  break;
1617  }
1618  if (_forwardprocessing)
1619  docidx++;
1620  else
1621  docidx--;
1622  }
1623 
1624  EndProgressBar(&pProgressBarData, false);
1625  return count;
1626  }
1627 
1628  /* Processing method for ForEachFile and ForEachFileSaved. */
1629  int ProcessForEachFile(FCStrings* pFileStrings, luabridge::LuaRef lua_callback_function, bool shouldsave)
1630  {
1631  if (!pFileStrings) return 0;
1632  if (pFileStrings->GetCount() == 0) return 0;
1633  int count = 0;
1634 
1635  int progressupdatecount;
1636  EProgressDataP pProgressBarData;
1637  StartProgressBar(&pProgressBarData, pFileStrings->GetCount(), &progressupdatecount);
1638 
1639  FCDocument currentdocument;
1640  currentdocument.SetToCurrent();
1641 
1642  FCString lastundostring;
1643  FCDocument::GetLastUndoString(&lastundostring);
1644 
1645  int filenameidx = 0;
1646  if (_forwardprocessing)
1647  filenameidx = 0;
1648  else
1649  filenameidx = pFileStrings->GetCount() - 1;
1650  while (filenameidx >= 0 && filenameidx < pFileStrings->GetCount())
1651  {
1652  while (true)
1653  {
1654  FCString* pString = pFileStrings->GetItemAt(filenameidx);
1655  if (!pString) break;
1656  if (pString->IsEmpty()) break;
1657  FCDocument document;
1658  count++;
1659  bool executereturn = false;
1660  /* There seems to be an issue with saving documents without
1661  * a window, so if save should be made, a document window is opened as well. */
1662  if (document.Open(pString, shouldsave, &lastundostring))
1663  {
1664  /* Document is now in focus */
1665  executereturn = ExecuteFileCallback(lua_callback_function, &document, pString, &pProgressBarData);
1666  if (executereturn && shouldsave) document.Save();
1667  document.SetDirty(false);
1668  if (shouldsave)
1669  document.CloseCurrentDocumentWindow();
1670  else
1671  document.Close();
1672 
1673  /* Start new Finale edit block for the current document */
1674  if (currentdocument.SwitchTo(&lastundostring, true))
1675  {
1676  currentdocument._DiscardSwitchBack();
1677  }
1678  }
1679  else
1680  {
1681  /* File couldn't be opened - send nil to the callback */
1682  luabridge::LuaRef parameter(_pGlobal_LuaState, NULL);
1683  executereturn = ExecuteFileCallback(lua_callback_function, &document, NULL, &pProgressBarData);
1684  }
1685  if (!executereturn) return count;
1686  break;
1687  } /* while (true) */
1688  if (_forwardprocessing) filenameidx++; else filenameidx--;
1689  }
1690  EndProgressBar(&pProgressBarData, false);
1691  return count;
1692  }
1693 
1694  /* Processing method for ForEachInteger. */
1695  int ProcessForEachInteger(int integer1, int integer2, luabridge::LuaRef lua_callback_function)
1696  {
1697  int count = 0;
1698  int incdec = 1;
1699 
1700  if (integer1 > integer2) incdec = -1;
1701 
1702  integer1 -= incdec;
1703 
1704  int progressupdatecount;
1705  EProgressDataP pProgressBarData;
1706 
1707  /* Multiplying difference with incdec to assure positive difference. */
1708  StartProgressBar(&pProgressBarData, (integer2 - integer1) * incdec + 1, &progressupdatecount);
1709 
1710  FCDocument currentdocument;
1711  currentdocument.SetToCurrent();
1712 
1713  FCString lastundostring;
1714  FCDocument::GetLastUndoString(&lastundostring);
1715 
1716  for (int i = integer1; i != integer2; i += incdec)
1717  {
1718  /* Handle the progress bar */
1719  if (!UpdateProgressBar(&pProgressBarData, &progressupdatecount)) return count;
1720 
1721  luabridge::LuaRef parameter(_pGlobal_LuaState, i + incdec);
1722  count ++;
1723  bool executereturn = ExecuteCallback(lua_callback_function, parameter, &pProgressBarData);
1724  if (!executereturn) return count;
1725  }
1726  EndProgressBar(&pProgressBarData, false);
1727  return count;
1728  }
1729 
1730 
1731  /* Preparation method for ForEachRegionObject(Saved). Creates a data object of the
1732  correct class, and defines the approach to use for the class. */
1733  __FCBaseData* MapRegionClassApproach(PDKFRAMEWORK_CLASSID classID, CLASS_APPROACHES* pClassApproach)
1734  {
1735  switch (classID)
1736  {
1737  case FCID_ACCIDENTALMOD:
1738  *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1739  return new FCAccidentalMod();
1740  case FCID_ARTICULATION:
1741  *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1742  return new FCArticulation();
1743  case FCID_BEATCHARTELEMENT:
1744  *pClassApproach = CLASSAPPROACH_MEASUREDETAILS;
1745  return new FCBeatChartElement();
1746  case FCID_BROKENBEAMMOD:
1747  *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1748  return new FCBrokenBeamMod();
1749 /* Not yet supported in JW Lua
1750  case FCID_CELLGRAPHIC:
1751  *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1752  return new FCCellGraphic(); */
1753  case FCID_CELLTEXT:
1754  *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1755  return new FCCellText();
1756  case FCID_CHORD:
1757  *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1758  return new FCChord();
1759  case FCID_CROSSSTAFFMOD:
1760  *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1761  return new FCCrossStaffMod();
1762  case FCID_CUSTOMSTEMMOD:
1763  *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1764  return new FCCustomStemMod();
1765  case FCID_DOTMOD:
1766  *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1767  return new FCDotMod();
1768  case FCID_ENTRYALTERMOD:
1769  *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1770  return new FCEntryAlterMod();
1771  case FCID_EXPRESSION:
1772  *pClassApproach = CLASSAPPROACH_MEASUREDETAILS;
1773  return new FCExpression();
1774  case FCID_MIDIEXPRESSION:
1775  *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1776  return new FCMidiExpression();
1777  case FCID_NOTEHEADMOD:
1778  *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1779  return new FCNoteheadMod();
1780  case FCID_PERCUSSIONNOTEMOD:
1781  *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1782  return new FCPercussionNoteMod();
1783  case FCID_PERFORMANCEMOD:
1784  *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1785  return new FCPerformanceMod();
1786  case FCID_SECONDARYBEAMBREAKMOD:
1787  *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1788  return new FCSecondaryBeamBreakMod();
1789  case FCID_SEPARATEMEASURENUMBER:
1790  *pClassApproach = CLASSAPPROACH_CELLDETAILS;
1791  return new FCSeparateMeasureNumber();
1792  case FCID_SEPARATEPLACEMENT:
1793  *pClassApproach = CLASSAPPROACH_MEASUREDETAILS;
1794  return new FCSeparatePlacement();
1795  case FCID_SMARTSHAPEENTRYMARK:
1796  *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1797  return new FCSmartShapeEntryMark();
1798  case FCID_STEMMOD:
1799  *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1800  return new FCStemMod();
1801  case FCID_SYLLABLEENTRYMOD:
1802  *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1803  return new FCSyllableEntryMod();
1804  case FCID_TABLATURENOTEMOD:
1805  *pClassApproach = CLASSAPPROACH_NOTEDETAILS;
1806  return new FCTablatureNoteMod();
1807  case FCID_TUPLET:
1808  *pClassApproach = CLASSAPPROACH_ENTRYDETAILS;
1809  return new FCTuplet();
1810  default:
1811  *pClassApproach = CLASSAPPROACH_NONE;
1812  return NULL;
1813  }
1814  }
1815 
1816 
1817  void StartTiming()
1818  {
1819  _timingstart = 0;
1820  _timingend = 0;
1821  _timingstart = FCUI::GetHiResTimer();
1822  }
1823 
1824  void EndTiming()
1825  {
1826  _timingend = FCUI::GetHiResTimer();
1827  }
1828 
1829  /* Initializes Finale's progress bar.
1830  *
1831  * The progress bar info is not stored in the class data, to make sure that stacked iterators should be able to run
1832  * from the same iterator.
1833  */
1834  void StartProgressBar(EProgressDataP *ppProgressBarData, int count, int* pProgressUpdateCount)
1835  {
1836  _progressbar_useraborted = false;
1837  *pProgressUpdateCount = 0;
1838  if (!_useprogressbar) return;
1839  *ppProgressBarData = FX_StartMassEdit(NULL, count);
1840  }
1841 
1842  /* Updates Finale's progress bar and checks for user iterrupts.
1843  *
1844  * The progress bar info is not stored in the class data, to make sure
1845  * that stacked iterators should be able to run
1846  * from the same iterator.
1847  *
1848  * Returns false if user aborts the progressbar
1849  */
1850  bool UpdateProgressBar(EProgressDataP *ppProgressBarData, int* pProgressUpdateCount)
1851  {
1852  if (!_useprogressbar) return true;
1853  if (!*ppProgressBarData) return true;
1854  (*pProgressUpdateCount)++;
1855  if (*pProgressUpdateCount < _progressfrequency) return true;
1856 
1857  bool continueflag = (FX_MassEditProgress(*ppProgressBarData, _progressfrequency, 0, 0, 0) != 0);
1858  if ((!continueflag) && _abortableprogressbar)
1859  {
1860  _progressbar_useraborted = true;
1861  FX_EndMassEdit(*ppProgressBarData, true);
1862  return false;
1863  }
1864  return true;
1865  }
1866 
1867  /* Destroys Finale's progress bar.
1868  *
1869  * The progress bar info is not stored in the class data, to make sure that stacked iterators should be able to run
1870  * from the same iterator.
1871  */
1872  void EndProgressBar(EProgressDataP *ppProgressBarData, bool abortprogress)
1873  {
1874  if (!_useprogressbar) return;
1875  if (!*ppProgressBarData) return;
1876  FX_EndMassEdit(*ppProgressBarData, abortprogress);
1877  *ppProgressBarData = NULL;
1878  }
1879 
1880  /* Set up the LuaRef for the correct object type */
1881  bool SetupCorrectCppClass(__FCBaseData* pProcessObject, luabridge::LuaRef &parameter)
1882  {
1883  switch (pProcessObject->GetClassID())
1884  {
1885  case FCID_ACCIDENTALMOD:
1886  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCAccidentalMod*)pProcessObject);
1887  return true;
1888  case FCID_ALLOTMENT:
1889  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCAllotment*)pProcessObject);
1890  return true;
1891  case FCID_ARTICULATION:
1892  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCArticulation*)pProcessObject);
1893  return true;
1894  case FCID_ARTICULATIONDEF:
1895  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCArticulationDef*)pProcessObject);
1896  return true;
1897  case FCID_BACKWARDREPEAT:
1898  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCBackwardRepeat*)pProcessObject);
1899  return true;
1900  case FCID_BASELINE:
1901  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCBaseline*)pProcessObject);
1902  return true;
1903  case FCID_BEAMMOD:
1904  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCBeamMod*)pProcessObject);
1905  return true;
1906  case FCID_BEATCHARTELEMENT:
1907  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCBeatChartElement*)pProcessObject);
1908  return true;
1909  case FCID_BROKENBEAMMOD:
1910  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCBrokenBeamMod*)pProcessObject);
1911  return true;
1912  case FCID_CATEGORYDEF:
1913  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCCategoryDef*)pProcessObject);
1914  return true;
1915  case FCID_CELLCLEFCHANGE:
1916  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCCellClefChange*)pProcessObject);
1917  return true;
1918  case FCID_CELLFRAMEHOLD:
1919  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCCellFrameHold*)pProcessObject);
1920  return true;
1921  case FCID_CELLGRAPHIC:
1922  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCCellGraphic*)pProcessObject);
1923  return true;
1924  case FCID_CELLTEXT:
1925  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCCellText*)pProcessObject);
1926  return true;
1927  case FCID_CENTERSMARTSHAPE:
1928  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCCenterSmartShape*)pProcessObject);
1929  return true;
1930  case FCID_CHORD:
1931  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCChord*)pProcessObject);
1932  return true;
1933  case FCID_CHORDSUFFIXELEMENT:
1934  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCChordSuffixElement*)pProcessObject);
1935  return true;
1936  case FCID_CHORUSSYLLABLE:
1937  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCChorusSyllable*)pProcessObject);
1938  return true;
1939  case FCID_CLEFDEF:
1940  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCClefDef*)pProcessObject);
1941  return true;
1942  case FCID_CROSSSTAFFMOD:
1943  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCCrossStaffMod*)pProcessObject);
1944  return true;
1945  case FCID_CUSTOMSMARTLINEDEF:
1946  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCCustomSmartLineDef*)pProcessObject);
1947  return true;
1948  case FCID_CUSTOMSTEMMOD:
1949  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCCustomStemMod*)pProcessObject);
1950  return true;
1951  case FCID_DOTMOD:
1952  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCDotMod*)pProcessObject);
1953  return true;
1954  case FCID_ENCLOSURE:
1955  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCEnclosure*)pProcessObject);
1956  return true;
1957  case FCID_ENDINGREPEAT:
1958  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCEndingRepeat*)pProcessObject);
1959  return true;
1960  case FCID_ENTRYALTERMOD:
1961  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCEntryAlterMod*)pProcessObject);
1962  return true;
1963  case FCID_EXECUTABLESHAPEDEF:
1964  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCExecutableShapeDef*)pProcessObject);
1965  return true;
1966  case FCID_EXPRESSION:
1967  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCExpression*)pProcessObject);
1968  return true;
1969  case FCID_FREEZESYSTEM:
1970  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCFreezeSystem*)pProcessObject);
1971  return true;
1972  case FCID_FRETBOARDSTYLEDEF:
1973  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCFretboardStyleDef*)pProcessObject);
1974  return true;
1975  case FCID_FRETBOARDGROUPDEF:
1976  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCFretboardGroupDef*)pProcessObject);
1977  return true;
1978  case FCID_FRETINSTRUMENTDEF:
1979  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCFretInstrumentDef*)pProcessObject);
1980  return true;
1981  case FCID_GROUP:
1982  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCGroup*)pProcessObject);
1983  return true;
1984  case FCID_INDEPENDENTCELLDETAIL:
1985  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCIndependentCellDetail*)pProcessObject);
1986  return true;
1987  case FCID_INSTRUMENTDEF:
1988  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCInstrumentDef*)pProcessObject);
1989  return true;
1990  case FCID_INSTRUMENTPLAYBACKDATA:
1991  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCInstrumentPlaybackData*)pProcessObject);
1992  return true;
1993  case FCID_MEASURE:
1994  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCMeasure*)pProcessObject);
1995  return true;
1996  case FCID_MEASURENUMBERREGION:
1997  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCMeasureNumberRegion*)pProcessObject);
1998  return true;
1999  case FCID_METATOOLASSIGNMENT:
2000  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCMetatoolAssignment*)pProcessObject);
2001  return true;
2002  case FCID_MIDIEXPRESSION:
2003  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCMidiExpression*)pProcessObject);
2004  return true;
2005  case FCID_MULTIMEASUREREST:
2006  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCMultiMeasureRest*)pProcessObject);
2007  return true;
2008  case FCID_MULTISTAFFINSTRUMENT:
2009  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCMultiStaffInstrument*)pProcessObject);
2010  return true;
2011  case FCID_NOTEHEADMOD:
2012  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCNoteheadMod*)pProcessObject);
2013  return true;
2014  case FCID_PERCUSSIONLAYOUTNOTE:
2015  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCPercussionLayoutNote*)pProcessObject);
2016  return true;
2017  case FCID_PERCUSSIONSTAFF:
2018  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCPercussionStaff*)pProcessObject);
2019  return true;
2020  case FCID_PERFORMANCEMOD:
2021  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCPerformanceMod*)pProcessObject);
2022  return true;
2023  case FCID_PAGE:
2024  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCPage*)pProcessObject);
2025  return true;
2026  case FCID_PAGEGRAPHIC:
2027  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCPageGraphic*)pProcessObject);
2028  return true;
2029  case FCID_PAGETEXT:
2030  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCPageText*)pProcessObject);
2031  return true;
2032  case FCID_PERCUSSIONNOTEMOD:
2033  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCPercussionNoteMod*)pProcessObject);
2034  return true;
2035  case FCID_RAWTEXT:
2036  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCRawText*)pProcessObject);
2037  return true;
2038  case FCID_SECONDARYBEAMBREAKMOD:
2039  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCSecondaryBeamBreakMod*)pProcessObject);
2040  return true;
2041  case FCID_SECTIONSYLLABLE:
2042  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCSectionSyllable*)pProcessObject);
2043  return true;
2044  case FCID_SEPARATEMEASURENUMBER:
2045  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCSeparateMeasureNumber*)pProcessObject);
2046  return true;
2047  case FCID_SEPARATEPLACEMENT:
2048  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCSeparatePlacement*)pProcessObject);
2049  return true;
2050  case FCID_SHAPEDEF:
2051  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCShapeDef*)pProcessObject);
2052  return true;
2053  case FCID_SHAPEEXPRESSIONDEF:
2054  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCShapeExpressionDef*)pProcessObject);
2055  return true;
2056  case FCID_SMARTSHAPE:
2057  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCSmartShape*)pProcessObject);
2058  return true;
2059  case FCID_SMARTSHAPEENTRYMARK:
2060  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCSmartShapeEntryMark*)pProcessObject);
2061  return true;
2062  case FCID_SMARTSHAPEMEASUREMARK:
2063  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCSmartShapeMeasureMark*)pProcessObject);
2064  return true;
2065  case FCID_STAFF:
2066  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCStaff*)pProcessObject);
2067  return true;
2068  case FCID_STAFFLIST:
2069  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCStaffList*)pProcessObject);
2070  return true;
2071  case FCID_STAFFNAMEPOSITION:
2072  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCStaffNamePosition*)pProcessObject);
2073  return true;
2074  case FCID_STAFFSTYLEASSIGN:
2075  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCStaffStyleAssign*)pProcessObject);
2076  return true;
2077  case FCID_STAFFSTYLEDEF:
2078  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCStaffStyleDef*)pProcessObject);
2079  return true;
2080  case FCID_STAFFSYSTEM:
2081  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCStaffSystem*)pProcessObject);
2082  return true;
2083  case FCID_STEMMOD:
2084  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCStemMod*)pProcessObject);
2085  return true;
2086  case FCID_SYLLABLEENTRYMOD:
2087  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCSyllableEntryMod*)pProcessObject);
2088  return true;
2089  case FCID_SYSTEMSTAFF:
2090  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCSystemStaff*)pProcessObject);
2091  return true;
2092  case FCID_TABLATURENOTEMOD:
2093  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCTablatureNoteMod*)pProcessObject);
2094  return true;
2095  case FCID_TEMPOELEMENT:
2096  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCTempoElement*)pProcessObject);
2097  return true;
2098  case FCID_TEXTBLOCK:
2099  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCTextBlock*)pProcessObject);
2100  return true;
2101  case FCID_TEXTEXPRESSIONDEF:
2102  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCTextExpressionDef*)pProcessObject);
2103  return true;
2104  case FCID_TEXTREPEAT:
2105  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCTextRepeat*)pProcessObject);
2106  return true;
2107  case FCID_TEXTREPEATDEF:
2108  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCTextRepeatDef*)pProcessObject);
2109  return true;
2110  case FCID_TIEMOD:
2111  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCTieMod*)pProcessObject);
2112  return true;
2113  case FCID_TUPLET:
2114  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCTuplet*)pProcessObject);
2115  return true;
2116  case FCID_VERSESYLLABLE:
2117  parameter = luabridge::LuaRef(_pGlobal_LuaState, (FCVerseSyllable*)pProcessObject);
2118  return true;
2119 
2120  default:
2121 #ifdef PDK_FRAMEWORK_DIAGNOSE
2122  DebugOutDigit("Error in FCLuaIterator - unhandled class: ", pProcessObject->GetClassID());
2123 #endif
2124  return false;
2125  }
2126  }
2127 public:
2133  {
2134  _progressfrequency = 20;
2135  _timingstart = _timingend = 0;
2136  _forwardprocessing = true;
2137  _downwardprocessing = true;
2138  _partialmeasureselections = true;
2139  _nullregionequalsall = false;
2140  _useprogressbar = false;
2141  _abortableprogressbar = false;
2142  _progressbar_useraborted = false;
2143  _loadlayermode = 0;
2144  _processscorepart = true;
2145  _processcurrentpart = true;
2146  _processcurrentdoc = true;
2147  }
2148 
2179  int ForEach(__FCCollectionData* pCollection, luabridge::LuaRef lua_callback_function)
2180  {
2181  StartTiming();
2182  int count = ProcessForEach(pCollection, lua_callback_function, false);
2183  EndTiming();
2184  return count;
2185  }
2186 
2215  int ForEachSaved(__FCCollectionData* pCollection, luabridge::LuaRef lua_callback_function)
2216  {
2217  StartTiming();
2218  int count = ProcessForEach(pCollection, lua_callback_function, true);
2219  EndTiming();
2220  return count;
2221  }
2222 
2244  int ForEachEntry(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2245  {
2246  StartTiming();
2247  int count = ProcessRegionEntries(pRegion, lua_callback_function, false);
2248  EndTiming();
2249  return count;
2250  }
2251 
2287  int ForEachEntrySaved(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2288  {
2289  StartTiming();
2290  int count = ProcessRegionEntries(pRegion, lua_callback_function, true);
2291  EndTiming();
2292  return count;
2293  }
2294 
2336  int ForEachNote(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2337  {
2338  StartTiming();
2339  int count = ProcessRegionNotes(pRegion, lua_callback_function, false);
2340  EndTiming();
2341  return count;
2342  }
2343 
2376  int ForEachNoteSaved(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2377  {
2378  StartTiming();
2379  int count = ProcessRegionNotes(pRegion, lua_callback_function, true);
2380  EndTiming();
2381  return count;
2382  }
2383 
2408  int ForEachCell(FCMusicRegion* pRegion, luabridge::LuaRef lua_callback_function)
2409  {
2410  StartTiming();
2411  int count = ProcessForEachCell(pRegion, lua_callback_function);
2412  EndTiming();
2413  return count;
2414  }
2415 
2435  int ForEachPart(luabridge::LuaRef lua_callback_function)
2436  {
2437  StartTiming();
2438  int count = ProcessForEachPart(lua_callback_function);
2439  EndTiming();
2440  return count;
2441  }
2442 
2503  int ForEachObject(int classID, luabridge::LuaRef lua_callback_function)
2504  {
2505  if (!lua_callback_function.isFunction()) return 0;
2506  StartTiming();
2507  __FCCollectionData* pCollection = LoadCollectionForClassID((PDKFRAMEWORK_CLASSID) classID);
2508  if (!pCollection)
2509  {
2510  EndTiming();
2511  return 0;
2512  }
2513  int count = ProcessForEach(pCollection, lua_callback_function, false);
2514  delete pCollection;
2515  EndTiming();
2516  return count;
2517  }
2518 
2545  int ForEachObjectSaved(int classID, luabridge::LuaRef lua_callback_function)
2546  {
2547  if (!lua_callback_function.isFunction()) return 0;
2548  StartTiming();
2549  __FCCollectionData* pCollection = LoadCollectionForClassID((PDKFRAMEWORK_CLASSID) classID);
2550  if (!pCollection)
2551  {
2552  EndTiming();
2553  return 0;
2554  }
2555  int count = ProcessForEach(pCollection, lua_callback_function, true);
2556  delete pCollection;
2557  EndTiming();
2558  return count;
2559  }
2560 
2605  int ForEachRegionObject(FCMusicRegion* pRegion, int classID, luabridge::LuaRef lua_callback_function)
2606  {
2607  StartTiming();
2608  int count = ProcessForEachRegionObject(pRegion, classID, lua_callback_function, false);
2609  EndTiming();
2610  return count;
2611  }
2612 
2636  int ForEachRegionObjectSaved(FCMusicRegion* pRegion, int classID, luabridge::LuaRef lua_callback_function)
2637  {
2638  StartTiming();
2639  int count = ProcessForEachRegionObject(pRegion, classID, lua_callback_function, true);
2640  EndTiming();
2641  return count;
2642  }
2643 
2677  int ForEachDocument(luabridge::LuaRef lua_callback_function)
2678  {
2679  StartTiming();
2680  int count = ProcessForEachDocument(lua_callback_function, false);
2681  EndTiming();
2682  return count;
2683  }
2684 
2721  int ForEachDocumentSaved(luabridge::LuaRef lua_callback_function)
2722  {
2723  StartTiming();
2724  int count = ProcessForEachDocument(lua_callback_function, true);
2725  EndTiming();
2726  return count;
2727  }
2728 
2769  int ForEachFile(FCStrings* pFileStrings, luabridge::LuaRef lua_callback_function)
2770  {
2771  StartTiming();
2772  int count = ProcessForEachFile(pFileStrings, lua_callback_function, false);
2773  EndTiming();
2774  return count;
2775  }
2776 
2821  int ForEachFileSaved(FCStrings* pFileStrings, luabridge::LuaRef lua_callback_function)
2822  {
2823  StartTiming();
2824  int count = ProcessForEachFile(pFileStrings, lua_callback_function, true);
2825  EndTiming();
2826  return count;
2827  }
2828 
2859  int ForEachInteger(int integer1, int integer2, luabridge::LuaRef lua_callback_function)
2860  {
2861  StartTiming();
2862  int count = ProcessForEachInteger(integer1, integer2, lua_callback_function);
2863  EndTiming();
2864  return count;
2865  }
2866 
2871  bool GetUseProgressBar() const { return _useprogressbar; }
2872 
2878  {
2879  return _progressfrequency;
2880  }
2881 
2887  {
2888  return _abortableprogressbar;
2889  }
2890 
2896  bool GetProgressBarUserAborted() const { return _progressbar_useraborted; }
2897 
2905  int GetLoadLayerMode() const
2906  {
2907  return _loadlayermode;
2908  }
2909 
2915  bool GetProcessScorePart() const { return _processscorepart; }
2916 
2921  bool GetProcessCurrentPart() const { return _processcurrentpart; }
2922 
2928  bool GetProcessCurrentDocument() const { return _processcurrentdoc; }
2929 
2935  bool GetNullRegionEqualsAll() const { return _nullregionequalsall; }
2936 
2947  bool GetForwardProcessing() const { return _forwardprocessing; }
2948 
2955  bool GetDownwardProcessing() const { return _downwardprocessing; }
2956 
2964  bool GetPartialMeasureSelections() const { return _partialmeasureselections; }
2965 
2973  void SetUseProgressBar(bool use) { _useprogressbar = use; }
2974 
2987  {
2988  if (freq < 1) return;
2989  _progressfrequency = freq;
2990  }
2991 
2996  void SetAbortableProgressBar(bool state) { _abortableprogressbar = state; }
2997 
3005  void SetLoadLayerMode(int loadlayermode) { _loadlayermode = loadlayermode; }
3006 
3011  void SetProcessScorePart(bool state) { _processscorepart = state; }
3012 
3017  void SetProcessCurrentPart(bool state) { _processcurrentpart = state; }
3018 
3024  void SetProcessCurrentDocument(bool state) { _processcurrentdoc = state; }
3025 
3031  void SetNullRegionEqualsAll(bool state) { _nullregionequalsall = state; }
3032 
3046  void SetForwardProcessing(bool forward) { _forwardprocessing = forward; }
3047 
3056  void SetDownwardProcessing(bool downward) { _downwardprocessing = downward; }
3057 
3065  void SetPartialMeasureSelections(bool partialselections) { _partialmeasureselections = partialselections; }
3066 
3077  bool AddEntryFilter(int filter, int logicmode)
3078  {
3079  switch (logicmode)
3080  {
3081  case LILOGIC_AND:
3082  return _entryfilters_AND.AddFilter((LUAITERATOR_ENTRYFILTERS)filter);
3083  case LILOGIC_OR:
3084  return _entryfilters_OR.AddFilter((LUAITERATOR_ENTRYFILTERS)filter);
3085  case LILOGIC_NOT:
3086  return _entryfilters_NOT.AddFilter((LUAITERATOR_ENTRYFILTERS)filter);
3087  }
3088  return false;
3089  }
3090 
3103  bool RemoveEntryFilter(int filter, int logicmode)
3104  {
3105  switch (logicmode)
3106  {
3107  case LILOGIC_AND:
3108  return _entryfilters_AND.RemoveFilter((LUAITERATOR_ENTRYFILTERS)filter);
3109  case LILOGIC_OR:
3110  return _entryfilters_OR.RemoveFilter((LUAITERATOR_ENTRYFILTERS)filter);
3111  case LILOGIC_NOT:
3112  return _entryfilters_NOT.RemoveFilter((LUAITERATOR_ENTRYFILTERS)filter);
3113  }
3114  return false;
3115  }
3116 
3122  {
3123  _entryfilters_AND.ClearAll();
3124  _entryfilters_OR.ClearAll();
3125  _entryfilters_NOT.ClearAll();
3126  }
3127 
3138  bool IsEntryFilterAdded(int filter, int logicmode)
3139  {
3140  switch (logicmode)
3141  {
3142  case LILOGIC_AND:
3143  return (_entryfilters_AND.Find((LUAITERATOR_ENTRYFILTERS)filter) != NULL);
3144  case LILOGIC_OR:
3145  return (_entryfilters_OR.Find((LUAITERATOR_ENTRYFILTERS)filter) != NULL);
3146  case LILOGIC_NOT:
3147  return (_entryfilters_NOT.Find((LUAITERATOR_ENTRYFILTERS)filter) != NULL);
3148  }
3149  return false;
3150  }
3151 
3162  bool AddNoteFilter(int filter, int logicmode)
3163  {
3164  switch (logicmode)
3165  {
3166  case LILOGIC_AND:
3167  return _notefilters_AND.AddFilter((LUAITERATOR_NOTEFILTERS)filter);
3168  case LILOGIC_OR:
3169  return _notefilters_OR.AddFilter((LUAITERATOR_NOTEFILTERS)filter);
3170  case LILOGIC_NOT:
3171  return _notefilters_NOT.AddFilter((LUAITERATOR_NOTEFILTERS)filter);
3172  }
3173  return false;
3174  }
3175 
3188  bool RemoveNoteFilter(int filter, int logicmode)
3189  {
3190  switch (logicmode)
3191  {
3192  case LILOGIC_AND:
3193  return _notefilters_AND.RemoveFilter((LUAITERATOR_NOTEFILTERS)filter);
3194  case LILOGIC_OR:
3195  return _notefilters_OR.RemoveFilter((LUAITERATOR_NOTEFILTERS)filter);
3196  case LILOGIC_NOT:
3197  return _notefilters_NOT.RemoveFilter((LUAITERATOR_NOTEFILTERS)filter);
3198  }
3199  return false;
3200  }
3201 
3207  {
3208  _notefilters_AND.ClearAll();
3209  _notefilters_OR.ClearAll();
3210  _notefilters_NOT.ClearAll();
3211  }
3212 
3223  bool IsNoteFilterAdded(int filter, int logicmode)
3224  {
3225  switch (logicmode)
3226  {
3227  case LILOGIC_AND:
3228  return (_notefilters_AND.Find((LUAITERATOR_NOTEFILTERS)filter) != NULL);
3229  case LILOGIC_OR:
3230  return (_notefilters_OR.Find((LUAITERATOR_NOTEFILTERS)filter) != NULL);
3231  case LILOGIC_NOT:
3232  return (_notefilters_NOT.Find((LUAITERATOR_NOTEFILTERS)filter) != NULL);
3233  }
3234  return false;
3235  }
3236 
3247  bool AddAltNotationFilter(int filter, int logicmode)
3248  {
3249  switch (logicmode)
3250  {
3251  case LILOGIC_AND:
3252  return _altnotationfilters_AND.AddFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3253  case LILOGIC_OR:
3254  return _altnotationfilters_OR.AddFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3255  case LILOGIC_NOT:
3256  return _altnotationfilters_NOT.AddFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3257  }
3258  return false;
3259  }
3260 
3274  bool RemoveAltNotationFilter(int filter, int logicmode)
3275  {
3276  switch (logicmode)
3277  {
3278  case LILOGIC_AND:
3279  return _altnotationfilters_AND.RemoveFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3280  case LILOGIC_OR:
3281  return _altnotationfilters_OR.RemoveFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3282  case LILOGIC_NOT:
3283  return _altnotationfilters_NOT.RemoveFilter((__FCStaffBase::ALTERNATE_STAFF)filter);
3284  }
3285  return false;
3286  }
3287 
3293  {
3294  _altnotationfilters_AND.ClearAll();
3295  _altnotationfilters_OR.ClearAll();
3296  _altnotationfilters_NOT.ClearAll();
3297  }
3298 
3310  bool IsAltNotationFilterAdded(int filter, int logicmode)
3311  {
3312  switch (logicmode)
3313  {
3314  case LILOGIC_AND:
3315  return (_altnotationfilters_AND.Find((__FCStaffBase::ALTERNATE_STAFF)filter) != NULL);
3316  case LILOGIC_OR:
3317  return (_altnotationfilters_OR.Find((__FCStaffBase::ALTERNATE_STAFF)filter) != NULL);
3318  case LILOGIC_NOT:
3319  return (_altnotationfilters_NOT.Find((__FCStaffBase::ALTERNATE_STAFF)filter) != NULL);
3320  }
3321  return false;
3322  }
3323 
3334  bool AddNotationStyleFilter(int filter, int logicmode)
3335  {
3336  switch (logicmode)
3337  {
3338  case LILOGIC_AND:
3339  return _notationstylefilters_AND.AddFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3340  case LILOGIC_OR:
3341  return _notationstylefilters_OR.AddFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3342  case LILOGIC_NOT:
3343  return _notationstylefilters_NOT.AddFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3344  }
3345  return false;
3346  }
3347 
3361  bool RemoveNotationStyleFilter(int filter, int logicmode)
3362  {
3363  switch (logicmode)
3364  {
3365  case LILOGIC_AND:
3366  return _notationstylefilters_AND.RemoveFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3367  case LILOGIC_OR:
3368  return _notationstylefilters_OR.RemoveFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3369  case LILOGIC_NOT:
3370  return _notationstylefilters_NOT.RemoveFilter((__FCStaffBase::STAFFNOTATION_STYLE)filter);
3371  }
3372  return false;
3373  }
3374 
3380  {
3381  _notationstylefilters_AND.ClearAll();
3382  _notationstylefilters_OR.ClearAll();
3383  _notationstylefilters_NOT.ClearAll();
3384  }
3385 
3396  bool IsNotationStyleFilterAdded(int filter, int logicmode)
3397  {
3398  switch (logicmode)
3399  {
3400  case LILOGIC_AND:
3401  return (_notationstylefilters_AND.Find((__FCStaffBase::STAFFNOTATION_STYLE)filter) != NULL);
3402  case LILOGIC_OR:
3403  return (_notationstylefilters_OR.Find((__FCStaffBase::STAFFNOTATION_STYLE)filter) != NULL);
3404  case LILOGIC_NOT:
3405  return (_notationstylefilters_NOT.Find((__FCStaffBase::STAFFNOTATION_STYLE)filter) != NULL);
3406  }
3407  return false;
3408  }
3409 
3421  {
3422  if (_timingend == 0) return 0;
3423  return (_timingend - _timingstart);
3424  }
3425 };
3426 
Collection class for FCCustomSmartLineDef class objects.
Definition: ff_smartshapes.h:3137
bool GetNullRegionEqualsAll() const
Returns if NULL regions should automatically be interpreted as a full document region, or not. This setting affects all region-based iterators.
Definition: fflua_luaiterator.h:2935
__FCBase * GetItemAt(int index)
Returns the object at the index position. Index is 0-based.
Definition: finaleframework.cpp:12797
The class for a note definition in a percussion layout.
Definition: ff_other.h:23136
Class that specifies the cross-staff connection for a note.
Definition: ff_entrydetails.h:1007
The class for a section syllable.
Definition: ff_entrydetails.h:2718
void SetProcessCurrentPart(bool state)
Sets if the part currently in editing focus should be processed in ForEachPart calls.
Definition: fflua_luaiterator.h:3017
bool SwitchBack(bool saveedits)
Ends the started edit block and switch back to the previous document.
Definition: finaleframework.cpp:27152
The class for a measure number region.
Definition: ff_other.h:5254
Class for a shape expression definition.
Definition: ff_other.h:14483
void SetForwardProcessing(bool forward)
Sets the direction of the iteration.
Definition: fflua_luaiterator.h:3046
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:3396
Class for a collection of documents. Usually used to get all the currently loaded documents in Finale...
Definition: ff_documents.h:277
virtual TimeEdu32 GetMeasurePos() const
Virtual method for cell-attached data that has a position in the measure.
Definition: ff_celldetails.h:86
Base class for all collections based on decendants from __FCBaseData.
Definition: ff_basecollection.h:465
Class for chord assignments to a measure/staff.
Definition: ff_celldetails.h:1144
The class for a verse syllable.
Definition: ff_entrydetails.h:2679
int LoadAll()
Loads all parts (including the "score part") for the document.
Definition: finaleframework.cpp:27034
bool Close()
Closes the document.
Definition: finaleframework.cpp:27290
Definition: fflua_luaiterator.h:128
virtual bool LoadNext()
Overloaded method of LoadNext that will only load incis within the same cmper1/cmper2.
Definition: finaleframework.cpp:20265
Class to encapsulate enclosures (available for example in expressions and measure numbers...
Definition: ff_other.h:2743
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:2336
Collection class for FCMultiMeasureRest class objects.
Definition: ff_othercollection.h:1051
twobyte GetEndMeasure() const
Returns the end measure for the region.
Definition: ff_region.h:408
Definition: fflua_luaiterator.h:104
void SetDirty(bool state)
Sets the "dirty" flag for the document (that indicates that the document needs to be saved)...
Definition: ff_documents.h:240
Encapsulates baselines offset values for lyrics, expressions, fretboards and chords.
Definition: ff_details.h:1069
bool GetGraceNote() const
Gets the grace note state of the note entry.
Definition: ff_noteframe.h:1467
Class that stores one record of a fretboard chord definition.
Definition: ff_other.h:21082
ALTERNATE_STAFF
Alternate staff notation styles for FCStaff::GetAltNotationStyle() and FCStaff::SetAltNotationStyle()...
Definition: ff_other.h:8995
bool RemoveAltNotationFilter(int filter, int logicmode)
Removes a alternate notation filter.
Definition: fflua_luaiterator.h:3274
ENTNUM GetEntryNumber() const
Returns the internal entry number (ID) for the note entry.
Definition: ff_noteframe.h:1059
Class for page-assigned graphics. Currently, this class can only be used to edit existing page graphi...
Definition: ff_other.h:18859
Class for attaching an tuplet to an entry.
Definition: ff_entrydetails.h:1647
Definition: fflua_luaiterator.h:162
Class for freezing a system at a specific measure.
Definition: ff_other.h:13506
virtual eStaff GetStaff() const
Virtual method for returning the staff number.
Definition: ff_other.h:138
Class for custom stem shapes (in Finale's Special Tools). The data is connected to either an upstem o...
Definition: ff_entrydetails.h:3658
Collection class for FCShapeDef class objects, which defines the shape definitions in the document...
Definition: ff_othercollection.h:1303
Class for measure/cell-attached graphic objects.
Definition: ff_celldetails.h:1809
Class for acciental modifications (as in Finale's Special Tools).
Definition: ff_entrydetails.h:3039
Collection class for FCFretboardGroupDef class objects.
Definition: ff_othercollection.h:1379
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:2721
Collection class for FCShapeExpressionDef class objects.
Definition: ff_othercollection.h:759
Class for a multi-measure rest instance.
Definition: ff_other.h:18234
Class for a category definition.
Definition: ff_other.h:12571
void SetCString(const char *pszBuffer, int maxchars=-1)
Sets the string, using a C-string version of the string.
Definition: finaleframework.cpp:1030
static double GetHiResTimer()
Returns a high-resolution timer value, mainly for use with internal profilers.
Definition: finaleframework.cpp:22004
bool SwitchTo(FCString *pUndoString, bool saveedits)
Switch document focus to this document and start a new (nested) undo/redo record, without closing the...
Definition: finaleframework.cpp:27129
void SetNullRegionEqualsAll(bool state)
Sets if NULL regions should automatically be interpreted as a full document region, or not. This setting affects all region-based iterators.
Definition: fflua_luaiterator.h:3031
Class for staff (or staff style) name positioning data.
Definition: ff_other.h:6956
Class for measure-attached (cell-attached) text blocks. The ConnectCell method must be called prior t...
Definition: ff_celldetails.h:1876
int CalcMeasureSpan()
Calculates the number of measures in the region.
Definition: ff_region.h:495
Class for a page-connected text block.
Definition: ff_other.h:15674
Class that contains data that appears in the middle of a long smart shape. This class is normally lin...
Definition: ff_smartshapes.h:418
int GetProgressUpdateFrequency() const
Returns the update frequency for the progress bar.
Definition: fflua_luaiterator.h:2877
Definition: fflua_luaiterator.h:107
void SetUseProgressBar(bool use)
Sets if the update progress bar should be used or not.
Definition: fflua_luaiterator.h:2973
bool ClearItemAt(int index)
Deletes the object at the index position and disposes the object. Index is 0-based.
Definition: finaleframework.cpp:12821
Class for manually broken beam adjustments (in Finale's Special Tools).
Definition: ff_entrydetails.h:4492
Class for a text block.
Definition: ff_other.h:15039
Class for Lua callback iterators. This class is not part of the C++ PDK Framework.
Definition: fflua_luaiterator.h:72
virtual void SetNoteEntry(FCNoteEntry *pEntry)
Maps the data to an entry.
Definition: ff_entrydetails.h:102
Definition: fflua_luaiterator.h:143
The class for an articulation definition. On Finale 2012 and above, this class supports the Unicode c...
Definition: ff_other.h:11535
bool GetAccidentalFreeze() const
Returns the freezed accidental state.
Definition: ff_noteframe.h:103
bool IsEntryPosWithin(FCNoteEntry *pEntry)
Checks if a entry is within the region. This checks for partial measures.
Definition: finaleframework.cpp:14672
Definition: fflua_luaiterator.h:165
bool Open(FCString *pFilePath, bool createwindow, FCString *pUndoString)
Opens a file as a new Finale documnent. The new document will automatically get editing focus...
Definition: finaleframework.cpp:27216
Collection class for FCTextRepeatDef class objects.
Definition: ff_othercollection.h:1197
Class with adjustments to the ties (in Finale's Special Tools).
Definition: ff_entrydetails.h:4372
Collection class for FCPage class objects.
Definition: ff_othercollection.h:59
bool GetNoteDetailFlag() const
Returns true for existing note detail records.
Definition: ff_noteframe.h:1789
The class for an instrument definition item (in the instrument list/Score Manager).
Definition: ff_other.h:22745
LUAITERATOR_LOGICMETHOD
Logical operators that are used for filters. If no filters are added/activated, all items are automat...
Definition: fflua_luaiterator.h:181
Class for controlling justification/alignment for all syllables that are connected to an entry...
Definition: ff_entrydetails.h:2742
bool GetProcessCurrentDocument() const
Returns if the document currently in editing focus should be processed in ForEachDocument and ForEach...
Definition: fflua_luaiterator.h:2928
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:15738
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. After callback has processed the object, each object is saved.
Definition: fflua_luaiterator.h:2545
bool GetSmartShapeFlag() const
Returns true if the entry is marked to contain smart shapes.
Definition: ff_noteframe.h:1850
bool IsScore()
Returns true if the part is the score.
Definition: ff_parts.h:289
Definition: fflua_luaiterator.h:125
Collection class for FCFretInstrumentDef class objects.
Definition: ff_othercollection.h:1226
Encapsulates the continous MIDI data in a cell.
Definition: ff_celldetails.h:248
PDKFRAMEWORK_CLASSID
Constants for the GetClassID method.
Definition: ff_base.h:60
Class for a metatool key assignment.
Definition: ff_other.h:24423
Class for text repeat assignments to a measure. The assignment is connected with a FCTextRepeatDef de...
Definition: ff_other.h:19723
STAFFNOTATION_STYLE GetNotationStyle() const
Returns the notation style for the staff.
Definition: ff_other.h:9452
The class for a backward repeat definition.
Definition: ff_other.h:21623
Definition: fflua_luaiterator.h:110
Collection class for FCMeasure class objects.
Definition: ff_othercollection.h:189
bool GetProcessScorePart() const
Returns if the score part (the part with part ID 0) should be processed in ForEachPart calls...
Definition: fflua_luaiterator.h:2915
bool CloseCurrentDocumentWindow()
Closes the current document Window.
Definition: finaleframework.cpp:27283
The class for a fretboard style definition, which reflects the content the "Fretboard Style" dialog b...
Definition: ff_other.h:20547
static void DebugOutDigit(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:274
Collection class for FCGroup class objects.
Definition: ff_detailscollection.h:22
bool IsUntitled()
Returns true if the document has no file connected to it.
Definition: finaleframework.cpp:27302
void ClearAllNotationStyleFilters()
Removes all filters for notation styles. This will result in all items being processed.
Definition: fflua_luaiterator.h:3379
Class for an opened Finale document. An opened Finale document has a 1-based ID and can be displayed ...
Definition: ff_documents.h:26
__FCStaffBase::ALTERNATE_STAFF GetAltNotationStyle()
Returns the alternate notation style for the staff.
Definition: ff_other.h:9507
FCNote * GetItemAt(int index)
Overload version of GetItemAt(), which returns a note object (if available) for the note entry...
Definition: ff_noteframe.h:855
Class that stores one "inci" of a staff list (for a system or for the global list of staves)...
Definition: ff_other.h:6706
Class for a text expression definition.
Definition: ff_other.h:13603
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:16
Class that handles separate placement for repeats.
Definition: ff_other.h:16251
Collection class for FCChord class objects.
Definition: ff_celldetails.h:2140
bool GetArticulationFlag() const
Returns true if the entry is marked to contain articulations.
Definition: ff_noteframe.h:1843
int LoadAll()
Gets all open docs into the collection.
Definition: finaleframework.cpp:27378
Definition: fflua_luaiterator.h:92
void SetLoadLayerMode(int loadlayermode)
Sets the load layer mode for the note entry iterators, such as ForEachEntry(), ForEachNote(), etc.
Definition: fflua_luaiterator.h:3005
Class for tablature instruments definitions.
Definition: ff_other.h:23746
Class for manual stem adjustments (in Finale's Special Tools).
Definition: ff_entrydetails.h:1307
bool GetSpecialAltsFlag() const
Returns true for existing special alteration records.
Definition: ff_noteframe.h:1807
bool LoadForCell(FCCell *pCell, TimeEdu32 durationpos)
Loads the staff spec data based on a position in a cell.
Definition: finaleframework.cpp:8771
Definition: fflua_luaiterator.h:184
twobyte CalcStaffNumber(twobyte slot)
Calculates the staff number, based on the region's slot number.
Definition: ff_region.h:522
The class for a chorus syllable.
Definition: ff_entrydetails.h:2699
FCLuaIterator()
The constructor.
Definition: fflua_luaiterator.h:2132
Class for smartshape assignments/connections to an entry.
Definition: ff_smartshapes.h:305
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:2215
Definition: fflua_luaiterator.h:131
TimeEdu32 CalcNondottedDuration()
Returns the non-dotted symbolic duration of the entry.
Definition: ff_noteframe.h:1550
Definition: fflua_luaiterator.h:134
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:2376
Class that represent one part in a document. The class also provides methods to switch between parts...
Definition: ff_parts.h:67
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:3011
Definition: fflua_luaiterator.h:101
The class for one single beat chart element.
Definition: ff_other.h:22059
bool GetForwardProcessing() const
Returns the direction of the iteration.
Definition: fflua_luaiterator.h:2947
Collection class for FCExecutableShapeDef class objects.
Definition: ff_othercollection.h:1285
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, similar to the each() iterator in JW Lua.
Definition: fflua_luaiterator.h:2179
Class for a shape definition (as in Finale's Shape selection dialog).
Definition: ff_other.h:2109
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:2408
Definition: fflua_luaiterator.h:95
bool RemoveNotationStyleFilter(int filter, int logicmode)
Removes a notation style filter.
Definition: fflua_luaiterator.h:3361
int GetCount() const
Returns the number of elements of the collection.
Definition: ff_basecollection.h:86
Class for expression assignments to a measure/staff.
Definition: ff_other.h:16483
bool GetStemDetailFlag() const
Gets the flag state for stem detail records.
Definition: ff_noteframe.h:1828
bool AddAltNotationFilter(int filter, int logicmode)
Adds/activates an alternate notation filter.
Definition: fflua_luaiterator.h:3247
Collection class for FCPart objects.
Definition: ff_parts.h:517
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:2636
Class with info about one tablature note.
Definition: ff_entrydetails.h:4570
bool IsCurrent()
Returns true if the current document is the current document.
Definition: ff_documents.h:60
bool IsEmpty() const
Returns true if the region is empty.
Definition: ff_region.h:112
The class for a staff system on a page.
Definition: ff_other.h:3548
FCString * GetItemAt(int index)
Overridden GetItemAt() method.
Definition: ff_basecollection.h:958
void SetAbortableProgressBar(bool state)
Sets if the progress bar should be abortable (by the Esc key).
Definition: fflua_luaiterator.h:2996
Class that contains independent key/time signatures for a cell.
Definition: ff_celldetails.h:2172
Collection class for FCClefDef class objects.
Definition: ff_globals.h:225
Definition: fflua_luaiterator.h:187
bool GetTie() const
Gets the tie start state for the note.
Definition: ff_noteframe.h:175
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:2244
Encapsulates one note in a note entry (from the FCNoteEntry class).
Definition: ff_noteframe.h:27
Definition: fflua_luaiterator.h:122
The class for a text repeat definition.
Definition: ff_other.h:19396
Class for staff style assignments to a staff.
Definition: ff_other.h:18060
Class for performance/playback modifications attached to note entires (as in Finale's MIDI Tool)...
Definition: ff_entrydetails.h:4190
Class for a manually added or edited measure number in a cell.
Definition: ff_celldetails.h:630
Class for allotment data (in the Document Options).
Definition: ff_other.h:18752
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:3310
LUAITERATOR_NOTEFILTERS
Constants for the note filters.
Definition: fflua_luaiterator.h:159
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:3138
Collection class for FCFretboardStyleDef class objects.
Definition: ff_othercollection.h:1355
int GetIndexOf(__FCBase *pObject)
Returns the 0-based order index for the object within the collection.
Definition: finaleframework.cpp:12805
Class for custom beam adjustments (in Finale's Special Tools).
Definition: ff_entrydetails.h:3758
Definition: fflua_luaiterator.h:86
bool GetLyricFlag() const
Returns the flag that marks that an entry has syllable attached to it.
Definition: ff_noteframe.h:1820
Class that holds the TGF frames and the clef changes of a TGF frame.
Definition: ff_celldetails.h:900
The class that reference a cell (one measure on one staff) in the musical "grid". ...
Definition: ff_cell.h:17
Contains a clef change inside a cell. This is an item member in a FCCellClefChanges collection (creat...
Definition: ff_other.h:24169
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:2287
FCDocument * GetItemAt(int index)
Overridden version of GetItemAt().
Definition: ff_documents.h:330
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:2896
Base class for the Finale Framework classes.
Definition: ff_base.h:47
An object that contains one staff list section (out of 4). Before data is loaded/saved, the SetMode() method must be called.
Definition: ff_other.h:23363
bool AddEntryFilter(int filter, int logicmode)
Adds/activates a note entry filter.
Definition: fflua_luaiterator.h:3077
Collection class for FCCategoryDef class objects.
Definition: ff_othercollection.h:669
Class for attaching an articulation definition to an entry.
Definition: ff_entrydetails.h:1450
bool SetFullDocument()
Sets the region to span the full document.
Definition: finaleframework.cpp:14544
The class for a measure (the full vertical measure stack) in the document. It maps the Measure Attrib...
Definition: ff_other.h:4052
bool IsNoteFilterAdded(int filter, int logicmode)
Returns true if a specific note filter has been added/activated for the iterator. ...
Definition: fflua_luaiterator.h:3223
bool IsNote()
Returns true if entry is a note.
Definition: ff_noteframe.h:1886
bool Save()
Saves the current document at the current document path.
Definition: finaleframework.cpp:27211
void ClearAllNoteFilters()
Removes all note filters.
Definition: fflua_luaiterator.h:3206
Collection class for FCTextExpressionDef class objects.
Definition: ff_othercollection.h:732
bool GetPerformanceDataFlag() const
Returns true for existing performance data records.
Definition: ff_noteframe.h:1799
Definition: fflua_luaiterator.h:116
Class that stores the information for drum mapping, either for a staff or staff style.
Definition: ff_other.h:6860
virtual bool LoadFirst()
Overloads the LoadFirst method with a one that loads the cell data into cmper1 (staff), cmper2 (measure), inci (0)
Definition: finaleframework.cpp:20228
bool IsDotted()
Returns true if it's a dotted entry.
Definition: finaleframework.cpp:17069
Class for a multi-staff instrument defined in the Score Manager.
Definition: ff_other.h:18540
Definition: fflua_luaiterator.h:169
The class for a staff in the score. It is also a base class for staff styles.
Definition: ff_other.h:10912
Collection class for FCPageGraphic class objects.
Definition: ff_othercollection.h:1167
Base class for all data-related classes (that handles Finale data).
Definition: ff_base.h:628
STAFFNOTATION_STYLE
Styles for the FCStaff::GetNotationStyle() and FCStaff::SetNotationStyle() methods. The constants are also used for the similar FCStaffStyleDef methods.
Definition: ff_other.h:8977
Definition: fflua_luaiterator.h:146
void SetLoadLayerMode(int mode)
Sets the "layer mode" for the Load method. This must be called/st before any Load() call...
Definition: ff_noteframe.h:3078
virtual bool Save()
Saves the currently loaded to its current location.
Definition: finaleframework.cpp:848
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:2769
void SetPartialMeasureSelections(bool partialselections)
Returns partially selected measures should be processed.
Definition: fflua_luaiterator.h:3065
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:2677
bool SwitchTo()
Sets the focus to this part (but does not set it in view).
Definition: ff_parts.h:240
void ConnectCell(FCCell *pCell)
Connects the object to a cell. This must be done prior to any load/save operations.
Definition: ff_celldetails.h:50
void ClearAllEntryFilters()
Removes all entry filters. This will result in all entry being processed by the ForEachEntry and ForE...
Definition: fflua_luaiterator.h:3121
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:2435
Class for (what it seems) the sole purpose of note entry resize.
Definition: ff_entrydetails.h:2936
virtual bool Load(CMPER itemno, twobyte inci)
Loads the indicated record within the item number.
Definition: finaleframework.cpp:4169
bool GetAbortableProgressBar() const
Returns if the progress bar should be abortable (by the Esc key).
Definition: fflua_luaiterator.h:2886
static void GetLastUndoString(FCString *pString)
Fetches the last undo string for the edit block.
Definition: ff_documents.h:254
bool IsMeasurePartial(eMeas measure)
Returns true if a specific measure is partially selected.
Definition: finaleframework.cpp:14696
bool LoadForEntry(FCNoteEntry *pNoteEntry)
Loads the staff spec data based on the position in the note entry.
Definition: finaleframework.cpp:8761
bool GetSecondaryBeamFlag() const
Returns true for secondary beam detail records.
Definition: ff_noteframe.h:1836
bool RemoveNoteFilter(int filter, int logicmode)
Removes a note filter.
Definition: fflua_luaiterator.h:3188
void SetProgressUpdateFrequency(int freq)
Sets the update frequency for the progress bar.
Definition: fflua_luaiterator.h:2986
Definition: fflua_luaiterator.h:149
Collection class for FCMeasureNumberRegion class objects.
Definition: ff_othercollection.h:327
Base class for "other" (ot_*) data with incis.
Definition: ff_other.h:59
virtual const PDKFRAMEWORK_CLASSID GetClassID()=0
Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has...
virtual bool LoadLast()
Overloads the LoadLast method with a one that loads the cell data into cmper1 (staff), cmper2 (measure) and the last found inci.
Definition: finaleframework.cpp:20243
Class that provides storage for text. This is to achieve platform-transparent text handling...
Definition: ff_base.h:1473
virtual twobyte CalcLastInci()
For internal use only!
Definition: ff_base.h:700
Encapsulates a note entry from an owner class (for example FCNoteEntryCell, FCNoteEntryLayer) class...
Definition: ff_noteframe.h:808
Collection class for FCPageText class objects.
Definition: ff_othercollection.h:851
bool IsCurrent()
Returns true if the part is the very same as the current part in the editing focus.
Definition: ff_parts.h:308
Base class for data that attach to cells. A call to the ConnectCell method is required prior to loadi...
Definition: ff_celldetails.h:21
Base class that provides the basic functionality for entry detail data (such as Special Tools modific...
Definition: ff_entrydetails.h:25
bool AddNoteFilter(int filter, int logicmode)
Adds/activates a note filter.
Definition: fflua_luaiterator.h:3162
A record that represents a smart shape in the score. It's connected to a score through FCSmartShapeMe...
Definition: ff_smartshapes.h:925
virtual twobyte CalcLastInci()
Overridden version of CalcLastInci for __FCInciOther-based classes.
Definition: finaleframework.cpp:4187
The class for a custom smart shape lines.
Definition: ff_smartshapes.h:1911
bool GetUseProgressBar() const
Returns if the update progress bar should be used or not.
Definition: fflua_luaiterator.h:2871
Definition: fflua_luaiterator.h:98
Class that encapsulates EREGION and provides additional functionality to region handling.
Definition: ff_region.h:24
Class for a staff style definition.
Definition: ff_other.h:17040
The class for a single tempo change in the Tempo Tool. The tempo elements should be stored in measure...
Definition: ff_other.h:22334
twobyte GetStartSlot() const
Returns the start slot (staff) for the region.
Definition: ff_region.h:435
The class representing a physical page in Finale.
Definition: ff_other.h:3240
FCPart * GetItemAt(int index)
Definition: ff_parts.h:591
The class for instrument playback data. This is also the link between staves/staff styles and the FCI...
Definition: ff_other.h:22991
Collection class for FCString class objects.
Definition: ff_basecollection.h:924
bool RemoveEntryFilter(int filter, int logicmode)
Removes a note entry filter.
Definition: fflua_luaiterator.h:3103
bool IsRest()
Returns true if entry is a rest.
Definition: ff_noteframe.h:1894
void SetDownwardProcessing(bool downward)
Sets the vertical direction for processing staves in the iteration, for region-based iterators...
Definition: fflua_luaiterator.h:3056
virtual int LoadAll()
Loads all available data into the collection.
Definition: finaleframework.cpp:12977
Collection class for FCMultiStaffInstrument class objects.
Definition: ff_othercollection.h:1099
int CalcStaffSpan()
Calculates the number of staves in the region.
Definition: ff_region.h:507
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:2821
LUAITERATOR_ENTRYFILTERS
Constants for the note entry filters.
Definition: fflua_luaiterator.h:83
Class for secondary beam breaks (in Finale's Special Tools).
Definition: ff_entrydetails.h:1117
virtual eMeas GetMeasure() const
Virtual method for returning the measure number.
Definition: ff_other.h:129
twobyte GetEndSlot() const
Returns the end slot (staff) for the region.
Definition: ff_region.h:448
Collection class for FCStaff class objects.
Definition: ff_othercollection.h:278
Class that encapsulate a cell of note entries.
Definition: ff_noteframe.h:2574
Class that stores one record of a chord suffix definition.
Definition: ff_other.h:20248
Class for smartshape assignments to a measure.
Definition: ff_smartshapes.h:190
Definition: fflua_luaiterator.h:140
The class for a "current staff state" (the sum of staff changes and staff style changes) at a specifi...
Definition: ff_other.h:11456
Definition: fflua_luaiterator.h:137
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:2605
Class for notehead modifications (as in Finale's Special Tools).
Definition: ff_entrydetails.h:314
void Add(__FCBase *pNewItem)
Adds an element to the end of the collection.
Definition: finaleframework.cpp:12756
Definition: fflua_luaiterator.h:113
virtual bool LoadPrevious()
Definition: finaleframework.cpp:20275
bool GetTupletStartFlag() const
Returns true if the entry is marked to start a tuplet.
Definition: ff_noteframe.h:1814
bool GetDownwardProcessing() const
Returns the vertical direction for processing staves in the iteration, for region-based iterators...
Definition: fflua_luaiterator.h:2955
void SetProcessCurrentDocument(bool state)
Sets if the document currently in editing focus should be processed in ForEachDocument and ForEachDoc...
Definition: fflua_luaiterator.h:3024
Collection class for FCSmartShape class objects.
Definition: ff_smartshapes.h:3167
Collection class for FCArticulationDef class objects.
Definition: ff_othercollection.h:473
int GetLoadLayerMode() const
Returns the load layer mode for the note entry iterators, such as ForEachEntry(), ForEachNote()...
Definition: fflua_luaiterator.h:2905
virtual bool HasStaffValue()
Method that should return true if GetStaff() returns actual values.
Definition: ff_other.h:141
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:2859
bool AddNotationStyleFilter(int filter, int logicmode)
Adds/activates an notation style filter.
Definition: fflua_luaiterator.h:3334
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:2503
Encapsulates a staff group.
Definition: ff_details.h:69
virtual TimeEdu32 GetMeasurePos() const
Virtual method for returning the position within the measure.
Definition: ff_other.h:148
Data class for the global clef definitions.
Definition: ff_globals.h:42
double CalcLastDuration()
Reports the duration of the last iterator run.
Definition: fflua_luaiterator.h:3420
bool GetPartialMeasureSelections() const
Returns partially selected measures should be processed.
Definition: fflua_luaiterator.h:2964
bool SetToCurrent()
Remaps the object to the current document.
Definition: ff_documents.h:90
Collection class for FCStaffSystem class objects. A collection typically contains all staff systems f...
Definition: ff_othercollection.h:127
bool GetProcessCurrentPart() const
Returns if the part currently in editing focus should be processed in ForEachPart calls...
Definition: fflua_luaiterator.h:2921
Definition: fflua_luaiterator.h:119
Definition: fflua_luaiterator.h:172
The class for a start of repeat bracket in the document. There can only be one ending repeat in each ...
Definition: ff_other.h:21157
Class with adjustments to the augmentation dots (in Finale's Special Tools).
Definition: ff_entrydetails.h:860
twobyte GetStartMeasure() const
Returns the start measure for the region.
Definition: ff_region.h:400
virtual bool Load(ENTNUM entnum, twobyte inci)
Loads the data at the given entry number and inci.
Definition: finaleframework.cpp:18886
Class for percussion note modification.
Definition: ff_entrydetails.h:3575
Collection class for FCStaffStyleDef class objects.
Definition: ff_othercollection.h:1013
bool GetAccidentalParentheses() const
Returns the parentheses accidental state.
Definition: ff_noteframe.h:110
Definition: fflua_luaiterator.h:89
void ClearAllAltNotationFilters()
Removes all filters for alternate notation. This will result in all items being processed.
Definition: fflua_luaiterator.h:3292
Base class for all collection classes. A collection is a storage that can store multiple objects of s...
Definition: ff_basecollection.h:24
The class for an executable shape definition.
Definition: ff_other.h:20161
bool IsEmpty()
Returns true if the string is empty.
Definition: ff_base.h:2461
Collection class for FCInstrumentDef class objects.
Definition: ff_othercollection.h:1681
Definition: fflua_luaiterator.h:190
bool SwitchBack()
Switches back yo the "original" current part, that was in focus at the call to SwitchTo.
Definition: ff_parts.h:256