Finale PDK Framework  0.54
ff_other.h
1 /*
2  * File: ff_other.h
3  * Author: Jari Williamsson
4  *
5  * Created on den 26 december 2009, 14:09
6  */
7 
8 #ifndef _FF_OTHER_H
9 #define _FF_OTHER_H
10 
11 #include "ff_timesig.h"
12 #include "ff_base.h"
13 #include "ff_region.h"
14 
15 
16 
23 class __FCOther : public __FCBaseData {
24 public:
27  void SetCmperAndInci(CMPER cmper, twobyte inci)
28  {
29  _dataid.other.cmper = cmper;
30  _dataid.other.inci = inci;
31  }
32 
33 
34 public:
35  virtual const char* ClassName() { return "__FCOther"; }
36 
39 
40 
47  bool IsIdenticalRecord(__FCOther* pCompare)
48  {
49  if (!DataIsLoaded()) return false;
50  if (_dataid.other.cmper != pCompare->_GetDataID()->other.cmper) return false;
51  if (_dataid.other.inci != pCompare->_GetDataID()->other.inci) return false;
52  return true;
53  }
54 };
55 
56 
59 class __FCInciOther : public __FCOther
60 {
61 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
62 
63  virtual bool LoadFirst() { return false; }
64 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
65 public:
70 
78  virtual bool Load(CMPER itemno, twobyte inci);
79 
81  virtual twobyte CalcLastInci();
82 
84  virtual bool Reload();
85 
92  virtual bool SaveNew(CMPER itemno);
93 
98  void _SetCmper(CMPER cmper) { _dataid.other.cmper = cmper; }
99 
100 
105  int GetItemCmper() const
106  {
107  if (!DataIsLoaded()) return kNewCmper;
108  return _dataid.other.cmper;
109  }
110 
117  int GetItemInci() const
118  {
119  if (!DataIsLoaded()) return kNewInci;
120  return _dataid.other.inci;
121  }
122 
123 
129  virtual eMeas GetMeasure() const { return 0; }
130 
138  virtual eStaff GetStaff() const { return 0; }
139 
141  virtual bool HasStaffValue() { return false; }
142 
148  virtual TimeEdu32 GetMeasurePos() const { return 0; }
149 };
150 
156 {
157  twobyte _inciblock[6];
158 
159  virtual int DataSizeLoad() { return sizeof(_inciblock); } /* A standard inci */
160  virtual void* Allocate() { return _GetDataPtr(); }
161  virtual EXTAG Tag() { return GetCustomTag(); }
162 
167  virtual void CloneMemoryFrom(__FCBaseData* pSource)
168  {
169  memcpy(&_inciblock, ((FCOtherInci*)pSource)->_GetDataPtr(), sizeof(_inciblock));
170  _datablock = &_inciblock;
171  _loadedsize = sizeof(_inciblock);
172  }
173 
174  virtual __FCBaseData* CreateObject()
175  {
176  return new FCOtherInci();
177  }
178 public:
179 
181  {
182  memset(&_inciblock, 0, sizeof(_inciblock));
183  _datablock = &_inciblock;
184  _loadedsize = sizeof(_inciblock);
185  }
186 
187 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
188 
194  void* _GetDataPtr() { return &_inciblock; }
195 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
196 
197  virtual const char* ClassName() { return "FCOtherInci"; }
198  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_OTHERINCI; }
199 };
200 
201 
202 
213 {
214 protected:
215 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
216 
223  int _DataSizeLoadFullCmper(CMPER cmper, ETAG othertag);
224 
232  bool _SaveOtherFullCmper(CMPER cmper, void* buffer, int size, ETAG othertag);
233 
241  bool _LoadOtherFullCmper(CMPER cmper, void* buffer, int size, ETAG othertag);
242 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
243 public:
244  virtual const char* ClassName() { return "__FCNoInciOther"; }
245 
248 
253  virtual bool Load(CMPER itemno);
254 
256  virtual bool Reload();
257 
263  virtual bool SaveAs(CMPER itemno);
264 
274  virtual bool DeepSaveAs(CMPER itemno)
275  {
276  return SaveAs(itemno);
277  }
278 
285  virtual bool DeepDeleteData()
286  {
287  return DeleteData();
288  }
289 
296  virtual bool SaveNew();
297 
305  virtual CMPER GetItemNo() const { return _dataid.other.cmper; }
306 
314  void SetItemNo(CMPER cmper)
315  {
316  _dataid.other.cmper = cmper;
317  _dataid.other.inci = 0;
318  }
319 
328  virtual bool LoadFirst() { return Load(1); }
329 
330 #ifdef PDK_FRAMEWORK_DEBUG
331  virtual void DebugDump()
332  {
334  DebugOutDigit("dataid.other.cmper: ", _dataid.other.cmper);
335  }
336 #endif
337 
338 };
339 
340 
346 {
347 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
348  private:
350  EDTCompositeTimeUpper _compositetimeupperdata;
351 
352 protected:
353  virtual EXTAG Tag() { return ot_CompositeTimeUpper; }
354  virtual int DataSizeLoad() { return sizeof(EDTCompositeTimeUpper); }
355  virtual void* Allocate() { return (void*) &_compositetimeupperdata; }
356 
361  virtual void CloneMemoryFrom(__FCBaseData* pSource)
362  {
363  memcpy(&_compositetimeupperdata, ((__FCCompositeTimeSigTopElement*)pSource)->_GetDataPtr(), sizeof(_compositetimeupperdata));
364  _datablock = &_compositetimeupperdata;
365  _loadedsize = sizeof(_compositetimeupperdata);
366  }
367 
368  virtual __FCBaseData* CreateObject()
369  {
370  return new __FCCompositeTimeSigTopElement();
371  }
372 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
373 public:
374  virtual const char* ClassName() { return "__FCCompositeTimeSigTopElement"; }
375  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_COMPOSITETIMESIGTOPELEMENT; }
376 
377 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
378 
384  void* _GetDataPtr() { return &_compositetimeupperdata; }
385 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
386 
389  {
390  memset(&_compositetimeupperdata, 0, sizeof(_compositetimeupperdata));
391  _datablock = &_compositetimeupperdata;
392  _loadedsize = sizeof(_compositetimeupperdata);
393  }
394 
396  ECompositeTimeUpper* _GetFirstRecordPtr() { return &_compositetimeupperdata.elements[0]; }
397 
399  ECompositeTimeUpper* _GetSecondRecordPtr() { return &_compositetimeupperdata.elements[1]; }
400 
401 
402 #ifdef PDK_FRAMEWORK_DEBUG
403  virtual void DebugDump()
404  {
406  }
407 #endif
408 };
409 
410 
411 
417 {
418 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
419  private:
421  EDTCompositeTimeLower _compositetimelowerdata;
422 
423 protected:
424  virtual EXTAG Tag() { return ot_CompositeTimeLower; }
425  virtual int DataSizeLoad() { return sizeof(EDTCompositeTimeLower); }
426  virtual void* Allocate() { return (void*) &_compositetimelowerdata; }
427 
432  virtual void CloneMemoryFrom(__FCBaseData* pSource)
433  {
434  memcpy(&_compositetimelowerdata, ((__FCCompositeTimeSigBottomElement*)pSource)->_GetDataPtr(), sizeof(_compositetimelowerdata));
435  _datablock = &_compositetimelowerdata;
436  _loadedsize = sizeof(_compositetimelowerdata);
437  }
438 
439  virtual __FCBaseData* CreateObject()
440  {
442  }
443 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
444 public:
445  virtual const char* ClassName() { return "__FCCompositeTimeSigBottomElement"; }
446  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_COMPOSITETIMESIGBOTTOMELEMENT; }
447 
448 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
449 
455  void* _GetDataPtr() { return &_compositetimelowerdata; }
456 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
457 
460  {
461  memset(&_compositetimelowerdata, 0, sizeof(_compositetimelowerdata));
462  _datablock = &_compositetimelowerdata;
463  _loadedsize = sizeof(_compositetimelowerdata);
464  }
465 
467  ECompositeTimeLower* _GetFirstRecordPtr() { return &_compositetimelowerdata.elements[0]; }
468 
470  ECompositeTimeLower* _GetSecondRecordPtr() { return &_compositetimelowerdata.elements[1]; }
471 
473  ECompositeTimeLower* _GetThirdRecordPtr() { return &_compositetimelowerdata.elements[2]; }
474 
475 
476 #ifdef PDK_FRAMEWORK_DEBUG
477  virtual void DebugDump()
478  {
480  }
481 #endif
482 };
483 
484 
485 
486 #ifdef PDK_FRAMEWORK_COMPOSITETIMESIGS
487 
496 {
498  ECompositeTimeUpper* _pArray;
499 
502  int _arraycounter;
503 
504 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
505 
509  ECompositeTimeUpper* _GetGroupElementPtr(int groupindex, int subindex)
510  {
511  groupindex++; /* Make the index 1-based internally for this method */
512  int currentindex = 0;
513  int subindexcount = 0;
514  for (int i = 0; i < _arraycounter; i++)
515  {
516  if (_pArray[i].chainstart) currentindex++;
517  if (currentindex == groupindex)
518  {
519  if (subindexcount == subindex) return &_pArray[i];
520  subindexcount++;
521  }
522  if (currentindex > groupindex) return NULL;
523  }
524  return NULL;
525  }
526 
534  void _RedistributeArray(CMPER cmper = 0)
535  {
536  if (cmper == 0)
537  {
538  if (GetCount() == 0) return; /* To prevent crash */
540  cmper = pFirstInci->_GetDataID()->other.cmper;
541  }
542  ClearAll();
543  twobyte inci = 0;
544  __FCCompositeTimeSigTopElement* pCurrentObject = NULL;
545  for (int i = 0; i < _arraycounter; i++)
546  {
547  if (i % 2 == 0)
548  {
549  pCurrentObject = new __FCCompositeTimeSigTopElement();
550  EDataID* pDataID = (EDataID*) pCurrentObject->_GetDataID(); /* "Turn off" const */
551  pDataID->other.cmper = cmper;
552  pDataID->other.inci = inci;
553  inci++;
554  memcpy(pCurrentObject->_GetFirstRecordPtr(), &_pArray[i], sizeof(ECompositeTimeUpper));
555  }
556  else
557  {
558  memcpy(pCurrentObject->_GetSecondRecordPtr(), &_pArray[i], sizeof(ECompositeTimeUpper));
559  Add(pCurrentObject);
560  pCurrentObject = NULL;
561  }
562  }
563  if (pCurrentObject) Add(pCurrentObject);
564  }
565 #endif
566 
567 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
568  virtual __FCBaseData* CreateElement() { return new __FCCompositeTimeSigTopElement(); }
569 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
570  public:
571 
572 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
573 
574  void _BuildArray()
575  {
576  delete [] _pArray;
577  _pArray = NULL;
578  _arraycounter = 0;
579  if (GetCount() == 0) return;
580  /* Count the number of active records in the array */
581  int activerecords = 0;
582  for (int i = 0; i < GetCount(); i++)
583  {
585  ECompositeTimeUpper* pCompositeTimeUpper = pData->_GetFirstRecordPtr();
586  if ((pCompositeTimeUpper->main == 0) &&
587  (pCompositeTimeUpper->fraction == 0)) continue;
588  activerecords ++;
589  pCompositeTimeUpper = pData->_GetSecondRecordPtr();
590  if ((pCompositeTimeUpper->main == 0) &&
591  (pCompositeTimeUpper->fraction == 0)) continue;
592  activerecords ++;
593  }
594  if (activerecords == 0) return;
595  // Allocate memory and copy:
596  _pArray = new ECompositeTimeUpper[activerecords];
597  int currentindex = 0;
598  for (int i = 0; i < GetCount(); i++)
599  {
601  ECompositeTimeUpper* pCompositeTimeUpper = pData->_GetFirstRecordPtr();
602  if ((pCompositeTimeUpper->main == 0) &&
603  (pCompositeTimeUpper->fraction == 0)) continue;
604  memcpy(&_pArray[currentindex], pCompositeTimeUpper, sizeof(ECompositeTimeUpper));
605  currentindex ++;
606  pCompositeTimeUpper = pData->_GetSecondRecordPtr();
607  if ((pCompositeTimeUpper->main == 0) &&
608  (pCompositeTimeUpper->fraction == 0)) continue;
609  memcpy(&_pArray[currentindex], pCompositeTimeUpper, sizeof(ECompositeTimeUpper));
610  currentindex ++;
611  }
612  _arraycounter = activerecords;
613  }
614 #endif
615 
616  virtual const char* ClassName() { return "FCCompositeTimeSigTop"; }
617 
620  {
621  _pArray = NULL;
622  _arraycounter = 0;
623  }
624 
627  {
628  delete [] _pArray;
629  _pArray = NULL;
630  _arraycounter = 0;
631  }
632 
639  {
640  int groupcount = 0;
641  for (int i = 0; i < _arraycounter; i++)
642  {
643  if (_pArray[i].chainstart) groupcount++;
644  }
645  return groupcount;
646  }
647 
654  int AddGroup(int elementcount)
655  {
656  if (elementcount < 1) return -1;
657  if (elementcount > 10) return -1;
658 
659  ECompositeTimeUpper* pNewArray = new ECompositeTimeUpper[_arraycounter + elementcount];
660 
661  if (_pArray)
662  {
663  /* Copy the old data and remove it */
664  int bytesize = sizeof(ECompositeTimeUpper) * _arraycounter;
665  memcpy(pNewArray, _pArray, bytesize);
666  delete [] _pArray;
667  }
668 
669  /* Initialize the new data */
670  ECompositeTimeUpper* pNewAddedData = &pNewArray[_arraycounter];
671  for (int i = 0; i < elementcount; i++)
672  {
673  pNewAddedData->chainstart = (i == 0);
674  pNewAddedData->fraction = 0;
675  pNewAddedData->main = 1;
676  pNewAddedData ++;
677  }
678 
679  /* Set new info: */
680  _arraycounter += elementcount;
681  _pArray = pNewArray;
682 
683  return GetGroupCount() - 1;
684  }
685 
692  void MergeWithPreviousGroup(int groupindex)
693  {
694  if (groupindex < 1) return;
695  ECompositeTimeUpper* pData = _GetGroupElementPtr(groupindex, 0);
696  if (!pData) return;
697  pData->chainstart = false;
698  }
699 
700 
708  int GetGroupElementCount(int index)
709  {
710  index++; /* Make the index 1-based internally for this method */
711  int currentindex = 0;
712  int count = 0;
713  for (int i = 0; i < _arraycounter; i++)
714  {
715  if (_pArray[i].chainstart) currentindex++;
716  if (currentindex == index) count++;
717  if (currentindex > index) return count;
718  }
719  return count;
720  }
721 
730  int CalcTotalGroupBeats(int groupindex)
731  {
732  int beatcount = 0;
733  int elementcount = GetGroupElementCount(groupindex);
734  for (int elementidx = 0; elementidx < elementcount; elementidx++)
735  {
736  beatcount += GetGroupElementBeats(groupindex, elementidx);
737  }
738  return beatcount;
739  }
740 
748  int GetGroupElementBeats(int groupindex, int subindex)
749  {
750  ECompositeTimeUpper* pCompositeTimeUpper = _GetGroupElementPtr(groupindex, subindex);
751  if (!pCompositeTimeUpper) return 0;
752  return pCompositeTimeUpper->main;
753  }
754 
758  {
759  return _arraycounter;
760  }
761 
769  void SetGroupElementBeats(int groupindex, int subindex, twobyte value)
770  {
771  ECompositeTimeUpper* pCompositeTimeUpper = _GetGroupElementPtr(groupindex, subindex);
772  if (!pCompositeTimeUpper) return;
773  pCompositeTimeUpper->main = value;
774  }
775 
778  virtual bool SaveAll()
779  {
780  if (_arraycounter == 0) return false;
781  if (GetCount() == 0)
782  {
783 #ifdef PDK_FRAMEWORK_DIAGNOSE
784  DebugOut("FCCompositeTimeSigTop()::SaveAll(): No existing collection items to read CMPER.");
785 #endif
786  return false; /* There must be an existing CMPER to save to */
787  }
788  _RedistributeArray();
790  CMPER cmper = pFirstInci->_GetDataID()->other.cmper;
791  DeleteDataForItem(cmper);
793  }
794 
797  virtual bool SaveAllForItem(CMPER cmper)
798  {
799  if (_arraycounter == 0) return false;
800 
801  _RedistributeArray(cmper);
802 
803  if (GetCount() == 0)
804  {
805 #ifdef PDK_FRAMEWORK_DIAGNOSE
806  DebugOut("FCCompositeTimeSigTop()::SaveAllForItem(): No existing collection items to read CMPER.");
807 #endif
808  return false; /* There must be an existing CMPER to save to */
809  }
810 
811  DeleteDataForItem(cmper);
813 
814  return true;
815  }
816 };
817 
818 #endif /*PDK_FRAMEWORK_COMPOSITETIMESIGS*/
819 
820 
821 #ifdef PDK_FRAMEWORK_COMPOSITETIMESIGS
822 
831 {
833  ECompositeTimeLower* _pArray;
834 
837  int _arraycounter;
838 
839 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
840 
844  ECompositeTimeLower* _GetGroupElementPtr(int groupindex, int subindex)
845  {
846  groupindex++; /* Make the index 1-based internally for this method */
847  int currentindex = 0;
848  int subindexcount = 0;
849  for (int i = 0; i < _arraycounter; i++)
850  {
851  if (_pArray[i].chainstart) currentindex++;
852  if (currentindex == groupindex)
853  {
854  if (subindexcount == subindex) return &_pArray[i];
855  subindexcount++;
856  }
857  if (currentindex > groupindex) return NULL;
858  }
859  return NULL;
860  }
861 
868  void _RedistributeArray(CMPER cmper = 0)
869  {
870  if (cmper == 0)
871  {
872  if (GetCount() == 0) return; /* To avoid crashes */
874  cmper = pFirstInci->_GetDataID()->other.cmper;
875  }
876  ClearAll();
877  twobyte inci = 0;
878  __FCCompositeTimeSigBottomElement* pCurrentObject = NULL;
879  EDataID* pDataID = NULL;
880  for (int i = 0; i < _arraycounter; i++)
881  {
882  switch (i % 3) {
883  case 0:
884  pCurrentObject = new __FCCompositeTimeSigBottomElement();
885  pDataID = (EDataID*) pCurrentObject->_GetDataID(); /* "Turn off" const */
886  pDataID->other.cmper = cmper;
887  pDataID->other.inci = inci;
888  inci++;
889  memcpy(pCurrentObject->_GetFirstRecordPtr(), &_pArray[i], sizeof (ECompositeTimeLower));
890  break;
891  case 1:
892  memcpy(pCurrentObject->_GetSecondRecordPtr(), &_pArray[i], sizeof (ECompositeTimeLower));
893  break;
894  default:
895  memcpy(pCurrentObject->_GetThirdRecordPtr(), &_pArray[i], sizeof (ECompositeTimeLower));
896  Add(pCurrentObject);
897  pCurrentObject = NULL;
898  break;
899  }
900  }
901  if (pCurrentObject) Add(pCurrentObject);
902  }
903 #endif
904 
905 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
906  virtual __FCBaseData* CreateElement() { return new __FCCompositeTimeSigBottomElement(); }
907 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
908  public:
909 
910 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
911 
912  void _BuildArray()
913  {
914  delete [] _pArray;
915  _pArray = NULL;
916  _arraycounter = 0;
917  if (GetCount() == 0) return;
918  /* Count the number of active records in the array */
919  int activerecords = 0;
920  for (int i = 0; i < GetCount(); i++)
921  {
923  ECompositeTimeLower* pCompositeTimeLower = pData->_GetFirstRecordPtr();
924  if (pCompositeTimeLower->main == 0) continue;
925  activerecords ++;
926  pCompositeTimeLower = pData->_GetSecondRecordPtr();
927  if (pCompositeTimeLower->main == 0) continue;
928  activerecords ++;
929  pCompositeTimeLower = pData->_GetThirdRecordPtr();
930  if (pCompositeTimeLower->main == 0) continue;
931  activerecords ++;
932  }
933  if (activerecords == 0) return;
934  // Allocate memory and copy:
935  _pArray = new ECompositeTimeLower[activerecords];
936  int currentindex = 0;
937  for (int i = 0; i < GetCount(); i++)
938  {
940  ECompositeTimeLower* pCompositeTimeLower = pData->_GetFirstRecordPtr();
941  if (pCompositeTimeLower->main == 0) continue;
942  memcpy(&_pArray[currentindex], pCompositeTimeLower, sizeof(ECompositeTimeLower));
943  currentindex ++;
944  pCompositeTimeLower = pData->_GetSecondRecordPtr();
945  if (pCompositeTimeLower->main == 0) continue;
946  memcpy(&_pArray[currentindex], pCompositeTimeLower, sizeof(ECompositeTimeLower));
947  currentindex ++;
948  pCompositeTimeLower = pData->_GetThirdRecordPtr();
949  if (pCompositeTimeLower->main == 0) continue;
950  memcpy(&_pArray[currentindex], pCompositeTimeLower, sizeof(ECompositeTimeLower));
951  currentindex ++;
952  }
953  _arraycounter = activerecords;
954  }
955 #endif
956 
957  virtual const char* ClassName() { return "FCCompositeTimeSigBottom"; }
958 
961  {
962  _pArray = NULL;
963  _arraycounter = 0;
964  }
965 
968  {
969  delete [] _pArray;
970  _pArray = NULL;
971  _arraycounter = 0;
972  }
973 
980  {
981  int groupcount = 0;
982  for (int i = 0; i < _arraycounter; i++)
983  {
984  if (_pArray[i].chainstart) groupcount++;
985  }
986  return groupcount;
987  }
988 
996  int GetGroupElementCount(int groupindex)
997  {
998  groupindex++; /* Make the index 1-based internally for this method */
999  int currentindex = 0;
1000  int count = 0;
1001  for (int i = 0; i < _arraycounter; i++)
1002  {
1003  if (_pArray[i].chainstart) currentindex++;
1004  if (currentindex == groupindex) count++;
1005  if (currentindex > groupindex) return count;
1006  }
1007  return count;
1008  }
1009 
1019  int GetGroupElementBeatDuration(int groupindex, int subindex)
1020  {
1021  ECompositeTimeLower* pCompositeTimeLower = _GetGroupElementPtr(groupindex, subindex);
1022  if (!pCompositeTimeLower) return 0;
1023  return pCompositeTimeLower->main;
1024  }
1025 
1029  {
1030  return _arraycounter;
1031  }
1032 
1037  int AddGroup()
1038  {
1039  ECompositeTimeLower* pNewArray = new ECompositeTimeLower[_arraycounter + 1];
1040 
1041  if (_pArray)
1042  {
1043  /* Copy the old data and remove it */
1044  int bytesize = sizeof(ECompositeTimeLower) * _arraycounter;
1045  memcpy(pNewArray, _pArray, bytesize);
1046  delete [] _pArray;
1047  }
1048 
1049  /* Initialize the new data */
1050  ECompositeTimeLower* pNewAddedData = &pNewArray[_arraycounter];
1051  pNewAddedData->chainstart = true;
1052  pNewAddedData->main = 1024;
1053  pNewAddedData ++;
1054 
1055  /* Set new info: */
1056  _arraycounter ++;
1057  _pArray = pNewArray;
1058 
1059  return GetGroupCount() - 1;
1060  }
1061 
1068  bool DeleteGroup(int groupindex)
1069  {
1070  if (groupindex < 0) return false;
1071  if (groupindex >= GetElementCount()) return false;
1072 
1073  /* Assumes that all groups are one element long!!! */
1074  for (int idx = groupindex; idx < _arraycounter - 1; idx ++)
1075  {
1076  TimeEdu32 value = GetGroupElementBeatDuration(idx + 1, 0);
1077  SetGroupElementBeatDuration(idx, 0, value);
1078  }
1079 
1080  _arraycounter --;
1081  return true;
1082  }
1083 
1090  void SetGroupElementBeatDuration(int groupindex, int subindex, twobyte value)
1091  {
1092  ECompositeTimeLower* pCompositeTimeLower = _GetGroupElementPtr(groupindex, subindex);
1093  if (!pCompositeTimeLower) return;
1094  pCompositeTimeLower->main = value;
1095  }
1096 
1099  virtual bool SaveAll()
1100  {
1101  if (_arraycounter == 0) return false;
1102  if (GetCount() == 0)
1103  {
1104 #ifdef PDK_FRAMEWORK_DIAGNOSE
1105  DebugOut("FCCompositeTimeSigBottom()::SaveAll(): No existing collection items to read CMPER.");
1106 #endif
1107  return false; /* There must be an existing CMPER to save to */
1108  }
1109  _RedistributeArray();
1111  CMPER cmper = pFirstInci->_GetDataID()->other.cmper;
1112  DeleteDataForItem(cmper);
1114  }
1115 
1118  virtual bool SaveAllForItem(CMPER cmper)
1119  {
1120  if (_arraycounter == 0) return false;
1121  _RedistributeArray(cmper);
1122  if (GetCount() == 0)
1123  {
1124 #ifdef PDK_FRAMEWORK_DIAGNOSE
1125  DebugOut("FCCompositeTimeSigBottom()::SaveAllForItem(): No existing collection items to read CMPER.");
1126 #endif
1127  return false; /* There must be an existing CMPER to save to */
1128  }
1129 
1130  DeleteDataForItem(cmper);
1132 
1133  return true;
1134  }
1135 };
1136 #endif
1137 
1138 
1139 #ifdef PDK_FRAMEWORK_SHAPES
1140 
1141 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1142 
1143 #include "pragma_align_begin.h"
1144 #if OPERATING_SYSTEM == WINDOWS
1145 struct __EDTPathData2014 /* 13 bytes */
1146 {
1147  double f;
1148  fourbyte l;
1149  onebyte isFloat;
1150 };
1151 #elif OPERATING_SYSTEM == MAC_OS
1152 struct __EDTPathData2014 /* 16 bytes */
1153 {
1154  double f;
1155  fourbyte l;
1156  fourbyte isFloat;
1157 };
1158 #endif
1159 #include "pragma_align_end.h"
1160 
1161 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1162 
1171 {
1172  ETAG _tag; /* Instruction tag */
1173  int _size; /* number of parameters */
1174  EDTPathData2002* _pPathDataOld; /* Pointer to data (pre-2014) */
1175  __EDTPathData2014* _pPathData2014; /* Pointer to data for Finale 2014 */
1176 #if FXT_VERSION >= FINALEVERSION_2014B
1177  EDTPathData2014b* _pPathData2014b; /* Pointer to data for Finale 2014b and later */
1178 #endif
1179  mutable FCString _tagstring; /* For GetTagAsString() */
1180 
1181  bool _Is2014Format();
1182  bool _Is2014bFormat();
1183 
1184  void _SetTag(ETAG tag)
1185  {
1186  _tag = tag;
1187  }
1188 
1190  void _AllocateParameters(int parametercount);
1191 
1193  void _SetFourbyteParameter(int parameterindex, fourbyte intvalue);
1194 
1195 public:
1196 
1202  {
1204  SHAPETAG_SETFONT = st_setfont,
1205 
1207  SHAPETAG_STARTOBJECT = st_startobject,
1208 
1210  SHAPETAG_STARTGROUP = st_startgroup,
1211 
1213  SHAPETAG_ENDGROUP = st_endgroup,
1214 
1216  SHAPETAG_DRAWCHAR = st_drawchar,
1217 
1219  SHAPETAG_STROKE = st_stroke,
1220 
1222  SHAPETAG_RMOVETO = st_rmoveto,
1223 
1225  SHAPETAG_LINEWIDTH = st_linewidth,
1226 
1228  SHAPETAG_SETDASH = st_setdash,
1229 
1231  SHAPETAG_LINETO = st_rlineto,
1232 
1234  SHAPETAG_SETGRAY = st_setgray,
1235 
1237  SHAPETAG_ELLIPSE = st_ellipse,
1238 
1240  SHAPETAG_FILLSOLID = st_fillsolid,
1241 
1243  SHAPETAG_CURVETO = st_curveto,
1244 
1246  SHAPETAG_SLUR = st_slur,
1247 
1249  SHAPETAG_RECTANGLE = st_rectangle,
1250 
1252  SHAPETAG_CLOSEPATH = st_closepath,
1253 
1255  SHAPETAG_BRACKET = st_bracket,
1256 
1258  SHAPETAG_NULL = st_null
1259  };
1260 
1262  FCShapeDefInstruction(ETAG tag, int instructionsize,
1263  void* pPathData);
1264 
1265  /* Constructor for using new, created data */
1267 
1281  void _SetMemory(EDTPathInst* pPathInstruction, void* pPathData, int offset);
1282 
1284  virtual ~FCShapeDefInstruction();
1285 
1291  int GetCount() const { return _size; }
1292 
1299  ETAG GetTag() const
1300  {
1301  return _tag;
1302  }
1303 
1305  virtual bool IsIdentical(__FCBase* pTestObject)
1306  {
1307  FCShapeDefInstruction* pTestInstruction = (FCShapeDefInstruction*) pTestObject;
1308  if (GetCount() != pTestInstruction->GetCount()) return false;
1309  if (GetTag() != pTestInstruction->GetTag()) return false;
1310  int count = GetCount();
1311  for (int i = 0; i < count; i++)
1312  {
1313  if (GetFourbyteData(i) != pTestInstruction->GetFourbyteData(i)) return false;
1314  }
1315  return true;
1316  }
1317 
1323  const char* GetTagAsString() const
1324  {
1325  _tagstring.Clear();
1326  switch (GetTag()) {
1327  case st_setfont:
1328  _tagstring.SetCString("setfont");
1329  break;
1330  case st_startobject:
1331  _tagstring.SetCString("startobject");
1332  break;
1333  case st_startgroup:
1334  _tagstring.SetCString("startgroup");
1335  break;
1336  case st_endgroup:
1337  _tagstring.SetCString("endgroup");
1338  break;
1339  case st_drawchar:
1340  _tagstring.SetCString("drawchar");
1341  break;
1342  case st_stroke:
1343  _tagstring.SetCString("stroke");
1344  break;
1345  case st_rmoveto:
1346  _tagstring.SetCString("rmoveto");
1347  break;
1348  case st_linewidth:
1349  _tagstring.SetCString("linewidth");
1350  break;
1351  case st_setdash:
1352  _tagstring.SetCString("setdash");
1353  break;
1354  case st_rlineto:
1355  _tagstring.SetCString("rlineto");
1356  break;
1357  case st_setgray:
1358  _tagstring.SetCString("setgrey");
1359  break;
1360  case st_ellipse:
1361  _tagstring.SetCString("ellipse");
1362  break;
1363  case st_fillsolid:
1364  _tagstring.SetCString("fillsolid");
1365  break;
1366  case st_curveto:
1367  _tagstring.SetCString("curveto");
1368  break;
1369  case st_slur:
1370  _tagstring.SetCString("slur");
1371  break;
1372  case st_rectangle:
1373  _tagstring.SetCString("rectangle");
1374  break;
1375  case st_closepath:
1376  _tagstring.SetCString("closepath");
1377  break;
1378  case st_bracket:
1379  _tagstring.SetCString("bracket");
1380  break;
1381  case 0:
1382  _tagstring.SetCString("Null");
1383  break;
1384  default:
1385  _tagstring.AppendCharacter((GetTag() & 0xff00) / 256);
1386  _tagstring.AppendCharacter(GetTag() & 0xff);
1387  break;
1388  }
1389 
1390  return _tagstring.GetCString();
1391  }
1392 
1400  fourbyte GetFourbyteData(int index);
1401 
1413  bool SetFourbyteData(int index, fourbyte fbvalue)
1414  {
1415  if (index < 0) return false;
1416  if (index >= _size) return false;
1417  _SetFourbyteParameter(index, fbvalue);
1418  return true;
1419  }
1420 
1428  double GetFloatData(int index);
1429 
1442  void Init_StartObject(int xorigin, int yorigin, int left, int top, int right, int bottom, int xtransform = 1000, int ytransform = 1000, int rotation = 0)
1443  {
1444  _SetTag(st_startobject);
1445  _AllocateParameters(11);
1446  _SetFourbyteParameter(0, xorigin);
1447  _SetFourbyteParameter(1, yorigin);
1448  _SetFourbyteParameter(2, left);
1449  _SetFourbyteParameter(3, top);
1450  _SetFourbyteParameter(4, right);
1451  _SetFourbyteParameter(5, bottom);
1452  _SetFourbyteParameter(6, xtransform);
1453  _SetFourbyteParameter(7, ytransform);
1454  _SetFourbyteParameter(8, rotation);
1455  /* The rest of the parameters is 0 */
1456  }
1457 
1462  void Init_StartGroup(int xorigin, int yorigin, int left, int top, int right, int bottom, int xtransform = 1000, int ytransform = 1000, int rotation = 0)
1463  {
1464  _SetTag(st_startgroup);
1465  _AllocateParameters(11);
1466  _SetFourbyteParameter(0, xorigin);
1467  _SetFourbyteParameter(1, yorigin);
1468  _SetFourbyteParameter(2, left);
1469  _SetFourbyteParameter(3, top);
1470  _SetFourbyteParameter(4, right);
1471  _SetFourbyteParameter(5, bottom);
1472  _SetFourbyteParameter(6, xtransform);
1473  _SetFourbyteParameter(7, ytransform);
1474  _SetFourbyteParameter(8, rotation);
1475  /* The rest of the parameters is 0 */
1476  }
1477 
1482  {
1483  _SetTag(st_endgroup);
1484  _AllocateParameters(0);
1485  }
1486 
1488  void Init_RMoveTo(int x, int y)
1489  {
1490  _SetTag(st_rmoveto);
1491  _AllocateParameters(2);
1492  _SetFourbyteParameter(0, x);
1493  _SetFourbyteParameter(1, y);
1494  }
1495 
1497  void Init_CurveTo(int x1, int y1, int x2, int y2, int endpt_x, int endpt_y)
1498  {
1499  _SetTag(st_curveto);
1500  _AllocateParameters(6);
1501  _SetFourbyteParameter(0, x1);
1502  _SetFourbyteParameter(1, y1);
1503  _SetFourbyteParameter(2, x2);
1504  _SetFourbyteParameter(3, y2);
1505  _SetFourbyteParameter(4, endpt_x);
1506  _SetFourbyteParameter(5, endpt_y);
1507  }
1508 
1510  void Init_Slur(int x1, int y1, int x2, int y2, int endpt_x, int endpt_y)
1511  {
1512  _SetTag(st_slur);
1513  _AllocateParameters(6);
1514  _SetFourbyteParameter(0, x1);
1515  _SetFourbyteParameter(1, y1);
1516  _SetFourbyteParameter(2, x2);
1517  _SetFourbyteParameter(3, y2);
1518  _SetFourbyteParameter(4, endpt_x);
1519  _SetFourbyteParameter(5, endpt_y);
1520  }
1521 
1522 
1526  void Init_LineWidth(int linewidth)
1527  {
1528  _SetTag(st_linewidth);
1529  _AllocateParameters(1);
1530  _SetFourbyteParameter(0, linewidth);
1531  }
1532 
1536  void Init_SetGrey(int greyvalue)
1537  {
1538  _SetTag(st_setgray);
1539  _AllocateParameters(1);
1540  _SetFourbyteParameter(0, greyvalue);
1541  }
1542 
1545  {
1546  _SetTag(st_fillsolid);
1547  _AllocateParameters(0);
1548  }
1549 
1552  {
1553  _SetTag(st_closepath);
1554  _AllocateParameters(0);
1555  }
1556 
1562  void Init_Ellipse(int width, int height)
1563  {
1564  _SetTag(st_ellipse);
1565  _AllocateParameters(2);
1566  _SetFourbyteParameter(0, width);
1567  _SetFourbyteParameter(1, height);
1568  }
1569 
1574  void Init_Rectangle(int width, int height)
1575  {
1576  _SetTag(st_rectangle);
1577  _AllocateParameters(2);
1578  _SetFourbyteParameter(0, width);
1579  _SetFourbyteParameter(1, height);
1580  }
1581 
1585  void Init_DrawChar(eUniChar16 character)
1586  {
1587  _SetTag(st_drawchar);
1588  _AllocateParameters(1);
1589  _SetFourbyteParameter(0, character);
1590  }
1591 
1595  void Init_SetFont(FCFontInfo* pFontInfo)
1596  {
1597  _SetTag(st_setfont);
1598  _AllocateParameters(3);
1599  _SetFourbyteParameter(0, pFontInfo->GetNameByID()); /* Enigma font ID */
1600  _SetFourbyteParameter(1, pFontInfo->GetSize()); /* font size */
1601  _SetFourbyteParameter(2, pFontInfo->GetEnigmaStyles()); /* efx */
1602  }
1603 
1606  void Init_SetDash(int dashlength, int spacebetween)
1607  {
1608  _SetTag(st_setdash);
1609  _AllocateParameters(2);
1610  _SetFourbyteParameter(0, dashlength);
1611  _SetFourbyteParameter(1, spacebetween);
1612  }
1613 
1615  void Init_RLineTo(int x, int y)
1616  {
1617  _SetTag(st_rlineto);
1618  _AllocateParameters(2);
1619  _SetFourbyteParameter(0, x);
1620  _SetFourbyteParameter(1, y);
1621  }
1622 
1624  void Init_Bracket(int brackettype)
1625  {
1626  _SetTag(st_bracket);
1627  _AllocateParameters(1);
1628  _SetFourbyteParameter(0, brackettype);
1629  }
1630 
1633  {
1634  _SetTag(st_stroke);
1635  _AllocateParameters(0);
1636  }
1637 
1639  void Init_Null()
1640  {
1641  _SetTag(0);
1642  _AllocateParameters(0);
1643  }
1644 
1645 
1646 #if PDK_FRAMEWORK_DEBUG
1647  virtual void DebugDump()
1648  {
1650 
1651  DebugOutDigit("sizeof double: ", sizeof(double));
1652  DebugOutString("Tag: ", GetTagAsString());
1653 
1654  DebugOutDigit("No of parameters: ", _size);
1655  for (int i = 0; i < _size; i++)
1656  {
1657  FCString parameterstring("Parameter ");
1658  parameterstring.AppendInteger(i + 1);
1659  parameterstring.AppendCString(": ");
1660  parameterstring.AppendInteger(GetFourbyteData(i));
1661  parameterstring.AppendCString(" (");
1662  parameterstring.AppendFloat(GetFloatData(i));
1663  parameterstring.AppendCString(")");
1664  DebugOutString("", &parameterstring);
1665  }
1666  }
1667 #endif
1668 };
1669 #endif /* PDK_FRAMEWORK_SHAPES */
1670 
1671 
1672 #ifdef PDK_FRAMEWORK_SHAPES
1673 
1681 {
1682 public:
1683  virtual const char* ClassName() { return "FCShapeDefInstructions"; }
1684 
1690 
1699  {
1700  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1701  pInstruction->Init_Null();
1702  Add(pInstruction);
1703  return pInstruction;
1704  }
1705 
1723  FCPoint* pBoundRightBottom,
1724  int xtransform = 1000, int ytransform = 1000,
1725  int rotation = 0)
1726  {
1727  if (!pOrigin) return NULL;
1728  if (!pBoundLeftTop) return NULL;
1729  if (!pBoundRightBottom) return NULL;
1730  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1731 
1732  pInstruction->Init_StartObject((int) pOrigin->GetX(),
1733  (int) pOrigin->GetY(),
1734  (int) pBoundLeftTop->GetX(),
1735  (int) pBoundLeftTop->GetY(),
1736  (int) pBoundRightBottom->GetX(),
1737  (int) pBoundRightBottom->GetY(),
1738  xtransform, ytransform, rotation);
1739  Add(pInstruction);
1740  return pInstruction;
1741  }
1742 
1750  FCPoint* pBoundRightBottom,
1751  int xtransform = 1000, int ytransform = 1000,
1752  int rotation = 0)
1753  {
1754  if (!pOrigin) return NULL;
1755  if (!pBoundLeftTop) return NULL;
1756  if (!pBoundRightBottom) return NULL;
1757  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1758 
1759  pInstruction->Init_StartGroup((int) pOrigin->GetX(),
1760  (int) pOrigin->GetY(),
1761  (int) pBoundLeftTop->GetX(),
1762  (int) pBoundLeftTop->GetY(),
1763  (int) pBoundRightBottom->GetX(),
1764  (int) pBoundRightBottom->GetY(),
1765  xtransform, ytransform, rotation);
1766  Add(pInstruction);
1767  return pInstruction;
1768  }
1769 
1773  {
1774  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1775  pInstruction->Init_EndGroup();
1776  Add(pInstruction);
1777  return pInstruction;
1778  }
1779 
1789  {
1790  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1791  pInstruction->Init_LineWidth(linewidth);
1792  Add(pInstruction);
1793  return pInstruction;
1794  }
1795 
1803  {
1804  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1805  pInstruction->Init_SetGrey(percent);
1806  Add(pInstruction);
1807  return pInstruction;
1808  }
1809 
1815  {
1816  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1817  pInstruction->Init_FillSolid();
1818  Add(pInstruction);
1819  return pInstruction;
1820  }
1821 
1828  {
1829  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1830  pInstruction->Init_ClosePath();
1831  Add(pInstruction);
1832  return pInstruction;
1833  }
1834 
1842  FCShapeDefInstruction* AddEllipse(int width, int height)
1843  {
1844  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1845  pInstruction->Init_Ellipse(width, height);
1846  Add(pInstruction);
1847  return pInstruction;
1848  }
1849 
1857  FCShapeDefInstruction* AddRectangle(int width, int height)
1858  {
1859  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1860  pInstruction->Init_Rectangle(width, height);
1861  Add(pInstruction);
1862  return pInstruction;
1863  }
1864 
1878  FCShapeDefInstruction* AddCurveTo(int ctrlpt_height = 72)
1879  {
1880  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1881  pInstruction->Init_CurveTo(72, ctrlpt_height, 144, 0, 72, -ctrlpt_height);
1882  Add(pInstruction);
1883  return pInstruction;
1884  }
1885 
1910  FCShapeDefInstruction* AddCurveToDetails(int x1, int y1, int x2, int y2, int endpt_x, int endpt_y)
1911  {
1912  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1913  pInstruction->Init_CurveTo(x1, y1, x2, y2, endpt_x, endpt_y);
1914  Add(pInstruction);
1915  return pInstruction;
1916  }
1917 
1925  FCShapeDefInstruction* AddSlur(int ctrlpt_height = 72)
1926  {
1927  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1928  pInstruction->Init_Slur(72, ctrlpt_height, 144, 0, 72, -ctrlpt_height);
1929  Add(pInstruction);
1930  return pInstruction;
1931  }
1932 
1939  {
1940  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1941  pInstruction->Init_Stroke();
1942  Add(pInstruction);
1943  return pInstruction;
1944  }
1945 
1953  FCShapeDefInstruction* AddSetDash(int dashlength, int spacebetween)
1954  {
1955  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1956  pInstruction->Init_SetDash(dashlength, spacebetween);
1957  Add(pInstruction);
1958  return pInstruction;
1959  }
1960 
1969  {
1970  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1971  pInstruction->Init_RLineTo(x, y);
1972  Add(pInstruction);
1973  return pInstruction;
1974  }
1975 
1983  {
1984  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1985  pInstruction->Init_Bracket(brackettype);
1986  Add(pInstruction);
1987  return pInstruction;
1988  }
1989 
1995  {
1996  return AddSetDash(18, 0);
1997  }
1998 
2007  {
2008  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2009  pInstruction->Init_RMoveTo(x, y);
2010  Add(pInstruction);
2011  return pInstruction;
2012  }
2013 
2024  {
2025  if (!pFontInfo) return NULL;
2026  FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2027  pInstruction->Init_SetFont(pFontInfo);
2028  Add(pInstruction);
2029  return pInstruction;
2030  }
2031 
2043  FCShapeDefInstruction* AddDrawChar(eUniChar16 character);
2044 
2054  FCShapeDefInstruction* AddDrawChars(const char* pszString)
2055  {
2056  if (!pszString) return NULL;
2057  int length = (int) strlen(pszString);
2058  FCShapeDefInstruction* pReturn = NULL;
2059  for (int i = 0; i < length; i++)
2060  {
2061  pReturn = AddDrawChar(pszString[i]);
2062  }
2063  return pReturn;
2064  }
2065 
2078  {
2079  if (!pString) return NULL;
2080  int length = pString->GetLength();
2081  FCShapeDefInstruction* pReturn = NULL;
2082  for (int i = 0; i < length; i++)
2083  {
2084  pReturn = AddDrawChar(pString->GetCharacterAt(i));
2085  }
2086  return pReturn;
2087  }
2088 };
2089 #endif /* PDK_FRAMEWORK_SHAPES */
2090 
2091 #ifdef PDK_FRAMEWORK_SHAPES
2092 #define __ot_Shape_WORKAROUNDTAG MAKEEXTAG(edOther,'S','D')
2093 
2110 {
2111 public:
2115  {
2116  SHAPEDEFTYPE_UNKNOWN = -1,
2117  SHAPEDEFTYPE_OTHER = 0,
2118  SHAPEDEFTYPE_ARTICULATION = 1,
2119  SHAPEDEFTYPE_BARLINE = 2,
2120  SHAPEDEFTYPE_EXECUTABLESHAPE = 3,
2121  SHAPEDEFTYPE_EXPRESSION = 4,
2122  SHAPEDEFTYPE_NOTE = 5,
2123  SHAPEDEFTYPE_FRAME = 6,
2124  SHAPEDEFTYPE_ARROWHEAD = 7,
2125  SHAPEDEFTYPE_FRETBOARD = 8,
2126  SHAPEDEFTYPE_CLEF = 9
2127  };
2128 
2129 private:
2130 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
2131  EDTShape* _TypeCast() const { return (EDTShape*)_datablock; }
2132 #if FXT_VERSION >= FINALEVERSION_2014B
2133  EDTShape2014b* _TypeCast2014b() const { return (EDTShape2014b*)_datablock; }
2134 #endif
2135  /* _isemptyshape & _shapedeftype are used for pre2014b, to
2136  try to work around load crashes for empty shapes on Windows */
2137  bool _isemptyshape;
2138  SHAPEDEF_TYPES _shapedeftype;
2139 
2140  void _AllocateMemory(int size)
2141  {
2142  if (size == 0)
2143  {
2144  _datablock = NULL;
2145  _loadedsize = 0;
2146  return;
2147  }
2148  _datablock = new char [size];
2149  memset(_datablock, 0, size);
2150  _loadedsize = size;
2151  }
2152 
2153  bool _Is2014Format() const;
2154 
2155  bool _Is2014bFormat() const;
2156 
2161  bool _SaveType(SHAPEDEF_TYPES shapedeftype)
2162  {
2163  /* On Fin2014b, the shape type is available in the struct. */
2164  if (_Is2014bFormat()) return true;
2165 
2166  twobyte oneinci[6];
2167  EDataID dataID;
2168  dataID.other.cmper = _dataid.other.cmper;
2169  dataID.other.inci = 0;
2170  fourbyte size = sizeof(oneinci);
2171  /* Load the raw data (no special extag!) */
2172  if (!FX_LoadEData(__ot_Shape_WORKAROUNDTAG, &dataID, &oneinci, &size)) return false;
2173  oneinci[2] = (twobyte) shapedeftype;
2174  _shapedeftype = shapedeftype;
2175  return FX_SaveEData(__ot_Shape_WORKAROUNDTAG, &dataID, &oneinci, size) != 0;
2176  }
2177 
2182  bool _LoadType()
2183  {
2184  /* On Fin2014b, the shape type is available in the struct */
2185  if (_Is2014bFormat()) return true;
2186 
2187  twobyte oneinci[6];
2188  EDataID dataID;
2189  dataID.other.cmper = _dataid.other.cmper;
2190  dataID.other.inci = 0;
2191  fourbyte size = sizeof(oneinci);
2192  /* Load the raw data (no special extag!) */
2193  if (!FX_LoadEData(__ot_Shape_WORKAROUNDTAG, &dataID, &oneinci, &size)) return false;
2194  _shapedeftype = (SHAPEDEF_TYPES) oneinci[2];
2195  return true;
2196  }
2197 
2198 protected:
2201  virtual EXTAG Tag() { return GetCustomTag() ? GetCustomTag() : ot_Shape; }
2202 
2203  virtual EVERSION EnigmaVersion();
2204 
2205  virtual void CloneMemoryFrom(__FCBaseData* pSource)
2206  {
2207  /* Copy the heap: */
2209  /* Copy the empty shape state */
2210  _isemptyshape = ((FCShapeDef*) pSource)->_GetIsEmptyShape();
2211  }
2212 
2213  virtual int DataSizeLoad()
2214  {
2215  fourbyte size;
2216  if (!FX_LoadEData(Tag(), &_dataid, NULL, &size, EnigmaVersion())) return 0;
2217 
2218  if (!_Is2014bFormat())
2219  {
2220  /* Attempt to workaround for empty shape crashes on earlier Finale versions. */
2221  SetCustomTag((size == sizeof(EDTShape)) ? __ot_Shape_WORKAROUNDTAG : ot_Shape);
2222  }
2223  return size;
2224  }
2225 
2226  virtual void* Allocate()
2227  {
2228  _AllocateMemory(DataSizeLoad());
2229  return _datablock;
2230  }
2231 
2232  virtual void Deallocate()
2233  {
2234  if (_datablock) delete [] (char*) _datablock;
2235  _datablock = NULL;
2236  _loadedsize = 0;
2237  }
2238 
2239  virtual bool IsDynamicSize() { return true; }
2240 
2241  virtual __FCBaseData* CreateObject() { return new FCShapeDef(); }
2242 
2247  EDTPathInst* _GetPathInstructionArray()
2248  {
2249  if (_isemptyshape) return NULL;
2250  if (_Is2014bFormat())
2251  {
2252 #if FXT_VERSION >= FINALEVERSION_2014B
2253  return (EDTPathInst*) ((char *)_datablock + _TypeCast2014b()->instrucOff);
2254 #endif
2255  }
2256  else
2257  {
2258  return (EDTPathInst*) ((char *)_datablock + _TypeCast()->instrucOff);
2259  }
2260  return NULL;
2261  }
2262 
2268  void* _GetPathDataArray()
2269  {
2270  if (_isemptyshape) return NULL;
2271  if (_Is2014bFormat())
2272  {
2273 #if FXT_VERSION >= FINALEVERSION_2014B
2274  return (void*) ((char *)_datablock + _TypeCast2014b()->dataOff);
2275 #endif
2276  }
2277  else
2278  {
2279  return (void*) ((char *)_datablock + _TypeCast()->dataOff);
2280  }
2281  return NULL;
2282  }
2283 
2293  bool _EmptyShapeCheck(CMPER cmper, bool* pIsEmpty)
2294  {
2295 #ifdef PDK_FRAMEWORK_DIAGNOSE
2296  if (_Is2014bFormat())
2297  {
2298  DebugOut("FCShapeDef::_EmptyShapeCheck was called on 2014b struct.");
2299  return false;
2300  }
2301 #endif
2302 
2303  *pIsEmpty = true;
2304  //twobyte shapetestinci[6];
2305  EDTShape shapetest;
2306  memset(&shapetest, 0, sizeof(shapetest));
2307  EDataID dataID;
2308  dataID.other.cmper = cmper;
2309  dataID.other.inci = 0;
2310  fourbyte size = sizeof(shapetest);
2311  /* Load the raw data (no special extag) */
2312  bool result = FX_LoadEData(__ot_Shape_WORKAROUNDTAG,
2313  &dataID, &shapetest, &size, EnigmaVersion()) != 0;
2314  if (!result) return false;
2315  int loopcount = size / sizeof(twobyte);
2316  twobyte* pNonZeroCheck = (twobyte*) &shapetest;
2317  for (int i = 0; i < loopcount; i++)
2318  {
2319  if (pNonZeroCheck[i])
2320  {
2321  if (i == 1) continue; /* On the 1st twobyte (0-based), there might
2322  be data even for empty shapes!!! */
2323  if (i == 2) continue; /* On the 2nd twobyte (0-based), there might
2324  be data even for empty shapes!!! */
2325  *pIsEmpty = false;
2326  return true;
2327  }
2328  }
2329  return true;
2330  }
2331 
2332 
2339  void* _GetInstructionDataPointer(int index);
2340 
2341 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
2342 public:
2343  virtual const char* ClassName() { return "FCShapeDef"; }
2344  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_SHAPEDEF; }
2345 
2348  {
2349  _isemptyshape = true;
2350  _shapedeftype = SHAPEDEFTYPE_UNKNOWN;
2351  }
2352 
2353  /* Virtual destructor */
2354  virtual ~FCShapeDef()
2355  {
2356  Deallocate();
2357  }
2358 
2362  bool _GetIsEmptyShape() { return _isemptyshape; }
2363 
2367  {
2368  if (_Is2014bFormat()) return false;
2369 
2370  EDataID dataID;
2371  twobyte buffer[6];
2372  dataID.other.cmper = GetItemNo();
2373  dataID.other.inci = 0;
2374  fourbyte size = sizeof(buffer);
2375  memset(buffer, 0, sizeof(buffer));
2376  if (!FX_LoadEData(__ot_Shape_WORKAROUNDTAG, &dataID, buffer, &size, FINALEVERSION_2010)) return false;
2377  return ((buffer[2] & 0x0008) != 0);
2378  }
2379 
2381  virtual bool LoadFirst()
2382  {
2383  return Load(1);
2384  }
2385 
2386  virtual bool DeleteData()
2387  {
2388  if (CalcProtected()) return false;
2389  return __FCNoInciOther::DeleteData();
2390  }
2391 
2393  virtual bool LoadNext()
2394  {
2395  return Load(GetItemNo() + 1);
2396  }
2397 
2401  virtual bool Load(CMPER itemno)
2402  {
2403  bool isemptyshape;
2404 
2405  bool result = false;
2406  if (_Is2014bFormat())
2407  {
2408  /* Normal load */
2409  result = __FCNoInciOther::Load(itemno);
2410  if (result)
2411  {
2412 #if FXT_VERSION >= FINALEVERSION_2014B
2413  _shapedeftype = (SHAPEDEF_TYPES) _TypeCast2014b()->shapeType;
2414  /* _isemptyshape shouldn't actively be used on 2014b+ */
2415  _isemptyshape = (_TypeCast2014b()->instrucLen == 0);
2416 #endif
2417  }
2418  else
2419  {
2420  _shapedeftype = SHAPEDEFTYPE_UNKNOWN;
2421  _isemptyshape = true;
2422  }
2423  }
2424  else
2425  {
2426  /* On pre2014b, try to work around the empty shape crash bug */
2427  if (!_EmptyShapeCheck(itemno, &isemptyshape)) return false;
2428  SetCustomTag(isemptyshape ? __ot_Shape_WORKAROUNDTAG : ot_Shape);
2429  _isemptyshape = isemptyshape;
2430  result = __FCNoInciOther::Load(itemno);
2431  if (result)
2432  _LoadType();
2433  else
2434  _shapedeftype = SHAPEDEFTYPE_UNKNOWN;
2435  }
2436  return result;
2437  }
2438 
2452 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
2454 #else
2455  int
2456 #endif
2457  GetType() const {
2458  if (!DataIsLoaded()) return SHAPEDEFTYPE_UNKNOWN;
2459  if (_Is2014bFormat())
2460  {
2461 #if FXT_VERSION >= FINALEVERSION_2014B
2462  return (FCShapeDef::SHAPEDEF_TYPES) _TypeCast2014b()->shapeType;
2463 #endif
2464  }
2465  return _shapedeftype;
2466  }
2467 
2478 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
2480 #else
2481  int
2482 #endif
2483  shapedeftype
2484  )
2485  {
2486  if (_Is2014bFormat())
2487  {
2488  /* On Finale 2014b, the shape type is in the struct */
2489 #if FXT_VERSION >= FINALEVERSION_2014B
2490  _TypeCast2014b()->shapeType = shapedeftype;
2491 #endif
2492  }
2493  if (!SaveNew()) return false;
2494  if (!_Is2014bFormat())
2495  {
2496  if (!_SaveType((SHAPEDEF_TYPES) shapedeftype)) return false;
2497  }
2498  return true;
2499  }
2500 
2513 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
2515 #else
2516  twobyte
2517 #endif
2518  shapedeftype)
2519  {
2520  if (_Is2014bFormat())
2521  {
2522  /* In Finale 2014b, the shape type is in the struct */
2523 #if FXT_VERSION >= FINALEVERSION_2014B
2524  _TypeCast2014b()->shapeType = shapedeftype;
2525 #endif
2526  }
2527  if (!Save()) return false; /* Aug 05, 2017: This was SaveNew(), seems very wrong? */
2528  if (!_Is2014bFormat())
2529  {
2530  if (!_SaveType((SHAPEDEF_TYPES) shapedeftype)) return false;
2531  }
2532  return true;
2533  }
2534 
2535 
2540  fourbyte GetDataCount() const
2541  {
2542  if (_Is2014bFormat())
2543  {
2544 #if FXT_VERSION >= FINALEVERSION_2014B
2545  return _isemptyshape ? 0 : _TypeCast2014b()->dataLen;
2546 #endif
2547  }
2548  else
2549  {
2550  return _isemptyshape ? 0 : _TypeCast()->dataLen;
2551  }
2552  return 0;
2553  }
2554 
2562  fourbyte GetInstructionsCount() const
2563  {
2564  int returnval = 0;
2565  if (_Is2014bFormat())
2566  {
2567 #if FXT_VERSION >= FINALEVERSION_2014B
2568  /* On 2014b+, _isemptyshape shouldn't be used. */
2569  returnval = _TypeCast2014b()->instrucLen;
2570 #endif
2571  }
2572  else
2573  {
2574  returnval = _isemptyshape ? 0 : _TypeCast()->instrucLen;
2575  /* Have some range check, since empty shapes can have
2576  very strange values on earlier Finale versions. */
2577  if ((returnval > 300) || (returnval < 0)) return -1;
2578  }
2579  return returnval;
2580  }
2581 
2590  ETAG GetInstructionTag(int index)
2591  {
2592  if (index < 0) return 0;
2593  if (index >= GetInstructionsCount()) return 0;
2594  EDTPathInst* pPathArray = _GetPathInstructionArray();
2595  return pPathArray[index].tag;
2596  }
2597 
2600  int GetInstructionSize(int index)
2601  {
2602  if (index < 0) return -1;
2603  if (index >= GetInstructionsCount()) return -1;
2604  EDTPathInst* pPathArray = _GetPathInstructionArray();
2605  return pPathArray[index].numdata;
2606  }
2607 
2619 
2620 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
2621 
2622  FCShapeDefInstructions* CreateInstructions_GC();
2623 #endif
2624 
2639 
2640 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
2641 
2642  FCStrings* CreateTextStrings_GC();
2643 #endif
2644 
2645 
2654  bool RebuildInstructions(FCShapeDefInstructions* pCollection);
2655 
2663  bool GetFontInfo(int index, FCFontInfo* pFontInfo);
2664 
2672  bool SetFontInfo(int index, FCFontInfo* pFontInfo);
2673 
2689  bool ExportAsSVGFile(FCString* pFileName, float scaling, const char* pszUnit);
2690 
2691 #ifdef PDK_FRAMEWORK_DEBUG
2692  virtual void DebugDump()
2693  {
2695  DebugOutDigit("Data size: ", (int) _loadedsize);
2696  DebugOutDigit("Instruction count: ", GetInstructionsCount());
2697  DebugOutDigit("Data count: ", GetDataCount());
2698  DebugOutDigit("sizeof EDTShape: ", sizeof(EDTShape));
2699  DebugOutDigit("sizeof EDTPathInst: ", sizeof(EDTPathInst));
2700  DebugOutDigit("sizeof EDTPathData2002: ", sizeof(EDTPathData2002));
2701 
2702 
2703  //FCShapeDefInstructions* pInstructions = CreateInstructions();
2704  //pInstructions->DebugDump();
2705  //delete pInstructions;
2706 
2707 /* DebugOutDigit("Instruction count: ", GetInstructionsCount());
2708  for (int i = 0; i < GetInstructionsCount(); i++)
2709  {
2710  DebugOutDigit("Instruction: ", i);
2711  if (GetInstructionTag(i) == 0)
2712  {
2713  DebugOut("Tag: st_null");
2714  }
2715  else
2716  {
2717  FCString firstchar, secondchar;
2718  firstchar.Append((GetInstructionTag(i) & 0xff00) / 0x100);
2719  secondchar.Append((GetInstructionTag(i) & 0x00ff));
2720  FCString resultstring;
2721  resultstring.Append(&firstchar);
2722  resultstring.Append(", ");
2723  resultstring.Append(&secondchar);
2724  DebugOutString("Tag: ", &resultstring);
2725  }
2726  } */
2727  }
2728 
2730  void InstructionDebugDump(int instructionindex);
2731 
2732 #endif /* PDK_FRAMEWORK_DEBUG */
2733 };
2734 #endif /* PDK_FRAMEWORK_SHAPES */
2735 
2736 
2737 
2744 {
2745 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
2746 
2747  EDTEnclosure _enclosuredataold; /* For loaded enclosures - DO
2748  * NOT REFERENCE this directly in the code!!!! */
2749 
2750  FIN25_4_CODE(EDTEnclosure25_4 _enclosuredata25_4;) /* For loaded enclosures - DO
2751  * NOT REFERENCE this directly in the code!!!!
2752  * Note that this data use a different EXTAG
2753  * than the old data */
2754 
2755  EDTEnclosure* _pEnclosureOld; /* Assigned pointer, pre 25.4 */
2756  FIN25_4_CODE(EDTEnclosure25_4* _pEnclosure25_4;) /* Assigned pointer, Finale 25.4 */
2757 
2758 
2759  /* Returns true if the 25.4 version of the struct should be used. */
2760  bool Use25_4Version() const;
2761 
2762  /* Returns a pointer to the flag member of the struct */
2763  const FLAG_16* _GetFlagPtr() const
2764  {
2765  FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->flag; )
2766  return &_pEnclosureOld->flag;
2767  }
2768 
2769  /* Returns a pointer to the lineWidth member of the struct */
2770  const EVPUFixedShort* _GetLineWidthPtr() const
2771  {
2772  FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->lineWidth; )
2773  return &_pEnclosureOld->lineWidth;
2774  }
2775 
2776  /* Returns a pointer to the xAdd member of the struct */
2777  const Evpu16* _GetXAddPtr() const
2778  {
2779  FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->xAdd; )
2780  return &_pEnclosureOld->xAdd;
2781  }
2782 
2783  /* Returns a pointer to the yAdd member of the struct */
2784  const Evpu16* _GetYAddPtr() const
2785  {
2786  FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->yAdd; )
2787  return &_pEnclosureOld->yAdd;
2788  }
2789 
2790  /* Returns a pointer to the xMargin member of the struct */
2791  const Evpu16* _GetXMarginPtr() const
2792  {
2793  FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->xMargin; )
2794  return &_pEnclosureOld->xMargin;
2795  }
2796 
2797  /* Returns a pointer to the yMargin member of the struct */
2798  const Evpu16* _GetYMarginPtr() const
2799  {
2800  FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->yMargin; )
2801  return &_pEnclosureOld->yMargin;
2802  }
2803 
2804 protected:
2805  virtual EXTAG Tag()
2806  {
2807  if (GetCustomTag()) return GetCustomTag();
2808  FIN25_4_CODE( if (Use25_4Version()) return ot_TextExpEnclosure25_4; )
2809  return ot_TextExpEnclosure;
2810  }
2811  virtual int DataSizeLoad()
2812  {
2813  FIN25_4_CODE( if (Use25_4Version()) return sizeof(EDTEnclosure25_4); )
2814  return sizeof(EDTEnclosure);
2815  }
2816 
2817  /* Returns a pointer either to the 25.4 or the old enclosure struct */
2818  virtual void* Allocate()
2819  {
2820  FIN25_4_CODE( if (Use25_4Version()) return (void*) _pEnclosure25_4; )
2821  return (void*) _pEnclosureOld;
2822  }
2823 
2828  virtual void CloneMemoryFrom(__FCBaseData* pSource)
2829  {
2830  void* pData = _GetEnclosure();
2831  int size = DataSizeLoad();
2832  memcpy(pData, ((FCEnclosure*)pSource)->_GetEnclosure(), size);
2833  _datablock = pData;
2834  _loadedsize = size;
2835  }
2836 
2837  virtual __FCBaseData* CreateObject() { return new FCEnclosure(); }
2838 
2839 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
2840 public:
2841  virtual const char* ClassName() { return "FCEnclosure"; }
2842  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_ENCLOSURE; }
2843 
2844 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
2845 
2853  void* _GetEnclosure() const {
2854  FIN25_4_CODE( if (Use25_4Version()) return (void*) _pEnclosure25_4; )
2855  return (void*) _pEnclosureOld;
2856  }
2857 
2858 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
2859 
2862  {
2865 
2868 
2871 
2874 
2877 
2880 
2883 
2886 
2889  };
2890 
2893  {
2896 
2899 
2902  };
2903 
2909  {
2910  if (Use25_4Version())
2911  {
2912  FIN25_4_CODE( _pEnclosure25_4 = &_enclosuredata25_4; )
2913  }
2914  else
2915  {
2916  _pEnclosureOld = &_enclosuredataold;
2917  }
2918 
2919  }
2920 
2924  void _AssignEDTEnclosure(void* pPointer)
2925  {
2926  if (Use25_4Version())
2927  {
2928  FIN25_4_CODE( _pEnclosure25_4 = (EDTEnclosure25_4*) pPointer; )
2929  }
2930  else
2931  {
2932  _pEnclosureOld = (EDTEnclosure*) pPointer;
2933  }
2934  }
2935 
2942  void SetShape(
2943 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
2945 #else
2946  int
2947 #endif
2948  shape)
2949  {
2950  if (!_GetEnclosure()) return;
2951  if (shape < 0) return;
2952  if (shape > 15) return;
2953  *(FLAG_16*)_GetFlagPtr() &= ~NEWSIDES;
2954  *(FLAG_16*)_GetFlagPtr() |= shape;
2955  }
2956 
2957 
2963  void SetLineWidth(int width)
2964  {
2965  if (!_GetEnclosure()) return;
2966  *(Evpu16*)_GetLineWidthPtr() = width;
2967  }
2968 
2973  void SetHorizontalOffset(int offset)
2974  {
2975  if (!_GetEnclosure()) return;
2976  *(Evpu16*)_GetXAddPtr() = offset;
2977  }
2978 
2983  void SetVerticalOffset(int offset)
2984  {
2985  if (!_GetEnclosure()) return;
2986  *(Evpu16*)_GetYAddPtr() = offset;
2987  }
2988 
2994  void SetHorizontalMargin(int margin)
2995  {
2996  if (!_GetEnclosure()) return;
2997  *(Evpu16*)_GetXMarginPtr() = margin;
2998  }
2999 
3005  void SetVerticalMargin(int margin)
3006  {
3007  if (!_GetEnclosure()) return;
3008  *(Evpu16*)_GetYMarginPtr() = margin;
3009  }
3010 
3015  void SetFixedSize(bool state)
3016  {
3017  if (!_GetEnclosure()) return;
3018  Set16BitFlag((FLAG_16*)_GetFlagPtr(), FIXED_SIZE, state);
3019  }
3020 
3025  void SetOpaque(bool state)
3026  {
3027  if (!_GetEnclosure()) return;
3028  Set16BitFlag((FLAG_16*)_GetFlagPtr(), ENCL_OPAQUE, state);
3029  }
3030 
3038  void SetRoundedCorners(bool state)
3039  {
3040  FIN25_4_CODE( if (Use25_4Version()) Set16BitFlag((FLAG_16*)_GetFlagPtr(), 0x0400 /* ROUND_CORNERS */, state); )
3041  }
3042 
3050  void SetRoundedCornerRadius(Efix32 radius)
3051  {
3052  FIN25_4_CODE( if (Use25_4Version()) _pEnclosure25_4->m_cornerRadius = radius; )
3053  }
3054 
3059  void SetMode(
3060 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
3062 #else
3063  int
3064 #endif
3065  enclosuremode)
3066  {
3067  switch (enclosuremode)
3068  {
3069  case ENCLOSUREMODE_NONE:
3070  Set16BitFlag((FLAG_16*)_GetFlagPtr(), NOT_TALL, false);
3071  Set16BitFlag((FLAG_16*)_GetFlagPtr(), EQUAL_ASPECT, false);
3072  break;
3074  Set16BitFlag((FLAG_16*)_GetFlagPtr(), NOT_TALL, true);
3075  Set16BitFlag((FLAG_16*)_GetFlagPtr(), EQUAL_ASPECT, false);
3076  break;
3078  Set16BitFlag((FLAG_16*)_GetFlagPtr(), NOT_TALL, false);
3079  Set16BitFlag((FLAG_16*)_GetFlagPtr(), EQUAL_ASPECT, true);
3080  break;
3081  }
3082  }
3083 
3084 
3091 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
3093 #else
3094  int
3095 #endif
3096  GetShape() const
3097  {
3098  if (!_GetEnclosure()) return ENCLOSURE_NONE;
3099  return (ENCLOSURESHAPE ) (*_GetFlagPtr() & NEWSIDES);
3100  }
3101 
3107  int GetLineWidth() const
3108  {
3109  if (!_GetEnclosure()) return 0;
3110  return *_GetLineWidthPtr();
3111  }
3112 
3118  {
3119  if (!_GetEnclosure()) return 0;
3120  return *_GetXAddPtr();
3121  }
3122 
3127  int GetVerticalOffset() const
3128  {
3129  if (!_GetEnclosure()) return 0;
3130  return *_GetYAddPtr();
3131  }
3132 
3139  {
3140  if (!_GetEnclosure()) return 0;
3141  return *_GetXMarginPtr();
3142  }
3143 
3149  int GetVerticalMargin() const
3150  {
3151  if (!_GetEnclosure()) return 0;
3152  return *_GetYMarginPtr();
3153  }
3154 
3159  bool GetFixedSize() const
3160  {
3161  if (!_GetEnclosure()) return false;
3162  return GetBitFlag(*_GetFlagPtr(), FIXED_SIZE);
3163  }
3164 
3169  bool GetOpaque() const
3170  {
3171  if (!_GetEnclosure()) return false;
3172  return GetBitFlag(*_GetFlagPtr(), ENCL_OPAQUE);
3173  }
3174 
3183  bool GetRoundedCorners() const
3184  {
3185  FIN25_4_CODE( if (Use25_4Version()) return GetBitFlag(*_GetFlagPtr(), 0x0400 /* ROUND_CORNERS */); )
3186  return false;
3187  }
3188 
3196  Efix32 GetRoundedCornerRadius() const
3197  {
3198  FIN25_4_CODE( if (Use25_4Version()) return _pEnclosure25_4->m_cornerRadius; )
3199  return 0;
3200  }
3201 
3206 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
3208 #else
3209  int
3210 #endif
3211  GetMode() const
3212  {
3213  if (!_GetEnclosure()) return ENCLOSUREMODE_NONE;
3214  if (GetBitFlag(*_GetFlagPtr(), NOT_TALL)) return ENCLOSUREMODE_MINWIDTH;
3215  if (GetBitFlag(*_GetFlagPtr(), EQUAL_ASPECT)) return ENCLOSUREMODE_MATCHDIMENSIONS;
3216  return ENCLOSUREMODE_NONE;
3217  }
3218 
3219 #ifdef PDK_FRAMEWORK_DEBUG
3220  virtual void DebugDump()
3221  {
3223  }
3224 #endif
3225 
3226 };
3227 
3228 
3229 #ifdef PDK_FRAMEWORK_LAYOUT
3230 
3240 class FCPage : public __FCNoInciOther
3241 {
3242 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3243  private:
3245  EDTPageSpec pagespec;
3246 protected:
3247  virtual EXTAG Tag() { return ot_EDTPageSpec; }
3248  virtual int DataSizeLoad() { return sizeof(EDTPageSpec); }
3249  virtual void* Allocate() { return (void*) &pagespec; }
3250 
3255  virtual void CloneMemoryFrom(__FCBaseData* pSource)
3256  {
3257  memcpy(&pagespec, ((FCPage*)pSource)->_GetPageSpec(), sizeof(pagespec));
3258  _datablock = &pagespec;
3259  _loadedsize = sizeof(pagespec);
3260  }
3261 
3262  virtual __FCBaseData* CreateObject() { return new FCPage(); }
3263 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
3264 public:
3265  virtual const char* ClassName() { return "FCPage"; }
3266  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_PAGE; }
3267 
3268 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3269 
3275  void* _GetPageSpec() { return &pagespec; }
3276 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
3277 
3284 
3292  eSsys GetFirstSystem();
3293 
3298  void SetFirstSystem(eSsys firstsysno);
3299 
3308  void UpdateLayout(bool bUnfreezeMeasures = false);
3309 
3316  bool IsPortrait()
3317  {
3318  return (GetHeight() > GetWidth());
3319  }
3320 
3327  Evpu32 GetWidth() const { return pagespec.width; }
3328 
3335  Evpu32 GetHeight() const { return pagespec.height; }
3336 
3343  Evpu16 GetLeftMargin() const { return pagespec.margLeft; }
3344 
3351  Evpu16 GetRightMargin() const { return -pagespec.margRight; }
3352 
3359  Evpu16 GetTopMargin() const { return -pagespec.margTop; }
3360 
3367  Evpu16 GetBottomMargin() const { return pagespec.margBottom; }
3368 
3378  twobyte GetPercent() const { return pagespec.percent; }
3379 
3392  bool GetHoldMargins() const { return GetBitFlag(pagespec.pageflag, PAGESPEC_MARGSCOPING); }
3393 
3394  /***********/
3395  /* SETTERS */
3396  /***********/
3397 
3404  void SetWidth(Evpu32 width) { pagespec.width = width; }
3405 
3412  void SetHeight(Evpu32 height) { pagespec.height = height; }
3413 
3420  void SetLeftMargin(Evpu16 margin) { pagespec.margLeft = margin; }
3421 
3428  void SetRightMargin(Evpu16 margin) { pagespec.margRight = -margin; }
3429 
3436  void SetTopMargin(Evpu16 margin) { pagespec.margTop = -margin; }
3437 
3444  void SetBottomMargin(Evpu16 margin) { pagespec.margBottom = margin; }
3445 
3455  void SetPercent(twobyte percent) { pagespec.percent = percent; }
3456 
3469  void SetHoldMargins(bool state) { Set16BitFlag(&pagespec.pageflag, PAGESPEC_MARGSCOPING, state); }
3470 
3481  eSsys CalcLastSystem();
3482 
3492  eMeas CalcFirstMeasure();
3493 
3503  eMeas CalcLastMeasure();
3504 
3518  int CalcInteriorHeight(bool resize);
3519 
3520 #ifdef PDK_FRAMEWORK_DEBUG
3521  virtual void DebugDump()
3522  {
3524  DebugOutDigit("First system: ", GetFirstSystem());
3525  DebugOutDigit("Last system: ", CalcLastSystem());
3526  }
3527 #endif
3528 };
3529 #endif // PDK_FRAMEWORK_LAYOUT
3530 
3531 
3532 #ifdef PDK_FRAMEWORK_LAYOUT
3533 
3534 #ifdef PDK_FRAMEWORK_DEBUG
3535 #include <stddef.h> /* Needed for the FCStaffSystem constructor in debug mode. */
3536 #endif
3537 
3538 class FCSystemStaves;
3539 class FCFreezeSystem;
3540 class FCMusicRegion;
3549 {
3550 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3551  private:
3553  EDTStaffSystemSpec2005 _staffsystem;
3554 protected:
3555  virtual EXTAG Tag() { return ot_EDTStaffSystemSpec; }
3556  virtual int DataSizeLoad() { return sizeof(EDTStaffSystemSpec2005); }
3557  virtual void* Allocate() { return (void*) &_staffsystem; }
3558 
3563  virtual void CloneMemoryFrom(__FCBaseData* pSource)
3564  {
3565  memcpy(&_staffsystem, ((FCStaffSystem*)pSource)->_GetStaffSystemSpec(), sizeof(_staffsystem));
3566  _datablock = &_staffsystem;
3567  _loadedsize = sizeof(_staffsystem);
3568  }
3569 
3570 
3571  virtual __FCBaseData* CreateObject() { return new FCStaffSystem(); }
3572 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
3573 public:
3574  virtual const char* ClassName() { return "FCStaffSystem"; }
3575  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_STAFFSYSTEM; }
3576 
3577 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3578 
3584  void* _GetStaffSystemSpec() { return &_staffsystem; }
3585 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
3586 
3592  {
3593 #ifdef PDK_FRAMEWORK_DEBUG
3594  /* This should normally be used with PDK_FRAMEWORK_DIAGNOSE, but since
3595  * it's so important that this is correct, place it on the
3596  * PDK_FRAMEWORK_DEBUG level!
3597  * */
3598  if ((offsetof(EDTStaffSystemSpec2005, horzPercent) - offsetof(EDTStaffSystemSpec2005, mend)) != 2)
3599  {
3600  DebugOut("ERROR: Packed struct alignment isn't set up correctly in the compiler options! Use "
3601  "-fpack-struct=1 for GCC.");
3602  }
3603 #endif
3604  }
3605 
3606 
3615  void SetFirstMeasure(eMeas measure)
3616  { ((EDTStaffSystemSpec2005*) _datablock)->mestart = measure; }
3617 
3626  void SetNextSysMeasure(eMeas measure)
3627  { ((EDTStaffSystemSpec2005*) _datablock)->mend = measure; }
3628 
3629 
3634  void SetSpaceBeforeMusic(twobyte space)
3635  { ((EDTStaffSystemSpec2005*) _datablock)->extraStartSystemSpace = space; }
3636 
3642  void SetSpaceAfterMusic(twobyte space)
3643  { ((EDTStaffSystemSpec2005*) _datablock)->extraEndSystemSpace = space; }
3644 
3650  void SetSpaceAbove(twobyte space)
3651  { ((EDTStaffSystemSpec2005*) _datablock)->betweensystems = -space; }
3652 
3661  void SetTopMargin(Evpu16 margin)
3662  { ((EDTStaffSystemSpec2005*) _datablock)->top = -margin; }
3663 
3674  void SetBottomMargin(Evpu16 margin)
3675  { ((EDTStaffSystemSpec2005*) _datablock)->bottom = -margin; }
3676 
3684  void SetLeftMargin(Evpu16 margin)
3685  { ((EDTStaffSystemSpec2005*) _datablock)->left = margin; }
3686 
3693  void SetRightMargin(Evpu16 margin)
3694  { ((EDTStaffSystemSpec2005*) _datablock)->right = margin; }
3695 
3700  void SetResize(twobyte value)
3701  {
3702  _staffsystem.ssysPercent = value;
3703  }
3704 
3717  void SetStaffHeight(twobyte value)
3718  { _staffsystem.staffHeight = value; }
3719 
3725  void SetResizeVerticalSpace(bool value)
3726  {
3727  Set16BitFlag(&_staffsystem.staveflag, SSPEC_RESIZE_VERT, value);
3728  }
3729 
3737  void SetUseStaffResize(bool state)
3738  {
3739  Set16BitFlag(&_staffsystem.staveflag, SSPEC_LINEPERC, state);
3740  }
3741 
3746  void SetHoldMargins(bool state)
3747  {
3748  Set16BitFlag(&_staffsystem.staveflag, SSPEC_HOLD_MARGINS, state);
3749  }
3750 
3757  eMeas GetFirstMeasure() const
3758  { return ((EDTStaffSystemSpec2005*) _datablock)->mestart; }
3759 
3764  eMeas GetNextSysMeasure() const
3765  { return ((EDTStaffSystemSpec2005*) _datablock)->mend; }
3766 
3771  twobyte GetSpaceBeforeMusic() const
3772  { return ((EDTStaffSystemSpec2005*) _datablock)->extraStartSystemSpace; }
3773 
3779  twobyte GetSpaceAfterMusic() const
3780  { return ((EDTStaffSystemSpec2005*) _datablock)->extraEndSystemSpace; }
3781 
3788  twobyte GetSpaceAbove() const
3789  { return -((EDTStaffSystemSpec2005*) _datablock)->betweensystems; }
3790 
3796  Evpu16 GetTopMargin() const
3797  { return -((EDTStaffSystemSpec2005*) _datablock)->top; }
3798 
3803  Evpu16 GetBottomMargin() const
3804  { return -((EDTStaffSystemSpec2005*) _datablock)->bottom; }
3805 
3813  Evpu16 GetLeftMargin() const
3814  { return ((EDTStaffSystemSpec2005*) _datablock)->left; }
3815 
3821  Evpu16 GetRightMargin() const
3822  { return ((EDTStaffSystemSpec2005*) _datablock)->right; }
3823 
3832  twobyte GetStaffHeight() const
3833  { return ((EDTStaffSystemSpec2005*) _datablock)->staffHeight; }
3834 
3839  twobyte GetResize() const
3840  { return ((EDTStaffSystemSpec2005*) _datablock)->ssysPercent; }
3841 
3848  { return GetBitFlag(((EDTStaffSystemSpec2005*) _datablock)->staveflag, SSPEC_RESIZE_VERT); }
3849 
3857  bool GetUseStaffResize() const
3858  {
3859  return GetBitFlag(_staffsystem.staveflag, SSPEC_LINEPERC);
3860  }
3861 
3866  bool GetHoldMargins() const
3867  {
3868  return GetBitFlag(_staffsystem.staveflag, SSPEC_HOLD_MARGINS);
3869  }
3870 
3877  twobyte GetTopStaff() const;
3878 
3886  Int100 GetHorizontalStretch() const
3887  {
3888  return _staffsystem.horzPercent;
3889  }
3890 
3896  bool HasPageBreak();
3897 
3902  eStaff CalcTopStaff();
3903 
3908  eStaff CalcBottomStaff();
3909 
3916  int CalcStavesSpan();
3917 
3928  int CalcHeight(bool verticalresize);
3929 
3941  int CalcWhiteSpaceBottom(bool verticalresize);
3942 
3951  bool IsOptimized() const;
3952 
3961  bool ContainsMeasure(eMeas measurenumber)
3962  {
3963  if (measurenumber < GetFirstMeasure()) return false;
3964  if (measurenumber >= GetNextSysMeasure()) return false;
3965  return true;
3966  }
3967 
3980  FCSystemStaves* CreateSystemStaves();
3981 
3982 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
3983 
3984  FCSystemStaves* CreateSystemStaves_GC();
3985 #endif
3986 
4002  FCFreezeSystem* CreateFreezeSystem(bool force_create = true);
4003 
4004 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
4005 
4006  FCFreezeSystem* CreateFreezeSystem_GC(bool force_create);
4007 #endif
4008 
4020  bool CalcRegion(FCMusicRegion* pRegion);
4021 
4022 #ifdef PDK_FRAMEWORK_DEBUG
4023  virtual void DebugDump()
4024  {
4026  DebugOutDigit("First measure: ", GetFirstMeasure());
4027  DebugOutDigit("Next System Measure: ", GetNextSysMeasure());
4028  DebugOutDigit("Space Above: ", GetSpaceAbove());
4029  DebugOutDigit("Top Margin: ", GetTopMargin());
4030  DebugOutDigit("Bottom Margin: ", GetBottomMargin());
4031  DebugOutDigit("Staff Height: ", GetStaffHeight());
4032  DebugOutDigit("Resize (percent): ", GetResize());
4033  }
4034 #endif
4035 };
4036 #endif // PDK_FRAMEWORK_LAYOUT
4037 
4038 
4039 class FCBeatChartElements;
4040 class FCExpressions;
4041 class FCTempoElements;
4042 
4043 class FCTimeSignature;
4044 
4053 {
4054 private:
4055 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
4056 
4060  mutable FCKeySignature* _pKeySig;
4061 
4066  mutable FCTimeSignature* _pTimeSig;
4067 
4072  mutable FCTimeSignature* _pTimeSigDisplay;
4073 
4075  EVERSION _VersionToUse() const;
4076 
4080  EDTMeasureSpec2005 _measurespec2005;
4081 
4082 #if FXT_VERSION >= FINALEVERSION_2014
4083  EDTMeasureSpec2014 _measurespec2014;
4084 #endif
4085 
4089  FLAG_16* _GetMeFlagPtr() const;
4090 
4094  FLAG_16* _GetNewFlagPtr() const;
4095 
4099  FLAG_16* _GetAuxFlagPtr() const;
4100 
4104  void _SetMeFlag(FLAG_16 mask, bool state);
4105 
4109  bool _GetMeFlag(FLAG_16 mask) const
4110  {
4111  return GetBitFlag(*_GetMeFlagPtr(), mask);
4112  }
4113 
4117  void _SetNewFlag(FLAG_16 mask, bool state);
4118 
4122  bool _GetNewFlag(FLAG_16 mask) const { return GetBitFlag(*_GetNewFlagPtr(), mask); }
4123 
4127  void _SetAuxFlag(FLAG_16 mask, bool state);
4128 
4132  bool _GetAuxFlag(FLAG_16 mask) const { return GetBitFlag(*_GetAuxFlagPtr(), mask); }
4133 
4134 protected:
4135  virtual EVERSION EnigmaVersion()
4136  {
4137  return _VersionToUse();
4138  }
4139  virtual EXTAG Tag() { return ot_MeasureSpec; }
4140  virtual int DataSizeLoad() {
4141 #if FXT_VERSION >= FINALEVERSION_2014
4142  if (_VersionToUse() == FINALEVERSION_2014) return sizeof(EDTMeasureSpec2014);
4143 #endif
4144  return sizeof(EDTMeasureSpec2005);
4145  }
4146 
4147  virtual void* Allocate()
4148  {
4149 #if FXT_VERSION >= FINALEVERSION_2014
4150  if (_VersionToUse() == FINALEVERSION_2014) return (void*) &_measurespec2014;
4151 #endif
4152  return (void*) &_measurespec2005;
4153  }
4154 
4159  virtual void CloneMemoryFrom(__FCBaseData* pSource)
4160  {
4161 #if FXT_VERSION >= FINALEVERSION_2014
4162  if (_VersionToUse() == FINALEVERSION_2014)
4163  {
4164  memcpy(&_measurespec2014, ((FCMeasure*)pSource)->_GetMeasureSpec(), sizeof(_measurespec2014));
4165  _datablock = &_measurespec2014;
4166  _loadedsize = sizeof(_measurespec2014);
4167  return;
4168  }
4169 #endif
4170  memcpy(&_measurespec2005, ((FCMeasure*)pSource)->_GetMeasureSpec(), sizeof(_measurespec2005));
4171  _datablock = &_measurespec2005;
4172  _loadedsize = sizeof(_measurespec2005);
4173  }
4174 
4175  virtual __FCBaseData* CreateObject() { return new FCMeasure(); }
4176 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
4177 public:
4178 
4186 
4188  BARLINE_NONE = 0,
4189 
4192 
4195 
4198 
4201 
4204 
4207 
4210 
4213  BARLINE_DEFAULT
4214  };
4215 
4216 private:
4221  bool _GetBarlineMask(
4222 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
4223 int
4224 #else
4226 #endif
4227  style, FLAG_16* pFlag);
4228 
4229 public:
4230 
4238 
4240  POSITIONING_TIMESIG = 0,
4241 
4244 
4246  POSITIONING_BEATCHART
4247  };
4248 
4256 
4258  SHOWSTATE_IFNEEDED = 0,
4259 
4262 
4264  SHOWSTATE_HIDE
4265  };
4266 
4267  virtual const char* ClassName() { return "FCMeasure"; }
4268  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_MEASURE; }
4269 
4270 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
4271 
4277  void* _GetMeasureSpec()
4278  {
4279 #if FXT_VERSION >= FINALEVERSION_2014
4280  if (_VersionToUse() == FINALEVERSION_2014) return &_measurespec2014;
4281 #endif
4282  return &_measurespec2005;
4283  }
4284 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
4285 
4292  {
4293  _pKeySig = NULL;
4294  _pTimeSig = NULL;
4295  _pTimeSigDisplay = NULL;
4296  }
4297 
4302  virtual ~FCMeasure() {
4303  if (_pKeySig) delete _pKeySig;
4304  if (_pTimeSig) delete _pTimeSig;
4305  if (_pTimeSigDisplay) delete _pTimeSigDisplay;
4306  }
4307 
4309  virtual bool Save();
4310 
4312  virtual bool Load(CMPER itemno);
4313 
4321  FCBeatChartElements* CreateBeatChartElements();
4322 
4323 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
4324  /* GC version of #CreateBeatChartElements for Lua. */
4325  FCBeatChartElements* CreateBeatChartElements_GC();
4326 #endif
4327 
4335  FCExpressions* CreateExpressions();
4336 
4337 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
4338  /* GC version of #CreateExpressions for Lua. */
4339  FCExpressions* CreateExpressions_GC();
4340 #endif
4341 
4349  FCTempoElements* CreateTempoElements();
4350 
4351 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
4352  /* GC version of #CreateTempoElements for Lua. */
4353  FCTempoElements* CreateTempoElements_GC();
4354 #endif
4355 
4356 
4359  void SetKeyless(bool state)
4360  {
4361  if (_VersionToUse() != FINALEVERSION_2014) return;
4362 #if FXT_VERSION >= FINALEVERSION_2014
4363  _measurespec2014.isKeyless = state;
4364 #endif
4365  }
4366 
4369  void SetHideKeySigShowAccis(bool state)
4370  {
4371  if (_VersionToUse() != FINALEVERSION_2014) return;
4372 #if FXT_VERSION >= FINALEVERSION_2014
4373  _measurespec2014.hideKeySigShowAccis = state;
4374 #endif
4375  }
4376 
4377 
4386  void SetPageBreak(bool state)
4387  { _SetNewFlag(MEAS_PAGEBREAK, state); }
4388 
4396  void SetBreakMMRest(bool state)
4397  { _SetMeFlag(MEAS_BREAKREST, state); }
4398 
4405  void SetForwardRepeat(bool state)
4406  { _SetMeFlag(MEAS_FORREPBAR, state); }
4407 
4416  void SetExpressionFlag(bool state)
4417  { _SetMeFlag(MEAS_DYNAMBIT, state); }
4418 
4427  void SetTextFlag(bool state)
4428  { _SetMeFlag(MEAS_MEASURETEXT, state); }
4429 
4442  void SetBackwardRepeat(bool state)
4443  { _SetMeFlag(MEAS_BACREPBAR, state); }
4444 
4456  void SetRepeatBracketFlag(bool state) { _SetMeFlag(MEAS_BARENDING, state); }
4457 
4467  void SetTextRepeatFlag(bool state) { _SetMeFlag(MEAS_REPEATS, state); }
4468 
4475  void SetSystemBreak(bool state) { _SetMeFlag(MEAS_MS_LINEBREAK, state); }
4476 
4484  void SetHideCautionary(bool state) { _SetAuxFlag(MEAS_HIDECAUTION, state); }
4485 
4492  void SetWidth(Evpu16 width) {
4493 #if FXT_VERSION >= FINALEVERSION_2014
4494  if (_VersionToUse() == FINALEVERSION_2014)
4495  {
4496  _measurespec2014.measpace = width;
4497  return;
4498  }
4499 #endif
4500  _measurespec2005.measpace = width;
4501  }
4502 
4509  void SetSpaceBefore(Evpu16 space)
4510  {
4511 #if FXT_VERSION >= FINALEVERSION_2014
4512  if (_VersionToUse() == FINALEVERSION_2014)
4513  {
4514  _measurespec2014.frontSpaceExtra = space;
4515  return;
4516  }
4517 #endif
4518  _measurespec2005.frontSpaceExtra = space;
4519  }
4520 
4527  void SetSpaceAfter(Evpu16 space)
4528  {
4529 #if FXT_VERSION >= FINALEVERSION_2014
4530  if (_VersionToUse() == FINALEVERSION_2014)
4531  {
4532  _measurespec2014.backSpaceExtra = space;
4533  return;
4534  }
4535 #endif
4536  _measurespec2005.backSpaceExtra = space;
4537  }
4538 
4549  void SetAllowHorizontalSplit(bool state) { _SetAuxFlag(MEAS_POSSPLIT, state); }
4550 
4560  void SetShowKeySignature(
4561 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
4562  SHOW_STATES state
4563 #else
4564  int state
4565 #endif
4566  );
4567 
4577  void SetShowTimeSignature(
4578 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
4579  SHOW_STATES state
4580 #else
4581  int state
4582 #endif
4583  );
4584 
4594  void SetShowFullNames(bool state);
4595 
4601  void SetContainsManualMeasureNumbers(bool state) { _SetAuxFlag(MEAS_MNSEPPLACE, state); }
4602 
4609  void SetBreakWordExtension(bool state) { _SetAuxFlag(0x8000, state); }
4610 
4617  void SetIncludeInNumbering(bool state) { _SetMeFlag(MEAS_NO_MEAS_NUM, !state); }
4618 
4625  void SetOverrideGroupBarlines(bool state) { _SetAuxFlag(MEAS_GRP_BARLINE_OVERRIDE, state); }
4626 
4636  void SetPositioningNotesMode(
4637 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
4638 POSITIONING_MODES mode
4639 #else
4640 int mode
4641 #endif
4642  );
4643 
4650  void SetPositionEvenly(bool state) { _SetAuxFlag(MEAS_INDIVPOSDEF, state); }
4651 
4659  void SetBarline(
4660 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
4661 int
4662 #else
4664 #endif
4665  style);
4666 
4673  void SetBarlineShapeID(twobyte shapeID) {
4674 #if FXT_VERSION >= FINALEVERSION_2014
4675  if (_VersionToUse() == FINALEVERSION_2014)
4676  {
4677  _measurespec2014.custombarshape = shapeID;
4678  return;
4679  }
4680 #endif
4681  _measurespec2005.custombarshape = shapeID;
4682  }
4683 
4690  void SetLeftBarlineShapeID(twobyte shapeID)
4691  {
4692 #if FXT_VERSION >= FINALEVERSION_2014
4693  if (_VersionToUse() == FINALEVERSION_2014)
4694  {
4695  _measurespec2014.customleftbarshape = shapeID;
4696  return;
4697  }
4698 #endif
4699  _measurespec2005.customleftbarshape = shapeID;
4700  }
4701 
4712  void SetLeftBarline(
4713 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
4714  BARLINE_STYLES style
4715 #else
4716  int style
4717 #endif
4718  );
4719 
4726  void SetSmartShapeFlag(bool state) { _SetAuxFlag(MEAS_SMARTSHAPEBIT, state); }
4727 
4736  void SetChordFlag(bool state) { _SetNewFlag(0x0008, state); }
4737 
4743  TimeEdu32 GetDuration()
4744  {
4745  return FX_GetMeasureDuration(0, GetItemNo());
4746  }
4747 
4748 
4754  bool GetKeyless() const
4755  {
4756  if (_VersionToUse() != FINALEVERSION_2014) return false;
4757 #if FXT_VERSION >= FINALEVERSION_2014
4758  return _measurespec2014.isKeyless != 0;
4759 #endif
4760  return false;
4761  }
4762 
4769  {
4770  if (_VersionToUse() != FINALEVERSION_2014) return false;
4771 #if FXT_VERSION >= FINALEVERSION_2014
4772  return _measurespec2014.hideKeySigShowAccis != 0;
4773 #endif
4774  return false;
4775  }
4776 
4777 
4787  bool GetPageBreak() const { return _GetNewFlag(MEAS_PAGEBREAK); }
4788 
4796  bool GetBreakMMRest() const { return _GetMeFlag(MEAS_BREAKREST); }
4797 
4804  bool GetSystemBreak() const { return _GetMeFlag(MEAS_MS_LINEBREAK); }
4805 
4812  bool GetForwardRepeat() const { return _GetMeFlag(MEAS_FORREPBAR); }
4813 
4822  bool GetExpressionFlag() const { return _GetMeFlag(MEAS_DYNAMBIT); }
4823 
4833  bool GetTextFlag() const { return _GetMeFlag(MEAS_MEASURETEXT); }
4834 
4844  bool GetBackwardRepeat() const { return _GetMeFlag(MEAS_BACREPBAR); }
4845 
4857  bool GetRepeatBracketFlag() const { return _GetMeFlag(MEAS_BARENDING); }
4858 
4868  bool GetTextRepeatFlag() const { return _GetMeFlag(MEAS_REPEATS); }
4869 
4877  bool GetHideCautionary() const { return _GetAuxFlag(MEAS_HIDECAUTION); }
4878 
4885  Evpu16 GetWidth() const {
4886 #if FXT_VERSION >= FINALEVERSION_2014
4887  if (_VersionToUse() == FINALEVERSION_2014)
4888  {
4889  return _measurespec2014.measpace;
4890  }
4891 #endif
4892  return _measurespec2005.measpace;
4893  }
4894 
4901  Evpu16 GetSpaceBefore() const {
4902 #if FXT_VERSION >= FINALEVERSION_2014
4903  if (_VersionToUse() == FINALEVERSION_2014)
4904  {
4905  return _measurespec2014.frontSpaceExtra;
4906  }
4907 #endif
4908  return _measurespec2005.frontSpaceExtra;
4909  }
4910 
4917  Evpu16 GetSpaceAfter() const {
4918 #if FXT_VERSION >= FINALEVERSION_2014
4919  if (_VersionToUse() == FINALEVERSION_2014)
4920  {
4921  return _measurespec2014.backSpaceExtra;
4922  }
4923 #endif
4924  return _measurespec2005.backSpaceExtra;
4925  }
4926 
4935  bool GetAllowHorizontalSplit() const { return _GetAuxFlag(MEAS_POSSPLIT); }
4936 
4946 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
4947  SHOW_STATES
4948 #else
4949  int
4950 #endif
4951  GetShowKeySignature() const;
4952 
4962 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
4963  SHOW_STATES
4964 #else
4965  int
4966 #endif
4967  GetShowTimeSignature() const;
4968 
4974  bool GetUseTimeSigForDisplay() const { return _GetNewFlag(MEAS_USE_DISPLAY_TIMESIG); }
4975 
4986  bool GetShowFullNames() const;
4987 
4994  bool GetContainsManualMeasureNumbers() const { return _GetAuxFlag(MEAS_MNSEPPLACE); }
4995 
5002  bool GetBreakWordExtension() const { return _GetAuxFlag(0x8000); }
5003 
5010  bool GetIncludeInNumbering() const { return !_GetMeFlag(MEAS_NO_MEAS_NUM); }
5011 
5018  bool GetOverrideGroupBarlines() const { return _GetAuxFlag(MEAS_GRP_BARLINE_OVERRIDE); }
5019 
5029 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5030  POSITIONING_MODES
5031 #else
5032  int
5033 #endif
5034  GetPositioningNotesMode() const;
5035 
5042  bool GetPositionEvenly() const { return _GetAuxFlag(MEAS_INDIVPOSDEF); }
5043 
5050 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
5051  int
5052 #else
5054 #endif
5055  GetBarline() const;
5056 
5065 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5066  BARLINE_STYLES
5067 #else
5068  int
5069 #endif
5070  GetLeftBarline() const;
5071 
5078  CMPER GetBarlineShapeID() const {
5079 #if FXT_VERSION >= FINALEVERSION_2014
5080  if (_VersionToUse() == FINALEVERSION_2014)
5081  {
5082  return _measurespec2014.custombarshape;
5083  }
5084 #endif
5085  return _measurespec2005.custombarshape;
5086  }
5087 
5094  CMPER GetLeftBarlineShapeID() const {
5095 #if FXT_VERSION >= FINALEVERSION_2014
5096  if (_VersionToUse() == FINALEVERSION_2014)
5097  {
5098  return _measurespec2014.customleftbarshape;
5099  }
5100 #endif
5101  return _measurespec2005.customleftbarshape;
5102  }
5103 
5119  if (!DataIsLoaded()) return NULL;
5120  if (_pKeySig) return _pKeySig;
5121  if (!_pKeySig) _pKeySig = new FCKeySignature();
5122 #if FXT_VERSION >= FINALEVERSION_2014
5123  if (_VersionToUse() == FINALEVERSION_2014)
5124  {
5125  _pKeySig->SetID(_measurespec2014.key);
5126  } else
5127 #endif
5128  {
5129  _pKeySig->SetID(_measurespec2005.key);
5130  }
5131  return _pKeySig;
5132  }
5133 
5140  bool GetSmartShapeFlag() const { return _GetAuxFlag(MEAS_SMARTSHAPEBIT); }
5141 
5150  bool GetChordFlag() const { return _GetNewFlag(0x0008); }
5151 
5167  {
5168  if (!DataIsLoaded()) return NULL;
5169  if (_pTimeSig) return _pTimeSig;
5170  if (!_pTimeSig) _pTimeSig = new FCTimeSignature();
5171 #if FXT_VERSION >= FINALEVERSION_2014
5172  if (_VersionToUse() == FINALEVERSION_2014)
5173  {
5174  _pTimeSig->SetBeats(_measurespec2014.beats);
5175  _pTimeSig->SetBeatDuration(_measurespec2014.divbeat);
5176  } else
5177 #endif
5178  {
5179  _pTimeSig->SetBeats(_measurespec2005.beats);
5180  _pTimeSig->SetBeatDuration(_measurespec2005.divbeat);
5181  }
5182  _pTimeSig->SetCompositeTop(_GetAuxFlag(MEAS_ALTNUMTSIG));
5183  _pTimeSig->SetCompositeBottom(_GetAuxFlag(MEAS_ALTDENTSIG));
5184  _pTimeSig->SetAbbreviate(false);
5185  return _pTimeSig;
5186  }
5187 
5199  {
5200  if (!DataIsLoaded()) return NULL;
5201  if (!GetUseTimeSigForDisplay()) return NULL;
5202  if (_pTimeSigDisplay) return _pTimeSigDisplay;
5203  if (!_pTimeSigDisplay) _pTimeSigDisplay = new FCTimeSignature();
5204 #if FXT_VERSION >= FINALEVERSION_2014
5205  if (_VersionToUse() == FINALEVERSION_2014)
5206  {
5207  _pTimeSigDisplay->SetBeats(_measurespec2014.dispBeats);
5208  _pTimeSigDisplay->SetBeatDuration(_measurespec2014.dispDivbeat);
5209  } else
5210 #endif
5211  {
5212  _pTimeSigDisplay->SetBeats(_measurespec2005.dispBeats);
5213  _pTimeSigDisplay->SetBeatDuration(_measurespec2005.dispDivbeat);
5214  }
5215  _pTimeSigDisplay->SetCompositeTop(_GetNewFlag(MEAS_DISPLAY_ALTNUMTSIG));
5216  _pTimeSigDisplay->SetCompositeBottom(_GetNewFlag(MEAS_DISPLAY_ALTDENTSIG));
5217  _pTimeSigDisplay->SetAbbreviate(_GetNewFlag(MEAS_ABBRVTIME));
5218  return _pTimeSigDisplay;
5219  }
5220 
5230  void SetUseTimeSigForDisplay(bool value)
5231  {
5232  if (!DataIsLoaded()) return;
5233  if (GetUseTimeSigForDisplay() == value) return;
5234  if (!value)
5235  {
5236  if (_pTimeSigDisplay)
5237  {
5238  delete _pTimeSigDisplay;
5239  _pTimeSigDisplay = NULL;
5240  }
5241  }
5242  return _SetNewFlag(MEAS_USE_DISPLAY_TIMESIG, value);
5243  }
5244 };
5245 
5246 /* Forward declaration, required for measure references FCMeasureNumberRegion */
5247 class FCMeasures;
5248 
5255 {
5256 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
5257  private:
5258  /* Reference table for checking the "Include measure in measure numbering" states.
5259  Use AssignAllMeasures() to set */
5260  FCMeasures* _pAllMeasures;
5261 
5262  /* Used for the _SetTempAllMeasures() etc mechanism. This is where the real value of
5263  * _pAllMeasures is stored, during a temporary collection assignment. */
5264  FCMeasures* _pTempAllMeasuresStorage;
5265 
5267  FIN25_4_CODE(EDTMeasNumberRegion25_4 _measureregion25_4;)
5270  FIN2012_CODE(EDTMeasNumberRegion2012 _measureregion2012;)
5272  EDTMeasNumberRegion2010 _measureregion2010;
5273  EDTMeasNumberRegion _measureregionold;
5275  FCEnclosure _startEnclosureScore; // Set up by the constructor
5276  FCEnclosure _startEnclosureParts; // Set up by the constructor
5277  FCEnclosure _multipleEnclosureScore; // Set up by the constructor
5278  FCEnclosure _multipleEnclosureParts; // Set up by the constructor
5279 
5280 
5281  /* Returns a pointer to the correct 'flags' member of the score/part struct */
5282  const FLAG_16* _GetScorePartFlagsPtr(bool parts);
5283 
5284  /* Returns a pointer to the correct 'flags2' member of the score/part struct */
5285  const FLAG_16* _GetScorePartFlags2Ptr(bool parts);
5286 
5287  /* Returns a pointer to the correct 'incidence' member of the score/part struct */
5288  const twobyte* _GetScorePartIncidencePtr(bool parts) const;
5289 
5290  /* Returns a pointer to the correct 'startxdisp' (or xdisp) member of the score/part struct */
5291  const twobyte* _GetScorePartStartxdispPtr(bool parts) const;
5292 
5293  /* Returns a pointer to the correct 'startxdisp' (or xdisp) member of the score/part struct */
5294  const twobyte* _GetScorePartStartydispPtr(bool parts) const;
5295 
5296  /* Returns a pointer to the correct 'multiplexdisp' member of the score/part struct */
5297  const twobyte* _GetScorePartMultiplexdispPtr(bool parts) const;
5298 
5299  /* Returns a pointer to the correct 'multipleydisp' member of the score/part struct */
5300  const twobyte* _GetScorePartMultipleydispPtr(bool parts) const;
5301 
5302  /* Returns a pointer to the correct 'mmrestxdisp' member of the score/part struct */
5303  const twobyte* _GetScorePartMmrestxdispPtr(bool parts) const;
5304 
5305  /* Returns a pointer to the correct 'mmrestydisp' member of the score/part struct */
5306  const twobyte* _GetScorePartMmrestydispPtr(bool parts) const;
5307 
5308  /* Returns a pointer to the correct 'startWith' member of the score/part struct */
5309  const twobyte* _GetScorePartStartWithPtr(bool parts) const;
5310 
5311  /* Returns a pointer to the correct 'leftMMBracketChar' member of the score/part struct
5312  eUniChar32 on Fin2012+
5313  EWCHAR on pre-Fin2012
5314  */
5315  const void* _GetScorePartLeftMMBracketCharPtr(bool parts) const;
5316 
5317  /* Returns a pointer to the correct 'rightMMBracketChar' member of the score/part struct
5318  eUniChar32 on Fin2012+
5319  EWCHAR on pre-Fin2012
5320  */
5321  const void* _GetScorePartRightMMBracketCharPtr(bool parts) const;
5322 
5323  /* Returns a pointer to the correct 'startFont' member of the score/part struct */
5324  const EFONTID* _GetScorePartStartFontPtr(bool parts) const;
5325 
5326  /* Returns a pointer to the correct 'startEfx' member of the score/part struct */
5327  const FLAG_16* _GetScorePartStartEfxPtr(bool parts) const;
5328 
5329  /* Returns a pointer to the correct 'startSize' member of the score/part struct */
5330  const twobyte* _GetScorePartStartSizePtr(bool parts) const;
5331 
5332  /* Returns a pointer to the correct 'multipleFont' member of the score/part struct */
5333  const EFONTID* _GetScorePartMultipleFontPtr(bool parts) const;
5334 
5335  /* Returns a pointer to the correct 'multipleEfx' member of the score/part struct */
5336  const FLAG_16* _GetScorePartMultipleEfxPtr(bool parts) const;
5337 
5338  /* Returns a pointer to the correct 'multipleSize' member of the score/part struct */
5339  const twobyte* _GetScorePartMultipleSizePtr(bool parts) const;
5340 
5341  /* Returns a pointer to the correct 'mmRestFont' member of the score/part struct */
5342  const EFONTID* _GetScorePartMmRestFontPtr(bool parts) const;
5343 
5344  /* Returns a pointer to the correct 'mmRestEfx' member of the score/part struct */
5345  const FLAG_16* _GetScorePartMmRestEfxPtr(bool parts) const;
5346 
5347  /* Returns a pointer to the correct 'mmRestSize' member of the score/part struct */
5348  const twobyte* _GetScorePartMmRestSizePtr(bool parts) const;
5349 
5350  /* Returns a pointer to the correct 'startMeas' member */
5351  const twobyte* _GetStartMeasPtr() const;
5352 
5353  /* Returns a pointer to the correct 'endMeas' member */
5354  const twobyte* _GetEndMeasPtr() const;
5355 
5356  /* Returns a pointer to the correct 'offset' member */
5357  const twobyte* _GetOffsetPtr() const;
5358 
5359  /* Returns a pointer to the correct 'prefix' member. Finale 2012+ uses eUniChar16 buffer,
5360  earlier versions use ECHAR buffer. */
5361  const void* _GetPrefixPtr() const;
5362 
5363  /* Returns a pointer to the correct 'suffix' member */
5364  const void* _GetSuffixPtr() const;
5365 
5366  /* Returns a pointer to the correct 'flag' member */
5367  const FLAG_16* _GetFlagPtr() const;
5368 
5369  /* Returns a pointer to the correct 'flag2' member */
5370  const FLAG_16* _GetFlag2Ptr() const;
5371 
5372  /* Returns a pointer to the correct 'region' member */
5373  const twobyte* _GetRegionPtr() const;
5374 
5375  /* Returns a pointer to the correct 'base' member */
5376  const twobyte* _GetBasePtr() const;
5377 
5378  /* Returns a pointer to the correct 'startchar' member
5379  Finale 2012+ uses eUniChar32, earlier versions use twobyte.
5380  */
5381  const void* _GetStartcharPtr() const;
5382 
5383  bool _GetScorePartFlags(bool parts, FLAG_16 flag);
5384  void _SetScorePartFlags(bool parts, FLAG_16 flag, bool state);
5385 
5386  FLAG_16 _GetScorePartFlagsValue(bool parts);
5387  void _SetScorePartFlagsValue(bool parts, FLAG_16 flag);
5388  FLAG_16 _GetScorePartFlags2Value(bool parts);
5389  void _SetScorePartFlags2Value(bool parts, FLAG_16 flag2);
5390 
5391  /* Non-virtual method to decide the FXT version */
5392  EVERSION _FXTVersionToUse() const;
5393 
5394  /* For internal use only. Formats a display version of the measure number index.
5395  The measure number index is the 0-based index within the numbering sequence.
5396  */
5397  void _FormatDisplayedNumberForIndex(twobyte meas_num_index, FCString* pString);
5398 protected:
5399  virtual EXTAG Tag() { return ot_MeasNumberRegion; }
5400  virtual int DataSizeLoad();
5401  virtual void* Allocate();
5402 
5403  virtual EVERSION EnigmaVersion();
5404 
5409  virtual void CloneMemoryFrom(__FCBaseData* pSource)
5410  {
5411  memcpy(_GetData(), ((FCMeasureNumberRegion*)pSource)->_GetData(), DataSizeLoad());
5412  _datablock = Allocate();
5414  }
5415 
5416  virtual __FCBaseData* CreateObject() { return new FCMeasureNumberRegion(); }
5417 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
5418 public:
5419 
5429  {
5431  NUMBERING_DIGITS = 0,
5432 
5433  /* "a, b, c...aa, bb, cc" */
5434  NUMBERING_LOWERCASEDOUBLE,
5435 
5438 
5441 
5444 
5447 
5450 
5453 
5456 
5459 
5461  NUMBERING_CUSTOM = 101 /* Set this style above all other */
5462  };
5463 
5469  {
5470  /* Show in all views */
5471  NUMBERVIEW_ALL = 0,
5472 
5473  /* Show in Page View only */
5474  NUMBERVIEW_PAGEONLY,
5475 
5476  /* Show in Scroll/Studio View only */
5477  NUMBERVIEW_SCROLLONLY
5478  };
5479 
5485  {
5487  MNALIGN_LEFT = 0,
5488 
5491 
5493  MNALIGN_RIGHT
5494  };
5495 
5501  {
5503  MNJUSTIFY_LEFT = TEXT_JUSTIFY_LEFT,
5504 
5506  MNJUSTIFY_CENTER = TEXT_JUSTIFY_CENTER,
5507 
5509  MNJUSTIFY_RIGHT = TEXT_JUSTIFY_RIGHT
5510  };
5511 
5512  virtual const char* ClassName() { return "FCMeasureNumberRegion"; }
5513  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_MEASURENUMBERREGION; }
5514 
5515 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
5516 
5522  void* _GetData() { return Allocate(); }
5523 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
5524 
5530 
5537  void SetStartMeasure(twobyte measure);
5538 
5545  void SetEndMeasure(twobyte measure);
5546 
5554  void SetStartNumber(twobyte offset);
5555 
5560  void SetPrefix(FCString* pString);
5561 
5566  void SetSuffix(FCString* pString);
5567 
5573  void SetUseScoreInfoForParts(bool value);
5574 
5577  void SetID(twobyte newid);
5578 
5590  void SetStartFontInfo(FCFontInfo* pFontInfo, bool parts);
5591 
5602  void SetMultipleFontInfo(FCFontInfo* pFontInfo, bool parts);
5603 
5615  void SetMultiMeasureFontInfo(FCFontInfo* pFontInfo, bool parts);
5616 
5627  void SetUseEnclosureStart(bool use, bool parts);
5628 
5637  void SetExcludeOtherStaves(bool exclude, bool parts);
5638 
5647  void SetUseEnclosureMultiple(bool use, bool parts);
5648 
5657  void SetShowOnTopStaff(bool showontop, bool parts);
5658 
5667  void SetShowOnSystemStart(bool showonstart, bool parts);
5668 
5677  void SetShowOnBottomStaff(bool showonbottom, bool parts);
5678 
5687  void SetShowMultiples(bool showmultiples, bool parts);
5688 
5697  void SetHideFirstNumber(bool hide, bool parts);
5698 
5709  void SetShowMultiMeasureRange(bool show, bool parts);
5710 
5721  void SetShowOnMultiMeasureRests(bool show, bool parts);
5722 
5731  void SetMultipleValue(twobyte value, bool parts);
5732 
5741  void SetMultipleStartMeasure(twobyte measure, bool parts);
5742 
5753  void SetMultiMeasureBracketLeft(eUniChar32 character, bool parts);
5754 
5765  void SetMultiMeasureBracketRight(eUniChar32 character, bool parts);
5766 
5776  void SetBreakMultiMeasureRests(bool breakstate, bool parts);
5777 
5783  void SetStartAlignment(
5784 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5785 MNALIGNMENTS
5786 #else
5787 int
5788 #endif
5789  alignment,
5790  bool parts);
5791 
5797  void SetStartJustification(
5798 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5799 MNJUSTIFICATIONS
5800 #else
5801 int
5802 #endif
5803 justification,
5804  bool parts);
5805 
5811  void SetMultipleAlignment(
5812 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5813 MNALIGNMENTS
5814 #else
5815 int
5816 #endif
5817  alignment,
5818  bool parts);
5819 
5825  void SetMultipleJustification(
5826 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5827 MNJUSTIFICATIONS
5828 #else
5829 int
5830 #endif
5831 justification,
5832  bool parts);
5833 
5839  void SetMultiMeasureAlignment(
5840 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5841 MNALIGNMENTS
5842 #else
5843 int
5844 #endif
5845  alignment,
5846  bool parts);
5847 
5853  void SetMultiMeasureJustification(
5854 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5855 MNJUSTIFICATIONS
5856 #else
5857 int
5858 #endif
5859 justification,
5860  bool parts);
5861 
5870  void SetStartHorizontalPosition(twobyte distance, bool parts);
5871 
5880  void SetStartVerticalPosition(twobyte distance, bool parts);
5881 
5890  void SetMultipleHorizontalPosition(twobyte distance, bool parts);
5891 
5900  void SetMultipleVerticalPosition(twobyte distance, bool parts);
5901 
5910  void SetMultiMeasureHorizontalPosition(twobyte distance, bool parts);
5911 
5920  void SetMultiMeasureVerticalPosition(twobyte distance, bool parts);
5921 
5928  void SetView(
5929 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5930  NUMBERVIEWS
5931 #else
5932  int
5933 #endif
5934  view
5935  );
5936 
5943  void SetNumberingStyle(
5944 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
5945  NUMBERINGSTYLE
5946 #else
5947  int
5948 #endif
5949  style
5950  );
5951 
5962  void SetBase(twobyte base);
5963 
5976  void SetStartCharacter(eUniChar32 character);
5977 
5983  void SetTime(bool state);
5984 
5989  void SetTimeFrames(bool state);
5990 
5997  void SetUseHours(bool state);
5998 
6003  void SetTimePrecision(twobyte precision);
6004 
6017  void SetCountFromOne(bool value);
6018 
6029  void SetNoZero(bool value);
6030 
6044  void SetDoubleUp(bool value);
6045 
6050  twobyte GetStartMeasure() const;
6051 
6056  twobyte GetEndMeasure() const;
6057 
6065  twobyte GetStartNumber() const;
6066 
6071  bool GetTime() const;
6072 
6077  bool GetTimeFrames() const;
6078 
6085  bool GetUseHours() const;
6086 
6091  twobyte GetTimePrecision() const;
6092 
6103  bool GetNoZero() const;
6104 
6119  bool GetDoubleUp() const;
6120 
6131  bool GetCountFromOne() const;
6132 
6145  eUniChar32 GetStartCharacter() const;
6146 
6157  twobyte GetBase() const;
6158 
6169  bool GetUseScoreInfoForParts() const;
6170 
6175  twobyte GetID();
6176 
6187  bool GetDisplayedNumber(eMeas number, FCString* pString);
6188 
6202  bool GetDisplayedNumberWithID(eMeas number, FCString* pString);
6203 
6210  void GetPrefix(FCString* pString);
6211 
6218  void GetSuffix(FCString* pString);
6219 
6230  {
6231  return parts ? &_startEnclosureParts : &_startEnclosureScore;
6232  }
6233 
6244  {
6245  return parts ? &_multipleEnclosureParts : &_multipleEnclosureScore;
6246  }
6247 
6254  bool GetUseEnclosureStart(bool parts);
6255 
6263  bool GetExcludeOtherStaves(bool parts);
6264 
6269  bool GetUseEnclosureMultiple(bool parts);
6270 
6275  bool GetShowOnTopStaff(bool parts);
6276 
6281  bool GetShowOnSystemStart(bool parts);
6282 
6287  bool GetShowOnBottomStaff(bool parts);
6288 
6293  bool GetShowMultiples(bool parts);
6294 
6299  bool GetHideFirstNumber(bool parts);
6300 
6307  bool GetShowMultiMeasureRange(bool parts);
6308 
6315  bool GetShowOnMultiMeasureRests(bool parts);
6316 
6322  twobyte GetMultipleValue(bool parts);
6323 
6328  twobyte GetMultipleStartMeasure(bool parts);
6329 
6336  eUniChar32 GetMultiMeasureBracketLeft(bool parts);
6337 
6344  eUniChar32 GetMultiMeasureBracketRight(bool parts);
6345 
6350  bool GetBreakMultiMeasureRests(bool parts);
6351 
6356 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
6357  MNALIGNMENTS
6358 #else
6359  int
6360 #endif
6361  GetStartAlignment(bool parts);
6362 
6367 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
6368  MNJUSTIFICATIONS
6369 #else
6370  int
6371 #endif
6372  GetStartJustification(bool parts);
6373 
6374 
6375 
6380 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
6381  MNALIGNMENTS
6382 #else
6383  int
6384 #endif
6385  GetMultipleAlignment(bool parts);
6386 
6391 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
6392  MNJUSTIFICATIONS
6393 #else
6394  int
6395 #endif
6396  GetMultipleJustification(bool parts);
6397 
6398 
6399 
6404 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
6405  MNALIGNMENTS
6406 #else
6407  int
6408 #endif
6409  GetMultiMeasureAlignment(bool parts);
6410 
6415 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
6416  MNJUSTIFICATIONS
6417 #else
6418  int
6419 #endif
6420  GetMultiMeasureJustification(bool parts);
6421 
6422 
6427  twobyte GetStartHorizontalPosition(bool parts);
6428 
6433  twobyte GetStartVerticalPosition(bool parts);
6434 
6439  twobyte GetMultipleHorizontalPosition(bool parts);
6440 
6445  twobyte GetMultipleVerticalPosition(bool parts);
6446 
6451  twobyte GetMultiMeasureHorizontalPosition(bool parts);
6452 
6457  twobyte GetMultiMeasureVerticalPosition(bool parts);
6458 
6464 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
6465  NUMBERVIEWS
6466 #else
6467  int
6468 #endif
6469  GetView() const;
6470 
6477 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
6478  NUMBERINGSTYLE
6479 #else
6480  int
6481 #endif
6482  GetNumberingStyle() const;
6483 
6495  void GetStartFontInfo(FCFontInfo* pFontInfo, bool parts);
6496 
6511  {
6512  FCFontInfo* pFontInfo = new FCFontInfo();
6513  GetStartFontInfo(pFontInfo, parts);
6514  return pFontInfo;
6515  }
6516 
6517 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
6518 
6519  FCFontInfo* CreateStartFontInfo_GC(bool parts);
6520 #endif
6521 
6532  void GetMultipleFontInfo(FCFontInfo* pFontInfo, bool parts);
6533 
6548  {
6549  FCFontInfo* pFontInfo = new FCFontInfo();
6550  GetMultipleFontInfo(pFontInfo, parts);
6551  return pFontInfo;
6552  }
6553 
6554 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
6555 
6556  FCFontInfo* CreateMultipleFontInfo_GC(bool parts);
6557 #endif
6558 
6569  void GetMultiMeasureFontInfo(FCFontInfo* pFontInfo, bool parts);
6570 
6585  {
6586  FCFontInfo* pFontInfo = new FCFontInfo();
6587  GetMultiMeasureFontInfo(pFontInfo, parts);
6588  return pFontInfo;
6589  }
6590 
6591 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
6592 
6593  FCFontInfo* CreateMultiMeasureFontInfo_GC(bool parts);
6594 #endif
6595 
6610  FCString* CreateDisplayedString(twobyte measure);
6611 
6612 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
6613 
6614  FCString* CreateDisplayedString_GC(twobyte measure);
6615 #endif
6616 
6617 
6626  void CloneFormattingFrom(FCMeasureNumberRegion* pRegionFrom, bool score, bool parts);
6627 
6636  bool IsMeasureIncluded(twobyte measureno)
6637  {
6638  if (measureno > GetEndMeasure()) return false;
6639  if (measureno < GetStartMeasure()) return false;
6640  return true;
6641  }
6642 
6656  bool AssignAllMeasures(FCMeasures* pAllMeasures);
6657 
6670  void _SetTempAllMeasures(FCMeasures* pAllMeasuresToUse)
6671  {
6672  /* Store the "actual" value, restore it with _RestoreTempAllMeasures() */
6673  _pTempAllMeasuresStorage = _pAllMeasures;
6674  /* Set temp value */
6675  _pAllMeasures = pAllMeasuresToUse;
6676  }
6677 
6683  {
6684  /* Restore from temporary storage to the "real" storage */
6685  _pAllMeasures = _pTempAllMeasuresStorage;
6686  }
6687 
6688 #ifdef PDK_FRAMEWORK_DEBUG
6689  virtual void DebugDump()
6690  {
6692  DebugOutDigit("Start measure: ", GetStartMeasure());
6693  DebugOutDigit("End measure: ", GetEndMeasure());
6694  }
6695 #endif
6696 };
6697 
6707 {
6708 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
6709  private:
6711  EDTInstrumentUsed _instrumentused;
6712  int _resize;
6713 
6715  virtual bool LoadFirst() { return false; }
6716 protected:
6717  virtual EXTAG Tag() { return ot_InstrumentUsed; }
6718  virtual int DataSizeLoad() { return sizeof(EDTInstrumentUsed); }
6719  virtual void* Allocate() { return (void*) &_instrumentused; }
6720 
6725  virtual void CloneMemoryFrom(__FCBaseData* pSource)
6726  {
6727  memcpy(&_instrumentused, ((FCSystemStaff*)pSource)->_GetDataPtr(), sizeof(_instrumentused));
6728  _datablock = &_instrumentused;
6729  _loadedsize = sizeof(_instrumentused);
6730  _resize = ((FCSystemStaff*)pSource)->GetResize();
6731  }
6732 
6733  virtual __FCBaseData* CreateObject() { return new FCSystemStaff(); }
6734 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
6735 public:
6736  virtual const char* ClassName() { return "FCSystemStaff"; }
6737  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_SYSTEMSTAFF; }
6738 
6739 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
6740 
6746  void* _GetDataPtr() { return &_instrumentused; }
6747 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
6748 
6755  {
6756  memset(&_instrumentused, 0, sizeof(_instrumentused));
6757  _datablock = &_instrumentused;
6758  _loadedsize = sizeof(_instrumentused);
6759  _resize = 100;
6760  }
6761 
6763  virtual bool Load(CMPER itemno, twobyte inci);
6764 
6766  virtual bool SaveNew(CMPER itemno);
6767 
6769  virtual bool Save();
6770 
6771 
6779  void SetDistance(Evpu32 distance) { _instrumentused.separ = -distance; }
6780 
6785  void SetStaff(eStaff staffno) { _instrumentused.inst = staffno; }
6786 
6794  Evpu32 GetDistance() const { return -_instrumentused.separ; }
6795 
6801  eStaff GetStaff() const { return _instrumentused.inst; }
6802 
6808  int GetResize() const
6809  {
6810  if (_dataid.other.cmper == 0) return 100;
6811  return _resize;
6812  }
6813 
6822  void SetResize(int value)
6823  {
6824  _resize = value;
6825  }
6826 
6834  {
6835  if (_dataid.other.cmper == 0) return false;
6836  if (!DataIsLoaded()) return false;
6837  EDataID dataID;
6838  dataID.detail.cmper1 = _dataid.other.cmper; /* System */
6839  dataID.detail.cmper2 = _instrumentused.inst; /* Staff */
6840  dataID.detail.inci = 0; /* Should be 0 */
6841  return FX_DeleteEData(dt_StaffEnduction, &dataID, EnigmaVersion()) != 0;
6842  }
6843 
6844 #ifdef PDK_FRAMEWORK_DEBUG
6845  virtual void DebugDump()
6846  {
6848  DebugOutDigit("Distance: ", GetDistance());
6849  }
6850 #endif
6851 };
6852 
6854 
6861 {
6862 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
6863  private:
6865  EDTDrumStaff2010 _drumstaff;
6866 
6868  virtual bool LoadFirst() { return false; }
6869 protected:
6870  virtual EXTAG Tag() { return GetCustomTag() ? GetCustomTag() : ot_DrumStaff2010; } /* Custom tags might be used!!! */
6871  virtual int DataSizeLoad() { return sizeof(EDTDrumStaff2010); }
6872  virtual void* Allocate() { return (void*) &_drumstaff; }
6873 
6878  virtual void CloneMemoryFrom(__FCBaseData* pSource)
6879  {
6880  memcpy(&_drumstaff, ((FCPercussionStaff*)pSource)->_GetDataPtr(), sizeof(_drumstaff));
6881  _datablock = &_drumstaff;
6882  _loadedsize = sizeof(_drumstaff);
6883  }
6884 
6885  virtual __FCBaseData* CreateObject() { return new FCPercussionStaff(); }
6886 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
6887 public:
6888  virtual const char* ClassName() { return "FCPercussionStaff"; }
6889  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_PERCUSSIONSTAFF; }
6890 
6891 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
6892 
6898  void* _GetDataPtr() { return &_drumstaff; }
6899 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
6900 
6903  {
6904  memset(&_drumstaff, 0, sizeof(_drumstaff));
6905  _datablock = &_drumstaff;
6906  _loadedsize = sizeof(_drumstaff);
6907  }
6908 
6916  {
6917  return _drumstaff.whichDrumLib;
6918  }
6919 
6924  void SetPercussionLibrary(CMPER cmper)
6925  {
6926  _drumstaff.whichDrumLib = cmper;
6927  }
6928 
6934  FCPercussionLayoutNotes* CreateLayoutNotes();
6935 
6936 #ifdef PDK_FRAMEWORK_DEBUG
6937  virtual void DebugDump()
6938  {
6940  DebugOutDigit("Percussion Library: ", GetPercussionLibrary());
6941  }
6942 #endif
6943 };
6944 
6945 #ifdef PDK_FRAMEWORK_PREFS
6946 
6957 {
6958 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
6959  private:
6960 
6961  bool _fullnamepos; /* Needed for calculating the preferences*/
6962 
6964  EDTNamePos _namepos;
6965 
6967  virtual bool LoadFirst() { return false; }
6968 protected:
6969  virtual EXTAG Tag() { return GetCustomTag() ? GetCustomTag() : ot_NamePosFull; } /* Custom tags SHOULD be used!!! */
6970  virtual int DataSizeLoad() { return sizeof(EDTNamePos); }
6971  virtual void* Allocate() { return (void*) &_namepos; }
6972 
6977  virtual void CloneMemoryFrom(__FCBaseData* pSource)
6978  {
6979  memcpy(&_namepos, ((FCStaffNamePosition*)pSource)->_GetDataPtr(), sizeof(_namepos));
6980  _datablock = &_namepos;
6981  _loadedsize = sizeof(_namepos);
6982  _fullnamepos = ((FCStaffNamePosition*)pSource)->_GetFullNamePos();
6983  }
6984 
6985  virtual __FCBaseData* CreateObject() { return new FCStaffNamePosition(_fullnamepos); }
6986 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
6987 public:
6988  virtual const char* ClassName() { return "FCStaffNamePosition"; }
6989  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_STAFFNAMEPOSITION; }
6990 
6991 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
6992 
6993  bool _GetFullNamePos() { return _fullnamepos; }
6994 
7001  void* _GetDataPtr() { return &_namepos; }
7002 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
7003 
7010  FCStaffNamePosition(bool fullname);
7011 
7016  twobyte GetHorizontalOffset() const { return _namepos.horizAdjust; }
7017 
7022  twobyte GetVerticalOffset() const { return _namepos.vertAdjust; }
7023 
7030  FLAG_16 GetJustification() const { return _namepos.flag & NAMEPOS_JUSTIBITS; }
7031 
7038  FLAG_16 GetAlignment() const { return (_namepos.flag & NAMEPOS_HALIGNBITS) >> 4; }
7039 
7044  bool GetExpandSingleWord() const { return GetBitFlag(_namepos.flag, NAMEPOS_EXPAND_SINGLE_WORD); }
7045 
7050  bool GetUsePositioning() const { return GetBitFlag(_namepos.flag, 0x0008); }
7051 
7052  // *******
7053  // SETTERS
7054  // *******
7055 
7060  void SetHorizontalOffset(twobyte value) { _namepos.horizAdjust = value; }
7061 
7066  void SetVerticalOffset(twobyte value) { _namepos.vertAdjust = value; }
7067 
7074  void SetJustification(FLAG_16 justification)
7075  {
7076  justification &= NAMEPOS_JUSTIBITS;
7077  _namepos.flag &= ~NAMEPOS_JUSTIBITS;
7078  _namepos.flag |= justification;
7079  }
7080 
7087  void SetAlignment(FLAG_16 alignment)
7088  {
7089  alignment = alignment << 4;
7090  alignment &= NAMEPOS_HALIGNBITS;
7091  _namepos.flag &= ~NAMEPOS_HALIGNBITS;
7092  _namepos.flag |= alignment;
7093  }
7094 
7099  void SetExpandSingleWord(bool state)
7100  {
7101  Set16BitFlag(&_namepos.flag, NAMEPOS_EXPAND_SINGLE_WORD, state);
7102  }
7103 
7108  void SetUsePositioning(bool state) { Set16BitFlag(&_namepos.flag, 0x0008, state); }
7109 
7114  Evpu16 CalcHorizontalPosition();
7115 
7120  Evpu16 CalcVerticalPosition();
7121 };
7122 #endif /* PDK_FRAMEWORK_PREFS */
7123 /* End of FCStaffNamePosition */
7124 
7125 
7126 class FCInstrumentDef;
7128 class FCFretInstrumentDef;
7129 
7134 {
7135 private:
7136  mutable FCString _uuid; /* Used for #GetInstrumentUUID */
7137 protected:
7138 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
7139 
7145  EVERSION _VersionToUse() const;
7146 
7147 
7148  /* PURE VIRTUAL METHODS
7149  *
7150  * Used for data pointer access.
7151  */
7152 
7154  virtual const uonebyte* _GetInstUUIDPtr() const = 0;
7155 
7157  virtual const FLAG_16* _GetInstFlagPtr() const = 0;
7158 
7160  virtual const FLAG_16* _GetFlagPtr() const = 0;
7161 
7163  virtual const FLAG_16* _GetAltFlagPtr() const = 0;
7164 
7166  virtual const FLAG_16* _GetAltFlag2Ptr() const = 0;
7167 
7169  virtual const twobyte* _GetTranspositionPtr() const = 0;
7170 
7172  virtual const FLAG_16* _GetMoreFlagsPtr() const = 0;
7173 
7175  virtual const FLAG_16* _GetMoreFlags2Ptr() const = 0;
7176 
7178  virtual const FLAG_16* _GetMoreFlags3Ptr() const = 0;
7179 
7181  virtual const twobyte* _GetAbbrvNamePtr() const = 0;
7182 
7184  virtual const twobyte* _GetFullNamePtr() const = 0;
7185 
7187  virtual const twobyte* _GetClefsPtr() const = 0;
7188 
7190  virtual const Efix32* _GetVertTabNumOffPtr() const = 0;
7191 
7193  virtual const CMPER* _GetFretInstIDPtr() const = 0;
7194 
7196  virtual const Evpu16* _GetBottomBarlineOffsetPtr() const = 0;
7197 
7199  virtual const Evpu16* _GetTopBarlineOffsetPtr() const = 0;
7200 
7202  virtual const utwobyte* _GetCapoLowFretPtr() const = 0;
7203 
7205  virtual const FLAG_16* _GetBotLinesPtr() const = 0;
7206 
7208  virtual const FLAG_16* _GetTopLinesPtr() const = 0;
7209 
7211  virtual const Efix32* _GetLineSpacePtr() const = 0;
7212 
7214  virtual const twobyte* _GetDwWRestPtr() const = 0;
7215 
7217  virtual const twobyte* _GetStemReversalPtr() const = 0;
7218 
7220  virtual const twobyte* _GetRepeatDotsOffPtr() const = 0;
7221 
7223  virtual const twobyte* _GetHOtherRestPtr() const = 0;
7224 
7230  void _SetFlag(FLAG_16 mask, bool state)
7231  {
7232  FLAG_16* pFlag = (FLAG_16*) _GetFlagPtr();
7233  return Set16BitFlag(pFlag, mask, state);
7234  }
7235 
7236 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
7237 private:
7238  /* ACCESSOR METHODS */
7239 
7242  bool _GetInstFlag(FLAG_16 mask) const
7243  {
7244  return GetBitFlag(*_GetInstFlagPtr(), mask);
7245  }
7246 
7249  void _SetInstFlag(FLAG_16 mask, bool state)
7250  {
7251  FLAG_16* pInstFlag = (FLAG_16*) _GetInstFlagPtr();
7252  return Set16BitFlag(pInstFlag, mask, state);
7253  }
7254 
7259  bool _GetFlag(FLAG_16 mask) const
7260  {
7261  return GetBitFlag(*_GetFlagPtr(), mask);
7262  }
7263 
7268  bool _GetAltFlag(FLAG_16 mask) const
7269  {
7270  return GetBitFlag(*_GetAltFlagPtr(), mask);
7271  }
7272 
7277  void _SetAltFlag(FLAG_16 mask, bool state)
7278  {
7279  FLAG_16* pFlag = (FLAG_16*) _GetAltFlagPtr();
7280  return Set16BitFlag(pFlag, mask, state);
7281  }
7282 
7287  bool _GetTranspositionFlag(FLAG_16 mask) const
7288  {
7289  return GetBitFlag(*_GetTranspositionPtr(), mask);
7290  }
7291 
7296  void _SetTranspositionFlag(FLAG_16 mask, bool state)
7297  {
7298  FLAG_16* pFlag = (FLAG_16*) _GetTranspositionPtr();
7299  return Set16BitFlag(pFlag, mask, state);
7300  }
7301 
7306  bool _GetMoreFlags(FLAG_16 mask) const
7307  {
7308  return GetBitFlag(*_GetMoreFlagsPtr(), mask);
7309  }
7310 
7311  bool _GetMoreFlags2(FLAG_16 mask) const
7312  {
7313  return GetBitFlag(*_GetMoreFlags2Ptr(), mask);
7314  }
7315 
7316  bool _GetMoreFlags3(FLAG_16 mask) const
7317  {
7318  return GetBitFlag(*_GetMoreFlags3Ptr(), mask);
7319  }
7320 
7325  void _SetMoreFlags(FLAG_16 mask, bool state)
7326  {
7327  FLAG_16* pFlag = (FLAG_16*) _GetMoreFlagsPtr();
7328  return Set16BitFlag(pFlag, mask, state);
7329  }
7330 
7335  void _SetMoreFlags2(FLAG_16 mask, bool state)
7336  {
7337  FLAG_16* pFlag = (FLAG_16*) _GetMoreFlags2Ptr();
7338  return Set16BitFlag(pFlag, mask, state);
7339  }
7340 
7345  void _SetMoreFlags3(FLAG_16 mask, bool state)
7346  {
7347  FLAG_16* pFlag = (FLAG_16*) _GetMoreFlags3Ptr();
7348  return Set16BitFlag(pFlag, mask, state);
7349  }
7350 
7352  void _SetAbbreviatedNameID(CMPER cmperid)
7353  {
7354  CMPER* pCmper = (CMPER*) _GetAbbrvNamePtr();
7355  *pCmper = cmperid;
7356  }
7357 
7359  void _SetFullNameID(CMPER cmperid)
7360  {
7361  CMPER* pCmper = (CMPER*) _GetFullNamePtr();
7362  *pCmper = cmperid;
7363  }
7364 public:
7365 #if FXT_VERSION >= FINALEVERSION_2012
7366 
7368  static const char* FFUUID_BLANKSTAFF;
7370  static const char* FFUUID_GRANDSTAFF;
7372  static const char* FFUUID_UNKNOWN;
7373 
7374  /* Strings */
7375 
7377  static const char* FFUUID_VIOLIN;
7379  static const char* FFUUID_VIOLA;
7381  static const char* FFUUID_CELLO;
7383  static const char* FFUUID_DOUBLEBASS;
7385  static const char* FFUUID_VIOLINSECTION;
7387  static const char* FFUUID_VIOLASECTION;
7389  static const char* FFUUID_CELLOSECTION;
7391  static const char* FFUUID_VIOLONCELLOSECTION;
7393  static const char* FFUUID_DOUBLEBASSSECTION;
7395  static const char* FFUUID_CONTRABASSSECTION;
7397  static const char* FFUUID_STRINGENSEMBLE;
7399  static const char* FFUUID_VIOLADAMORE;
7401  static const char* FFUUID_AJAENG;
7403  static const char* FFUUID_ARPEGGIONE;
7405  static const char* FFUUID_BARYTON;
7407  static const char* FFUUID_BYZANTINELYRA;
7409  static const char* FFUUID_CRETANLYRA;
7411  static const char* FFUUID_CRWTH;
7413  static const char* FFUUID_DAHU;
7415  static const char* FFUUID_DANGAO;
7417  static const char* FFUUID_DIHU;
7419  static const char* FFUUID_ERHU;
7421  static const char* FFUUID_ERXIAN;
7423  static const char* FFUUID_FIDDLE;
7425  static const char* FFUUID_GAOHU;
7427  static const char* FFUUID_GEHU;
7429  static const char* FFUUID_HAEGEUM;
7431  static const char* FFUUID_HARDANGERFIDDLE;
7433  static const char* FFUUID_HURDYGURDY;
7435  static const char* FFUUID_IGIL;
7437  static const char* FFUUID_KAMANCHA;
7439  static const char* FFUUID_KOKYU;
7441  static const char* FFUUID_KORA;
7443  static const char* FFUUID_LARUAN;
7445  static const char* FFUUID_LEIQIN;
7447  static const char* FFUUID_LIRONE;
7449  static const char* FFUUID_MORINKHUUR;
7451  static const char* FFUUID_NYCKELHARPA;
7453  static const char* FFUUID_OCTOBASS;
7455  static const char* FFUUID_REBAB;
7457  static const char* FFUUID_REBEC;
7459  static const char* FFUUID_SARANGI;
7461  static const char* FFUUID_SARANGIDRONE;
7463  static const char* FFUUID_STROHVIOLIN;
7465  static const char* FFUUID_TROMBAMARINA;
7467  static const char* FFUUID_VIELLE;
7469  static const char* FFUUID_VIOL;
7471  static const char* FFUUID_VIOLADAGAMBA;
7473  static const char* FFUUID_VIOLINOPICCOLO;
7475  static const char* FFUUID_VIOLONCELLOPICCOLO;
7477  static const char* FFUUID_VIOLOTTA;
7479  static const char* FFUUID_ZHONGHU;
7480 
7481  /* Keyboards */
7482 
7484  static const char* FFUUID_PIANO;
7486  static const char* FFUUID_PIANONONAME;
7488  static const char* FFUUID_HARPSICHORD;
7490  static const char* FFUUID_ORGAN;
7492  static const char* FFUUID_ORGAN2STAFF;
7494  static const char* FFUUID_CELESTA;
7496  static const char* FFUUID_ACCORDION;
7498  static const char* FFUUID_MELODICA;
7500  static const char* FFUUID_ELECTRICPIANO;
7502  static const char* FFUUID_CLAVINET;
7504  static const char* FFUUID_SYNTHPAD;
7506  static const char* FFUUID_SYNTHLEAD;
7508  static const char* FFUUID_SYNTHBRASS;
7510  static const char* FFUUID_SYNTHSOUNDTRACK;
7512  static const char* FFUUID_SOUNDFX;
7514  static const char* FFUUID_HARMONIUM;
7516  static const char* FFUUID_ONDESMARTENOT;
7518  static const char* FFUUID_THEREMIN;
7520  static const char* FFUUID_VIRGINAL;
7522  static const char* FFUUID_CLAVICHORD;
7523 
7524  /* Voices */
7525 
7527  static const char* FFUUID_SOPRANOVOICE;
7529  static const char* FFUUID_ALTOVOICE;
7531  static const char* FFUUID_TENORVOICE;
7533  static const char* FFUUID_BARITONEVOICE;
7535  static const char* FFUUID_BASSVOICE;
7537  static const char* FFUUID_VOCALS;
7539  static const char* FFUUID_VOICE;
7541  static const char* FFUUID_VOICENONAME;
7543  static const char* FFUUID_MEZZOSOPRANOVOICE;
7545  static const char* FFUUID_CONTRALTOVOICE;
7547  static const char* FFUUID_COUNTERTENORVOICE;
7549  static const char* FFUUID_BASSBAROTONEVOICE;
7551  static const char* FFUUID_CHOIRAAHS;
7553  static const char* FFUUID_CHOIROOHS;
7555  static const char* FFUUID_YODEL;
7557  static const char* FFUUID_BEATBOX;
7559  static const char* FFUUID_KAZOO;
7561  static const char* FFUUID_TALKBOX;
7563  static const char* FFUUID_VOCALPERCUSSION;
7564 
7565  /* Woodwinds */
7566 
7568  static const char* FFUUID_PICCOLO;
7570  static const char* FFUUID_FLUTE;
7572  static const char* FFUUID_ALTOFLUTE;
7574  static const char* FFUUID_OBOE;
7576  static const char* FFUUID_OBOEDAMORE;
7578  static const char* FFUUID_ENGLISHHORN;
7580  static const char* FFUUID_CLARINETBFLAT;
7582  static const char* FFUUID_CLARINETA;
7584  static const char* FFUUID_CLARINETEFLAT;
7586  static const char* FFUUID_ALTOCLARINET;
7588  static const char* FFUUID_CONTRALTOCLARINET;
7590  static const char* FFUUID_BASSCLARINET;
7592  static const char* FFUUID_CONTRABASSCLARINET;
7594  static const char* FFUUID_BASSOON;
7596  static const char* FFUUID_CONTRABASSOON;
7598  static const char* FFUUID_WINDSECTION;
7600  static const char* FFUUID_SOPRANOSAX;
7602  static const char* FFUUID_ALTOSAX;
7604  static const char* FFUUID_TENORSAX;
7606  static const char* FFUUID_BARITONESAX;
7608  static const char* FFUUID_SOPRANORECORDER;
7610  static const char* FFUUID_SOPRANINORECORDER;
7612  static const char* FFUUID_ALTORECORDER;
7614  static const char* FFUUID_TENORRECORDER;
7616  static const char* FFUUID_BASSRECORDER;
7618  static const char* FFUUID_DESCANTRECORDER;
7620  static const char* FFUUID_OCARINA;
7622  static const char* FFUUID_PENNYWHISTLE;
7624  static const char* FFUUID_PENNYWHISTLED;
7626  static const char* FFUUID_PENNYWHISTLEG;
7628  static const char* FFUUID_LOWIRISHWHISTLE;
7630  static const char* FFUUID_TINWHISTLEBFLAT;
7632  static const char* FFUUID_HARMONICA;
7634  static const char* FFUUID_BASSHARMONICA;
7636  static const char* FFUUID_CONCERTINA;
7638  static const char* FFUUID_BANDONEON;
7640  static const char* FFUUID_HORNF_WWQUINTET;
7642  static const char* FFUUID_BAGPIPES;
7644  static const char* FFUUID_UILLEANNPIPES;
7646  static const char* FFUUID_GAIDAPIPES;
7648  static const char* FFUUID_CONTRAALTOFLUTE;
7650  static const char* FFUUID_BASSFLUTE;
7652  static const char* FFUUID_CONTRABASSFLUTE;
7654  static const char* FFUUID_DOUBLECONTRABASSFLUTE;
7656  static const char* FFUUID_HYPERBASSFLUTE;
7658  static const char* FFUUID_PANPIPES;
7660  static const char* FFUUID_FIFE;
7662  static const char* FFUUID_BOTTLEBLOW;
7664  static const char* FFUUID_JUG;
7666  static const char* FFUUID_PICCOLOOBOE;
7668  static const char* FFUUID_PICCOLOHECKELPHONE;
7670  static const char* FFUUID_HECKELPHONE;
7672  static const char* FFUUID_BASSOBOE;
7674  static const char* FFUUID_BASSETCLARINET;
7676  static const char* FFUUID_BASSETHORN;
7678  static const char* FFUUID_HORNPIPE;
7680  static const char* FFUUID_PICCOLOCLARINET;
7682  static const char* FFUUID_SAXONETTE;
7684  static const char* FFUUID_SOPRANINOSAX;
7686  static const char* FFUUID_MEZZOSOPRANOSAX;
7688  static const char* FFUUID_SOPRILLO;
7690  static const char* FFUUID_CMELODYSAX;
7692  static const char* FFUUID_AULOCHROME;
7694  static const char* FFUUID_XAPHOON;
7696  static const char* FFUUID_BASSSAX;
7698  static const char* FFUUID_CONTRABASSSAX;
7700  static const char* FFUUID_SUBCONTRABASSSAX;
7702  static const char* FFUUID_TUBAX;
7704  static const char* FFUUID_BANSURI;
7706  static const char* FFUUID_DANSO;
7708  static const char* FFUUID_DIZI;
7710  static const char* FFUUID_DILLIKAVAL;
7712  static const char* FFUUID_DIPLE;
7714  static const char* FFUUID_DOUBLEFLUTE;
7716  static const char* FFUUID_DVOJNICE;
7718  static const char* FFUUID_DVOJNICEDRONE;
7720  static const char* FFUUID_FLAGEOLET;
7722  static const char* FFUUID_FUJARA;
7724  static const char* FFUUID_GEMSHORN;
7726  static const char* FFUUID_HOCCHIKU;
7728  static const char* FFUUID_HUN;
7730  static const char* FFUUID_IRISHFLUTE;
7732  static const char* FFUUID_KAVAL;
7734  static const char* FFUUID_KHLUI;
7736  static const char* FFUUID_KNOTWEEDFLUTE;
7738  static const char* FFUUID_KONCOVKAALTOFLUTE;
7740  static const char* FFUUID_KOUDI;
7742  static const char* FFUUID_NEY;
7744  static const char* FFUUID_NOHKAN;
7746  static const char* FFUUID_NOSEFLUTE;
7748  static const char* FFUUID_PALENDAG;
7750  static const char* FFUUID_QUENA;
7752  static const char* FFUUID_RYUTEKI;
7754  static const char* FFUUID_SHAKUHACHI;
7756  static const char* FFUUID_SHEPHERDSPIPE;
7758  static const char* FFUUID_SHINOBUE;
7760  static const char* FFUUID_SHIVAWHISTLE;
7762  static const char* FFUUID_SHVI;
7764  static const char* FFUUID_SULING;
7766  static const char* FFUUID_TARKA;
7768  static const char* FFUUID_TENOROVERTONEFLUTE;
7770  static const char* FFUUID_TUMPONG;
7772  static const char* FFUUID_VENU;
7774  static const char* FFUUID_XIAO;
7776  static const char* FFUUID_XUN;
7778  static const char* FFUUID_ALBOGUE;
7780  static const char* FFUUID_ALBOKA;
7782  static const char* FFUUID_ALTOCRUMHORN;
7784  static const char* FFUUID_ARGHUL;
7786  static const char* FFUUID_BAWU;
7788  static const char* FFUUID_CHALUMEAU;
7790  static const char* FFUUID_CLARINETTEDAMOUR;
7792  static const char* FFUUID_CORNAMUSE;
7794  static const char* FFUUID_DIPLICA;
7796  static const char* FFUUID_DOUBLECLARINET;
7798  static const char* FFUUID_HECKELCLARINA;
7800  static const char* FFUUID_HECKELPHONECLARINET;
7802  static const char* FFUUID_HIRTENSCHALMEI;
7804  static const char* FFUUID_LAUNEDDAS;
7806  static const char* FFUUID_MAQRUNAH;
7808  static const char* FFUUID_MIJWIZ;
7810  static const char* FFUUID_OCTAVIN;
7812  static const char* FFUUID_PIBGORN;
7814  static const char* FFUUID_RAUSCHPFEIFE;
7816  static const char* FFUUID_SIPSI;
7818  static const char* FFUUID_MODERNTAROGATO;
7820  static const char* FFUUID_TENORCRUMHORN;
7822  static const char* FFUUID_ZHALEIKA;
7824  static const char* FFUUID_ALGAITA;
7826  static const char* FFUUID_BIFORA;
7828  static const char* FFUUID_BOMBARDE;
7830  static const char* FFUUID_CROMORNE;
7832  static const char* FFUUID_DUDUK;
7834  static const char* FFUUID_DULCIAN;
7836  static const char* FFUUID_DULZAINA;
7838  static const char* FFUUID_GUAN;
7840  static const char* FFUUID_GUANZI;
7842  static const char* FFUUID_HICHIRIKI;
7844  static const char* FFUUID_HNE;
7846  static const char* FFUUID_JOGIBAJA;
7848  static const char* FFUUID_KENBAU;
7850  static const char* FFUUID_MIZMAR;
7852  static const char* FFUUID_NADASWARAM;
7854  static const char* FFUUID_OBOEDACACCIA;
7856  static const char* FFUUID_PI;
7858  static const char* FFUUID_PIRI;
7860  static const char* FFUUID_PUNGISNAKECHARMER;
7862  static const char* FFUUID_RACKETT;
7864  static const char* FFUUID_REEDCONTRABASS;
7866  static const char* FFUUID_RHAITA;
7868  static const char* FFUUID_ROTHPHONE;
7870  static const char* FFUUID_SARRUSOPHONE;
7872  static const char* FFUUID_SHAWM;
7874  static const char* FFUUID_SHEHNAI;
7876  static const char* FFUUID_SOPILA;
7878  static const char* FFUUID_SORNA;
7880  static const char* FFUUID_SRALAI;
7882  static const char* FFUUID_SUONA;
7884  static const char* FFUUID_SURNAY;
7886  static const char* FFUUID_TAEPYEONGSO;
7888  static const char* FFUUID_ANCIENTTAROGATO;
7890  static const char* FFUUID_TROMPETACHINA;
7892  static const char* FFUUID_ZURLA;
7894  static const char* FFUUID_ZURNA;
7896  static const char* FFUUID_KHAENMOUTHORGAN;
7898  static const char* FFUUID_HULUSI;
7900  static const char* FFUUID_SHENG;
7901 
7902  /* Brass */
7904  static const char* FFUUID_TRUMPETBFLAT;
7906  static const char* FFUUID_TRUMPETC;
7908  static const char* FFUUID_TRUMPETD;
7910  static const char* FFUUID_CORNET;
7912  static const char* FFUUID_FLUGELHORN;
7914  static const char* FFUUID_MELLOPHONE;
7916  static const char* FFUUID_HORNF;
7918  static const char* FFUUID_TROMBONE;
7920  static const char* FFUUID_BASSTROMBONE;
7922  static const char* FFUUID_EUPHONIUM;
7924  static const char* FFUUID_BARITONEBC;
7926  static const char* FFUUID_BARITONETC;
7928  static const char* FFUUID_TUBA;
7930  static const char* FFUUID_BASSTUBA;
7932  static const char* FFUUID_SOUSAPHONE;
7934  static const char* FFUUID_BRASSSECTION;
7936  static const char* FFUUID_PICCOLOTRUMPETA;
7938  static const char* FFUUID_BUGLE;
7940  static const char* FFUUID_CORNETEFLAT;
7942  static const char* FFUUID_HORNEFLAT;
7944  static const char* FFUUID_ALTOTROMBONE;
7946  static const char* FFUUID_TENORTROMBONE;
7948  static const char* FFUUID_CONTRABASSTROMBONE;
7950  static const char* FFUUID_ALPHORN;
7952  static const char* FFUUID_ALTOHORN;
7954  static const char* FFUUID_DIDGERIDOO;
7956  static const char* FFUUID_POSTHORN;
7958  static const char* FFUUID_VIENNAHORN;
7960  static const char* FFUUID_WAGNERTUBA;
7962  static const char* FFUUID_BAROQUETRUMPET;
7964  static const char* FFUUID_BASSTRUMPET;
7966  static const char* FFUUID_CORNETTO;
7968  static const char* FFUUID_FISCORN;
7970  static const char* FFUUID_KUHLOHORN;
7972  static const char* FFUUID_POCKETTRUMPET;
7974  static const char* FFUUID_SAXHORN;
7976  static const char* FFUUID_SLIDETRUMPET;
7978  static const char* FFUUID_CIMBASSO;
7980  static const char* FFUUID_DOUBLEBELLEUPHONIUM;
7982  static const char* FFUUID_SACKBUT;
7984  static const char* FFUUID_HELICON;
7986  static const char* FFUUID_OPHICLEIDE;
7988  static const char* FFUUID_SERPENT;
7990  static const char* FFUUID_SUBCONTRABASSTUBA;
7992  static const char* FFUUID_CONCHSHELL;
7994  static const char* FFUUID_HORAGAI;
7996  static const char* FFUUID_SHOFAR;
7998  static const char* FFUUID_VUVUZELA;
7999 
8000  /* Plucked strings */
8002  static const char* FFUUID_HARP;
8004  static const char* FFUUID_TROUBADORHARP;
8006  static const char* FFUUID_GUITAR;
8008  static const char* FFUUID_GUITAR8VB;
8010  static const char* FFUUID_ACOUSTICGUITAR;
8012  static const char* FFUUID_CLASSICALGUITAR;
8014  static const char* FFUUID_ELECTRICGUITAR;
8016  static const char* FFUUID_STEELGUITAR;
8018  static const char* FFUUID_BANJO;
8020  static const char* FFUUID_TENORBANJO;
8022  static const char* FFUUID_ACOUSTICBASS;
8024  static const char* FFUUID_BASSGUITAR;
8026  static const char* FFUUID_ELECTRICBASS;
8028  static const char* FFUUID_FRETLESSBASS;
8030  static const char* FFUUID_STRINGBASS;
8032  static const char* FFUUID_MANDOLIN;
8034  static const char* FFUUID_DULCIMER;
8036  static const char* FFUUID_HAMMEREDDULCIMER;
8038  static const char* FFUUID_DULCIMER8VB;
8040  static const char* FFUUID_AUTOHARP;
8042  static const char* FFUUID_LUTE;
8044  static const char* FFUUID_UKULELE;
8046  static const char* FFUUID_TENORUKULELE;
8048  static const char* FFUUID_SITAR;
8050  static const char* FFUUID_ZITHER;
8052  static const char* FFUUID_ARCHLUTE;
8054  static const char* FFUUID_BAGLAMA;
8056  static const char* FFUUID_BALALAIKA;
8058  static const char* FFUUID_BANDURA;
8060  static const char* FFUUID_BANJOLELE;
8062  static const char* FFUUID_BARBAT;
8064  static const char* FFUUID_BEGENA;
8066  static const char* FFUUID_BIWA;
8068  static const char* FFUUID_BOLON;
8070  static const char* FFUUID_BORDONUA;
8072  static const char* FFUUID_BOUZOUKI;
8074  static const char* FFUUID_BULGARIANTAMBURA;
8076  static const char* FFUUID_CHAPMANSTICK;
8078  static const char* FFUUID_CHARANGO;
8080  static const char* FFUUID_CHITARRABATTENTE;
8082  static const char* FFUUID_CHOAZHOUGUZHENG;
8084  static const char* FFUUID_CIMBALOM;
8086  static const char* FFUUID_CITTERN;
8088  static const char* FFUUID_CUATRO;
8090  static const char* FFUUID_DANBAU;
8092  static const char* FFUUID_DANNGUYET;
8094  static const char* FFUUID_DANTAMTHAPLUC;
8096  static const char* FFUUID_DANTRANH;
8098  static const char* FFUUID_DANTYBA;
8100  static const char* FFUUID_DIDDLEYBOW;
8102  static const char* FFUUID_DOBRO;
8104  static const char* FFUUID_DOMRA;
8106  static const char* FFUUID_DUTAR;
8108  static const char* FFUUID_DUXIANQIN;
8111  static const char* FFUUID_EKTARA1;
8113  static const char* FFUUID_FLAMENCOGUITAR;
8115  static const char* FFUUID_GEOMUNGO;
8118  static const char* FFUUID_EKTARA2;
8120  static const char* FFUUID_GOTTUVADHYAM;
8124  static const char* FFUUID_GUITARRON;
8126  static const char* FFUUID_GUITJO;
8128  static const char* FFUUID_GUITJODOUBLENECK;
8130  static const char* FFUUID_GUQIN;
8132  static const char* FFUUID_GUZHENG;
8134  static const char* FFUUID_HARPGUITAR;
8136  static const char* FFUUID_IRISHBOUZOUKI;
8138  static const char* FFUUID_JARANAHUASTECA;
8140  static const char* FFUUID_JARANAJAROCHO;
8142  static const char* FFUUID_JARANAMOSQUITO;
8144  static const char* FFUUID_JARANASEGUNDA;
8146  static const char* FFUUID_JARANATERCERA;
8148  static const char* FFUUID_KABOSY;
8150  static const char* FFUUID_KANTELE;
8152  static const char* FFUUID_KAYAGUM;
8154  static const char* FFUUID_KHIM;
8156  static const char* FFUUID_KOBZA;
8158  static const char* FFUUID_KOMUZ;
8160  static const char* FFUUID_KOTO;
8162  static const char* FFUUID_KUTIYAPI;
8164  static const char* FFUUID_LANGELEIK;
8166  static const char* FFUUID_LYRE;
8168  static const char* FFUUID_MANDOBASS;
8170  static const char* FFUUID_MANDOCELLO;
8172  static const char* FFUUID_MANDOLA;
8174  static const char* FFUUID_MANDORA;
8176  static const char* FFUUID_MANDORE;
8178  static const char* FFUUID_MANGBETU;
8180  static const char* FFUUID_MAROVANY;
8182  static const char* FFUUID_MOHANVEENA;
8184  static const char* FFUUID_MOODSWINGER;
8186  static const char* FFUUID_MUSICALBOW;
8188  static const char* FFUUID_NGONI;
8190  static const char* FFUUID_OCTAVEMANDOLIN;
8192  static const char* FFUUID_OUD;
8194  static const char* FFUUID_PIPA;
8196  static const char* FFUUID_PORTUGUESEGUITAR;
8198  static const char* FFUUID_PSALTERY;
8200  static const char* FFUUID_REQUINTOGUITAR;
8202  static const char* FFUUID_RUAN;
8204  static const char* FFUUID_RUDRAVEENA;
8206  static const char* FFUUID_SALLANEH;
8208  static const char* FFUUID_SANSHIN;
8210  static const char* FFUUID_SANTOOR;
8212  static const char* FFUUID_SANXIAN;
8214  static const char* FFUUID_SAROD;
8216  static const char* FFUUID_SAUNG;
8218  static const char* FFUUID_SAZ;
8220  static const char* FFUUID_SE;
8222  static const char* FFUUID_SETAR;
8224  static const char* FFUUID_SHAMISEN;
8226  static const char* FFUUID_TAMBURA;
8229  static const char* FFUUID_TAR_PLUCKED;
8231  static const char* FFUUID_THEORBO;
8233  static const char* FFUUID_TIMPLE;
8235  static const char* FFUUID_TRES;
8237  static const char* FFUUID_TSYMBALY;
8239  static const char* FFUUID_VALIHA;
8241  static const char* FFUUID_VEENA;
8243  static const char* FFUUID_VICHITRAVEENA;
8245  static const char* FFUUID_VIHUELAMEXICO;
8247  static const char* FFUUID_VIHUELASPAIN;
8249  static const char* FFUUID_WASHTUBBASS;
8251  static const char* FFUUID_WHAMOLA;
8253  static const char* FFUUID_XALAM;
8255  static const char* FFUUID_YANGQIN;
8257  static const char* FFUUID_YAZHENG;
8259  static const char* FFUUID_YUEQIN;
8260 
8261  /* Tablature */
8263  static const char* FFUUID_TAB_GUITAR;
8265  static const char* FFUUID_TAB_GUITARNONAME;
8267  static const char* FFUUID_TAB_GUITARSTEMS;
8269  static const char* FFUUID_TAB_GUITAR_D;
8271  static const char* FFUUID_TAB_GUITAR_DADGAD;
8273  static const char* FFUUID_TAB_GUITAR_DOUBLED;
8275  static const char* FFUUID_TAB_GUITAR_DROPD;
8277  static const char* FFUUID_TAB_GUITAR_G;
8279  static const char* FFUUID_TAB_GUITAR_7STRING;
8281  static const char* FFUUID_TAB_BANJO_G;
8283  static const char* FFUUID_TAB_TENORBANJO;
8285  static const char* FFUUID_TAB_BANJO_C;
8287  static const char* FFUUID_TAB_BANJO_D;
8289  static const char* FFUUID_TAB_BANJO_DOUBLEC;
8291  static const char* FFUUID_TAB_BANJO_GMODAL;
8293  static const char* FFUUID_TAB_BANJO_PLECTRUM;
8295  static const char* FFUUID_TAB_BASSGUITAR_4;
8297  static const char* FFUUID_TAB_BASSGUITAR_5;
8299  static const char* FFUUID_TAB_BASSGUITAR_6;
8301  static const char* FFUUID_TAB_DULCIMER_DAA;
8303  static const char* FFUUID_TAB_DULCIMER_DAAUNISON;
8305  static const char* FFUUID_TAB_DULCIMER_DAD;
8307  static const char* FFUUID_TAB_GAMBA;
8309  static const char* FFUUID_TAB_LUTEITALIAN;
8311  static const char* FFUUID_TAB_LUTELETTERS;
8313  static const char* FFUUID_TAB_MANDOLIN;
8315  static const char* FFUUID_TAB_REQUINTO;
8317  static const char* FFUUID_TAB_SITAR_SHANKAR;
8319  static const char* FFUUID_TAB_SITAR_KHAN;
8321  static const char* FFUUID_TAB_UKULELE;
8323  static const char* FFUUID_TAB_VIHUELA;
8324 
8325  /* Pitched Percussion */
8327  static const char* FFUUID_TIMPANI;
8329  static const char* FFUUID_MALLETS;
8331  static const char* FFUUID_BELLS;
8333  static const char* FFUUID_CHIMES;
8335  static const char* FFUUID_CROTALES;
8337  static const char* FFUUID_GLOCKENSPIEL;
8339  static const char* FFUUID_SOPRANOGLOCKENSPIEL;
8341  static const char* FFUUID_ALTOGLOCKENSPIEL;
8343  static const char* FFUUID_MARIMBA;
8345  static const char* FFUUID_BASSMARIMBA;
8347  static const char* FFUUID_MARIMBASINGLESTAFF;
8349  static const char* FFUUID_TUBULARBELLS;
8351  static const char* FFUUID_VIBRAPHONE;
8353  static const char* FFUUID_XYLOPHONE;
8355  static const char* FFUUID_SOPRANOXYLOPHONE;
8357  static const char* FFUUID_ALTOXYLOPHONE;
8359  static const char* FFUUID_BASSXYLOPHONE;
8361  static const char* FFUUID_XYLORIMBA;
8363  static const char* FFUUID_BELL_LYRE;
8365  static const char* FFUUID_BOOMWHACKERS;
8367  static const char* FFUUID_CHROMANOTESINSTRUMENTS;
8369  static const char* FFUUID_CARILLON;
8371  static const char* FFUUID_CRYSTALGLASSES;
8374  static const char* FFUUID_FLEXATONE_PITCHED;
8376  static const char* FFUUID_GLASSHARMONICA;
8378  static const char* FFUUID_GLASSMARIMBA;
8380  static const char* FFUUID_HANDBELLS;
8382  static const char* FFUUID_HANDBELLS_TCLEF;
8384  static const char* FFUUID_HANDBELLS_BCLEF;
8386  static const char* FFUUID_HANG_TCLEF;
8388  static const char* FFUUID_JAWHARP;
8390  static const char* FFUUID_KALIMBA;
8392  static const char* FFUUID_SOPRANOMETALLOPHONE;
8394  static const char* FFUUID_ALTOMETALLOPHONE;
8396  static const char* FFUUID_BASSMETALLOPHONE;
8398  static const char* FFUUID_MUSICALSAW;
8400  static const char* FFUUID_SLIDEWHISTLE;
8402  static const char* FFUUID_STEELDRUMS_TCLEF;
8404  static const char* FFUUID_STEELDRUMS_BCLEF;
8406  static const char* FFUUID_BONANGGAMELAN;
8408  static const char* FFUUID_GANGSAGAMELAN;
8410  static const char* FFUUID_GENDERGAMELAN;
8412  static const char* FFUUID_GIYINGGAMELAN;
8414  static const char* FFUUID_KANTILGAMELAN;
8416  static const char* FFUUID_PELOGPANERUSGAMELAN;
8418  static const char* FFUUID_PEMADEGAMELAN;
8420  static const char* FFUUID_PENYACAHGAMELAN;
8422  static const char* FFUUID_SARONBARUNGGAMELAN;
8424  static const char* FFUUID_SARONDEMONGGAMELAN;
8426  static const char* FFUUID_SARONPANERUSGAMELAN;
8428  static const char* FFUUID_SLENDROPANERUSGAMELAN;
8430  static const char* FFUUID_SLENTHEMSGAMELAN;
8432  static const char* FFUUID_ALMGLOCKEN;
8434  static const char* FFUUID_ANGKLUNG;
8436  static const char* FFUUID_ARRAYMBIRA;
8438  static const char* FFUUID_BALAFON;
8440  static const char* FFUUID_BALAPHON;
8442  static const char* FFUUID_BIANQING;
8444  static const char* FFUUID_BIANZHONG;
8446  static const char* FFUUID_FANGXIANG;
8448  static const char* FFUUID_GANDINGANAKAYO;
8450  static const char* FFUUID_GYIL;
8452  static const char* FFUUID_KUBING;
8454  static const char* FFUUID_KULINTANG;
8456  static const char* FFUUID_KULINTANGAKAYO;
8458  static const char* FFUUID_KULINTANGATINIOK;
8460  static const char* FFUUID_LAMELLAPHONE;
8462  static const char* FFUUID_LIKEMBE;
8464  static const char* FFUUID_LUNTANG;
8466  static const char* FFUUID_MBIRA;
8468  static const char* FFUUID_MURCHANG;
8470  static const char* FFUUID_RANATEKLEK;
8472  static const char* FFUUID_RANATTHUMLEK;
8474  static const char* FFUUID_SANZA;
8476  static const char* FFUUID_TAIKODRUMS;
8478  static const char* FFUUID_TEMPLEBELLS;
8480  static const char* FFUUID_TIBETANBELLS;
8482  static const char* FFUUID_TIBETANSINGINGBOWLS;
8483 
8484  /* Drums */
8485 
8487  static const char* FFUUID_SNAREDRUM;
8489  static const char* FFUUID_BASSDRUM;
8491  static const char* FFUUID_DRUMSET;
8493  static const char* FFUUID_TENORDRUM;
8495  static const char* FFUUID_QUADTOMS;
8497  static const char* FFUUID_QUINTTOMS;
8499  static const char* FFUUID_ROTOTOMS;
8501  static const char* FFUUID_TENORLINE;
8503  static const char* FFUUID_SNARELINE;
8505  static const char* FFUUID_BASSDRUMS_5LINE;
8507  static const char* FFUUID_DJEMBE;
8509  static const char* FFUUID_BONGODRUMS;
8511  static const char* FFUUID_CONGADRUMS;
8513  static const char* FFUUID_LOGDRUM;
8515  static const char* FFUUID_TABLAS;
8517  static const char* FFUUID_TIMBALES;
8519  static const char* FFUUID_AFRICANLOGDRUM;
8521  static const char* FFUUID_APENTEMMA;
8523  static const char* FFUUID_ARABIANFRAMEDRUM;
8525  static const char* FFUUID_ASHIKO;
8527  static const char* FFUUID_ATABAQUE;
8529  static const char* FFUUID_BATA;
8531  static const char* FFUUID_BENDIR;
8533  static const char* FFUUID_BODHRAN;
8535  static const char* FFUUID_BOMBO;
8537  static const char* FFUUID_BOUGARABOU;
8539  static const char* FFUUID_BUFFALODRUM;
8541  static const char* FFUUID_CHENDA;
8543  static const char* FFUUID_CHUDAIKO;
8545  static const char* FFUUID_DABAKAN;
8547  static const char* FFUUID_DAIBYOSI;
8549  static const char* FFUUID_DAMROO;
8551  static const char* FFUUID_DARABUKA;
8553  static const char* FFUUID_DATANGULIONDRUM;
8555  static const char* FFUUID_DHOL;
8557  static const char* FFUUID_DHOLAK;
8559  static const char* FFUUID_DOLLU;
8561  static const char* FFUUID_DONDO;
8563  static const char* FFUUID_DOUNDOUNBA;
8565  static const char* FFUUID_DUFF;
8567  static const char* FFUUID_DUMBEK;
8569  static const char* FFUUID_EWEDRUMKAGAN;
8571  static const char* FFUUID_EWEDRUMKPANLOGO1LARGE;
8573  static const char* FFUUID_EWEDRUMKPANLOGO2MEDIUM;
8575  static const char* FFUUID_EWEDRUMKPANLOGO3COMBO;
8577  static const char* FFUUID_EWEDRUMSOGO;
8579  static const char* FFUUID_FONTOMFROM;
8581  static const char* FFUUID_GEDUK;
8583  static const char* FFUUID_HANDDRUM;
8585  static const char* FFUUID_HIRADAIKO;
8587  static const char* FFUUID_IGIHUMURIZO;
8589  static const char* FFUUID_INGOMA;
8591  static const char* FFUUID_INYAHURA;
8593  static const char* FFUUID_JANGGU;
8595  static const char* FFUUID_KAKKO;
8597  static const char* FFUUID_KANJIRA;
8599  static const char* FFUUID_KENDANGGAMELAN;
8601  static const char* FFUUID_KENKENI;
8603  static const char* FFUUID_KHOL;
8605  static const char* FFUUID_KODAIKO;
8607  static const char* FFUUID_KUDUM;
8609  static const char* FFUUID_LAMBEGDRUM;
8611  static const char* FFUUID_MADAL;
8613  static const char* FFUUID_MADDALE;
8615  static const char* FFUUID_MOROCCODRUM;
8617  static const char* FFUUID_MRIDANGAM;
8619  static const char* FFUUID_NAAL;
8621  static const char* FFUUID_NAGADODAIKO;
8623  static const char* FFUUID_NAGARA;
8625  static const char* FFUUID_NAQARA;
8627  static const char* FFUUID_NATIVELOGDRUM;
8629  static const char* FFUUID_NIGERIANLOGDRUM;
8631  static const char* FFUUID_ODAIKO;
8633  static const char* FFUUID_OKAWA;
8635  static const char* FFUUID_OKEDODAIKO;
8637  static const char* FFUUID_PAHUHULA;
8639  static const char* FFUUID_PAKHAVAJ;
8641  static const char* FFUUID_PANDERO;
8643  static const char* FFUUID_POWWOWDRUM;
8645  static const char* FFUUID_PUEBLODRUM;
8647  static const char* FFUUID_REPINIQUE;
8649  static const char* FFUUID_SABAR;
8651  static const char* FFUUID_SAKARA;
8653  static const char* FFUUID_SAMPHO;
8655  static const char* FFUUID_SANGBAN;
8657  static const char* FFUUID_SHIMEDAIKO;
8659  static const char* FFUUID_SURDO;
8661  static const char* FFUUID_TALKINGDRUM;
8663  static const char* FFUUID_TAMA;
8665  static const char* FFUUID_TAMBORITA;
8667  static const char* FFUUID_TAMTE;
8669  static const char* FFUUID_TANTAN;
8671  static const char* FFUUID_TANGKU;
8673  static const char* FFUUID_TAPHON;
8676  static const char* FFUUID_TARDRUM;
8678  static const char* FFUUID_TASHA;
8680  static const char* FFUUID_THAVIL;
8682  static const char* FFUUID_TOMBAK;
8684  static const char* FFUUID_TUMBAK;
8686  static const char* FFUUID_TSUZUMI;
8688  static const char* FFUUID_UCHIWADAIKO;
8690  static const char* FFUUID_UDAKU;
8692  static const char* FFUUID_ZARB;
8693 
8694  /* Percussion */
8695 
8697  static const char* FFUUID_PERCUSSIONGENERAL;
8699  static const char* FFUUID_PERCACCESSORIES;
8701  static const char* FFUUID_WINDCHIMES;
8703  static const char* FFUUID_CHIMETREE;
8705  static const char* FFUUID_BELLTREE;
8707  static const char* FFUUID_JINGLEBELLS;
8709  static const char* FFUUID_TAMBOURINE;
8711  static const char* FFUUID_TRIANGLE;
8713  static const char* FFUUID_CYMBALS;
8715  static const char* FFUUID_FINGERCYMBALS;
8717  static const char* FFUUID_CRASHCYMBAL;
8719  static const char* FFUUID_HIHATCYMBAL;
8721  static const char* FFUUID_RIDECYMBAL;
8723  static const char* FFUUID_SPLASHCYMBAL;
8725  static const char* FFUUID_TAMTAM;
8727  static const char* FFUUID_GONG;
8729  static const char* FFUUID_AGOGOBELLS;
8731  static const char* FFUUID_AIRHORN;
8733  static const char* FFUUID_BRAKEDRUM;
8735  static const char* FFUUID_CABASA;
8737  static const char* FFUUID_CAJON;
8739  static const char* FFUUID_CASTANETS;
8741  static const char* FFUUID_CLAP;
8743  static const char* FFUUID_CLAPPER;
8745  static const char* FFUUID_CLAVES;
8747  static const char* FFUUID_COWBELL;
8749  static const char* FFUUID_CUICA;
8751  static const char* FFUUID_GUIRO;
8753  static const char* FFUUID_MARACAS;
8755  static const char* FFUUID_POLICEWHISTLE;
8757  static const char* FFUUID_RAINSTICK;
8759  static const char* FFUUID_RATCHET;
8761  static const char* FFUUID_RATTLE;
8763  static const char* FFUUID_SANDBLOCK;
8765  static const char* FFUUID_SHAKERS;
8767  static const char* FFUUID_SPOONS;
8769  static const char* FFUUID_TEMPLEBLOCKS;
8771  static const char* FFUUID_VIBRASLAP;
8773  static const char* FFUUID_WASHBOARD;
8775  static const char* FFUUID_WHIP;
8777  static const char* FFUUID_WINDMACHINE;
8779  static const char* FFUUID_WOODBLOCKS;
8781  static const char* FFUUID_CENGCENGGAMELAN;
8783  static const char* FFUUID_GONGAGENGGAMELAN;
8785  static const char* FFUUID_KEMPULGAMELAN;
8787  static const char* FFUUID_KEMPYANGGAMELAN;
8789  static const char* FFUUID_KENONGGAMELAN;
8791  static const char* FFUUID_KETUKGAMELAN;
8793  static const char* FFUUID_REYONGGAMELAN;
8795  static const char* FFUUID_ADODO;
8797  static const char* FFUUID_AEOLIANHARP;
8799  static const char* FFUUID_AFOXE;
8801  static const char* FFUUID_AGOGOBLOCK;
8803  static const char* FFUUID_AGUNG;
8805  static const char* FFUUID_AGUNGATAMLANG;
8807  static const char* FFUUID_AHOKO;
8809  static const char* FFUUID_BABENDIL;
8811  static const char* FFUUID_BASICINDIANPERCUSSION;
8813  static const char* FFUUID_BERIMBAU;
8815  static const char* FFUUID_BO;
8817  static const char* FFUUID_BONES;
8819  static const char* FFUUID_BONGOBELLS;
8821  static const char* FFUUID_BULLROARER;
8823  static const char* FFUUID_CAXIXI;
8825  static const char* FFUUID_CHACHABELLS;
8827  static const char* FFUUID_CHABARA;
8829  static const char* FFUUID_CHANCHIKI;
8831  static const char* FFUUID_CHIMTA;
8833  static const char* FFUUID_CHINATEMPLEBLOCKS;
8835  static const char* FFUUID_CHINESECYMBALS;
8837  static const char* FFUUID_CHINESEGONGS;
8841  static const char* FFUUID_CHING;
8843  static const char* FFUUID_CHIPPLI;
8845  static const char* FFUUID_DAFF;
8847  static const char* FFUUID_DAFLI;
8849  static const char* FFUUID_DAWURO;
8851  static const char* FFUUID_DEF;
8853  static const char* FFUUID_DOIRA;
8855  static const char* FFUUID_EWEDRUMATOKE;
8857  static const char* FFUUID_EWEDRUMAXATSE;
8859  static const char* FFUUID_EWEDRUMGANGOKUI;
8862  static const char* FFUUID_FLEXATONE_PERC;
8864  static const char* FFUUID_GANDINGAN;
8866  static const char* FFUUID_GANZA;
8868  static const char* FFUUID_GHATAM;
8870  static const char* FFUUID_GHUNGROO;
8872  static const char* FFUUID_GOME;
8874  static const char* FFUUID_GUBAN;
8876  static const char* FFUUID_HANDCYMBAL;
8878  static const char* FFUUID_HANG;
8880  static const char* FFUUID_HATHELI;
8882  static const char* FFUUID_HOSHO;
8884  static const char* FFUUID_HYOUSHIGI;
8886  static const char* FFUUID_IBO;
8888  static const char* FFUUID_INDIANGONG;
8890  static const char* FFUUID_IPU;
8892  static const char* FFUUID_JAWBONE;
8894  static const char* FFUUID_KAEKEEKE;
8896  static const char* FFUUID_KAGUL;
8898  static const char* FFUUID_KALAAU;
8900  static const char* FFUUID_KASHIKLAR;
8902  static const char* FFUUID_KESI;
8904  static const char* FFUUID_KHARTAL;
8906  static const char* FFUUID_KKWAENGGWARI;
8908  static const char* FFUUID_KPOKOKPOKO;
8910  static const char* FFUUID_KRINSLITDRUM;
8912  static const char* FFUUID_LAVASTONES;
8914  static const char* FFUUID_LUOGONG;
8916  static const char* FFUUID_MANJEERA;
8918  static const char* FFUUID_PANCLAPPERS;
8920  static const char* FFUUID_PATSCHEN;
8922  static const char* FFUUID_RATTLECOG;
8924  static const char* FFUUID_RIQ;
8926  static const char* FFUUID_SHEKERE;
8928  static const char* FFUUID_SISTRE;
8930  static const char* FFUUID_SISTRUM;
8932  static const char* FFUUID_SLIDEWHISTLE_PERCCLEF;
8934  static const char* FFUUID_SLITDRUM;
8936  static const char* FFUUID_SNAP;
8938  static const char* FFUUID_STAMP;
8940  static const char* FFUUID_STIRDRUM;
8942  static const char* FFUUID_TEBYOSHI;
8944  static const char* FFUUID_TELEVI;
8946  static const char* FFUUID_TEPONAXTLI;
8948  static const char* FFUUID_THAIGONG;
8950  static const char* FFUUID_TIBETANCYMBALS;
8952  static const char* FFUUID_TICTOCBLOCK;
8954  static const char* FFUUID_TIMBALEBELL;
8956  static const char* FFUUID_TINAJA;
8958  static const char* FFUUID_TINGSHA;
8960  static const char* FFUUID_TOERE;
8962  static const char* FFUUID_TONETANG;
8964  static const char* FFUUID_TRYCHEL;
8966  static const char* FFUUID_UDU;
8968  static const char* FFUUID_ZILLS;
8969 
8970 #endif
8971 
8978  {
8980  STAFFNOTATION_NORMAL = 0,
8981 
8983  STAFFNOTATION_PERCUSSION = 1,
8984 
8986  STAFFNOTATION_TABLATURE = 2
8987  };
8988 
8996 
8998  ALTSTAFF_NORMAL = FXUseNormalNotation,
8999 
9001  ALTSTAFF_SLASHBEATS = FXUseSlashBeatsNotation,
9002 
9004  ALTSTAFF_RHYTHMIC = FXUseRhythmicNotation,
9005 
9007  ALTSTAFF_ONEBARREPEAT = FXUseOneBarRepeatSymbol,
9008 
9010  ALTSTAFF_TWOBARREPEAT = FXUseTwoBarRepeatSymbol,
9011 
9013  ALTSTAFF_BLANKNOTATIONRESTS = 5,
9014 
9016  ALTSTAFF_BLANKNOTATION = FXUseBlankNotation
9017  };
9018 
9025  {
9027  STAFFHIDE_NORMAL = 0,
9028 
9030  STAFFHIDE_SCORE = 1,
9031 
9033  STAFFHIDE_SCORE_AND_PARTS = 2,
9034 
9036  STAFFHIDE_CUTAWAY = 3
9037  };
9038 
9039  /***********/
9040  /* GETTERS */
9041  /***********/
9042 
9047  bool GetIgnoreKeySig() const { return _GetInstFlag(STAFF_NOKEY); }
9048 
9053  bool GetIndependentTimeSig() const { return _GetInstFlag(STAFF_FLOATTIME); }
9054 
9060  bool GetIndependentKeySig() const { return _GetInstFlag(STAFF_FLOATKEYS); }
9061 
9066  bool GetShowMeasureNumbers() const { return !_GetInstFlag(STAFF_NEGMNUMB); }
9067 
9073  bool GetShowKeySignatures() const { return !_GetInstFlag(STAFF_NEGKEY); }
9074 
9075 
9088  {
9089 #if FXT_VERSION < FINALEVERSION_25
9090  return !_GetInstFlag(STAFF_NEGTIME); /* 32-bit PDK */
9091 #else
9092  return !_GetInstFlag(STAFF_NEGTIME_SCORE); /* This is just a rename of the old STAFF_NEGTIME constant */
9093 #endif
9094  }
9095 
9104  {
9105  return GetShowTimeSignatures();
9106  }
9107 
9117  {
9118 #if FXT_VERSION >= FINALEVERSION_25
9119  return !_GetMoreFlags3(STAFF_MF3_NEGTIME_PARTS); /* 64-bit PDK */
9120 #else
9121  return GetShowScoreTimeSignatures(); /* 32-bit PDK */
9122 #endif
9123  }
9124 
9125 
9131  bool GetShowClefs() const { return !_GetInstFlag(STAFF_NEGCLEF); }
9132 
9138  bool GetShowChords() const { return !_GetInstFlag(0x0002 /*STAFF_HIDE_CHORDS*/); }
9139 
9145  bool GetShowBarlines() const { return !_GetInstFlag(STAFF_HIDE_BARLINES); }
9146 
9152  bool GetShowTextRepeats() const { return !_GetInstFlag(STAFF_NEGREPEAT); }
9153 
9158  bool GetShowRepeats() const { return !_GetInstFlag(STAFF_HIDE_RPT_BARS); }
9159 
9164  bool GetShowScoreStaffNames() const { return !_GetInstFlag(STAFF_NEGNAME); }
9165 
9170  bool GetBreakBarlines() const { return _GetInstFlag(STAFF_BLINEBREAK); }
9171 
9176  bool GetBreakRepeatBarlines() const { return _GetInstFlag(STAFF_RBARBREAK); }
9177 
9183  bool GetShowAugmentationDots() const { return _GetMoreFlags(STAFF_MF_SHOW_DOTS); }
9184 
9189  bool GetIndependentFont() const { return _GetFlag(STAFF_USESMFONT); }
9190 
9195  bool GetShowNoteColors() const { return _GetFlag(STAFF_SHOW_NOTE_COLORS); }