Finale PDK Framework 0.77
Power Up Your Finale Music Software
Loading...
Searching...
No Matches
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 <cassert>
12#include <cmath>
13
14#include "ff_timesig.h"
15#include "ff_base.h"
16#include "ff_region.h"
17
18
19
26class __FCOther : public __FCBaseData {
27public:
30 void SetCmperAndInci(CMPER cmper, twobyte inci)
31 {
32 _dataid.other.cmper = cmper;
33 _dataid.other.inci = inci;
34 }
35
36
37public:
38 const char* ClassName() const override { return "__FCOther"; }
39
42
43
51 {
52 if (!DataIsLoaded()) return false;
53 if (_dataid.other.cmper != pCompare->_GetDataID()->other.cmper) return false;
54 if (_dataid.other.inci != pCompare->_GetDataID()->other.inci) return false;
55 return true;
56 }
57};
58
59
63{
64#ifndef DOXYGEN_SHOULD_IGNORE_THIS
66 bool LoadFirst() override { return false; }
67
68 bool _RawRelink() override
69 {
70 DeleteData();
71 return SaveNew(GetItemCmper());
72 }
73
74#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
75public:
80 const char* ClassName() const override { return "__FCInciOther"; }
81
89 virtual bool Load(CMPER itemno, twobyte inci);
90
92 twobyte CalcLastInci() override;
93
95 bool Reload() override;
96
103 virtual bool SaveNew(CMPER itemno);
104
109 void _SetCmper(CMPER cmper) { _dataid.other.cmper = cmper; }
110
111
116 int GetItemCmper() const
117 {
118 if (!DataIsLoaded()) return kNewCmper;
119 return _dataid.other.cmper;
120 }
121
128 int GetItemInci() const
129 {
130 if (!DataIsLoaded()) return kNewInci;
131 return _dataid.other.inci;
132 }
133
134
140 virtual eMeas GetMeasure() const { return 0; }
141
149 virtual eStaff GetStaff() const { return 0; }
150
152 virtual bool HasStaffValue() const { return false; }
153
159 virtual TimeEdu32 GetMeasurePos() const { return 0; }
160};
161
167{
168 twobyte _inciblock[6];
169
170 int DataSizeLoad() const override { return sizeof(_inciblock); } /* A standard inci */
171 void* Allocate() override { return _GetDataPtr(); }
172 EXTAG Tag() const override { return GetCustomTag(); }
173
178 void CloneMemoryFrom(__FCBaseData* pSource) override
179 {
180 memcpy(&_inciblock, ((FCOtherInci*)pSource)->_GetDataPtr(), sizeof(_inciblock));
181 _datablock = &_inciblock;
182 _loadedsize = sizeof(_inciblock);
183 }
184
185 __FCBaseData* CreateObject() override
186 {
187 return new FCOtherInci();
188 }
189public:
190
195 FCOtherInci(EXTAG customTag = 0) : __FCInciOther()
196 {
197 if (customTag) SetCustomTag(customTag);
198 memset(&_inciblock, 0, sizeof(_inciblock));
199 _datablock = &_inciblock;
200 _loadedsize = sizeof(_inciblock);
202 }
203
204#ifndef DOXYGEN_SHOULD_IGNORE_THIS
211 void* _GetDataPtr() { return &_inciblock; }
212#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
213
214 const char* ClassName() const override { return "FCOtherInci"; }
215 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_OTHERINCI; }
216};
217
218
219
231{
232protected:
233#ifndef DOXYGEN_SHOULD_IGNORE_THIS
241 int _DataSizeLoadFullCmper(CMPER cmper, ETAG othertag) const;
242
250 bool _SaveOtherFullCmper(CMPER cmper, void* buffer, int size, ETAG othertag);
251
259 bool _LoadOtherFullCmper(CMPER cmper, void* buffer, int size, ETAG othertag);
260#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
261public:
262 const char* ClassName() const override { return "__FCNoInciOther"; }
263
266
271 virtual bool Load(CMPER itemno);
272
274 bool Reload() override;
275
281 virtual bool SaveAs(CMPER itemno);
282
292 virtual bool DeepSaveAs(CMPER itemno)
293 {
294 return SaveAs(itemno);
295 }
296
303 bool DeepDeleteData() override
304 {
305 return DeleteData();
306 }
307
314 virtual bool SaveNew();
315
323 virtual CMPER GetItemNo() const { return _dataid.other.cmper; }
324
332 void SetItemNo(CMPER cmper)
333 {
334 _dataid.other.cmper = cmper;
335 _dataid.other.inci = 0;
336 }
337
346 bool LoadFirst() override { return Load(1); }
347
348#ifdef PDK_FRAMEWORK_DEBUG
349 void DebugDump() override
350 {
352 DebugOutInt("dataid.other.cmper: ", _dataid.other.cmper);
353 }
354#endif
355
356};
357
358
364{
365#ifndef DOXYGEN_SHOULD_IGNORE_THIS
366 private:
368 EDTCompositeTimeUpper _compositetimeupperdata;
369
370protected:
371 EXTAG Tag() const override { return ot_CompositeTimeUpper; }
372 int DataSizeLoad() const override { return sizeof(EDTCompositeTimeUpper); }
373 void* Allocate() override { return (void*) &_compositetimeupperdata; }
374
379 void CloneMemoryFrom(__FCBaseData* pSource) override
380 {
381 memcpy(&_compositetimeupperdata, ((__FCCompositeTimeSigTopElement*)pSource)->_GetDataPtr(), sizeof(_compositetimeupperdata));
382 _datablock = &_compositetimeupperdata;
383 _loadedsize = sizeof(_compositetimeupperdata);
384 }
385
386 __FCBaseData* CreateObject() override
387 {
389 }
390#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
391public:
392 const char* ClassName() const override { return "__FCCompositeTimeSigTopElement"; }
393 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_COMPOSITETIMESIGTOPELEMENT; }
394
395#ifndef DOXYGEN_SHOULD_IGNORE_THIS
402 void* _GetDataPtr() { return &_compositetimeupperdata; }
403#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
404
407 {
408 memset(&_compositetimeupperdata, 0, sizeof(_compositetimeupperdata));
409 _datablock = &_compositetimeupperdata;
410 _loadedsize = sizeof(_compositetimeupperdata);
411 }
412
414 ECompositeTimeUpper* _GetFirstRecordPtr() { return &_compositetimeupperdata.elements[0]; }
415
417 ECompositeTimeUpper* _GetSecondRecordPtr() { return &_compositetimeupperdata.elements[1]; }
418
419
420#ifdef PDK_FRAMEWORK_DEBUG
421 void DebugDump() override
422 {
424 }
425#endif
426};
427
428
429
435{
436#ifndef DOXYGEN_SHOULD_IGNORE_THIS
437 private:
439 EDTCompositeTimeLower _compositetimelowerdata;
440
441protected:
442 EXTAG Tag() const override { return ot_CompositeTimeLower; }
443 int DataSizeLoad() const override { return sizeof(EDTCompositeTimeLower); }
444 void* Allocate() override { return (void*) &_compositetimelowerdata; }
445
450 void CloneMemoryFrom(__FCBaseData* pSource) override
451 {
452 memcpy(&_compositetimelowerdata, ((__FCCompositeTimeSigBottomElement*)pSource)->_GetDataPtr(), sizeof(_compositetimelowerdata));
453 _datablock = &_compositetimelowerdata;
454 _loadedsize = sizeof(_compositetimelowerdata);
455 }
456
457 __FCBaseData* CreateObject() override
458 {
460 }
461#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
462public:
463 const char* ClassName() const override { return "__FCCompositeTimeSigBottomElement"; }
464 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_COMPOSITETIMESIGBOTTOMELEMENT; }
465
466#ifndef DOXYGEN_SHOULD_IGNORE_THIS
473 void* _GetDataPtr() { return &_compositetimelowerdata; }
474#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
475
478 {
479 memset(&_compositetimelowerdata, 0, sizeof(_compositetimelowerdata));
480 _datablock = &_compositetimelowerdata;
481 _loadedsize = sizeof(_compositetimelowerdata);
482 }
483
485 ECompositeTimeLower* _GetFirstRecordPtr() { return &_compositetimelowerdata.elements[0]; }
486
488 ECompositeTimeLower* _GetSecondRecordPtr() { return &_compositetimelowerdata.elements[1]; }
489
491 ECompositeTimeLower* _GetThirdRecordPtr() { return &_compositetimelowerdata.elements[2]; }
492
493
494#ifdef PDK_FRAMEWORK_DEBUG
495 void DebugDump() override
496 {
498 }
499#endif
500};
501
502
503
504#ifdef PDK_FRAMEWORK_COMPOSITETIMESIGS
516{
518 ECompositeTimeUpper* _pArray;
519
522 int _arraycounter;
523
524#ifndef DOXYGEN_SHOULD_IGNORE_THIS
529 ECompositeTimeUpper* _GetGroupElementPtr(int groupindex, int subindex) const
530 {
531 groupindex++; /* Make the index 1-based internally for this method */
532 int currentindex = 0;
533 int subindexcount = 0;
534 for (int i = 0; i < _arraycounter; i++)
535 {
536 if (_pArray[i].chainstart) currentindex++;
537 if (currentindex == groupindex)
538 {
539 if (subindexcount == subindex) return &_pArray[i];
540 subindexcount++;
541 }
542 if (currentindex > groupindex) return NULL;
543 }
544 return NULL;
545 }
546
554 void _RedistributeArray(CMPER cmper = 0)
555 {
556 if (cmper == 0)
557 {
558 if (GetCount() == 0) return; /* To prevent crash */
560 cmper = pFirstInci->_GetDataID()->other.cmper;
561 }
562 ClearAll();
563 twobyte inci = 0;
564 __FCCompositeTimeSigTopElement* pCurrentObject = NULL;
565 for (int i = 0; i < _arraycounter; i++)
566 {
567 if (i % 2 == 0)
568 {
569 pCurrentObject = new __FCCompositeTimeSigTopElement();
570 EDataID* pDataID = (EDataID*) pCurrentObject->_GetDataID(); /* "Turn off" const */
571 pDataID->other.cmper = cmper;
572 pDataID->other.inci = inci;
573 inci++;
574 memcpy(pCurrentObject->_GetFirstRecordPtr(), &_pArray[i], sizeof(ECompositeTimeUpper));
575 }
576 else
577 {
578 memcpy(pCurrentObject->_GetSecondRecordPtr(), &_pArray[i], sizeof(ECompositeTimeUpper));
579 Add(pCurrentObject);
580 pCurrentObject = NULL;
581 }
582 }
583 if (pCurrentObject) Add(pCurrentObject);
584 }
585#endif
586
587#ifndef DOXYGEN_SHOULD_IGNORE_THIS
588 __FCBaseData* CreateElement() override { return new __FCCompositeTimeSigTopElement(); }
589#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
590 public:
591
592#ifndef DOXYGEN_SHOULD_IGNORE_THIS
594 void _BuildArray()
595 {
596 delete [] _pArray;
597 _pArray = NULL;
598 _arraycounter = 0;
599 if (GetCount() == 0) return;
600 /* Count the number of active records in the array */
601 int activerecords = 0;
602 for (int i = 0; i < GetCount(); i++)
603 {
605 ECompositeTimeUpper* pCompositeTimeUpper = pData->_GetFirstRecordPtr();
606 if ((pCompositeTimeUpper->main == 0) &&
607 (pCompositeTimeUpper->fraction == 0)) continue;
608 activerecords ++;
609 pCompositeTimeUpper = pData->_GetSecondRecordPtr();
610 if ((pCompositeTimeUpper->main == 0) &&
611 (pCompositeTimeUpper->fraction == 0)) continue;
612 activerecords ++;
613 }
614 if (activerecords == 0) return;
615 // Allocate memory and copy:
616 _pArray = new ECompositeTimeUpper[activerecords];
617 int currentindex = 0;
618 for (int i = 0; i < GetCount(); i++)
619 {
621 ECompositeTimeUpper* pCompositeTimeUpper = pData->_GetFirstRecordPtr();
622 if ((pCompositeTimeUpper->main == 0) &&
623 (pCompositeTimeUpper->fraction == 0)) continue;
624 memcpy(&_pArray[currentindex], pCompositeTimeUpper, sizeof(ECompositeTimeUpper));
625 currentindex ++;
626 pCompositeTimeUpper = pData->_GetSecondRecordPtr();
627 if ((pCompositeTimeUpper->main == 0) &&
628 (pCompositeTimeUpper->fraction == 0)) continue;
629 memcpy(&_pArray[currentindex], pCompositeTimeUpper, sizeof(ECompositeTimeUpper));
630 currentindex ++;
631 }
632 _arraycounter = activerecords;
633 }
634#endif
635
636 const char* ClassName() const override { return "FCCompositeTimeSigTop"; }
637
643 {
644 _pArray = NULL;
645 _arraycounter = 0;
646 }
647
650 {
651 delete [] _pArray;
652 _pArray = NULL;
653 _arraycounter = 0;
654 }
655
663 int GetGroupCount() const
664 {
665 int groupcount = 0;
666 for (int i = 0; i < _arraycounter; i++)
667 {
668 if (_pArray[i].chainstart) groupcount++;
669 }
670 return groupcount;
671 }
672
681 int AddGroup(int elementcount)
682 {
683 if (elementcount < 1) return -1;
684 if (elementcount > 10) return -1;
685
686 ECompositeTimeUpper* pNewArray = new ECompositeTimeUpper[_arraycounter + elementcount];
687
688 if (_pArray)
689 {
690 /* Copy the old data and remove it */
691 int bytesize = sizeof(ECompositeTimeUpper) * _arraycounter;
692 memcpy(pNewArray, _pArray, bytesize);
693 delete [] _pArray;
694 }
695
696 /* Initialize the new data */
697 ECompositeTimeUpper* pNewAddedData = &pNewArray[_arraycounter];
698 for (int i = 0; i < elementcount; i++)
699 {
700 pNewAddedData->chainstart = (i == 0);
701 pNewAddedData->fraction = 0;
702 pNewAddedData->main = 1;
703 pNewAddedData ++;
704 }
705
706 /* Set new info: */
707 _arraycounter += elementcount;
708 _pArray = pNewArray;
709
710 return GetGroupCount() - 1;
711 }
712
719 void MergeWithPreviousGroup(int groupindex)
720 {
721 if (groupindex < 1) return;
722 ECompositeTimeUpper* pData = _GetGroupElementPtr(groupindex, 0);
723 if (!pData) return;
724 pData->chainstart = false;
725 }
726
727
736 int GetGroupElementCount(int index) const
737 {
738 index++; /* Make the index 1-based internally for this method */
739 int currentindex = 0;
740 int count = 0;
741 for (int i = 0; i < _arraycounter; i++)
742 {
743 if (_pArray[i].chainstart) currentindex++;
744 if (currentindex == index) count++;
745 if (currentindex > index) return count;
746 }
747 return count;
748 }
749
760 int CalcTotalGroupBeats(int groupindex) const
761 {
762 int beatcount = 0;
763 int elementcount = GetGroupElementCount(groupindex);
764 for (int elementidx = 0; elementidx < elementcount; elementidx++)
765 {
766 beatcount += GetGroupElementBeats(groupindex, elementidx);
767 }
768 return beatcount;
769 }
770
780 int GetGroupElementBeats(int groupindex, int subindex) const
781 {
782 ECompositeTimeUpper* pCompositeTimeUpper = _GetGroupElementPtr(groupindex, subindex);
783 if (!pCompositeTimeUpper) return 0;
784 return pCompositeTimeUpper->main;
785 }
786
796 double GetGroupElementBeatsWithFraction(int groupindex, int subindex) const
797 {
798 ECompositeTimeUpper* pCompositeTimeUpper = _GetGroupElementPtr(groupindex, subindex);
799 if (!pCompositeTimeUpper) return 0;
800 if (! pCompositeTimeUpper->fraction) return pCompositeTimeUpper->main;
801 assert(LO_UONEBYTE(pCompositeTimeUpper->fraction) != 0);
802 return static_cast<double>(pCompositeTimeUpper->main) +
803 (static_cast<double>(HI_UONEBYTE(pCompositeTimeUpper->fraction)) / static_cast<double>(LO_UONEBYTE(pCompositeTimeUpper->fraction)));
804 }
805
811 int GetElementCount() const
812 {
813 return _arraycounter;
814 }
815
824 void SetGroupElementBeats(int groupindex, int subindex, twobyte value)
825 {
826 ECompositeTimeUpper* pCompositeTimeUpper = _GetGroupElementPtr(groupindex, subindex);
827 if (!pCompositeTimeUpper) return;
828 pCompositeTimeUpper->main = value;
829 }
830
839 void SetGroupElementBeatsWithFraction(int groupindex, int subindex, double value)
840 {
841 ECompositeTimeUpper* pCompositeTimeUpper = _GetGroupElementPtr(groupindex, subindex);
842 if (!pCompositeTimeUpper) return;
843 if (value == std::floor(value))
844 {
845 pCompositeTimeUpper->main = std::floor(value);
846 pCompositeTimeUpper->fraction = 0;
847 }
848 else
849 {
850 double integer;
851 double fraction = std::modf(value, &integer);
852 pCompositeTimeUpper->main = integer;
853 pCompositeTimeUpper->fraction = MAKE_TWOBYTE(120, std::lround(fraction * 120.0));
854 }
855 }
856
865 bool SaveAll() override
866 {
867 if (_arraycounter == 0) return false;
868 if (GetCount() == 0)
869 {
870#ifdef PDK_FRAMEWORK_DIAGNOSE
871 DebugOut("FCCompositeTimeSigTop()::SaveAll(): No existing collection items to read CMPER.");
872#endif
873 return false; /* There must be an existing CMPER to save to */
874 }
875 _RedistributeArray();
877 CMPER cmper = pFirstInci->_GetDataID()->other.cmper;
878 DeleteDataForItem(cmper);
880 }
881
884 bool SaveAllForItem(CMPER cmper) override
885 {
886 if (_arraycounter == 0) return false;
887
888 _RedistributeArray(cmper);
889
890 if (GetCount() == 0)
891 {
892#ifdef PDK_FRAMEWORK_DIAGNOSE
893 DebugOut("FCCompositeTimeSigTop()::SaveAllForItem(): No existing collection items to read CMPER.");
894#endif
895 return false; /* There must be an existing CMPER to save to */
896 }
897
898 DeleteDataForItem(cmper);
900
901 return true;
902 }
903};
904
905#endif /*PDK_FRAMEWORK_COMPOSITETIMESIGS*/
906
907
908#ifdef PDK_FRAMEWORK_COMPOSITETIMESIGS
920{
922 ECompositeTimeLower* _pArray;
923
926 int _arraycounter;
927
928#ifndef DOXYGEN_SHOULD_IGNORE_THIS
933 ECompositeTimeLower* _GetGroupElementPtr(int groupindex, int subindex) const
934 {
935 groupindex++; /* Make the index 1-based internally for this method */
936 int currentindex = 0;
937 int subindexcount = 0;
938 for (int i = 0; i < _arraycounter; i++)
939 {
940 if (_pArray[i].chainstart) currentindex++;
941 if (currentindex == groupindex)
942 {
943 if (subindexcount == subindex) return &_pArray[i];
944 subindexcount++;
945 }
946 if (currentindex > groupindex) return NULL;
947 }
948 return NULL;
949 }
950
957 void _RedistributeArray(CMPER cmper = 0)
958 {
959 if (cmper == 0)
960 {
961 if (GetCount() == 0) return; /* To avoid crashes */
963 cmper = pFirstInci->_GetDataID()->other.cmper;
964 }
965 ClearAll();
966 twobyte inci = 0;
967 __FCCompositeTimeSigBottomElement* pCurrentObject = NULL;
968 EDataID* pDataID = NULL;
969 for (int i = 0; i < _arraycounter; i++)
970 {
971 switch (i % 3) {
972 case 0:
973 pCurrentObject = new __FCCompositeTimeSigBottomElement();
974 pDataID = (EDataID*) pCurrentObject->_GetDataID(); /* "Turn off" const */
975 pDataID->other.cmper = cmper;
976 pDataID->other.inci = inci;
977 inci++;
978 memcpy(pCurrentObject->_GetFirstRecordPtr(), &_pArray[i], sizeof (ECompositeTimeLower));
979 break;
980 case 1:
981 memcpy(pCurrentObject->_GetSecondRecordPtr(), &_pArray[i], sizeof (ECompositeTimeLower));
982 break;
983 default:
984 memcpy(pCurrentObject->_GetThirdRecordPtr(), &_pArray[i], sizeof (ECompositeTimeLower));
985 Add(pCurrentObject);
986 pCurrentObject = NULL;
987 break;
988 }
989 }
990 if (pCurrentObject) Add(pCurrentObject);
991 }
992#endif
993
994#ifndef DOXYGEN_SHOULD_IGNORE_THIS
995 __FCBaseData* CreateElement() override { return new __FCCompositeTimeSigBottomElement(); }
996#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
997 public:
998
999#ifndef DOXYGEN_SHOULD_IGNORE_THIS
1001 void _BuildArray()
1002 {
1003 delete [] _pArray;
1004 _pArray = NULL;
1005 _arraycounter = 0;
1006 if (GetCount() == 0) return;
1007 /* Count the number of active records in the array */
1008 int activerecords = 0;
1009 for (int i = 0; i < GetCount(); i++)
1010 {
1012 ECompositeTimeLower* pCompositeTimeLower = pData->_GetFirstRecordPtr();
1013 if (pCompositeTimeLower->main == 0) continue;
1014 activerecords ++;
1015 pCompositeTimeLower = pData->_GetSecondRecordPtr();
1016 if (pCompositeTimeLower->main == 0) continue;
1017 activerecords ++;
1018 pCompositeTimeLower = pData->_GetThirdRecordPtr();
1019 if (pCompositeTimeLower->main == 0) continue;
1020 activerecords ++;
1021 }
1022 if (activerecords == 0) return;
1023 // Allocate memory and copy:
1024 _pArray = new ECompositeTimeLower[activerecords];
1025 int currentindex = 0;
1026 for (int i = 0; i < GetCount(); i++)
1027 {
1029 ECompositeTimeLower* pCompositeTimeLower = pData->_GetFirstRecordPtr();
1030 if (pCompositeTimeLower->main == 0) continue;
1031 memcpy(&_pArray[currentindex], pCompositeTimeLower, sizeof(ECompositeTimeLower));
1032 currentindex ++;
1033 pCompositeTimeLower = pData->_GetSecondRecordPtr();
1034 if (pCompositeTimeLower->main == 0) continue;
1035 memcpy(&_pArray[currentindex], pCompositeTimeLower, sizeof(ECompositeTimeLower));
1036 currentindex ++;
1037 pCompositeTimeLower = pData->_GetThirdRecordPtr();
1038 if (pCompositeTimeLower->main == 0) continue;
1039 memcpy(&_pArray[currentindex], pCompositeTimeLower, sizeof(ECompositeTimeLower));
1040 currentindex ++;
1041 }
1042 _arraycounter = activerecords;
1043 }
1044#endif
1045
1046 const char* ClassName() const override { return "FCCompositeTimeSigBottom"; }
1047
1053 {
1054 _pArray = NULL;
1055 _arraycounter = 0;
1056 }
1057
1060 {
1061 delete [] _pArray;
1062 _pArray = NULL;
1063 _arraycounter = 0;
1064 }
1065
1073 int GetGroupCount() const
1074 {
1075 int groupcount = 0;
1076 for (int i = 0; i < _arraycounter; i++)
1077 {
1078 if (_pArray[i].chainstart) groupcount++;
1079 }
1080 return groupcount;
1081 }
1082
1091 int GetGroupElementCount(int groupindex) const
1092 {
1093 groupindex++; /* Make the index 1-based internally for this method */
1094 int currentindex = 0;
1095 int count = 0;
1096 for (int i = 0; i < _arraycounter; i++)
1097 {
1098 if (_pArray[i].chainstart) currentindex++;
1099 if (currentindex == groupindex) count++;
1100 if (currentindex > groupindex) return count;
1101 }
1102 return count;
1103 }
1104
1114 int GetGroupElementBeatDuration(int groupindex, int subindex) const
1115 {
1116 ECompositeTimeLower* pCompositeTimeLower = _GetGroupElementPtr(groupindex, subindex);
1117 if (!pCompositeTimeLower) return 0;
1118 return pCompositeTimeLower->main;
1119 }
1120
1126 {
1127 return _arraycounter;
1128 }
1129
1138 int AddGroup(int elementcount = 1)
1139 {
1140 if (elementcount < 1) return -1;
1141 if (elementcount > 10) return -1;
1142
1143 ECompositeTimeLower* pNewArray = new ECompositeTimeLower[_arraycounter + elementcount];
1144
1145 if (_pArray)
1146 {
1147 /* Copy the old data and remove it */
1148 int bytesize = sizeof(ECompositeTimeLower) * _arraycounter;
1149 memcpy(pNewArray, _pArray, bytesize);
1150 delete [] _pArray;
1151 }
1152
1153 /* Initialize the new data */
1154 ECompositeTimeLower* pNewAddedData = &pNewArray[_arraycounter];
1155 for (int i = 0; i < elementcount; i++)
1156 {
1157 pNewAddedData->chainstart = (i == 0);
1158 pNewAddedData->main = 1024;
1159 pNewAddedData ++;
1160 }
1161
1162 /* Set new info: */
1163 _arraycounter += elementcount;
1164 _pArray = pNewArray;
1165
1166 return GetGroupCount() - 1;
1167 }
1168
1175 bool DeleteGroup(int groupindex)
1176 {
1177 // JW seems to have believed that each group could only contain one element.
1178 // (This is certainly the most typical scenario.)
1179 // However, groups can definitely contain multiple elements, so this function
1180 // DOES NOT WORK as written! Hence, it is not Lua-connected. RGP 12/27/2021
1181 if (groupindex < 0) return false;
1182 if (groupindex >= GetElementCount()) return false;
1183
1184 /* Assumes that all groups are one element long!!! */
1185 for (int idx = groupindex; idx < _arraycounter - 1; idx ++)
1186 {
1187 TimeEdu32 value = GetGroupElementBeatDuration(idx + 1, 0);
1188 SetGroupElementBeatDuration(idx, 0, value);
1189 }
1190
1191 _arraycounter --;
1192 return true;
1193 }
1194
1203 void SetGroupElementBeatDuration(int groupindex, int subindex, twobyte value)
1204 {
1205 ECompositeTimeLower* pCompositeTimeLower = _GetGroupElementPtr(groupindex, subindex);
1206 if (!pCompositeTimeLower) return;
1207 pCompositeTimeLower->main = value;
1208 }
1209
1218 bool SaveAll() override
1219 {
1220 if (_arraycounter == 0) return false;
1221 if (GetCount() == 0)
1222 {
1223#ifdef PDK_FRAMEWORK_DIAGNOSE
1224 DebugOut("FCCompositeTimeSigBottom()::SaveAll(): No existing collection items to read CMPER.");
1225#endif
1226 return false; /* There must be an existing CMPER to save to */
1227 }
1228 _RedistributeArray();
1230 CMPER cmper = pFirstInci->_GetDataID()->other.cmper;
1231 DeleteDataForItem(cmper);
1233 }
1234
1237 bool SaveAllForItem(CMPER cmper) override
1238 {
1239 if (_arraycounter == 0) return false;
1240 _RedistributeArray(cmper);
1241 if (GetCount() == 0)
1242 {
1243#ifdef PDK_FRAMEWORK_DIAGNOSE
1244 DebugOut("FCCompositeTimeSigBottom()::SaveAllForItem(): No existing collection items to read CMPER.");
1245#endif
1246 return false; /* There must be an existing CMPER to save to */
1247 }
1248
1249 DeleteDataForItem(cmper);
1251
1252 return true;
1253 }
1254};
1255#endif
1256
1257
1258#ifdef PDK_FRAMEWORK_SHAPES
1259
1260#ifndef DOXYGEN_SHOULD_IGNORE_THIS
1261
1262#include "pragma_align_begin.h"
1263#if OPERATING_SYSTEM == WINDOWS
1264struct __EDTPathData2014 /* 13 bytes */
1265{
1266 double f;
1267 fourbyte l;
1268 onebyte isFloat;
1269};
1270#elif OPERATING_SYSTEM == MAC_OS
1271struct __EDTPathData2014 /* 16 bytes */
1272{
1273 double f;
1274 fourbyte l;
1275 fourbyte isFloat;
1276};
1277#endif
1278#include "pragma_align_end.h"
1279
1280#endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1281
1290{
1291 ETAG _tag; /* Instruction tag */
1292 int _size; /* number of parameters */
1293 EDTPathData2002* _pPathDataOld; /* Pointer to data (pre-2014) */
1294 __EDTPathData2014* _pPathData2014; /* Pointer to data for Finale 2014 */
1295#if FXT_VERSION >= FINALEVERSION_2014B
1296 EDTPathData2014b* _pPathData2014b; /* Pointer to data for Finale 2014b and later */
1297#endif
1298 mutable FCString _tagstring; /* For GetTagAsString() */
1299
1300 bool _Is2014Format() const;
1301 bool _Is2014bFormat() const;
1302
1303 void _SetTag(ETAG tag)
1304 {
1305 _tag = tag;
1306 }
1307
1309 void _AllocateParameters(int parametercount);
1310
1312 void _SetFourbyteParameter(int parameterindex, fourbyte intvalue);
1313
1314public:
1315
1321 {
1323 SHAPETAG_SETFONT = st_setfont,
1324
1326 SHAPETAG_STARTOBJECT = st_startobject,
1327
1329 SHAPETAG_STARTGROUP = st_startgroup,
1330
1332 SHAPETAG_ENDGROUP = st_endgroup,
1333
1335 SHAPETAG_DRAWCHAR = st_drawchar,
1336
1338 SHAPETAG_STROKE = st_stroke,
1339
1341 SHAPETAG_RMOVETO = st_rmoveto,
1342
1344 SHAPETAG_LINEWIDTH = st_linewidth,
1345
1347 SHAPETAG_SETDASH = st_setdash,
1348
1350 SHAPETAG_LINETO = st_rlineto,
1351
1353 SHAPETAG_SETGRAY = st_setgray,
1354
1356 SHAPETAG_ELLIPSE = st_ellipse,
1357
1359 SHAPETAG_FILLSOLID = st_fillsolid,
1360
1362 SHAPETAG_CURVETO = st_curveto,
1363
1365 SHAPETAG_SLUR = st_slur,
1366
1368 SHAPETAG_RECTANGLE = st_rectangle,
1369
1371 SHAPETAG_CLOSEPATH = st_closepath,
1372
1374 SHAPETAG_BRACKET = st_bracket,
1375
1377 SHAPETAG_NULL = st_null
1379
1381 FCShapeDefInstruction(ETAG tag, int instructionsize,
1382 void* pPathData);
1383
1384 /* Constructor for using new, created data */
1386 const char* ClassName() const override { return "FCShapeDefInstruction"; }
1387
1401 void _SetMemory(EDTPathInst* pPathInstruction, void* pPathData, int offset);
1402
1404 virtual ~FCShapeDefInstruction();
1405
1411 int GetCount() const { return _size; }
1412
1419 ETAG GetTag() const
1420 {
1421 return _tag;
1422 }
1423
1425 bool IsIdentical(const __FCBase* pTestObject) const override
1426 {
1427 const FCShapeDefInstruction* pTestInstruction = dynamic_cast<const FCShapeDefInstruction*>(pTestObject);
1428 if(!pTestInstruction) return false;
1429 if (GetCount() != pTestInstruction->GetCount()) return false;
1430 if (GetTag() != pTestInstruction->GetTag()) return false;
1431 int count = GetCount();
1432 for (int i = 0; i < count; i++)
1433 {
1434 if (GetFourbyteData(i) != pTestInstruction->GetFourbyteData(i)) return false;
1435 }
1436 return true;
1437 }
1438
1444 const char* GetTagAsString() const
1445 {
1446 _tagstring.Clear();
1447 switch (GetTag()) {
1448 case st_setfont:
1449 _tagstring.SetCString("setfont");
1450 break;
1451 case st_startobject:
1452 _tagstring.SetCString("startobject");
1453 break;
1454 case st_startgroup:
1455 _tagstring.SetCString("startgroup");
1456 break;
1457 case st_endgroup:
1458 _tagstring.SetCString("endgroup");
1459 break;
1460 case st_drawchar:
1461 _tagstring.SetCString("drawchar");
1462 break;
1463 case st_stroke:
1464 _tagstring.SetCString("stroke");
1465 break;
1466 case st_rmoveto:
1467 _tagstring.SetCString("rmoveto");
1468 break;
1469 case st_linewidth:
1470 _tagstring.SetCString("linewidth");
1471 break;
1472 case st_setdash:
1473 _tagstring.SetCString("setdash");
1474 break;
1475 case st_rlineto:
1476 _tagstring.SetCString("rlineto");
1477 break;
1478 case st_setgray:
1479 _tagstring.SetCString("setgrey");
1480 break;
1481 case st_ellipse:
1482 _tagstring.SetCString("ellipse");
1483 break;
1484 case st_fillsolid:
1485 _tagstring.SetCString("fillsolid");
1486 break;
1487 case st_curveto:
1488 _tagstring.SetCString("curveto");
1489 break;
1490 case st_slur:
1491 _tagstring.SetCString("slur");
1492 break;
1493 case st_rectangle:
1494 _tagstring.SetCString("rectangle");
1495 break;
1496 case st_closepath:
1497 _tagstring.SetCString("closepath");
1498 break;
1499 case st_bracket:
1500 _tagstring.SetCString("bracket");
1501 break;
1502 case 0:
1503 _tagstring.SetCString("Null");
1504 break;
1505 default:
1506 _tagstring.AppendCharacter((GetTag() & 0xff00) / 256);
1507 _tagstring.AppendCharacter(GetTag() & 0xff);
1508 break;
1509 }
1510
1511 return _tagstring.GetCString();
1512 }
1513
1521 fourbyte GetFourbyteData(int index) const;
1522
1534 bool SetFourbyteData(int index, fourbyte fbvalue)
1535 {
1536 if (index < 0) return false;
1537 if (index >= _size) return false;
1538 _SetFourbyteParameter(index, fbvalue);
1539 return true;
1540 }
1541
1549 double GetFloatData(int index);
1550
1563 void Init_StartObject(int xorigin, int yorigin, int left, int top, int right, int bottom, int xtransform = 1000, int ytransform = 1000, int rotation = 0)
1564 {
1565 _SetTag(st_startobject);
1566 _AllocateParameters(11);
1567 _SetFourbyteParameter(0, xorigin);
1568 _SetFourbyteParameter(1, yorigin);
1569 _SetFourbyteParameter(2, left);
1570 _SetFourbyteParameter(3, top);
1571 _SetFourbyteParameter(4, right);
1572 _SetFourbyteParameter(5, bottom);
1573 _SetFourbyteParameter(6, xtransform);
1574 _SetFourbyteParameter(7, ytransform);
1575 _SetFourbyteParameter(8, rotation);
1576 /* The rest of the parameters is 0 */
1577 }
1578
1583 void Init_StartGroup(int xorigin, int yorigin, int left, int top, int right, int bottom, int xtransform = 1000, int ytransform = 1000, int rotation = 0)
1584 {
1585 _SetTag(st_startgroup);
1586 _AllocateParameters(11);
1587 _SetFourbyteParameter(0, xorigin);
1588 _SetFourbyteParameter(1, yorigin);
1589 _SetFourbyteParameter(2, left);
1590 _SetFourbyteParameter(3, top);
1591 _SetFourbyteParameter(4, right);
1592 _SetFourbyteParameter(5, bottom);
1593 _SetFourbyteParameter(6, xtransform);
1594 _SetFourbyteParameter(7, ytransform);
1595 _SetFourbyteParameter(8, rotation);
1596 /* The rest of the parameters is 0 */
1597 }
1598
1603 {
1604 _SetTag(st_endgroup);
1605 _AllocateParameters(0);
1606 }
1607
1609 void Init_RMoveTo(int x, int y)
1610 {
1611 _SetTag(st_rmoveto);
1612 _AllocateParameters(2);
1613 _SetFourbyteParameter(0, x);
1614 _SetFourbyteParameter(1, y);
1615 }
1616
1618 void Init_CurveTo(int x1, int y1, int x2, int y2, int endpt_x, int endpt_y)
1619 {
1620 _SetTag(st_curveto);
1621 _AllocateParameters(6);
1622 _SetFourbyteParameter(0, x1);
1623 _SetFourbyteParameter(1, y1);
1624 _SetFourbyteParameter(2, x2);
1625 _SetFourbyteParameter(3, y2);
1626 _SetFourbyteParameter(4, endpt_x);
1627 _SetFourbyteParameter(5, endpt_y);
1628 }
1629
1631 void Init_Slur(int x1, int y1, int x2, int y2, int endpt_x, int endpt_y)
1632 {
1633 _SetTag(st_slur);
1634 _AllocateParameters(6);
1635 _SetFourbyteParameter(0, x1);
1636 _SetFourbyteParameter(1, y1);
1637 _SetFourbyteParameter(2, x2);
1638 _SetFourbyteParameter(3, y2);
1639 _SetFourbyteParameter(4, endpt_x);
1640 _SetFourbyteParameter(5, endpt_y);
1641 }
1642
1643
1647 void Init_LineWidth(int linewidth)
1648 {
1649 _SetTag(st_linewidth);
1650 _AllocateParameters(1);
1651 _SetFourbyteParameter(0, linewidth);
1652 }
1653
1657 void Init_SetGrey(int greyvalue)
1658 {
1659 _SetTag(st_setgray);
1660 _AllocateParameters(1);
1661 _SetFourbyteParameter(0, greyvalue);
1662 }
1663
1666 {
1667 _SetTag(st_fillsolid);
1668 _AllocateParameters(0);
1669 }
1670
1673 {
1674 _SetTag(st_closepath);
1675 _AllocateParameters(0);
1676 }
1677
1683 void Init_Ellipse(int width, int height)
1684 {
1685 _SetTag(st_ellipse);
1686 _AllocateParameters(2);
1687 _SetFourbyteParameter(0, width);
1688 _SetFourbyteParameter(1, height);
1689 }
1690
1695 void Init_Rectangle(int width, int height)
1696 {
1697 _SetTag(st_rectangle);
1698 _AllocateParameters(2);
1699 _SetFourbyteParameter(0, width);
1700 _SetFourbyteParameter(1, height);
1701 }
1702
1706 void Init_DrawChar(eUniChar16 character)
1707 {
1708 _SetTag(st_drawchar);
1709 _AllocateParameters(1);
1710 _SetFourbyteParameter(0, character);
1711 }
1712
1716 void Init_SetFont(FCFontInfo* pFontInfo)
1717 {
1718 _SetTag(st_setfont);
1719 _AllocateParameters(3);
1720 _SetFourbyteParameter(0, pFontInfo->GetIDByName()); /* Enigma font ID */
1721 _SetFourbyteParameter(1, pFontInfo->GetSize()); /* font size */
1722 _SetFourbyteParameter(2, pFontInfo->GetEnigmaStyles()); /* efx */
1723 }
1724
1727 void Init_SetDash(int dashlength, int spacebetween)
1728 {
1729 _SetTag(st_setdash);
1730 _AllocateParameters(2);
1731 _SetFourbyteParameter(0, dashlength);
1732 _SetFourbyteParameter(1, spacebetween);
1733 }
1734
1736 void Init_RLineTo(int x, int y)
1737 {
1738 _SetTag(st_rlineto);
1739 _AllocateParameters(2);
1740 _SetFourbyteParameter(0, x);
1741 _SetFourbyteParameter(1, y);
1742 }
1743
1745 void Init_Bracket(int brackettype)
1746 {
1747 _SetTag(st_bracket);
1748 _AllocateParameters(1);
1749 _SetFourbyteParameter(0, brackettype);
1750 }
1751
1754 {
1755 _SetTag(st_stroke);
1756 _AllocateParameters(0);
1757 }
1758
1761 {
1762 _SetTag(0);
1763 _AllocateParameters(0);
1764 }
1765
1766
1767#if PDK_FRAMEWORK_DEBUG
1768 void DebugDump() override
1769 {
1771
1772 DebugOutInt("sizeof double: ", sizeof(double));
1773 DebugOutString("Tag: ", GetTagAsString());
1774
1775 DebugOutInt("No of parameters: ", _size);
1776 for (int i = 0; i < _size; i++)
1777 {
1778 FCString parameterstring("Parameter ");
1779 parameterstring.AppendInteger(i + 1);
1780 parameterstring.AppendCString(": ");
1781 parameterstring.AppendInteger(GetFourbyteData(i));
1782 parameterstring.AppendCString(" (");
1783 parameterstring.AppendFloat(GetFloatData(i));
1784 parameterstring.AppendCString(")");
1785 DebugOutString("", &parameterstring);
1786 }
1787 }
1788#endif
1789};
1790#endif /* PDK_FRAMEWORK_SHAPES */
1791
1792
1793#ifdef PDK_FRAMEWORK_SHAPES
1794
1804{
1805public:
1806 const char* ClassName() const override { return "FCShapeDefInstructions"; }
1807
1813
1822 {
1823 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1824 pInstruction->Init_Null();
1825 Add(pInstruction);
1826 return pInstruction;
1827 }
1828
1846 FCPoint* pBoundRightBottom,
1847 int xtransform = 1000, int ytransform = 1000,
1848 int rotation = 0)
1849 {
1850 if (!pOrigin) return NULL;
1851 if (!pBoundLeftTop) return NULL;
1852 if (!pBoundRightBottom) return NULL;
1853 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1854
1855 pInstruction->Init_StartObject((int) pOrigin->GetX(),
1856 (int) pOrigin->GetY(),
1857 (int) pBoundLeftTop->GetX(),
1858 (int) pBoundLeftTop->GetY(),
1859 (int) pBoundRightBottom->GetX(),
1860 (int) pBoundRightBottom->GetY(),
1861 xtransform, ytransform, rotation);
1862 Add(pInstruction);
1863 return pInstruction;
1864 }
1865
1873 FCPoint* pBoundRightBottom,
1874 int xtransform = 1000, int ytransform = 1000,
1875 int rotation = 0)
1876 {
1877 if (!pOrigin) return NULL;
1878 if (!pBoundLeftTop) return NULL;
1879 if (!pBoundRightBottom) return NULL;
1880 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1881
1882 pInstruction->Init_StartGroup((int) pOrigin->GetX(),
1883 (int) pOrigin->GetY(),
1884 (int) pBoundLeftTop->GetX(),
1885 (int) pBoundLeftTop->GetY(),
1886 (int) pBoundRightBottom->GetX(),
1887 (int) pBoundRightBottom->GetY(),
1888 xtransform, ytransform, rotation);
1889 Add(pInstruction);
1890 return pInstruction;
1891 }
1892
1896 {
1897 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1898 pInstruction->Init_EndGroup();
1899 Add(pInstruction);
1900 return pInstruction;
1901 }
1902
1912 {
1913 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1914 pInstruction->Init_LineWidth(linewidth);
1915 Add(pInstruction);
1916 return pInstruction;
1917 }
1918
1926 {
1927 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1928 pInstruction->Init_SetGrey(percent);
1929 Add(pInstruction);
1930 return pInstruction;
1931 }
1932
1938 {
1939 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1940 pInstruction->Init_FillSolid();
1941 Add(pInstruction);
1942 return pInstruction;
1943 }
1944
1951 {
1952 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1953 pInstruction->Init_ClosePath();
1954 Add(pInstruction);
1955 return pInstruction;
1956 }
1957
1965 FCShapeDefInstruction* AddEllipse(int width, int height)
1966 {
1967 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1968 pInstruction->Init_Ellipse(width, height);
1969 Add(pInstruction);
1970 return pInstruction;
1971 }
1972
1980 FCShapeDefInstruction* AddRectangle(int width, int height)
1981 {
1982 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
1983 pInstruction->Init_Rectangle(width, height);
1984 Add(pInstruction);
1985 return pInstruction;
1986 }
1987
2001 FCShapeDefInstruction* AddCurveTo(int ctrlpt_height = 72)
2002 {
2003 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2004 pInstruction->Init_CurveTo(72, ctrlpt_height, 144, 0, 72, -ctrlpt_height);
2005 Add(pInstruction);
2006 return pInstruction;
2007 }
2008
2033 FCShapeDefInstruction* AddCurveToDetails(int x1, int y1, int x2, int y2, int endpt_x, int endpt_y)
2034 {
2035 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2036 pInstruction->Init_CurveTo(x1, y1, x2, y2, endpt_x, endpt_y);
2037 Add(pInstruction);
2038 return pInstruction;
2039 }
2040
2048 FCShapeDefInstruction* AddSlur(int ctrlpt_height = 72)
2049 {
2050 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2051 pInstruction->Init_Slur(72, ctrlpt_height, 144, 0, 72, -ctrlpt_height);
2052 Add(pInstruction);
2053 return pInstruction;
2054 }
2055
2062 {
2063 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2064 pInstruction->Init_Stroke();
2065 Add(pInstruction);
2066 return pInstruction;
2067 }
2068
2076 FCShapeDefInstruction* AddSetDash(int dashlength, int spacebetween)
2077 {
2078 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2079 pInstruction->Init_SetDash(dashlength, spacebetween);
2080 Add(pInstruction);
2081 return pInstruction;
2082 }
2083
2092 {
2093 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2094 pInstruction->Init_RLineTo(x, y);
2095 Add(pInstruction);
2096 return pInstruction;
2097 }
2098
2106 {
2107 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2108 pInstruction->Init_Bracket(brackettype);
2109 Add(pInstruction);
2110 return pInstruction;
2111 }
2112
2118 {
2119 return AddSetDash(18, 0);
2120 }
2121
2130 {
2131 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2132 pInstruction->Init_RMoveTo(x, y);
2133 Add(pInstruction);
2134 return pInstruction;
2135 }
2136
2147 {
2148 if (!pFontInfo) return NULL;
2149 FCShapeDefInstruction* pInstruction = new FCShapeDefInstruction();
2150 pInstruction->Init_SetFont(pFontInfo);
2151 Add(pInstruction);
2152 return pInstruction;
2153 }
2154
2166 FCShapeDefInstruction* AddDrawChar(eUniChar16 character);
2167
2177 FCShapeDefInstruction* AddDrawChars(const char* pszString)
2178 {
2179 if (!pszString) return NULL;
2180 int length = (int) strlen(pszString);
2181 FCShapeDefInstruction* pReturn = NULL;
2182 for (int i = 0; i < length; i++)
2183 {
2184 pReturn = AddDrawChar(pszString[i]);
2185 }
2186 return pReturn;
2187 }
2188
2201 {
2202 if (!pString) return NULL;
2203 int length = pString->GetLength();
2204 FCShapeDefInstruction* pReturn = NULL;
2205 for (int i = 0; i < length; i++)
2206 {
2207 pReturn = AddDrawChar(pString->GetCharacterAt(i));
2208 }
2209 return pReturn;
2210 }
2211};
2212#endif /* PDK_FRAMEWORK_SHAPES */
2213
2214#ifdef PDK_FRAMEWORK_SHAPES
2215#define __ot_Shape_WORKAROUNDTAG MAKEEXTAG(edOther,'S','D')
2216
2233{
2234public:
2238 {
2239 SHAPEDEFTYPE_UNKNOWN = -1,
2240 SHAPEDEFTYPE_OTHER = 0,
2241 SHAPEDEFTYPE_ARTICULATION = 1,
2242 SHAPEDEFTYPE_BARLINE = 2,
2243 SHAPEDEFTYPE_EXECUTABLESHAPE = 3,
2244 SHAPEDEFTYPE_EXPRESSION = 4,
2245 SHAPEDEFTYPE_NOTE = 5,
2246 SHAPEDEFTYPE_FRAME = 6,
2247 SHAPEDEFTYPE_ARROWHEAD = 7,
2248 SHAPEDEFTYPE_FRETBOARD = 8,
2249 SHAPEDEFTYPE_CLEF = 9
2250 };
2251
2252private:
2253#ifndef DOXYGEN_SHOULD_IGNORE_THIS
2254 EDTShape* _TypeCast() const { return (EDTShape*)_datablock; }
2255#if FXT_VERSION >= FINALEVERSION_2014B
2256 EDTShape2014b* _TypeCast2014b() const { return (EDTShape2014b*)_datablock; }
2257#endif
2258 /* _isemptyshape & _shapedeftype are used for pre2014b, to
2259 try to work around load crashes for empty shapes on Windows */
2260 bool _isemptyshape;
2261 SHAPEDEF_TYPES _shapedeftype;
2262
2263 void _AllocateMemory(int size)
2264 {
2265 if (size == 0)
2266 {
2267 _datablock = NULL;
2268 _loadedsize = 0;
2269 return;
2270 }
2271 _datablock = new char [size];
2272 memset(_datablock, 0, size);
2273 _loadedsize = size;
2274 }
2275
2276 bool _Is2014Format() const;
2277
2278 bool _Is2014bFormat() const;
2279
2284 bool _SaveType(SHAPEDEF_TYPES shapedeftype)
2285 {
2286 /* On Fin2014b, the shape type is available in the struct. */
2287 if (_Is2014bFormat()) return true;
2288
2289 twobyte oneinci[6];
2290 EDataID dataID;
2291 dataID.other.cmper = _dataid.other.cmper;
2292 dataID.other.inci = 0;
2293 fourbyte size = sizeof(oneinci);
2294 /* Load the raw data (no special extag!) */
2295 if (!FX_LoadEData(__ot_Shape_WORKAROUNDTAG, &dataID, &oneinci, &size)) return false;
2296 oneinci[2] = (twobyte) shapedeftype;
2297 _shapedeftype = shapedeftype;
2298 return FX_SaveEData(__ot_Shape_WORKAROUNDTAG, &dataID, &oneinci, size) != 0;
2299 }
2300
2305 bool _LoadType()
2306 {
2307 /* On Fin2014b, the shape type is available in the struct */
2308 if (_Is2014bFormat()) return true;
2309
2310 twobyte oneinci[6];
2311 EDataID dataID;
2312 dataID.other.cmper = _dataid.other.cmper;
2313 dataID.other.inci = 0;
2314 fourbyte size = sizeof(oneinci);
2315 /* Load the raw data (no special extag!) */
2316 if (!FX_LoadEData(__ot_Shape_WORKAROUNDTAG, &dataID, &oneinci, &size)) return false;
2317 _shapedeftype = (SHAPEDEF_TYPES) oneinci[2];
2318 return true;
2319 }
2320
2321protected:
2324 EXTAG Tag() const override { return GetCustomTag() ? GetCustomTag() : ot_Shape; }
2325
2326 EVERSION EnigmaVersion() const override;
2327
2328 void CloneMemoryFrom(__FCBaseData* pSource) override
2329 {
2330 /* Copy the heap: */
2332 /* Copy the empty shape state */
2333 _isemptyshape = ((FCShapeDef*) pSource)->_GetIsEmptyShape();
2334 }
2335
2336 int DataSizeLoad() const override
2337 {
2338 fourbyte size;
2339 if (!FX_LoadEData(Tag(), &_dataid, NULL, &size, EnigmaVersion())) return 0;
2340
2341#if !defined(__LP64__) && !defined(_WIN64)
2342 if (!_Is2014bFormat())
2343 {
2344 /* Attempt to workaround for empty shape crashes on earlier Finale versions. */
2345 SetCustomTag((size == sizeof(EDTShape)) ? __ot_Shape_WORKAROUNDTAG : ot_Shape);
2346 }
2347#endif // 32-bit only
2348
2349 return size;
2350 }
2351
2352 void* Allocate() override
2353 {
2354 _AllocateMemory(DataSizeLoad());
2355 return _datablock;
2356 }
2357
2358 void Deallocate() override
2359 {
2360 if (_datablock) delete [] (char*) _datablock;
2361 _datablock = NULL;
2362 _loadedsize = 0;
2363 }
2364
2365 bool IsDynamicSize() override { return true; }
2366
2367 __FCBaseData* CreateObject() override { return new FCShapeDef(); }
2368
2373 EDTPathInst* _GetPathInstructionArray()
2374 {
2375 if (_isemptyshape) return NULL;
2376 if (_Is2014bFormat())
2377 {
2378#if FXT_VERSION >= FINALEVERSION_2014B
2379 return (EDTPathInst*) ((char *)_datablock + _TypeCast2014b()->instrucOff);
2380#endif
2381 }
2382 else
2383 {
2384 return (EDTPathInst*) ((char *)_datablock + _TypeCast()->instrucOff);
2385 }
2386 return NULL;
2387 }
2388
2394 void* _GetPathDataArray()
2395 {
2396 if (_isemptyshape) return NULL;
2397 if (_Is2014bFormat())
2398 {
2399#if FXT_VERSION >= FINALEVERSION_2014B
2400 return (void*) ((char *)_datablock + _TypeCast2014b()->dataOff);
2401#endif
2402 }
2403 else
2404 {
2405 return (void*) ((char *)_datablock + _TypeCast()->dataOff);
2406 }
2407 return NULL;
2408 }
2409
2419 bool _EmptyShapeCheck(CMPER cmper, bool* pIsEmpty)
2420 {
2421#ifdef PDK_FRAMEWORK_DIAGNOSE
2422 if (_Is2014bFormat())
2423 {
2424 DebugOut("FCShapeDef::_EmptyShapeCheck was called on 2014b struct.");
2425 return false;
2426 }
2427#endif
2428
2429 *pIsEmpty = true;
2430 //twobyte shapetestinci[6];
2431 EDTShape shapetest;
2432 memset(&shapetest, 0, sizeof(shapetest));
2433 EDataID dataID;
2434 dataID.other.cmper = cmper;
2435 dataID.other.inci = 0;
2436 fourbyte size = sizeof(shapetest);
2437 /* Load the raw data (no special extag) */
2438 bool result = FX_LoadEData(__ot_Shape_WORKAROUNDTAG,
2439 &dataID, &shapetest, &size, EnigmaVersion()) != 0;
2440 if (!result) return false;
2441 int loopcount = size / sizeof(twobyte);
2442 twobyte* pNonZeroCheck = (twobyte*) &shapetest;
2443 for (int i = 0; i < loopcount; i++)
2444 {
2445 if (pNonZeroCheck[i])
2446 {
2447 if (i == 1) continue; /* On the 1st twobyte (0-based), there might
2448 be data even for empty shapes!!! */
2449 if (i == 2) continue; /* On the 2nd twobyte (0-based), there might
2450 be data even for empty shapes!!! */
2451 *pIsEmpty = false;
2452 return true;
2453 }
2454 }
2455 return true;
2456 }
2457
2458
2465 void* _GetInstructionDataPointer(int index);
2466
2467#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
2468public:
2469 const char* ClassName() const override { return "FCShapeDef"; }
2470 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_SHAPEDEF; }
2471
2474 {
2475 _isemptyshape = true;
2476 _shapedeftype = SHAPEDEFTYPE_UNKNOWN;
2477 }
2478
2479 /* Virtual destructor */
2480 virtual ~FCShapeDef()
2481 {
2482 Deallocate();
2483 }
2484
2488 bool _GetIsEmptyShape() { return _isemptyshape; }
2489
2493 {
2494 if (_Is2014bFormat()) return false;
2495
2496 EDataID dataID;
2497 twobyte buffer[6];
2498 dataID.other.cmper = GetItemNo();
2499 dataID.other.inci = 0;
2500 fourbyte size = sizeof(buffer);
2501 memset(buffer, 0, sizeof(buffer));
2502 if (!FX_LoadEData(__ot_Shape_WORKAROUNDTAG, &dataID, buffer, &size, FINALEVERSION_2010)) return false;
2503 return ((buffer[2] & 0x0008) != 0);
2504 }
2505
2507 bool LoadFirst() override
2508 {
2509 return Load(1);
2510 }
2511
2512 bool DeleteData() override
2513 {
2514 if (CalcProtected()) return false;
2516 }
2517
2519 bool LoadNext() override
2520 {
2521 return Load(GetItemNo() + 1);
2522 }
2523
2527 bool Load(CMPER itemno) override
2528 {
2529 bool isemptyshape;
2530
2531 bool result = false;
2532 if (_Is2014bFormat())
2533 {
2534 /* Normal load */
2535 result = __FCNoInciOther::Load(itemno);
2536 if (result)
2537 {
2538#if FXT_VERSION >= FINALEVERSION_2014B
2539 _shapedeftype = (SHAPEDEF_TYPES) _TypeCast2014b()->shapeType;
2540 /* _isemptyshape shouldn't actively be used on 2014b+ */
2541 _isemptyshape = (_TypeCast2014b()->instrucLen == 0);
2542#endif
2543 }
2544 else
2545 {
2546 _shapedeftype = SHAPEDEFTYPE_UNKNOWN;
2547 _isemptyshape = true;
2548 }
2549 }
2550 else
2551 {
2552 /* On pre2014b, try to work around the empty shape crash bug */
2553 if (!_EmptyShapeCheck(itemno, &isemptyshape)) return false;
2554 SetCustomTag(isemptyshape ? __ot_Shape_WORKAROUNDTAG : ot_Shape);
2555 _isemptyshape = isemptyshape;
2556 result = __FCNoInciOther::Load(itemno);
2557 if (result)
2558 _LoadType();
2559 else
2560 _shapedeftype = SHAPEDEFTYPE_UNKNOWN;
2561 }
2562 return result;
2563 }
2564
2578#ifndef PDK_FRAMEWORK_LUAFRIENDLY
2580#else
2581 int
2582#endif
2583 GetType() const {
2584 if (!DataIsLoaded()) return SHAPEDEFTYPE_UNKNOWN;
2585 if (_Is2014bFormat())
2586 {
2587#if FXT_VERSION >= FINALEVERSION_2014B
2588 return (FCShapeDef::SHAPEDEF_TYPES) _TypeCast2014b()->shapeType;
2589#endif
2590 }
2591 return _shapedeftype;
2592 }
2593
2604#ifndef PDK_FRAMEWORK_LUAFRIENDLY
2606#else
2607 int
2608#endif
2609 shapedeftype
2610 )
2611 {
2612 if (_Is2014bFormat())
2613 {
2614 /* On Finale 2014b, the shape type is in the struct */
2615#if FXT_VERSION >= FINALEVERSION_2014B
2616 _TypeCast2014b()->shapeType = shapedeftype;
2617#endif
2618 }
2619 if (!SaveNew()) return false;
2620 if (!_Is2014bFormat())
2621 {
2622 if (!_SaveType((SHAPEDEF_TYPES) shapedeftype)) return false;
2623 }
2624 return true;
2625 }
2626
2639#ifndef PDK_FRAMEWORK_LUAFRIENDLY
2641#else
2642 twobyte
2643#endif
2644 shapedeftype)
2645 {
2646 if (_Is2014bFormat())
2647 {
2648 /* In Finale 2014b, the shape type is in the struct */
2649#if FXT_VERSION >= FINALEVERSION_2014B
2650 _TypeCast2014b()->shapeType = shapedeftype;
2651#endif
2652 }
2653 if (!Save()) return false; /* Aug 05, 2017: This was SaveNew(), seems very wrong? */
2654 if (!_Is2014bFormat())
2655 {
2656 if (!_SaveType((SHAPEDEF_TYPES) shapedeftype)) return false;
2657 }
2658 return true;
2659 }
2660
2661
2666 fourbyte GetDataCount() const
2667 {
2668 if (_Is2014bFormat())
2669 {
2670#if FXT_VERSION >= FINALEVERSION_2014B
2671 return _isemptyshape ? 0 : _TypeCast2014b()->dataLen;
2672#endif
2673 }
2674 else
2675 {
2676 return _isemptyshape ? 0 : _TypeCast()->dataLen;
2677 }
2678 return 0;
2679 }
2680
2688 fourbyte GetInstructionsCount() const
2689 {
2690 int returnval = 0;
2691 if (_Is2014bFormat())
2692 {
2693#if FXT_VERSION >= FINALEVERSION_2014B
2694 /* On 2014b+, _isemptyshape shouldn't be used. */
2695 returnval = _TypeCast2014b()->instrucLen;
2696#endif
2697 }
2698 else
2699 {
2700 returnval = _isemptyshape ? 0 : _TypeCast()->instrucLen;
2701 /* Have some range check, since empty shapes can have
2702 very strange values on earlier Finale versions. */
2703 if ((returnval > 300) || (returnval < 0)) return -1;
2704 }
2705 return returnval;
2706 }
2707
2716 ETAG GetInstructionTag(int index)
2717 {
2718 if (index < 0) return 0;
2719 if (index >= GetInstructionsCount()) return 0;
2720 EDTPathInst* pPathArray = _GetPathInstructionArray();
2721 return pPathArray[index].tag;
2722 }
2723
2726 int GetInstructionSize(int index)
2727 {
2728 if (index < 0) return -1;
2729 if (index >= GetInstructionsCount()) return -1;
2730 EDTPathInst* pPathArray = _GetPathInstructionArray();
2731 return pPathArray[index].numdata;
2732 }
2733
2745
2746#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
2748 luabridge::RefCountedPtr<FCShapeDefInstructions> CreateInstructions_GC()
2749 { return makeLuaSharedPtr(CreateInstructions()); }
2750#endif
2751
2766
2767#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
2769 luabridge::RefCountedPtr<FCStrings> CreateTextStrings_GC()
2770 { return makeLuaSharedPtr(CreateTextStrings()); }
2771#endif
2772
2773
2783
2791 bool GetFontInfo(int index, FCFontInfo* pFontInfo);
2792
2800 bool SetFontInfo(int index, FCFontInfo* pFontInfo);
2801
2817 bool ExportAsSVGFile(FCString* pFileName, float scaling, const char* pszUnit);
2818
2819#ifdef PDK_FRAMEWORK_DEBUG
2820 void DebugDump() override
2821 {
2823 DebugOutInt("Data size: ", (int) _loadedsize);
2824 DebugOutInt("Instruction count: ", GetInstructionsCount());
2825 DebugOutInt("Data count: ", GetDataCount());
2826 DebugOutInt("sizeof EDTShape: ", sizeof(EDTShape));
2827 DebugOutInt("sizeof EDTPathInst: ", sizeof(EDTPathInst));
2828 DebugOutInt("sizeof EDTPathData2002: ", sizeof(EDTPathData2002));
2829
2830
2831 //FCShapeDefInstructions* pInstructions = CreateInstructions();
2832 //pInstructions->DebugDump();
2833 //delete pInstructions;
2834
2835/* DebugOutInt("Instruction count: ", GetInstructionsCount());
2836 for (int i = 0; i < GetInstructionsCount(); i++)
2837 {
2838 DebugOutInt("Instruction: ", i);
2839 if (GetInstructionTag(i) == 0)
2840 {
2841 DebugOut("Tag: st_null");
2842 }
2843 else
2844 {
2845 FCString firstchar, secondchar;
2846 firstchar.Append((GetInstructionTag(i) & 0xff00) / 0x100);
2847 secondchar.Append((GetInstructionTag(i) & 0x00ff));
2848 FCString resultstring;
2849 resultstring.Append(&firstchar);
2850 resultstring.Append(", ");
2851 resultstring.Append(&secondchar);
2852 DebugOutString("Tag: ", &resultstring);
2853 }
2854 } */
2855 }
2856
2858 void InstructionDebugDump(int instructionindex);
2859
2860#endif /* PDK_FRAMEWORK_DEBUG */
2861};
2862#endif /* PDK_FRAMEWORK_SHAPES */
2863
2864
2865
2872{
2873#ifndef DOXYGEN_SHOULD_IGNORE_THIS
2875 EDTEnclosure _enclosuredataold; /* For loaded enclosures - DO
2876 * NOT REFERENCE this directly in the code!!!! */
2877
2878 FIN25_4_CODE(EDTEnclosure25_4 _enclosuredata25_4;) /* For loaded enclosures - DO
2879 * NOT REFERENCE this directly in the code!!!!
2880 * Note that this data use a different EXTAG
2881 * than the old data */
2882
2883 EDTEnclosure* _pEnclosureOld; /* Assigned pointer, pre 25.4 */
2884 FIN25_4_CODE(EDTEnclosure25_4* _pEnclosure25_4;) /* Assigned pointer, Finale 25.4 */
2885
2886
2887 /* Returns true if the 25.4 version of the struct should be used. */
2888 bool Use25_4Version() const;
2889
2890 /* Returns a pointer to the flag member of the struct */
2891 const FLAG_16* _GetFlagPtr() const
2892 {
2893 FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->flag; )
2894 return &_pEnclosureOld->flag;
2895 }
2896
2897 /* Returns a pointer to the lineWidth member of the struct */
2898 const EVPUFixedShort* _GetLineWidthPtr() const
2899 {
2900 FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->lineWidth; )
2901 return &_pEnclosureOld->lineWidth;
2902 }
2903
2904 /* Returns a pointer to the xAdd member of the struct */
2905 const Evpu16* _GetXAddPtr() const
2906 {
2907 FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->xAdd; )
2908 return &_pEnclosureOld->xAdd;
2909 }
2910
2911 /* Returns a pointer to the yAdd member of the struct */
2912 const Evpu16* _GetYAddPtr() const
2913 {
2914 FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->yAdd; )
2915 return &_pEnclosureOld->yAdd;
2916 }
2917
2918 /* Returns a pointer to the xMargin member of the struct */
2919 const Evpu16* _GetXMarginPtr() const
2920 {
2921 FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->xMargin; )
2922 return &_pEnclosureOld->xMargin;
2923 }
2924
2925 /* Returns a pointer to the yMargin member of the struct */
2926 const Evpu16* _GetYMarginPtr() const
2927 {
2928 FIN25_4_CODE( if (Use25_4Version()) return &_pEnclosure25_4->yMargin; )
2929 return &_pEnclosureOld->yMargin;
2930 }
2931
2932protected:
2933 EXTAG Tag() const override
2934 {
2935 if (GetCustomTag()) return GetCustomTag();
2936 FIN25_4_CODE( if (Use25_4Version()) return ot_TextExpEnclosure25_4; )
2937 return ot_TextExpEnclosure;
2938 }
2939 int DataSizeLoad() const override
2940 {
2941 FIN25_4_CODE( if (Use25_4Version()) return sizeof(EDTEnclosure25_4); )
2942 return sizeof(EDTEnclosure);
2943 }
2944
2945 /* Returns a pointer either to the 25.4 or the old enclosure struct */
2946 void* Allocate() override
2947 {
2948 FIN25_4_CODE( if (Use25_4Version()) return (void*) _pEnclosure25_4; )
2949 return (void*) _pEnclosureOld;
2950 }
2951
2956 void CloneMemoryFrom(__FCBaseData* pSource) override
2957 {
2958 void* pData = _GetEnclosure();
2959 int size = DataSizeLoad();
2960 memcpy(pData, ((FCEnclosure*)pSource)->_GetEnclosure(), size);
2961 _datablock = pData;
2962 _loadedsize = size;
2963 }
2964
2965 __FCBaseData* CreateObject() override { return new FCEnclosure(); }
2966
2967#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
2968public:
2969 const char* ClassName() const override { return "FCEnclosure"; }
2970 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_ENCLOSURE; }
2971
2972#ifndef DOXYGEN_SHOULD_IGNORE_THIS
2981 void* _GetEnclosure() const {
2982 FIN25_4_CODE( if (Use25_4Version()) return (void*) _pEnclosure25_4; )
2983 return (void*) _pEnclosureOld;
2984 }
2985
2986#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
2987
3018
3031
3051 {
3052 // Defaults to pointing to self-contained storage. (See comment above.)
3053 //
3054 if (Use25_4Version())
3055 {
3056 FIN25_4_CODE( _pEnclosure25_4 = &_enclosuredata25_4; )
3057 }
3058 else
3059 {
3060 _pEnclosureOld = &_enclosuredataold;
3061 }
3062 void* pData = _GetEnclosure();
3063 memset(pData, 0, DataSizeLoad());
3064 _datablock = pData;
3065 }
3066
3070 void _AssignEDTEnclosure(void* pPointer)
3071 {
3072 if (Use25_4Version())
3073 {
3074 FIN25_4_CODE( _pEnclosure25_4 = (EDTEnclosure25_4*) pPointer; )
3075 }
3076 else
3077 {
3078 _pEnclosureOld = (EDTEnclosure*) pPointer;
3079 }
3080 }
3081
3089#ifndef PDK_FRAMEWORK_LUAFRIENDLY
3091#else
3092 int
3093#endif
3094 shape)
3095 {
3096 if (!_GetEnclosure()) return;
3097 if (shape < 0) return;
3098 if (shape > 15) return;
3099 *(FLAG_16*)_GetFlagPtr() &= ~NEWSIDES;
3100 *(FLAG_16*)_GetFlagPtr() |= shape;
3101 }
3102
3103
3109 void SetLineWidth(int width)
3110 {
3111 if (!_GetEnclosure()) return;
3112 *(Evpu16*)_GetLineWidthPtr() = width;
3113 }
3114
3119 void SetHorizontalOffset(int offset)
3120 {
3121 if (!_GetEnclosure()) return;
3122 *(Evpu16*)_GetXAddPtr() = offset;
3123 }
3124
3129 void SetVerticalOffset(int offset)
3130 {
3131 if (!_GetEnclosure()) return;
3132 *(Evpu16*)_GetYAddPtr() = offset;
3133 }
3134
3140 void SetHorizontalMargin(int margin)
3141 {
3142 if (!_GetEnclosure()) return;
3143 *(Evpu16*)_GetXMarginPtr() = margin;
3144 }
3145
3151 void SetVerticalMargin(int margin)
3152 {
3153 if (!_GetEnclosure()) return;
3154 *(Evpu16*)_GetYMarginPtr() = margin;
3155 }
3156
3161 void SetFixedSize(bool state)
3162 {
3163 if (!_GetEnclosure()) return;
3164 Set16BitFlag((FLAG_16*)_GetFlagPtr(), FIXED_SIZE, state);
3165 }
3166
3171 void SetOpaque(bool state)
3172 {
3173 if (!_GetEnclosure()) return;
3174 Set16BitFlag((FLAG_16*)_GetFlagPtr(), ENCL_OPAQUE, state);
3175 }
3176
3184 void SetRoundedCorners(bool state)
3185 {
3186 FIN25_4_CODE( if (Use25_4Version()) Set16BitFlag((FLAG_16*)_GetFlagPtr(), 0x0400 /* ROUND_CORNERS */, state); )
3187 }
3188
3196 void SetRoundedCornerRadius(Efix32 radius)
3197 {
3198 FIN25_4_CODE( if (Use25_4Version()) _pEnclosure25_4->m_cornerRadius = radius; )
3199 }
3200
3206#ifndef PDK_FRAMEWORK_LUAFRIENDLY
3208#else
3209 int
3210#endif
3211 enclosuremode)
3212 {
3213 switch (enclosuremode)
3214 {
3215 case ENCLOSUREMODE_NONE:
3216 Set16BitFlag((FLAG_16*)_GetFlagPtr(), NOT_TALL, false);
3217 Set16BitFlag((FLAG_16*)_GetFlagPtr(), EQUAL_ASPECT, false);
3218 break;
3220 Set16BitFlag((FLAG_16*)_GetFlagPtr(), NOT_TALL, true);
3221 Set16BitFlag((FLAG_16*)_GetFlagPtr(), EQUAL_ASPECT, false);
3222 break;
3224 Set16BitFlag((FLAG_16*)_GetFlagPtr(), NOT_TALL, false);
3225 Set16BitFlag((FLAG_16*)_GetFlagPtr(), EQUAL_ASPECT, true);
3226 break;
3227 }
3228 }
3229
3230
3237#ifndef PDK_FRAMEWORK_LUAFRIENDLY
3239#else
3240 int
3241#endif
3242 GetShape() const
3243 {
3244 if (!_GetEnclosure()) return ENCLOSURE_NONE;
3245 return (ENCLOSURESHAPE ) (*_GetFlagPtr() & NEWSIDES);
3246 }
3247
3253 int GetLineWidth() const
3254 {
3255 if (!_GetEnclosure()) return 0;
3256 return *_GetLineWidthPtr();
3257 }
3258
3264 {
3265 if (!_GetEnclosure()) return 0;
3266 return *_GetXAddPtr();
3267 }
3268
3274 {
3275 if (!_GetEnclosure()) return 0;
3276 return *_GetYAddPtr();
3277 }
3278
3285 {
3286 if (!_GetEnclosure()) return 0;
3287 return *_GetXMarginPtr();
3288 }
3289
3296 {
3297 if (!_GetEnclosure()) return 0;
3298 return *_GetYMarginPtr();
3299 }
3300
3305 bool GetFixedSize() const
3306 {
3307 if (!_GetEnclosure()) return false;
3308 return GetBitFlag(*_GetFlagPtr(), FIXED_SIZE);
3309 }
3310
3315 bool GetOpaque() const
3316 {
3317 if (!_GetEnclosure()) return false;
3318 return GetBitFlag(*_GetFlagPtr(), ENCL_OPAQUE);
3319 }
3320
3330 {
3331 FIN25_4_CODE( if (Use25_4Version()) return GetBitFlag(*_GetFlagPtr(), 0x0400 /* ROUND_CORNERS */); )
3332 return false;
3333 }
3334
3343 {
3344 FIN25_4_CODE( if (Use25_4Version()) return _pEnclosure25_4->m_cornerRadius; )
3345 return 0;
3346 }
3347
3352#ifndef PDK_FRAMEWORK_LUAFRIENDLY
3354#else
3355 int
3356#endif
3357 GetMode() const
3358 {
3359 if (!_GetEnclosure()) return ENCLOSUREMODE_NONE;
3360 if (GetBitFlag(*_GetFlagPtr(), NOT_TALL)) return ENCLOSUREMODE_MINWIDTH;
3361 if (GetBitFlag(*_GetFlagPtr(), EQUAL_ASPECT)) return ENCLOSUREMODE_MATCHDIMENSIONS;
3362 return ENCLOSUREMODE_NONE;
3363 }
3364
3369 bool SaveAs(CMPER itemno) override
3370 {
3371 if (! DataIsLoaded())
3373 return __FCNoInciOther::SaveAs(itemno);
3374 }
3375
3376#ifdef PDK_FRAMEWORK_DEBUG
3377 void DebugDump() override
3378 {
3380 }
3381#endif
3382
3383};
3384
3385
3386#ifdef PDK_FRAMEWORK_LAYOUT
3387
3398{
3399#ifndef DOXYGEN_SHOULD_IGNORE_THIS
3400 private:
3402 EDTPageSpec pagespec;
3403protected:
3404 EXTAG Tag() const override { return ot_EDTPageSpec; }
3405 int DataSizeLoad() const override { return sizeof(EDTPageSpec); }
3406 void* Allocate() override { return (void*) &pagespec; }
3407
3412 void CloneMemoryFrom(__FCBaseData* pSource) override
3413 {
3414 memcpy(&pagespec, ((FCPage*)pSource)->_GetPageSpec(), sizeof(pagespec));
3415 _datablock = &pagespec;
3416 _loadedsize = sizeof(pagespec);
3417 }
3418
3419 __FCBaseData* CreateObject() override { return new FCPage(); }
3420#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
3421public:
3422 const char* ClassName() const override { return "FCPage"; }
3423 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_PAGE; }
3424
3425#ifndef DOXYGEN_SHOULD_IGNORE_THIS
3432 void* _GetPageSpec() { return &pagespec; }
3433#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
3434
3441
3449 eSsys GetFirstSystem();
3450
3455 void SetFirstSystem(eSsys firstsysno);
3456
3465 void UpdateLayout(bool bUnfreezeMeasures = false);
3466
3473 bool IsPortrait() const
3474 {
3475 return (GetHeight() > GetWidth());
3476 }
3477
3482 bool IsBlank() const
3483 {
3484 return pagespec.stavestr == -1;
3485 }
3486
3493 Evpu32 GetWidth() const { return pagespec.width; }
3494
3501 Evpu32 GetHeight() const { return pagespec.height; }
3502
3509 Evpu16 GetLeftMargin() const { return pagespec.margLeft; }
3510
3517 Evpu16 GetRightMargin() const { return -pagespec.margRight; }
3518
3525 Evpu16 GetTopMargin() const { return -pagespec.margTop; }
3526
3533 Evpu16 GetBottomMargin() const { return pagespec.margBottom; }
3534
3544 twobyte GetPercent() const { return pagespec.percent; }
3545
3558 bool GetHoldMargins() const { return GetBitFlag(pagespec.pageflag, PAGESPEC_MARGSCOPING); }
3559
3560 /***********/
3561 /* SETTERS */
3562 /***********/
3563
3570 void SetWidth(Evpu32 width) { pagespec.width = width; }
3571
3578 void SetHeight(Evpu32 height) { pagespec.height = height; }
3579
3586 void SetLeftMargin(Evpu16 margin) { pagespec.margLeft = margin; }
3587
3594 void SetRightMargin(Evpu16 margin) { pagespec.margRight = -margin; }
3595
3602 void SetTopMargin(Evpu16 margin) { pagespec.margTop = -margin; }
3603
3610 void SetBottomMargin(Evpu16 margin) { pagespec.margBottom = margin; }
3611
3621 void SetPercent(twobyte percent) { pagespec.percent = percent; }
3622
3635 void SetHoldMargins(bool state) { Set16BitFlag(&pagespec.pageflag, PAGESPEC_MARGSCOPING, state); }
3636
3647 eSsys CalcLastSystem();
3648
3658 eMeas CalcFirstMeasure();
3659
3669 eMeas CalcLastMeasure();
3670
3684 int CalcInteriorHeight(bool resize);
3685
3686#ifdef PDK_FRAMEWORK_DEBUG
3687 void DebugDump() override
3688 {
3690 DebugOutInt("First system: ", GetFirstSystem());
3691 DebugOutInt("Last system: ", CalcLastSystem());
3692 }
3693#endif
3694};
3695#endif // PDK_FRAMEWORK_LAYOUT
3696
3697
3698#ifdef PDK_FRAMEWORK_LAYOUT
3699
3700#ifdef PDK_FRAMEWORK_DEBUG
3701#include <stddef.h> /* Needed for the FCStaffSystem constructor in debug mode. */
3702#endif
3703
3704class FCSystemStaves;
3705class FCFreezeSystem;
3706class FCMusicRegion;
3715{
3716#ifndef DOXYGEN_SHOULD_IGNORE_THIS
3717 private:
3719 EDTStaffSystemSpec2005 _staffsystem;
3720protected:
3721 EXTAG Tag() const override { return ot_EDTStaffSystemSpec; }
3722 int DataSizeLoad() const override { return sizeof(EDTStaffSystemSpec2005); }
3723 void* Allocate() override { return (void*) &_staffsystem; }
3724
3729 void CloneMemoryFrom(__FCBaseData* pSource) override
3730 {
3731 memcpy(&_staffsystem, ((FCStaffSystem*)pSource)->_GetStaffSystemSpec(), sizeof(_staffsystem));
3732 _datablock = &_staffsystem;
3733 _loadedsize = sizeof(_staffsystem);
3734 }
3735
3736
3737 __FCBaseData* CreateObject() override { return new FCStaffSystem(); }
3738#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
3739public:
3740 const char* ClassName() const override { return "FCStaffSystem"; }
3741 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_STAFFSYSTEM; }
3742
3743#ifndef DOXYGEN_SHOULD_IGNORE_THIS
3750 void* _GetStaffSystemSpec() { return &_staffsystem; }
3751#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
3752
3758 {
3759#ifdef PDK_FRAMEWORK_DEBUG
3760 /* This should normally be used with PDK_FRAMEWORK_DIAGNOSE, but since
3761 * it's so important that this is correct, place it on the
3762 * PDK_FRAMEWORK_DEBUG level!
3763 * */
3764 if ((offsetof(EDTStaffSystemSpec2005, horzPercent) - offsetof(EDTStaffSystemSpec2005, mend)) != 2)
3765 {
3766 DebugOut("ERROR: Packed struct alignment isn't set up correctly in the compiler options! Use "
3767 "-fpack-struct=1 for GCC.");
3768 }
3769#endif
3770 }
3771
3772
3781 void SetFirstMeasure(eMeas measure)
3782 { ((EDTStaffSystemSpec2005*) _datablock)->mestart = measure; }
3783
3792 void SetNextSysMeasure(eMeas measure)
3793 { ((EDTStaffSystemSpec2005*) _datablock)->mend = measure; }
3794
3795
3800 void SetSpaceBeforeMusic(twobyte space)
3801 { ((EDTStaffSystemSpec2005*) _datablock)->extraStartSystemSpace = space; }
3802
3808 void SetSpaceAfterMusic(twobyte space)
3809 { ((EDTStaffSystemSpec2005*) _datablock)->extraEndSystemSpace = space; }
3810
3816 void SetSpaceAbove(twobyte space)
3817 { ((EDTStaffSystemSpec2005*) _datablock)->betweensystems = -space; }
3818
3827 void SetTopMargin(Evpu16 margin)
3828 { ((EDTStaffSystemSpec2005*) _datablock)->top = -margin; }
3829
3840 void SetBottomMargin(Evpu16 margin)
3841 { ((EDTStaffSystemSpec2005*) _datablock)->bottom = -margin; }
3842
3850 void SetLeftMargin(Evpu16 margin)
3851 { ((EDTStaffSystemSpec2005*) _datablock)->left = margin; }
3852
3859 void SetRightMargin(Evpu16 margin)
3860 { ((EDTStaffSystemSpec2005*) _datablock)->right = margin; }
3861
3866 void SetResize(twobyte value)
3867 {
3868 _staffsystem.ssysPercent = value;
3869 }
3870
3883 void SetStaffHeight(twobyte value)
3884 { _staffsystem.staffHeight = value; }
3885
3891 void SetResizeVerticalSpace(bool value)
3892 {
3893 Set16BitFlag(&_staffsystem.staveflag, SSPEC_RESIZE_VERT, value);
3894 }
3895
3903 void SetUseStaffResize(bool state)
3904 {
3905 Set16BitFlag(&_staffsystem.staveflag, SSPEC_LINEPERC, state);
3906 }
3907
3912 void SetHoldMargins(bool state)
3913 {
3914 Set16BitFlag(&_staffsystem.staveflag, SSPEC_HOLD_MARGINS, state);
3915 }
3916
3923 eMeas GetFirstMeasure() const
3924 { return ((EDTStaffSystemSpec2005*) _datablock)->mestart; }
3925
3930 eMeas GetNextSysMeasure() const
3931 { return ((EDTStaffSystemSpec2005*) _datablock)->mend; }
3932
3937 twobyte GetSpaceBeforeMusic() const
3938 { return ((EDTStaffSystemSpec2005*) _datablock)->extraStartSystemSpace; }
3939
3945 twobyte GetSpaceAfterMusic() const
3946 { return ((EDTStaffSystemSpec2005*) _datablock)->extraEndSystemSpace; }
3947
3954 twobyte GetSpaceAbove() const
3955 { return -((EDTStaffSystemSpec2005*) _datablock)->betweensystems; }
3956
3962 Evpu16 GetTopMargin() const
3963 { return -((EDTStaffSystemSpec2005*) _datablock)->top; }
3964
3969 Evpu16 GetBottomMargin() const
3970 { return -((EDTStaffSystemSpec2005*) _datablock)->bottom; }
3971
3979 Evpu16 GetLeftMargin() const
3980 { return ((EDTStaffSystemSpec2005*) _datablock)->left; }
3981
3987 Evpu16 GetRightMargin() const
3988 { return ((EDTStaffSystemSpec2005*) _datablock)->right; }
3989
3998 twobyte GetStaffHeight() const
3999 { return ((EDTStaffSystemSpec2005*) _datablock)->staffHeight; }
4000
4005 twobyte GetResize() const
4006 { return ((EDTStaffSystemSpec2005*) _datablock)->ssysPercent; }
4007
4014 { return GetBitFlag(((EDTStaffSystemSpec2005*) _datablock)->staveflag, SSPEC_RESIZE_VERT); }
4015
4024 {
4025 return GetBitFlag(_staffsystem.staveflag, SSPEC_LINEPERC);
4026 }
4027
4032 bool GetHoldMargins() const
4033 {
4034 return GetBitFlag(_staffsystem.staveflag, SSPEC_HOLD_MARGINS);
4035 }
4036
4043 twobyte GetTopStaff() const;
4044
4053 {
4054 return _staffsystem.horzPercent;
4055 }
4056
4062 bool HasPageBreak();
4063
4068 eStaff CalcTopStaff();
4069
4074 eStaff CalcBottomStaff();
4075
4082 int CalcStavesSpan();
4083
4094 int CalcHeight(bool verticalresize);
4095
4107 int CalcWhiteSpaceBottom(bool verticalresize);
4108
4117 bool IsOptimized() const;
4118
4127 bool ContainsMeasure(eMeas measurenumber)
4128 {
4129 if (measurenumber < GetFirstMeasure()) return false;
4130 if (measurenumber >= GetNextSysMeasure()) return false;
4131 return true;
4132 }
4133
4147
4148#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
4150 luabridge::RefCountedPtr<FCSystemStaves> CreateSystemStaves_GC()
4151 { return makeLuaSharedPtr(CreateSystemStaves()); }
4152#endif
4153
4169 FCFreezeSystem* CreateFreezeSystem(bool force_create = true);
4170
4171#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
4173 luabridge::RefCountedPtr<FCFreezeSystem> CreateFreezeSystem_GC(bool force_create)
4174 { return makeLuaSharedPtr(CreateFreezeSystem(force_create)); }
4175#endif
4176
4188 bool CalcRegion(FCMusicRegion* pRegion);
4189
4190#ifdef PDK_FRAMEWORK_DEBUG
4191 void DebugDump() override
4192 {
4194 DebugOutInt("First measure: ", GetFirstMeasure());
4195 DebugOutInt("Next System Measure: ", GetNextSysMeasure());
4196 DebugOutInt("Space Above: ", GetSpaceAbove());
4197 DebugOutInt("Top Margin: ", GetTopMargin());
4198 DebugOutInt("Bottom Margin: ", GetBottomMargin());
4199 DebugOutInt("Staff Height: ", GetStaffHeight());
4200 DebugOutInt("Resize (percent): ", GetResize());
4201 }
4202#endif
4203};
4204#endif // PDK_FRAMEWORK_LAYOUT
4205
4206
4208class FCExpressions;
4209class FCTempoElements;
4210
4211class FCTimeSignature;
4212
4221{
4222private:
4223#ifndef DOXYGEN_SHOULD_IGNORE_THIS
4228 mutable FCKeySignature* _pKeySig;
4229
4234 mutable FCTimeSignature* _pTimeSig;
4235
4240 mutable FCTimeSignature* _pTimeSigDisplay;
4241
4243 EVERSION _VersionToUse() const;
4244
4248 EDTMeasureSpec2005 _measurespec2005;
4249
4250#if FXT_VERSION >= FINALEVERSION_2014
4251 EDTMeasureSpec2014 _measurespec2014;
4252#endif
4253
4257 FLAG_16* _GetMeFlagPtr() const;
4258
4262 FLAG_16* _GetNewFlagPtr() const;
4263
4267 FLAG_16* _GetAuxFlagPtr() const;
4268
4272 void _SetMeFlag(FLAG_16 mask, bool state);
4273
4277 bool _GetMeFlag(FLAG_16 mask) const
4278 {
4279 return GetBitFlag(*_GetMeFlagPtr(), mask);
4280 }
4281
4285 void _SetNewFlag(FLAG_16 mask, bool state);
4286
4290 bool _GetNewFlag(FLAG_16 mask) const { return GetBitFlag(*_GetNewFlagPtr(), mask); }
4291
4295 void _SetAuxFlag(FLAG_16 mask, bool state);
4296
4300 bool _GetAuxFlag(FLAG_16 mask) const { return GetBitFlag(*_GetAuxFlagPtr(), mask); }
4301
4306 FCString* _CreateNumberString(bool qualified, bool showAllRepeatPasses)
4307 {
4308 FCString* retval = new FCString;
4309 eUniChar16 buffer[512];
4310 if (! FX_GetMeasureNumberString(GetItemNo(), buffer, DIM(buffer), qualified, showAllRepeatPasses))
4311 if (qualified)
4312 retval->FormatCString("#%d", GetItemNo());
4313 else
4314 retval->FormatCString("%d", GetItemNo());
4315 else
4316 retval->SetUnicodeString(buffer);
4317 return retval;
4318 }
4319
4320protected:
4321 EVERSION EnigmaVersion() const override
4322 {
4323 return _VersionToUse();
4324 }
4325 EXTAG Tag() const override { return ot_MeasureSpec; }
4326 int DataSizeLoad() const override {
4327#if FXT_VERSION >= FINALEVERSION_2014
4328 if (_VersionToUse() == FINALEVERSION_2014) return sizeof(EDTMeasureSpec2014);
4329#endif
4330 return sizeof(EDTMeasureSpec2005);
4331 }
4332
4333 void* Allocate() override
4334 {
4335#if FXT_VERSION >= FINALEVERSION_2014
4336 if (_VersionToUse() == FINALEVERSION_2014) return (void*) &_measurespec2014;
4337#endif
4338 return (void*) &_measurespec2005;
4339 }
4340
4345 void CloneMemoryFrom(__FCBaseData* pSource) override
4346 {
4347#if FXT_VERSION >= FINALEVERSION_2014
4348 if (_VersionToUse() == FINALEVERSION_2014)
4349 {
4350 memcpy(&_measurespec2014, ((FCMeasure*)pSource)->_GetMeasureSpec(), sizeof(_measurespec2014));
4351 _datablock = &_measurespec2014;
4352 _loadedsize = sizeof(_measurespec2014);
4353 return;
4354 }
4355#endif
4356 memcpy(&_measurespec2005, ((FCMeasure*)pSource)->_GetMeasureSpec(), sizeof(_measurespec2005));
4357 _datablock = &_measurespec2005;
4358 _loadedsize = sizeof(_measurespec2005);
4359 }
4360
4361 __FCBaseData* CreateObject() override { return new FCMeasure(); }
4362#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
4363public:
4364
4401
4402private:
4407 bool _GetBarlineMask(
4408#ifdef PDK_FRAMEWORK_LUAFRIENDLY
4409int
4410#else
4412#endif
4413 style, FLAG_16* pFlag);
4414
4415public:
4416
4434
4452
4453 const char* ClassName() const override { return "FCMeasure"; }
4454 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_MEASURE; }
4455
4456#ifndef DOXYGEN_SHOULD_IGNORE_THIS
4463 void* _GetMeasureSpec()
4464 {
4465#if FXT_VERSION >= FINALEVERSION_2014
4466 if (_VersionToUse() == FINALEVERSION_2014) return &_measurespec2014;
4467#endif
4468 return &_measurespec2005;
4469 }
4470#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
4471
4478 {
4479 _pKeySig = NULL;
4480 _pTimeSig = NULL;
4481 _pTimeSigDisplay = NULL;
4482 }
4483
4488 virtual ~FCMeasure() {
4489 if (_pKeySig) delete _pKeySig;
4490 if (_pTimeSig) delete _pTimeSig;
4491 if (_pTimeSigDisplay) delete _pTimeSigDisplay;
4492 }
4493
4495 bool Save() override;
4496
4498 bool Load(CMPER itemno) override;
4499
4508
4509#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
4510 /* GC version of #CreateBeatChartElements for Lua. */
4511 luabridge::RefCountedPtr<FCBeatChartElements> CreateBeatChartElements_GC()
4512 { return makeLuaSharedPtr(CreateBeatChartElements()); }
4513#endif
4514
4523
4524#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
4525 /* GC version of #CreateExpressions for Lua. */
4526 luabridge::RefCountedPtr<FCExpressions> CreateExpressions_GC()
4527 { return makeLuaSharedPtr(CreateExpressions()); }
4528#endif
4529
4538
4539#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
4540 /* GC version of #CreateTempoElements for Lua. */
4541 luabridge::RefCountedPtr<FCTempoElements> CreateTempoElements_GC()
4542 { return makeLuaSharedPtr(CreateTempoElements()); }
4543#endif
4544
4545
4548 void SetKeyless(bool state)
4549 {
4550 if (_VersionToUse() != FINALEVERSION_2014) return;
4551#if FXT_VERSION >= FINALEVERSION_2014
4552 _measurespec2014.isKeyless = state;
4553#endif
4554 }
4555
4558 void SetHideKeySigShowAccis(bool state)
4559 {
4560 if (_VersionToUse() != FINALEVERSION_2014) return;
4561#if FXT_VERSION >= FINALEVERSION_2014
4562 _measurespec2014.hideKeySigShowAccis = state;
4563#endif
4564 }
4565
4566
4575 void SetPageBreak(bool state)
4576 { _SetNewFlag(MEAS_PAGEBREAK, state); }
4577
4585 void SetBreakMMRest(bool state)
4586 { _SetMeFlag(MEAS_BREAKREST, state); }
4587
4594 void SetForwardRepeat(bool state)
4595 { _SetMeFlag(MEAS_FORREPBAR, state); }
4596
4605 void SetExpressionFlag(bool state)
4606 { _SetMeFlag(MEAS_DYNAMBIT, state); }
4607
4616 void SetTextFlag(bool state)
4617 { _SetMeFlag(MEAS_MEASURETEXT, state); }
4618
4631 void SetBackwardRepeat(bool state)
4632 { _SetMeFlag(MEAS_BACREPBAR, state); }
4633
4645 void SetRepeatBracketFlag(bool state) { _SetMeFlag(MEAS_BARENDING, state); }
4646
4656 void SetTextRepeatFlag(bool state) { _SetMeFlag(MEAS_REPEATS, state); }
4657
4664 void SetSystemBreak(bool state) { _SetMeFlag(MEAS_MS_LINEBREAK, state); }
4665
4673 void SetHideCautionary(bool state) { _SetAuxFlag(MEAS_HIDECAUTION, state); }
4674
4684 void SetWidth(Evpu16 width) {
4685#if FXT_VERSION >= FINALEVERSION_2014
4686 if (_VersionToUse() == FINALEVERSION_2014)
4687 {
4688 _measurespec2014.measpace = width;
4689 return;
4690 }
4691#endif
4692 _measurespec2005.measpace = width;
4693 }
4694
4701 void SetSpaceBefore(Evpu16 space)
4702 {
4703#if FXT_VERSION >= FINALEVERSION_2014
4704 if (_VersionToUse() == FINALEVERSION_2014)
4705 {
4706 _measurespec2014.frontSpaceExtra = space;
4707 return;
4708 }
4709#endif
4710 _measurespec2005.frontSpaceExtra = space;
4711 }
4712
4719 void SetSpaceAfter(Evpu16 space)
4720 {
4721#if FXT_VERSION >= FINALEVERSION_2014
4722 if (_VersionToUse() == FINALEVERSION_2014)
4723 {
4724 _measurespec2014.backSpaceExtra = space;
4725 return;
4726 }
4727#endif
4728 _measurespec2005.backSpaceExtra = space;
4729 }
4730
4741 void SetAllowHorizontalSplit(bool state) { _SetAuxFlag(MEAS_POSSPLIT, state); }
4742
4753#ifndef PDK_FRAMEWORK_LUAFRIENDLY
4754 SHOW_STATES state
4755#else
4756 int state
4757#endif
4758 );
4759
4770#ifndef PDK_FRAMEWORK_LUAFRIENDLY
4771 SHOW_STATES state
4772#else
4773 int state
4774#endif
4775 );
4776
4786 void SetShowFullNames(bool state);
4787
4793 void SetContainsManualMeasureNumbers(bool state) { _SetAuxFlag(MEAS_MNSEPPLACE, state); }
4794
4801 void SetBreakWordExtension(bool state) { _SetAuxFlag(0x8000, state); }
4802
4809 void SetIncludeInNumbering(bool state) { _SetMeFlag(MEAS_NO_MEAS_NUM, !state); }
4810
4817 void SetOverrideGroupBarlines(bool state) { _SetAuxFlag(MEAS_GRP_BARLINE_OVERRIDE, state); }
4818
4829#ifndef PDK_FRAMEWORK_LUAFRIENDLY
4831#else
4832int mode
4833#endif
4834 );
4835
4842 void SetPositionEvenly(bool state) { _SetAuxFlag(MEAS_INDIVPOSDEF, state); }
4843
4851 void SetBarline(
4852#ifdef PDK_FRAMEWORK_LUAFRIENDLY
4853int
4854#else
4856#endif
4857 style);
4858
4865 void SetBarlineShapeID(twobyte shapeID) {
4866#if FXT_VERSION >= FINALEVERSION_2014
4867 if (_VersionToUse() == FINALEVERSION_2014)
4868 {
4869 _measurespec2014.custombarshape = shapeID;
4870 return;
4871 }
4872#endif
4873 _measurespec2005.custombarshape = shapeID;
4874 }
4875
4882 void SetLeftBarlineShapeID(twobyte shapeID)
4883 {
4884#if FXT_VERSION >= FINALEVERSION_2014
4885 if (_VersionToUse() == FINALEVERSION_2014)
4886 {
4887 _measurespec2014.customleftbarshape = shapeID;
4888 return;
4889 }
4890#endif
4891 _measurespec2005.customleftbarshape = shapeID;
4892 }
4893
4904 void SetLeftBarline(
4905#ifndef PDK_FRAMEWORK_LUAFRIENDLY
4906 BARLINE_STYLES style
4907#else
4908 int style
4909#endif
4910 );
4911
4918 void SetSmartShapeFlag(bool state) { _SetAuxFlag(MEAS_SMARTSHAPEBIT, state); }
4919
4928 void SetChordFlag(bool state) { _SetNewFlag(0x0008, state); }
4929
4935 TimeEdu32 GetDuration()
4936 {
4937 return FX_GetMeasureDuration(0, GetItemNo());
4938 }
4939
4940
4946 bool GetKeyless() const
4947 {
4948 if (_VersionToUse() != FINALEVERSION_2014) return false;
4949#if FXT_VERSION >= FINALEVERSION_2014
4950 return _measurespec2014.isKeyless != 0;
4951#endif
4952 return false;
4953 }
4954
4961 {
4962 if (_VersionToUse() != FINALEVERSION_2014) return false;
4963#if FXT_VERSION >= FINALEVERSION_2014
4964 return _measurespec2014.hideKeySigShowAccis != 0;
4965#endif
4966 return false;
4967 }
4968
4969
4979 bool GetPageBreak() const { return _GetNewFlag(MEAS_PAGEBREAK); }
4980
4988 bool GetBreakMMRest() const { return _GetMeFlag(MEAS_BREAKREST); }
4989
4996 bool GetSystemBreak() const { return _GetMeFlag(MEAS_MS_LINEBREAK); }
4997
5004 bool GetForwardRepeat() const { return _GetMeFlag(MEAS_FORREPBAR); }
5005
5014 bool GetExpressionFlag() const { return _GetMeFlag(MEAS_DYNAMBIT); }
5015
5025 bool GetTextFlag() const { return _GetMeFlag(MEAS_MEASURETEXT); }
5026
5036 bool GetBackwardRepeat() const { return _GetMeFlag(MEAS_BACREPBAR); }
5037
5049 bool GetRepeatBracketFlag() const { return _GetMeFlag(MEAS_BARENDING); }
5050
5060 bool GetTextRepeatFlag() const { return _GetMeFlag(MEAS_REPEATS); }
5061
5069 bool GetHideCautionary() const { return _GetAuxFlag(MEAS_HIDECAUTION); }
5070
5077 Evpu16 GetWidth() const {
5078#if FXT_VERSION >= FINALEVERSION_2014
5079 if (_VersionToUse() == FINALEVERSION_2014)
5080 {
5081 return _measurespec2014.measpace;
5082 }
5083#endif
5084 return _measurespec2005.measpace;
5085 }
5086
5093 Evpu16 GetSpaceBefore() const {
5094#if FXT_VERSION >= FINALEVERSION_2014
5095 if (_VersionToUse() == FINALEVERSION_2014)
5096 {
5097 return _measurespec2014.frontSpaceExtra;
5098 }
5099#endif
5100 return _measurespec2005.frontSpaceExtra;
5101 }
5102
5109 Evpu16 GetSpaceAfter() const {
5110#if FXT_VERSION >= FINALEVERSION_2014
5111 if (_VersionToUse() == FINALEVERSION_2014)
5112 {
5113 return _measurespec2014.backSpaceExtra;
5114 }
5115#endif
5116 return _measurespec2005.backSpaceExtra;
5117 }
5118
5127 bool GetAllowHorizontalSplit() const { return _GetAuxFlag(MEAS_POSSPLIT); }
5128
5138#ifndef PDK_FRAMEWORK_LUAFRIENDLY
5140#else
5141 int
5142#endif
5143 GetShowKeySignature() const;
5144
5154#ifndef PDK_FRAMEWORK_LUAFRIENDLY
5156#else
5157 int
5158#endif
5159 GetShowTimeSignature() const;
5160
5166 bool GetUseTimeSigForDisplay() const { return _GetNewFlag(MEAS_USE_DISPLAY_TIMESIG); }
5167
5178 bool GetShowFullNames() const;
5179
5186 bool GetContainsManualMeasureNumbers() const { return _GetAuxFlag(MEAS_MNSEPPLACE); }
5187
5194 bool GetBreakWordExtension() const { return _GetAuxFlag(0x8000); }
5195
5202 bool GetIncludeInNumbering() const { return !_GetMeFlag(MEAS_NO_MEAS_NUM); }
5203
5210 bool GetOverrideGroupBarlines() const { return _GetAuxFlag(MEAS_GRP_BARLINE_OVERRIDE); }
5211
5221#ifndef PDK_FRAMEWORK_LUAFRIENDLY
5223#else
5224 int
5225#endif
5227
5234 bool GetPositionEvenly() const { return _GetAuxFlag(MEAS_INDIVPOSDEF); }
5235
5242#ifdef PDK_FRAMEWORK_LUAFRIENDLY
5243 int
5244#else
5246#endif
5247 GetBarline() const;
5248
5257#ifndef PDK_FRAMEWORK_LUAFRIENDLY
5259#else
5260 int
5261#endif
5262 GetLeftBarline() const;
5263
5270 CMPER GetBarlineShapeID() const {
5271#if FXT_VERSION >= FINALEVERSION_2014
5272 if (_VersionToUse() == FINALEVERSION_2014)
5273 {
5274 return _measurespec2014.custombarshape;
5275 }
5276#endif
5277 return _measurespec2005.custombarshape;
5278 }
5279
5287#if FXT_VERSION >= FINALEVERSION_2014
5288 if (_VersionToUse() == FINALEVERSION_2014)
5289 {
5290 return _measurespec2014.customleftbarshape;
5291 }
5292#endif
5293 return _measurespec2005.customleftbarshape;
5294 }
5295
5311 if (!DataIsLoaded()) return NULL;
5312 if (_pKeySig) return _pKeySig;
5313 if (!_pKeySig) _pKeySig = new FCKeySignature();
5314#if FXT_VERSION >= FINALEVERSION_2014
5315 if (_VersionToUse() == FINALEVERSION_2014)
5316 {
5317 _pKeySig->SetID(_measurespec2014.key);
5318 } else
5319#endif
5320 {
5321 _pKeySig->SetID(_measurespec2005.key);
5322 }
5323 return _pKeySig;
5324 }
5325
5332 bool GetSmartShapeFlag() const { return _GetAuxFlag(MEAS_SMARTSHAPEBIT); }
5333
5342 bool GetChordFlag() const { return _GetNewFlag(0x0008); }
5343
5359 {
5360 if (!DataIsLoaded()) return NULL;
5361 if (_pTimeSig) return _pTimeSig;
5362 if (!_pTimeSig) _pTimeSig = new FCTimeSignature();
5363#if FXT_VERSION >= FINALEVERSION_2014
5364 if (_VersionToUse() == FINALEVERSION_2014)
5365 {
5366 _pTimeSig->SetBeats(_measurespec2014.beats);
5367 _pTimeSig->SetBeatDuration(_measurespec2014.divbeat);
5368 } else
5369#endif
5370 {
5371 _pTimeSig->SetBeats(_measurespec2005.beats);
5372 _pTimeSig->SetBeatDuration(_measurespec2005.divbeat);
5373 }
5374 _pTimeSig->SetCompositeTop(_GetAuxFlag(MEAS_ALTNUMTSIG));
5375 _pTimeSig->SetCompositeBottom(_GetAuxFlag(MEAS_ALTDENTSIG));
5376 _pTimeSig->SetAbbreviate(false);
5377 return _pTimeSig;
5378 }
5379
5391 {
5392 if (!DataIsLoaded()) return NULL;
5393 if (!GetUseTimeSigForDisplay()) return NULL;
5394 if (_pTimeSigDisplay) return _pTimeSigDisplay;
5395 if (!_pTimeSigDisplay) _pTimeSigDisplay = new FCTimeSignature();
5396#if FXT_VERSION >= FINALEVERSION_2014
5397 if (_VersionToUse() == FINALEVERSION_2014)
5398 {
5399 _pTimeSigDisplay->SetBeats(_measurespec2014.dispBeats);
5400 _pTimeSigDisplay->SetBeatDuration(_measurespec2014.dispDivbeat);
5401 } else
5402#endif
5403 {
5404 _pTimeSigDisplay->SetBeats(_measurespec2005.dispBeats);
5405 _pTimeSigDisplay->SetBeatDuration(_measurespec2005.dispDivbeat);
5406 }
5407 _pTimeSigDisplay->SetCompositeTop(_GetNewFlag(MEAS_DISPLAY_ALTNUMTSIG));
5408 _pTimeSigDisplay->SetCompositeBottom(_GetNewFlag(MEAS_DISPLAY_ALTDENTSIG));
5409 _pTimeSigDisplay->SetAbbreviate(_GetNewFlag(MEAS_ABBRVTIME));
5410 return _pTimeSigDisplay;
5411 }
5412
5422 {
5423 if (!DataIsLoaded()) return;
5424 if (GetUseTimeSigForDisplay() == value) return;
5425 if (!value)
5426 {
5427 if (_pTimeSigDisplay)
5428 {
5429 delete _pTimeSigDisplay;
5430 _pTimeSigDisplay = NULL;
5431 }
5432 }
5433 return _SetNewFlag(MEAS_USE_DISPLAY_TIMESIG, value);
5434 }
5435
5449 FCString* CreateNumberString(bool showAllRepeatPasses = false)
5450 {
5451 return _CreateNumberString(true, showAllRepeatPasses);
5452 }
5453
5454#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
5456 luabridge::RefCountedPtr<FCString> CreateNumberString_GC(bool showAllRepeatPasses = false)
5457 { return makeLuaSharedPtr(CreateNumberString(showAllRepeatPasses)); }
5458#endif
5459
5473 FCString* CreateNumberStringUnqualified(bool showAllRepeatPasses = false)
5474 {
5475 return _CreateNumberString(false, showAllRepeatPasses);
5476 }
5477
5478#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
5480 luabridge::RefCountedPtr<FCString> CreateNumberStringUnqualified_GC(bool showAllRepeatPasses = false)
5481 { return makeLuaSharedPtr(CreateNumberStringUnqualified(showAllRepeatPasses)); }
5482#endif
5483};
5484
5485/* Forward declaration, required for measure references FCMeasureNumberRegion */
5486class FCMeasures;
5487
5494{
5495#ifndef DOXYGEN_SHOULD_IGNORE_THIS
5496 private:
5497 /* Reference table for checking the "Include measure in measure numbering" states.
5498 Use AssignAllNonNumberedMeasures() to set */
5499 FCNumbers* _pNonIncludedMeasures;
5500
5501 /* Used for the _SetTempAllMeasures() etc mechanism. This is where the real value of
5502 * _pAllMeasures is stored, during a temporary collection assignment. */
5503 FCNumbers* _pTempNonIncludedMeasuresStorage;
5504
5506 FIN25_4_CODE(EDTMeasNumberRegion25_4 _measureregion25_4;)
5509 FIN2012_CODE(EDTMeasNumberRegion2012 _measureregion2012;)
5511 EDTMeasNumberRegion2010 _measureregion2010;
5512 EDTMeasNumberRegion _measureregionold;
5514 FCEnclosure _startEnclosureScore; // Set up by the constructor
5515 FCEnclosure _startEnclosureParts; // Set up by the constructor
5516 FCEnclosure _multipleEnclosureScore; // Set up by the constructor
5517 FCEnclosure _multipleEnclosureParts; // Set up by the constructor
5518
5519
5520 /* Returns a pointer to the correct 'flags' member of the score/part struct */
5521 const FLAG_16* _GetScorePartFlagsPtr(bool parts);
5522
5523 /* Returns a pointer to the correct 'flags2' member of the score/part struct */
5524 const FLAG_16* _GetScorePartFlags2Ptr(bool parts);
5525
5526 /* Returns a pointer to the correct 'incidence' member of the score/part struct */
5527 const twobyte* _GetScorePartIncidencePtr(bool parts) const;
5528
5529 /* Returns a pointer to the correct 'startxdisp' (or xdisp) member of the score/part struct */
5530 const twobyte* _GetScorePartStartxdispPtr(bool parts) const;
5531
5532 /* Returns a pointer to the correct 'startxdisp' (or xdisp) member of the score/part struct */
5533 const twobyte* _GetScorePartStartydispPtr(bool parts) const;
5534
5535 /* Returns a pointer to the correct 'multiplexdisp' member of the score/part struct */
5536 const twobyte* _GetScorePartMultiplexdispPtr(bool parts) const;
5537
5538 /* Returns a pointer to the correct 'multipleydisp' member of the score/part struct */
5539 const twobyte* _GetScorePartMultipleydispPtr(bool parts) const;
5540
5541 /* Returns a pointer to the correct 'mmrestxdisp' member of the score/part struct */
5542 const twobyte* _GetScorePartMmrestxdispPtr(bool parts) const;
5543
5544 /* Returns a pointer to the correct 'mmrestydisp' member of the score/part struct */
5545 const twobyte* _GetScorePartMmrestydispPtr(bool parts) const;
5546
5547 /* Returns a pointer to the correct 'startWith' member of the score/part struct */
5548 const twobyte* _GetScorePartStartWithPtr(bool parts) const;
5549
5550 /* Returns a pointer to the correct 'leftMMBracketChar' member of the score/part struct
5551 eUniChar32 on Fin2012+
5552 EWCHAR on pre-Fin2012
5553 */
5554 const void* _GetScorePartLeftMMBracketCharPtr(bool parts) const;
5555
5556 /* Returns a pointer to the correct 'rightMMBracketChar' member of the score/part struct
5557 eUniChar32 on Fin2012+
5558 EWCHAR on pre-Fin2012
5559 */
5560 const void* _GetScorePartRightMMBracketCharPtr(bool parts) const;
5561
5562 /* Returns a pointer to the correct 'startFont' member of the score/part struct */
5563 const EFONTID* _GetScorePartStartFontPtr(bool parts) const;
5564
5565 /* Returns a pointer to the correct 'startEfx' member of the score/part struct */
5566 const FLAG_16* _GetScorePartStartEfxPtr(bool parts) const;
5567
5568 /* Returns a pointer to the correct 'startSize' member of the score/part struct */
5569 const twobyte* _GetScorePartStartSizePtr(bool parts) const;
5570
5571 /* Returns a pointer to the correct 'multipleFont' member of the score/part struct */
5572 const EFONTID* _GetScorePartMultipleFontPtr(bool parts) const;
5573
5574 /* Returns a pointer to the correct 'multipleEfx' member of the score/part struct */
5575 const FLAG_16* _GetScorePartMultipleEfxPtr(bool parts) const;
5576
5577 /* Returns a pointer to the correct 'multipleSize' member of the score/part struct */
5578 const twobyte* _GetScorePartMultipleSizePtr(bool parts) const;
5579
5580 /* Returns a pointer to the correct 'mmRestFont' member of the score/part struct */
5581 const EFONTID* _GetScorePartMmRestFontPtr(bool parts) const;
5582
5583 /* Returns a pointer to the correct 'mmRestEfx' member of the score/part struct */
5584 const FLAG_16* _GetScorePartMmRestEfxPtr(bool parts) const;
5585
5586 /* Returns a pointer to the correct 'mmRestSize' member of the score/part struct */
5587 const twobyte* _GetScorePartMmRestSizePtr(bool parts) const;
5588
5589 /* Returns a pointer to the correct 'startMeas' member */
5590 const twobyte* _GetStartMeasPtr() const;
5591
5592 /* Returns a pointer to the correct 'endMeas' member */
5593 const twobyte* _GetEndMeasPtr() const;
5594
5595 /* Returns a pointer to the correct 'offset' member */
5596 const twobyte* _GetOffsetPtr() const;
5597
5598 /* Returns a pointer to the correct 'prefix' member. Finale 2012+ uses eUniChar16 buffer,
5599 earlier versions use ECHAR buffer. */
5600 const void* _GetPrefixPtr() const;
5601
5602 /* Returns a pointer to the correct 'suffix' member */
5603 const void* _GetSuffixPtr() const;
5604
5605 /* Returns a pointer to the correct 'flag' member */
5606 const FLAG_16* _GetFlagPtr() const;
5607
5608 /* Returns a pointer to the correct 'flag2' member */
5609 const FLAG_16* _GetFlag2Ptr() const;
5610
5611 /* Returns a pointer to the correct 'region' member */
5612 const twobyte* _GetRegionPtr() const;
5613
5614 /* Returns a pointer to the correct 'base' member */
5615 const twobyte* _GetBasePtr() const;
5616
5617 /* Returns a pointer to the correct 'startchar' member
5618 Finale 2012+ uses eUniChar32, earlier versions use twobyte.
5619 */
5620 const void* _GetStartcharPtr() const;
5621
5622 bool _GetScorePartFlags(bool parts, FLAG_16 flag);
5623 void _SetScorePartFlags(bool parts, FLAG_16 flag, bool state);
5624
5625 FLAG_16 _GetScorePartFlagsValue(bool parts);
5626 void _SetScorePartFlagsValue(bool parts, FLAG_16 flag);
5627 FLAG_16 _GetScorePartFlags2Value(bool parts);
5628 void _SetScorePartFlags2Value(bool parts, FLAG_16 flag2);
5629
5630 /* Non-virtual method to decide the FXT version */
5631 EVERSION _FXTVersionToUse() const;
5632
5633 /* For internal use only. Formats a display version of the measure number index.
5634 The measure number index is the 0-based index within the numbering sequence.
5635 */
5636 void _FormatDisplayedNumberForIndex(twobyte meas_num_index, FCString* pString);
5637protected:
5638 EXTAG Tag() const override { return ot_MeasNumberRegion; }
5639 int DataSizeLoad() const override;
5640 void* Allocate() override;
5641
5642 EVERSION EnigmaVersion() const override;
5643
5648 void CloneMemoryFrom(__FCBaseData* pSource) override
5649 {
5650 memcpy(_GetData(), ((FCMeasureNumberRegion*)pSource)->_GetData(), DataSizeLoad());
5651 _datablock = Allocate();
5653 }
5654
5655 __FCBaseData* CreateObject() override { return new FCMeasureNumberRegion(); }
5656#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
5657public:
5658
5702
5718
5734
5740 {
5742 MNJUSTIFY_LEFT = TEXT_JUSTIFY_LEFT,
5743
5745 MNJUSTIFY_CENTER = TEXT_JUSTIFY_CENTER,
5746
5748 MNJUSTIFY_RIGHT = TEXT_JUSTIFY_RIGHT
5750
5751 const char* ClassName() const override { return "FCMeasureNumberRegion"; }
5752 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_MEASURENUMBERREGION; }
5753
5754#ifndef DOXYGEN_SHOULD_IGNORE_THIS
5761 void* _GetData() { return Allocate(); }
5762#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
5763
5769
5776 void SetStartMeasure(twobyte measure);
5777
5784 void SetEndMeasure(twobyte measure);
5785
5793 void SetStartNumber(twobyte offset);
5794
5799 void SetPrefix(FCString* pString);
5800
5805 void SetSuffix(FCString* pString);
5806
5812 void SetUseScoreInfoForParts(bool value);
5813
5816 void SetID(twobyte newid);
5817
5829 void SetStartFontInfo(FCFontInfo* pFontInfo, bool parts);
5830
5841 void SetMultipleFontInfo(FCFontInfo* pFontInfo, bool parts);
5842
5854 void SetMultiMeasureFontInfo(FCFontInfo* pFontInfo, bool parts);
5855
5866 void SetUseEnclosureStart(bool use, bool parts);
5867
5876 void SetExcludeOtherStaves(bool exclude, bool parts);
5877
5886 void SetUseEnclosureMultiple(bool use, bool parts);
5887
5896 void SetShowOnTopStaff(bool showontop, bool parts);
5897
5906 void SetShowOnSystemStart(bool showonstart, bool parts);
5907
5916 void SetShowOnBottomStaff(bool showonbottom, bool parts);
5917
5926 void SetShowMultiples(bool showmultiples, bool parts);
5927
5936 void SetHideFirstNumber(bool hide, bool parts);
5937
5948 void SetShowMultiMeasureRange(bool show, bool parts);
5949
5960 void SetShowOnMultiMeasureRests(bool show, bool parts);
5961
5970 void SetMultipleValue(twobyte value, bool parts);
5971
5980 void SetMultipleStartMeasure(twobyte measure, bool parts);
5981
5992 void SetMultiMeasureBracketLeft(eUniChar32 character, bool parts);
5993
6004 void SetMultiMeasureBracketRight(eUniChar32 character, bool parts);
6005
6015 void SetBreakMultiMeasureRests(bool breakstate, bool parts);
6016
6022 void SetStartAlignment(
6023#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6025#else
6026int
6027#endif
6028 alignment,
6029 bool parts);
6030
6037#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6039#else
6040int
6041#endif
6042justification,
6043 bool parts);
6044
6051#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6053#else
6054int
6055#endif
6056 alignment,
6057 bool parts);
6058
6065#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6067#else
6068int
6069#endif
6070justification,
6071 bool parts);
6072
6079#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6081#else
6082int
6083#endif
6084 alignment,
6085 bool parts);
6086
6093#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6095#else
6096int
6097#endif
6098justification,
6099 bool parts);
6100
6109 void SetStartHorizontalPosition(twobyte distance, bool parts);
6110
6119 void SetStartVerticalPosition(twobyte distance, bool parts);
6120
6129 void SetMultipleHorizontalPosition(twobyte distance, bool parts);
6130
6139 void SetMultipleVerticalPosition(twobyte distance, bool parts);
6140
6149 void SetMultiMeasureHorizontalPosition(twobyte distance, bool parts);
6150
6159 void SetMultiMeasureVerticalPosition(twobyte distance, bool parts);
6160
6167 void SetView(
6168#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6170#else
6171 int
6172#endif
6173 view
6174 );
6175
6182 void SetNumberingStyle(
6183#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6185#else
6186 int
6187#endif
6188 style
6189 );
6190
6201 void SetBase(twobyte base);
6202
6215 void SetStartCharacter(eUniChar32 character);
6216
6222 void SetTime(bool state);
6223
6228 void SetTimeFrames(bool state);
6229
6236 void SetUseHours(bool state);
6237
6242 void SetTimePrecision(twobyte precision);
6243
6256 void SetCountFromOne(bool value);
6257
6268 void SetNoZero(bool value);
6269
6283 void SetDoubleUp(bool value);
6284
6289 twobyte GetStartMeasure() const;
6290
6295 twobyte GetEndMeasure() const;
6296
6304 twobyte GetStartNumber() const;
6305
6310 bool GetTime() const;
6311
6316 bool GetTimeFrames() const;
6317
6324 bool GetUseHours() const;
6325
6330 twobyte GetTimePrecision() const;
6331
6342 bool GetNoZero() const;
6343
6358 bool GetDoubleUp() const;
6359
6370 bool GetCountFromOne() const;
6371
6384 eUniChar32 GetStartCharacter() const;
6385
6396 twobyte GetBase() const;
6397
6408 bool GetUseScoreInfoForParts() const;
6409
6414 twobyte GetID();
6415
6426 bool GetDisplayedNumber(eMeas number, FCString* pString);
6427
6441 bool GetDisplayedNumberWithID(eMeas number, FCString* pString);
6442
6449 void GetPrefix(FCString* pString);
6450
6457 void GetSuffix(FCString* pString);
6458
6469 {
6470 return parts ? &_startEnclosureParts : &_startEnclosureScore;
6471 }
6472
6483 {
6484 return parts ? &_multipleEnclosureParts : &_multipleEnclosureScore;
6485 }
6486
6493 bool GetUseEnclosureStart(bool parts);
6494
6502 bool GetExcludeOtherStaves(bool parts);
6503
6508 bool GetUseEnclosureMultiple(bool parts);
6509
6514 bool GetShowOnTopStaff(bool parts);
6515
6520 bool GetShowOnSystemStart(bool parts);
6521
6526 bool GetShowOnBottomStaff(bool parts);
6527
6532 bool GetShowMultiples(bool parts);
6533
6538 bool GetHideFirstNumber(bool parts);
6539
6546 bool GetShowMultiMeasureRange(bool parts);
6547
6554 bool GetShowOnMultiMeasureRests(bool parts);
6555
6561 twobyte GetMultipleValue(bool parts);
6562
6567 twobyte GetMultipleStartMeasure(bool parts);
6568
6575 eUniChar32 GetMultiMeasureBracketLeft(bool parts);
6576
6583 eUniChar32 GetMultiMeasureBracketRight(bool parts);
6584
6589 bool GetBreakMultiMeasureRests(bool parts);
6590
6595#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6597#else
6598 int
6599#endif
6600 GetStartAlignment(bool parts);
6601
6606#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6608#else
6609 int
6610#endif
6611 GetStartJustification(bool parts);
6612
6613
6614
6619#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6621#else
6622 int
6623#endif
6624 GetMultipleAlignment(bool parts);
6625
6630#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6632#else
6633 int
6634#endif
6635 GetMultipleJustification(bool parts);
6636
6637
6638
6643#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6645#else
6646 int
6647#endif
6648 GetMultiMeasureAlignment(bool parts);
6649
6654#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6656#else
6657 int
6658#endif
6659 GetMultiMeasureJustification(bool parts);
6660
6661
6666 twobyte GetStartHorizontalPosition(bool parts);
6667
6672 twobyte GetStartVerticalPosition(bool parts);
6673
6678 twobyte GetMultipleHorizontalPosition(bool parts);
6679
6684 twobyte GetMultipleVerticalPosition(bool parts);
6685
6690 twobyte GetMultiMeasureHorizontalPosition(bool parts);
6691
6696 twobyte GetMultiMeasureVerticalPosition(bool parts);
6697
6703#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6705#else
6706 int
6707#endif
6708 GetView() const;
6709
6716#ifndef PDK_FRAMEWORK_LUAFRIENDLY
6718#else
6719 int
6720#endif
6721 GetNumberingStyle() const;
6722
6734 void GetStartFontInfo(FCFontInfo* pFontInfo, bool parts);
6735
6750 {
6751 FCFontInfo* pFontInfo = new FCFontInfo();
6752 GetStartFontInfo(pFontInfo, parts);
6753 return pFontInfo;
6754 }
6755
6756#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
6758 luabridge::RefCountedPtr<FCFontInfo> CreateStartFontInfo_GC(bool parts)
6759 { return makeLuaSharedPtr(CreateStartFontInfo(parts)); }
6760#endif
6761
6772 void GetMultipleFontInfo(FCFontInfo* pFontInfo, bool parts);
6773
6788 {
6789 FCFontInfo* pFontInfo = new FCFontInfo();
6790 GetMultipleFontInfo(pFontInfo, parts);
6791 return pFontInfo;
6792 }
6793
6794#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
6796 luabridge::RefCountedPtr<FCFontInfo> CreateMultipleFontInfo_GC(bool parts)
6797 { return makeLuaSharedPtr(CreateMultipleFontInfo(parts)); }
6798#endif
6799
6810 void GetMultiMeasureFontInfo(FCFontInfo* pFontInfo, bool parts);
6811
6826 {
6827 FCFontInfo* pFontInfo = new FCFontInfo();
6828 GetMultiMeasureFontInfo(pFontInfo, parts);
6829 return pFontInfo;
6830 }
6831
6832#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
6834 luabridge::RefCountedPtr<FCFontInfo> CreateMultiMeasureFontInfo_GC(bool parts)
6835 { return makeLuaSharedPtr(CreateMultiMeasureFontInfo(parts)); }
6836#endif
6837
6852 FCString* CreateDisplayedString(twobyte measure);
6853
6854#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
6856 luabridge::RefCountedPtr<FCString> CreateDisplayedString_GC(twobyte measure)
6857 { return makeLuaSharedPtr(CreateDisplayedString(measure)); }
6858#endif
6859
6860
6869 void CloneFormattingFrom(FCMeasureNumberRegion* pRegionFrom, bool score, bool parts);
6870
6879 bool IsMeasureIncluded(twobyte measureno)
6880 {
6881 if (measureno > GetEndMeasure()) return false;
6882 if (measureno < GetStartMeasure()) return false;
6883 return true;
6884 }
6885
6901 bool AssignAllNonNumberedMeasures(FCNumbers* pAllNonNumberedMeasures);
6902
6915 void _SetTempNonIncludedMeasures(FCNumbers* pNonNumberedMeasuresToUse)
6916 {
6917 /* Store the "actual" value, restore it with _RestoreTempNonIncludedMeasures() */
6918 _pTempNonIncludedMeasuresStorage = _pNonIncludedMeasures;
6919 /* Set temp value */
6920 _pNonIncludedMeasures = pNonNumberedMeasuresToUse;
6921 }
6922
6928 {
6929 /* Restore from temporary storage to the "real" storage */
6930 _pNonIncludedMeasures = _pTempNonIncludedMeasuresStorage;
6931 }
6932
6933#ifdef PDK_FRAMEWORK_DEBUG
6934 void DebugDump() override
6935 {
6937 DebugOutInt("Start measure: ", GetStartMeasure());
6938 DebugOutInt("End measure: ", GetEndMeasure());
6939 }
6940#endif
6941};
6942
6952{
6953#ifndef DOXYGEN_SHOULD_IGNORE_THIS
6954 private:
6956 EDTInstrumentUsed _instrumentused;
6957 int _resize;
6958
6960 bool LoadFirst() override { return false; }
6961protected:
6962 EXTAG Tag() const override { return ot_InstrumentUsed; }
6963 int DataSizeLoad() const override { return sizeof(EDTInstrumentUsed); }
6964 void* Allocate() override { return (void*) &_instrumentused; }
6965
6970 void CloneMemoryFrom(__FCBaseData* pSource) override
6971 {
6972 memcpy(&_instrumentused, ((FCSystemStaff*)pSource)->_GetDataPtr(), sizeof(_instrumentused));
6973 _datablock = &_instrumentused;
6974 _loadedsize = sizeof(_instrumentused);
6975 _resize = ((FCSystemStaff*)pSource)->GetResize();
6976 }
6977
6978 __FCBaseData* CreateObject() override { return new FCSystemStaff(); }
6979#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
6980public:
6981 const char* ClassName() const override { return "FCSystemStaff"; }
6982 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_SYSTEMSTAFF; }
6983
6984#ifndef DOXYGEN_SHOULD_IGNORE_THIS
6991 void* _GetDataPtr() { return &_instrumentused; }
6992#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
6993
7000 {
7001 memset(&_instrumentused, 0, sizeof(_instrumentused));
7002 _datablock = &_instrumentused;
7003 _loadedsize = sizeof(_instrumentused);
7004 _resize = 100;
7005 }
7006
7008 bool Load(CMPER itemno, twobyte inci) override;
7009
7011 bool SaveNew(CMPER itemno) override;
7012
7014 bool Save() override;
7015
7016
7024 void SetDistance(Evpu32 distance) { _instrumentused.separ = -distance; }
7025
7030 void SetStaff(eStaff staffno) { _instrumentused.inst = staffno; }
7031
7039 Evpu32 GetDistance() const { return -_instrumentused.separ; }
7040
7046 eStaff GetStaff() const override { return _instrumentused.inst; }
7047
7053 int GetResize() const
7054 {
7055 if (_dataid.other.cmper == 0) return 100;
7056 return _resize;
7057 }
7058
7067 void SetResize(int value)
7068 {
7069 _resize = value;
7070 }
7071
7079 {
7080 if (_dataid.other.cmper == 0) return false;
7081 if (!DataIsLoaded()) return false;
7082 EDataID dataID;
7083 dataID.detail.cmper1 = _dataid.other.cmper; /* System */
7084 dataID.detail.cmper2 = _instrumentused.inst; /* Staff */
7085 dataID.detail.inci = 0; /* Should be 0 */
7086 return FX_DeleteEData(dt_StaffEnduction, &dataID, EnigmaVersion()) != 0;
7087 }
7088
7089#ifdef PDK_FRAMEWORK_DEBUG
7090 void DebugDump() override
7091 {
7093 DebugOutInt("Distance: ", GetDistance());
7094 }
7095#endif
7096};
7097
7099
7106{
7107#ifndef DOXYGEN_SHOULD_IGNORE_THIS
7108 private:
7110 EDTDrumStaff2010 _drumstaff;
7111
7113 bool LoadFirst() override { return false; }
7114protected:
7115 EXTAG Tag() const override { return GetCustomTag() ? GetCustomTag() : ot_DrumStaff2010; } /* Custom tags might be used!!! */
7116 int DataSizeLoad() const override { return sizeof(EDTDrumStaff2010); }
7117 void* Allocate() override { return (void*) &_drumstaff; }
7118
7123 void CloneMemoryFrom(__FCBaseData* pSource) override
7124 {
7125 memcpy(&_drumstaff, ((FCPercussionStaff*)pSource)->_GetDataPtr(), sizeof(_drumstaff));
7126 _datablock = &_drumstaff;
7127 _loadedsize = sizeof(_drumstaff);
7128 }
7129
7130 __FCBaseData* CreateObject() override { return new FCPercussionStaff(); }
7131#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
7132public:
7133 const char* ClassName() const override { return "FCPercussionStaff"; }
7134 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_PERCUSSIONSTAFF; }
7135
7136#ifndef DOXYGEN_SHOULD_IGNORE_THIS
7143 void* _GetDataPtr() { return &_drumstaff; }
7144#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
7145
7148 {
7149 memset(&_drumstaff, 0, sizeof(_drumstaff));
7150 _datablock = &_drumstaff;
7151 _loadedsize = sizeof(_drumstaff);
7152 }
7153
7161 {
7162 return _drumstaff.whichDrumLib;
7163 }
7164
7169 void SetPercussionLibrary(CMPER cmper)
7170 {
7171 _drumstaff.whichDrumLib = cmper;
7172 }
7173
7180
7181#ifdef PDK_FRAMEWORK_DEBUG
7182 void DebugDump() override
7183 {
7185 DebugOutInt("Percussion Library: ", GetPercussionLibrary());
7186 }
7187#endif
7188};
7189
7190#ifdef PDK_FRAMEWORK_PREFS
7202{
7203#ifndef DOXYGEN_SHOULD_IGNORE_THIS
7204 private:
7205
7206 bool _fullnamepos; /* Needed for calculating the preferences*/
7207
7209 EDTNamePos _namepos;
7210
7212 bool LoadFirst() override { return false; }
7213protected:
7214 EXTAG Tag() const override { return GetCustomTag() ? GetCustomTag() : ot_NamePosFull; } /* Custom tags SHOULD be used!!! */
7215 int DataSizeLoad() const override { return sizeof(EDTNamePos); }
7216 void* Allocate() override { return (void*) &_namepos; }
7217
7222 void CloneMemoryFrom(__FCBaseData* pSource) override
7223 {
7224 memcpy(&_namepos, ((FCStaffNamePosition*)pSource)->_GetDataPtr(), sizeof(_namepos));
7225 _datablock = &_namepos;
7226 _loadedsize = sizeof(_namepos);
7227 _fullnamepos = ((FCStaffNamePosition*)pSource)->_GetFullNamePos();
7228 }
7229
7230 __FCBaseData* CreateObject() override { return new FCStaffNamePosition(_fullnamepos); }
7231#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
7232public:
7233 const char* ClassName() const override { return "FCStaffNamePosition"; }
7234 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_STAFFNAMEPOSITION; }
7235
7236#ifndef DOXYGEN_SHOULD_IGNORE_THIS
7238 bool _GetFullNamePos() { return _fullnamepos; }
7239
7246 void* _GetDataPtr() { return &_namepos; }
7247
7249 bool Load(CMPER itemno) override
7250 {
7251 const EDTNamePos savenamepos = _namepos;
7252 const bool retval = __FCNoInciOther::Load(itemno);
7253 if (! retval)
7254 {
7256 _namepos = savenamepos;
7257 }
7258 return retval;
7259 }
7260#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
7261
7268 FCStaffNamePosition(bool fullname);
7269
7274 twobyte GetHorizontalOffset() const { return _namepos.horizAdjust; }
7275
7280 twobyte GetVerticalOffset() const { return _namepos.vertAdjust; }
7281
7288 FLAG_16 GetJustification() const { return (_namepos.flag & (NAMEPOS_JUSTIBITS & 0x7)); }
7289
7296 FLAG_16 GetAlignment() const { return (_namepos.flag & NAMEPOS_HALIGNBITS) >> 4; }
7297
7302 bool GetExpandSingleWord() const { return GetBitFlag(_namepos.flag, NAMEPOS_EXPAND_SINGLE_WORD); }
7303
7308 bool GetUsePositioning() const { return GetBitFlag(_namepos.flag, 0x0008); }
7309
7310 // *******
7311 // SETTERS
7312 // *******
7313
7318 void SetHorizontalOffset(twobyte value) { _namepos.horizAdjust = value; }
7319
7324 void SetVerticalOffset(twobyte value) { _namepos.vertAdjust = value; }
7325
7332 void SetJustification(FLAG_16 justification)
7333 {
7334 const FLAG_16 actualJustiBits = (NAMEPOS_JUSTIBITS & 0x7);
7335 justification &= actualJustiBits;
7336 _namepos.flag &= ~actualJustiBits;
7337 _namepos.flag |= justification;
7338 }
7339
7346 void SetAlignment(FLAG_16 alignment)
7347 {
7348 alignment = alignment << 4;
7349 alignment &= NAMEPOS_HALIGNBITS;
7350 _namepos.flag &= ~NAMEPOS_HALIGNBITS;
7351 _namepos.flag |= alignment;
7352 }
7353
7358 void SetExpandSingleWord(bool state)
7359 {
7360 Set16BitFlag(&_namepos.flag, NAMEPOS_EXPAND_SINGLE_WORD, state);
7361 }
7362
7367 void SetUsePositioning(bool state) { Set16BitFlag(&_namepos.flag, 0x0008, state); }
7368
7373 Evpu16 CalcHorizontalPosition();
7374
7379 Evpu16 CalcVerticalPosition();
7380};
7381#endif /* PDK_FRAMEWORK_PREFS */
7382/* End of FCStaffNamePosition */
7383
7384
7385class FCInstrumentDef;
7388
7393{
7394 mutable FCString _uuid; /* Used for #GetInstrumentUUID */
7395
7396protected:
7397#ifndef DOXYGEN_SHOULD_IGNORE_THIS
7398#ifdef PDK_FRAMEWORK_PREFS
7400 std::unique_ptr<FCStaffNamePosition> _pFullNamePosition;
7401 std::unique_ptr<FCStaffNamePosition> _pAbbreviatedNamePosition;
7402#endif // PDK_FRAMEWORK_PREFS
7403
7410 EVERSION _VersionToUse() const;
7411
7412
7413 /* PURE VIRTUAL METHODS
7414 *
7415 * Used for data pointer access.
7416 */
7417
7419 virtual const uonebyte* _GetInstUUIDPtr() const = 0;
7420
7422 virtual const FLAG_16* _GetInstFlagPtr() const = 0;
7423
7425 virtual const FLAG_16* _GetFlagPtr() const = 0;
7426
7428 virtual const FLAG_16* _GetAltFlagPtr() const = 0;
7429
7431 virtual const FLAG_16* _GetAltFlag2Ptr() const = 0;
7432
7434 virtual const twobyte* _GetTranspositionPtr() const = 0;
7435
7437 virtual const FLAG_16* _GetMoreFlagsPtr() const = 0;
7438
7440 virtual const FLAG_16* _GetMoreFlags2Ptr() const = 0;
7441
7443 virtual const FLAG_16* _GetMoreFlags3Ptr() const = 0;
7444
7446 virtual const twobyte* _GetAbbrvNamePtr() const = 0;
7447
7449 virtual const twobyte* _GetFullNamePtr() const = 0;
7450
7452 virtual const twobyte* _GetClefsPtr() const = 0;
7453
7455 virtual const Efix32* _GetVertTabNumOffPtr() const = 0;
7456
7458 virtual const CMPER* _GetFretInstIDPtr() const = 0;
7459
7461 virtual const Evpu16* _GetBottomBarlineOffsetPtr() const = 0;
7462
7464 virtual const Evpu16* _GetTopBarlineOffsetPtr() const = 0;
7465
7467 virtual const utwobyte* _GetCapoLowFretPtr() const = 0;
7468
7470 virtual const FLAG_16* _GetBotLinesPtr() const = 0;
7471
7473 virtual const FLAG_16* _GetTopLinesPtr() const = 0;
7474
7476 virtual const Efix32* _GetLineSpacePtr() const = 0;
7477
7479 virtual const twobyte* _GetDwWRestPtr() const = 0;
7480
7482 virtual const twobyte* _GetStemReversalPtr() const = 0;
7483
7485 virtual const twobyte* _GetRepeatDotsOffPtr() const = 0;
7486
7488 virtual const twobyte* _GetHOtherRestPtr() const = 0;
7489
7491 virtual const EFONTID* _GetMFontPtr() const = 0;
7492
7494 virtual const twobyte* _GetSizeEfxPtr() const = 0;
7495
7497 virtual const Efix32* _GetHorzStemOffUpPtr() const = 0;
7498
7500 virtual const Efix32* _GetHorzStemOffDownPtr() const = 0;
7501
7503 virtual const Efix32* _GetVertStemStartOffUpPtr() const = 0;
7504
7506 virtual const Efix32* _GetVertStemStartOffDownPtr() const = 0;
7507
7509 virtual const Efix32* _GetVertStemEndOffUpPtr() const = 0;
7510
7512 virtual const Efix32* _GetVertStemEndOffDownPtr() const = 0;
7513
7518 virtual EXTAG _GetFullNamePosTag() const = 0;
7519
7524 virtual twobyte _GetFullNamePosCmper() const = 0;
7525
7530 virtual EXTAG _GetAbbreviatedNamePosTag() const = 0;
7531
7536 virtual twobyte _GetAbbreviatedNamePosCmper() const = 0;
7537
7538#ifdef PDK_FRAMEWORK_PREFS
7543 virtual bool _SaveNewFullNamePos() = 0;
7544
7549 virtual bool _SaveNewAbbreviatedNamePos() = 0;
7550#endif // PDK_FRAMEWORK_PREFS
7551
7557 void _SetFlag(FLAG_16 mask, bool state)
7558 {
7559 FLAG_16* pFlag = (FLAG_16*) _GetFlagPtr();
7560 return Set16BitFlag(pFlag, mask, state);
7561 }
7562
7563#endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
7564private:
7565 /* ACCESSOR METHODS */
7566
7569 bool _GetInstFlag(FLAG_16 mask) const
7570 {
7571 return GetBitFlag(*_GetInstFlagPtr(), mask);
7572 }
7573
7576 void _SetInstFlag(FLAG_16 mask, bool state)
7577 {
7578 FLAG_16* pInstFlag = (FLAG_16*) _GetInstFlagPtr();
7579 return Set16BitFlag(pInstFlag, mask, state);
7580 }
7581
7586 bool _GetFlag(FLAG_16 mask) const
7587 {
7588 return GetBitFlag(*_GetFlagPtr(), mask);
7589 }
7590
7595 bool _GetAltFlag(FLAG_16 mask) const
7596 {
7597 return GetBitFlag(*_GetAltFlagPtr(), mask);
7598 }
7599
7604 void _SetAltFlag(FLAG_16 mask, bool state)
7605 {
7606 FLAG_16* pFlag = (FLAG_16*) _GetAltFlagPtr();
7607 return Set16BitFlag(pFlag, mask, state);
7608 }
7609
7614 bool _GetTranspositionFlag(FLAG_16 mask) const
7615 {
7616 return GetBitFlag(*_GetTranspositionPtr(), mask);
7617 }
7618
7623 void _SetTranspositionFlag(FLAG_16 mask, bool state)
7624 {
7625 FLAG_16* pFlag = (FLAG_16*) _GetTranspositionPtr();
7626 return Set16BitFlag(pFlag, mask, state);
7627 }
7628
7633 bool _GetMoreFlags(FLAG_16 mask) const
7634 {
7635 return GetBitFlag(*_GetMoreFlagsPtr(), mask);
7636 }
7637
7638 bool _GetMoreFlags2(FLAG_16 mask) const
7639 {
7640 return GetBitFlag(*_GetMoreFlags2Ptr(), mask);
7641 }
7642
7643 bool _GetMoreFlags3(FLAG_16 mask) const
7644 {
7645 return GetBitFlag(*_GetMoreFlags3Ptr(), mask);
7646 }
7647
7652 void _SetMoreFlags(FLAG_16 mask, bool state)
7653 {
7654 FLAG_16* pFlag = (FLAG_16*) _GetMoreFlagsPtr();
7655 return Set16BitFlag(pFlag, mask, state);
7656 }
7657
7662 void _SetMoreFlags2(FLAG_16 mask, bool state)
7663 {
7664 FLAG_16* pFlag = (FLAG_16*) _GetMoreFlags2Ptr();
7665 return Set16BitFlag(pFlag, mask, state);
7666 }
7667
7672 void _SetMoreFlags3(FLAG_16 mask, bool state)
7673 {
7674 FLAG_16* pFlag = const_cast<FLAG_16*>(_GetMoreFlags3Ptr());
7675 return Set16BitFlag(pFlag, mask, state);
7676 }
7677
7679 void _SetAbbreviatedNameID(CMPER cmperid)
7680 {
7681 CMPER* pCmper = (CMPER*) _GetAbbrvNamePtr();
7682 *pCmper = cmperid;
7683 }
7684
7686 void _SetFullNameID(CMPER cmperid)
7687 {
7688 CMPER* pCmper = (CMPER*) _GetFullNamePtr();
7689 *pCmper = cmperid;
7690 }
7691
7692public:
7693 const char* ClassName() const override { return "__FCStaffBase"; }
7694
7695#if FXT_VERSION >= FINALEVERSION_2012
7696
7698 static const char FFUUID_BLANKSTAFF[];
7700 static const char FFUUID_GRANDSTAFF[];
7702 static const char FFUUID_UNKNOWN[];
7703
7704 /* Strings */
7705
7707 static const char FFUUID_VIOLIN[];
7709 static const char FFUUID_VIOLA[];
7711 static const char FFUUID_CELLO[];
7713 static const char FFUUID_DOUBLEBASS[];
7715 static const char FFUUID_VIOLINSECTION[];
7717 static const char FFUUID_VIOLASECTION[];
7719 static const char FFUUID_CELLOSECTION[];
7721 static const char FFUUID_VIOLONCELLOSECTION[];
7723 static const char FFUUID_DOUBLEBASSSECTION[];
7725 static const char FFUUID_CONTRABASSSECTION[];
7727 static const char FFUUID_STRINGENSEMBLE[];
7729 static const char FFUUID_VIOLADAMORE[];
7731 static const char FFUUID_AJAENG[];
7733 static const char FFUUID_ARPEGGIONE[];
7735 static const char FFUUID_BARYTON[];
7737 static const char FFUUID_BYZANTINELYRA[];
7739 static const char FFUUID_CRETANLYRA[];
7741 static const char FFUUID_CRWTH[];
7743 static const char FFUUID_DAHU[];
7745 static const char FFUUID_DANGAO[];
7747 static const char FFUUID_DIHU[];
7749 static const char FFUUID_ERHU[];
7751 static const char FFUUID_ERXIAN[];
7753 static const char FFUUID_FIDDLE[];
7755 static const char FFUUID_GAOHU[];
7757 static const char FFUUID_GEHU[];
7759 static const char FFUUID_HAEGEUM[];
7761 static const char FFUUID_HARDANGERFIDDLE[];
7763 static const char FFUUID_HURDYGURDY[];
7765 static const char FFUUID_IGIL[];
7767 static const char FFUUID_KAMANCHA[];
7769 static const char FFUUID_KOKYU[];
7771 static const char FFUUID_KORA[];
7773 static const char FFUUID_LARUAN[];
7775 static const char FFUUID_LEIQIN[];
7777 static const char FFUUID_LIRONE[];
7779 static const char FFUUID_MORINKHUUR[];
7781 static const char FFUUID_NYCKELHARPA[];
7783 static const char FFUUID_OCTOBASS[];
7785 static const char FFUUID_REBAB[];
7787 static const char FFUUID_REBEC[];
7789 static const char FFUUID_SARANGI[];
7791 static const char FFUUID_SARANGIDRONE[];
7793 static const char FFUUID_STROHVIOLIN[];
7795 static const char FFUUID_TROMBAMARINA[];
7797 static const char FFUUID_VIELLE[];
7799 static const char FFUUID_VIOL[];
7801 static const char FFUUID_VIOLADAGAMBA[];
7803 static const char FFUUID_VIOLINOPICCOLO[];
7805 static const char FFUUID_VIOLONCELLOPICCOLO[];
7807 static const char FFUUID_VIOLOTTA[];
7809 static const char FFUUID_ZHONGHU[];
7810
7811 /* Keyboards */
7812
7814 static const char FFUUID_PIANO[];
7816 static const char FFUUID_PIANONONAME[];
7818 static const char FFUUID_HARPSICHORD[];
7820 static const char FFUUID_ORGAN[];
7822 static const char FFUUID_ORGAN2STAFF[];
7824 static const char FFUUID_CELESTA[];
7826 static const char FFUUID_ACCORDION[];
7828 static const char FFUUID_MELODICA[];
7830 static const char FFUUID_ELECTRICPIANO[];
7832 static const char FFUUID_CLAVINET[];
7834 static const char FFUUID_SYNTHPAD[];
7836 static const char FFUUID_SYNTHLEAD[];
7838 static const char FFUUID_SYNTHBRASS[];
7840 static const char FFUUID_SYNTHSOUNDTRACK[];
7842 static const char FFUUID_SOUNDFX[];
7844 static const char FFUUID_HARMONIUM[];
7846 static const char FFUUID_ONDESMARTENOT[];
7848 static const char FFUUID_THEREMIN[];
7850 static const char FFUUID_VIRGINAL[];
7852 static const char FFUUID_CLAVICHORD[];
7853
7854 /* Voices */
7855
7857 static const char FFUUID_SOPRANOVOICE[];
7859 static const char FFUUID_ALTOVOICE[];
7861 static const char FFUUID_TENORVOICE[];
7863 static const char FFUUID_BARITONEVOICE[];
7865 static const char FFUUID_BASSVOICE[];
7867 static const char FFUUID_VOCALS[];
7869 static const char FFUUID_VOICE[];
7871 static const char FFUUID_VOICENONAME[];
7873 static const char FFUUID_MEZZOSOPRANOVOICE[];
7875 static const char FFUUID_CONTRALTOVOICE[];
7877 static const char FFUUID_COUNTERTENORVOICE[];
7879 static const char FFUUID_BASSBAROTONEVOICE[];
7881 static const char FFUUID_CHOIRAAHS[];
7883 static const char FFUUID_CHOIROOHS[];
7885 static const char FFUUID_YODEL[];
7887 static const char FFUUID_BEATBOX[];
7889 static const char FFUUID_KAZOO[];
7891 static const char FFUUID_TALKBOX[];
7893 static const char FFUUID_VOCALPERCUSSION[];
7894
7895 /* Woodwinds */
7896
7898 static const char FFUUID_PICCOLO[];
7900 static const char FFUUID_FLUTE[];
7902 static const char FFUUID_ALTOFLUTE[];
7904 static const char FFUUID_OBOE[];
7906 static const char FFUUID_OBOEDAMORE[];
7908 static const char FFUUID_ENGLISHHORN[];
7910 static const char FFUUID_CLARINETBFLAT[];
7912 static const char FFUUID_CLARINETA[];
7914 static const char FFUUID_CLARINETEFLAT[];
7916 static const char FFUUID_ALTOCLARINET[];
7918 static const char FFUUID_CONTRALTOCLARINET[];
7920 static const char FFUUID_BASSCLARINET[];
7922 static const char FFUUID_CONTRABASSCLARINET[];
7924 static const char FFUUID_BASSOON[];
7926 static const char FFUUID_CONTRABASSOON[];
7928 static const char FFUUID_WINDSECTION[];
7930 static const char FFUUID_SOPRANOSAX[];
7932 static const char FFUUID_ALTOSAX[];
7934 static const char FFUUID_TENORSAX[];
7936 static const char FFUUID_BARITONESAX[];
7938 static const char FFUUID_SOPRANORECORDER[];
7940 static const char FFUUID_SOPRANINORECORDER[];
7942 static const char FFUUID_ALTORECORDER[];
7944 static const char FFUUID_TENORRECORDER[];
7946 static const char FFUUID_BASSRECORDER[];
7948 static const char FFUUID_DESCANTRECORDER[];
7950 static const char FFUUID_OCARINA[];
7952 static const char FFUUID_PENNYWHISTLE[];
7954 static const char FFUUID_PENNYWHISTLED[];
7956 static const char FFUUID_PENNYWHISTLEG[];
7958 static const char FFUUID_LOWIRISHWHISTLE[];
7960 static const char FFUUID_TINWHISTLEBFLAT[];
7962 static const char FFUUID_HARMONICA[];
7964 static const char FFUUID_BASSHARMONICA[];
7966 static const char FFUUID_CONCERTINA[];
7968 static const char FFUUID_BANDONEON[];
7970 static const char FFUUID_HORNF_WWQUINTET[];
7972 static const char FFUUID_BAGPIPES[];
7974 static const char FFUUID_UILLEANNPIPES[];
7976 static const char FFUUID_GAIDAPIPES[];
7978 static const char FFUUID_CONTRAALTOFLUTE[];
7980 static const char FFUUID_BASSFLUTE[];
7982 static const char FFUUID_CONTRABASSFLUTE[];
7984 static const char FFUUID_DOUBLECONTRABASSFLUTE[];
7986 static const char FFUUID_HYPERBASSFLUTE[];
7988 static const char FFUUID_PANPIPES[];
7990 static const char FFUUID_FIFE[];
7992 static const char FFUUID_BOTTLEBLOW[];
7994 static const char FFUUID_JUG[];
7996 static const char FFUUID_PICCOLOOBOE[];
7998 static const char FFUUID_PICCOLOHECKELPHONE[];
8000 static const char FFUUID_HECKELPHONE[];
8002 static const char FFUUID_BASSOBOE[];
8004 static const char FFUUID_BASSETCLARINET[];
8006 static const char FFUUID_BASSETHORN[];
8008 static const char FFUUID_HORNPIPE[];
8010 static const char FFUUID_PICCOLOCLARINET[];
8012 static const char FFUUID_SAXONETTE[];
8014 static const char FFUUID_SOPRANINOSAX[];
8016 static const char FFUUID_MEZZOSOPRANOSAX[];
8018 static const char FFUUID_SOPRILLO[];
8020 static const char FFUUID_CMELODYSAX[];
8022 static const char FFUUID_AULOCHROME[];
8024 static const char FFUUID_XAPHOON[];
8026 static const char FFUUID_BASSSAX[];
8028 static const char FFUUID_CONTRABASSSAX[];
8030 static const char FFUUID_SUBCONTRABASSSAX[];
8032 static const char FFUUID_TUBAX[];
8034 static const char FFUUID_BANSURI[];
8036 static const char FFUUID_DANSO[];
8038 static const char FFUUID_DIZI[];
8040 static const char FFUUID_DILLIKAVAL[];
8042 static const char FFUUID_DIPLE[];
8044 static const char FFUUID_DOUBLEFLUTE[];
8046 static const char FFUUID_DVOJNICE[];
8048 static const char FFUUID_DVOJNICEDRONE[];
8050 static const char FFUUID_FLAGEOLET[];
8052 static const char FFUUID_FUJARA[];
8054 static const char FFUUID_GEMSHORN[];
8056 static const char FFUUID_HOCCHIKU[];
8058 static const char FFUUID_HUN[];
8060 static const char FFUUID_IRISHFLUTE[];
8062 static const char FFUUID_KAVAL[];
8064 static const char FFUUID_KHLUI[];
8066 static const char FFUUID_KNOTWEEDFLUTE[];
8068 static const char FFUUID_KONCOVKAALTOFLUTE[];
8070 static const char FFUUID_KOUDI[];
8072 static const char FFUUID_NEY[];
8074 static const char FFUUID_NOHKAN[];
8076 static const char FFUUID_NOSEFLUTE[];
8078 static const char FFUUID_PALENDAG[];
8080 static const char FFUUID_QUENA[];
8082 static const char FFUUID_RYUTEKI[];
8084 static const char FFUUID_SHAKUHACHI[];
8086 static const char FFUUID_SHEPHERDSPIPE[];
8088 static const char FFUUID_SHINOBUE[];
8090 static const char FFUUID_SHIVAWHISTLE[];
8092 static const char FFUUID_SHVI[];
8094 static const char FFUUID_SULING[];
8096 static const char FFUUID_TARKA[];
8098 static const char FFUUID_TENOROVERTONEFLUTE[];
8100 static const char FFUUID_TUMPONG[];
8102 static const char FFUUID_VENU[];
8104 static const char FFUUID_XIAO[];
8106 static const char FFUUID_XUN[];
8108 static const char FFUUID_ALBOGUE[];
8110 static const char FFUUID_ALBOKA[];
8112 static const char FFUUID_ALTOCRUMHORN[];
8114 static const char FFUUID_ARGHUL[];
8116 static const char FFUUID_BAWU[];
8118 static const char FFUUID_CHALUMEAU[];
8120 static const char FFUUID_CLARINETTEDAMOUR[];
8122 static const char FFUUID_CORNAMUSE[];
8124 static const char FFUUID_DIPLICA[];
8126 static const char FFUUID_DOUBLECLARINET[];
8128 static const char FFUUID_HECKELCLARINA[];
8130 static const char FFUUID_HECKELPHONECLARINET[];
8132 static const char FFUUID_HIRTENSCHALMEI[];
8134 static const char FFUUID_LAUNEDDAS[];
8136 static const char FFUUID_MAQRUNAH[];
8138 static const char FFUUID_MIJWIZ[];
8140 static const char FFUUID_OCTAVIN[];
8142 static const char FFUUID_PIBGORN[];
8144 static const char FFUUID_RAUSCHPFEIFE[];
8146 static const char FFUUID_SIPSI[];
8148 static const char FFUUID_MODERNTAROGATO[];
8150 static const char FFUUID_TENORCRUMHORN[];
8152 static const char FFUUID_ZHALEIKA[];
8154 static const char FFUUID_ALGAITA[];
8156 static const char FFUUID_BIFORA[];
8158 static const char FFUUID_BOMBARDE[];
8160 static const char FFUUID_CROMORNE[];
8162 static const char FFUUID_DUDUK[];
8164 static const char FFUUID_DULCIAN[];
8166 static const char FFUUID_DULZAINA[];
8168 static const char FFUUID_GUAN[];
8170 static const char FFUUID_GUANZI[];
8172 static const char FFUUID_HICHIRIKI[];
8174 static const char FFUUID_HNE[];
8176 static const char FFUUID_JOGIBAJA[];
8178 static const char FFUUID_KENBAU[];
8180 static const char FFUUID_MIZMAR[];
8182 static const char FFUUID_NADASWARAM[];
8184 static const char FFUUID_OBOEDACACCIA[];
8186 static const char FFUUID_PI[];
8188 static const char FFUUID_PIRI[];
8190 static const char FFUUID_PUNGISNAKECHARMER[];
8192 static const char FFUUID_RACKETT[];
8194 static const char FFUUID_REEDCONTRABASS[];
8196 static const char FFUUID_RHAITA[];
8198 static const char FFUUID_ROTHPHONE[];
8200 static const char FFUUID_SARRUSOPHONE[];
8202 static const char FFUUID_SHAWM[];
8204 static const char FFUUID_SHEHNAI[];
8206 static const char FFUUID_SOPILA[];
8208 static const char FFUUID_SORNA[];
8210 static const char FFUUID_SRALAI[];
8212 static const char FFUUID_SUONA[];
8214 static const char FFUUID_SURNAY[];
8216 static const char FFUUID_TAEPYEONGSO[];
8218 static const char FFUUID_ANCIENTTAROGATO[];
8220 static const char FFUUID_TROMPETACHINA[];
8222 static const char FFUUID_ZURLA[];
8224 static const char FFUUID_ZURNA[];
8226 static const char FFUUID_KHAENMOUTHORGAN[];
8228 static const char FFUUID_HULUSI[];
8230 static const char FFUUID_SHENG[];
8231
8232 /* Brass */
8234 static const char FFUUID_TRUMPETBFLAT[];
8236 static const char FFUUID_TRUMPETC[];
8238 static const char FFUUID_TRUMPETD[];
8240 static const char FFUUID_CORNET[];
8242 static const char FFUUID_FLUGELHORN[];
8244 static const char FFUUID_MELLOPHONE[];
8246 static const char FFUUID_HORNF[];
8248 static const char FFUUID_TROMBONE[];
8250 static const char FFUUID_BASSTROMBONE[];
8252 static const char FFUUID_EUPHONIUM[];
8254 static const char FFUUID_BARITONEBC[];
8256 static const char FFUUID_BARITONETC[];
8258 static const char FFUUID_TUBA[];
8260 static const char FFUUID_BASSTUBA[];
8262 static const char FFUUID_SOUSAPHONE[];
8264 static const char FFUUID_BRASSSECTION[];
8266 static const char FFUUID_PICCOLOTRUMPETA[];
8268 static const char FFUUID_BUGLE[];
8270 static const char FFUUID_CORNETEFLAT[];
8272 static const char FFUUID_HORNEFLAT[];
8274 static const char FFUUID_ALTOTROMBONE[];
8276 static const char FFUUID_TENORTROMBONE[];
8278 static const char FFUUID_CONTRABASSTROMBONE[];
8280 static const char FFUUID_ALPHORN[];
8282 static const char FFUUID_ALTOHORN[];
8284 static const char FFUUID_DIDGERIDOO[];
8286 static const char FFUUID_POSTHORN[];
8288 static const char FFUUID_VIENNAHORN[];
8290 static const char FFUUID_WAGNERTUBA[];
8292 static const char FFUUID_BAROQUETRUMPET[];
8294 static const char FFUUID_BASSTRUMPET[];
8296 static const char FFUUID_CORNETTO[];
8298 static const char FFUUID_FISCORN[];
8300 static const char FFUUID_KUHLOHORN[];
8302 static const char FFUUID_POCKETTRUMPET[];
8304 static const char FFUUID_SAXHORN[];
8306 static const char FFUUID_SLIDETRUMPET[];
8308 static const char FFUUID_CIMBASSO[];
8310 static const char FFUUID_DOUBLEBELLEUPHONIUM[];
8312 static const char FFUUID_SACKBUT[];
8314 static const char FFUUID_HELICON[];
8316 static const char FFUUID_OPHICLEIDE[];
8318 static const char FFUUID_SERPENT[];
8320 static const char FFUUID_SUBCONTRABASSTUBA[];
8322 static const char FFUUID_CONCHSHELL[];
8324 static const char FFUUID_HORAGAI[];
8326 static const char FFUUID_SHOFAR[];
8328 static const char FFUUID_VUVUZELA[];
8329
8330 /* Plucked strings */
8332 static const char FFUUID_HARP[];
8334 static const char FFUUID_TROUBADORHARP[];
8336 static const char FFUUID_GUITAR[];
8338 static const char FFUUID_GUITAR8VB[];
8340 static const char FFUUID_ACOUSTICGUITAR[];
8342 static const char FFUUID_CLASSICALGUITAR[];
8344 static const char FFUUID_ELECTRICGUITAR[];
8346 static const char FFUUID_STEELGUITAR[];
8348 static const char FFUUID_BANJO[];
8350 static const char FFUUID_TENORBANJO[];
8352 static const char FFUUID_ACOUSTICBASS[];
8354 static const char FFUUID_BASSGUITAR[];
8356 static const char FFUUID_ELECTRICBASS[];
8358 static const char FFUUID_FRETLESSBASS[];
8360 static const char FFUUID_STRINGBASS[];
8362 static const char FFUUID_MANDOLIN[];
8364 static const char FFUUID_DULCIMER[];
8366 static const char FFUUID_HAMMEREDDULCIMER[];
8368 static const char FFUUID_DULCIMER8VB[];
8370 static const char FFUUID_AUTOHARP[];
8372 static const char FFUUID_LUTE[];
8374 static const char FFUUID_UKULELE[];
8376 static const char FFUUID_TENORUKULELE[];
8378 static const char FFUUID_SITAR[];
8380 static const char FFUUID_ZITHER[];
8382 static const char FFUUID_ARCHLUTE[];
8384 static const char FFUUID_BAGLAMA[];
8386 static const char FFUUID_BALALAIKA[];
8388 static const char FFUUID_BANDURA[];
8390 static const char FFUUID_BANJOLELE[];
8392 static const char FFUUID_BARBAT[];
8394 static const char FFUUID_BEGENA[];
8396 static const char FFUUID_BIWA[];
8398 static const char FFUUID_BOLON[];
8400 static const char FFUUID_BORDONUA[];
8402 static const char FFUUID_BOUZOUKI[];
8404 static const char FFUUID_BULGARIANTAMBURA[];
8406 static const char FFUUID_CHAPMANSTICK[];
8408 static const char FFUUID_CHARANGO[];
8410 static const char FFUUID_CHITARRABATTENTE[];
8412 static const char FFUUID_CHOAZHOUGUZHENG[];
8414 static const char FFUUID_CIMBALOM[];
8416 static const char FFUUID_CITTERN[];
8418 static const char FFUUID_CUATRO[];
8420 static const char FFUUID_DANBAU[];
8422 static const char FFUUID_DANNGUYET[];
8424 static const char FFUUID_DANTAMTHAPLUC[];
8426 static const char FFUUID_DANTRANH[];
8428 static const char FFUUID_DANTYBA[];
8430 static const char FFUUID_DIDDLEYBOW[];
8432 static const char FFUUID_DOBRO[];
8434 static const char FFUUID_DOMRA[];
8436 static const char FFUUID_DUTAR[];
8438 static const char FFUUID_DUXIANQIN[];
8441 static const char FFUUID_EKTARA1[];
8443 static const char FFUUID_FLAMENCOGUITAR[];
8445 static const char FFUUID_GEOMUNGO[];
8448 static const char FFUUID_EKTARA2[];
8450 static const char FFUUID_GOTTUVADHYAM[];
8454 static const char FFUUID_GUITARRON[];
8456 static const char FFUUID_GUITJO[];
8458 static const char FFUUID_GUITJODOUBLENECK[];
8460 static const char FFUUID_GUQIN[];
8462 static const char FFUUID_GUZHENG[];
8464 static const char FFUUID_HARPGUITAR[];
8466 static const char FFUUID_IRISHBOUZOUKI[];
8468 static const char FFUUID_JARANAHUASTECA[];
8470 static const char FFUUID_JARANAJAROCHO[];
8472 static const char FFUUID_JARANAMOSQUITO[];
8474 static const char FFUUID_JARANASEGUNDA[];
8476 static const char FFUUID_JARANATERCERA[];
8478 static const char FFUUID_KABOSY[];
8480 static const char FFUUID_KANTELE[];
8482 static const char FFUUID_KAYAGUM[];
8484 static const char FFUUID_KHIM[];
8486 static const char FFUUID_KOBZA[];
8488 static const char FFUUID_KOMUZ[];
8490 static const char FFUUID_KOTO[];
8492 static const char FFUUID_KUTIYAPI[];
8494 static const char FFUUID_LANGELEIK[];
8496 static const char FFUUID_LYRE[];
8498 static const char FFUUID_MANDOBASS[];
8500 static const char FFUUID_MANDOCELLO[];
8502 static const char FFUUID_MANDOLA[];
8504 static const char FFUUID_MANDORA[];
8506 static const char FFUUID_MANDORE[];
8508 static const char FFUUID_MANGBETU[];
8510 static const char FFUUID_MAROVANY[];
8512 static const char FFUUID_MOHANVEENA[];
8514 static const char FFUUID_MOODSWINGER[];
8516 static const char FFUUID_MUSICALBOW[];
8518 static const char FFUUID_NGONI[];
8520 static const char FFUUID_OCTAVEMANDOLIN[];
8522 static const char FFUUID_OUD[];
8524 static const char FFUUID_PIPA[];
8526 static const char FFUUID_PORTUGUESEGUITAR[];
8528 static const char FFUUID_PSALTERY[];
8530 static const char FFUUID_REQUINTOGUITAR[];
8532 static const char FFUUID_RUAN[];
8534 static const char FFUUID_RUDRAVEENA[];
8536 static const char FFUUID_SALLANEH[];
8538 static const char FFUUID_SANSHIN[];
8540 static const char FFUUID_SANTOOR[];
8542 static const char FFUUID_SANXIAN[];
8544 static const char FFUUID_SAROD[];
8546 static const char FFUUID_SAUNG[];
8548 static const char FFUUID_SAZ[];
8550 static const char FFUUID_SE[];
8552 static const char FFUUID_SETAR[];
8554 static const char FFUUID_SHAMISEN[];
8556 static const char FFUUID_TAMBURA[];
8559 static const char FFUUID_TAR_PLUCKED[];
8561 static const char FFUUID_THEORBO[];
8563 static const char FFUUID_TIMPLE[];
8565 static const char FFUUID_TRES[];
8567 static const char FFUUID_TSYMBALY[];
8569 static const char FFUUID_VALIHA[];
8571 static const char FFUUID_VEENA[];
8573 static const char FFUUID_VICHITRAVEENA[];
8575 static const char FFUUID_VIHUELAMEXICO[];
8577 static const char FFUUID_VIHUELASPAIN[];
8579 static const char FFUUID_WASHTUBBASS[];
8581 static const char FFUUID_WHAMOLA[];
8583 static const char FFUUID_XALAM[];
8585 static const char FFUUID_YANGQIN[];
8587 static const char FFUUID_YAZHENG[];
8589 static const char FFUUID_YUEQIN[];
8590
8591 /* Tablature */
8593 static const char FFUUID_TAB_GUITAR[];
8595 static const char FFUUID_TAB_GUITARNONAME[];
8597 static const char FFUUID_TAB_GUITARSTEMS[];
8599 static const char FFUUID_TAB_GUITAR_D[];
8601 static const char FFUUID_TAB_GUITAR_DADGAD[];
8603 static const char FFUUID_TAB_GUITAR_DOUBLED[];
8605 static const char FFUUID_TAB_GUITAR_DROPD[];
8607 static const char FFUUID_TAB_GUITAR_G[];
8609 static const char FFUUID_TAB_GUITAR_7STRING[];
8611 static const char FFUUID_TAB_BANJO_G[];
8613 static const char FFUUID_TAB_TENORBANJO[];
8615 static const char FFUUID_TAB_BANJO_C[];
8617 static const char FFUUID_TAB_BANJO_D[];
8619 static const char FFUUID_TAB_BANJO_DOUBLEC[];
8621 static const char FFUUID_TAB_BANJO_GMODAL[];
8623 static const char FFUUID_TAB_BANJO_PLECTRUM[];
8625 static const char FFUUID_TAB_BASSGUITAR_4[];
8627 static const char FFUUID_TAB_BASSGUITAR_5[];
8629 static const char FFUUID_TAB_BASSGUITAR_6[];
8631 static const char FFUUID_TAB_DULCIMER_DAA[];
8635 static const char FFUUID_TAB_DULCIMER_DAD[];
8637 static const char FFUUID_TAB_GAMBA[];
8639 static const char FFUUID_TAB_LUTEITALIAN[];
8641 static const char FFUUID_TAB_LUTELETTERS[];
8643 static const char FFUUID_TAB_MANDOLIN[];
8645 static const char FFUUID_TAB_REQUINTO[];
8647 static const char FFUUID_TAB_SITAR_SHANKAR[];
8649 static const char FFUUID_TAB_SITAR_KHAN[];
8651 static const char FFUUID_TAB_UKULELE[];
8653 static const char FFUUID_TAB_VIHUELA[];
8654
8655 /* Pitched Percussion */
8657 static const char FFUUID_TIMPANI[];
8659 static const char FFUUID_MALLETS[];
8661 static const char FFUUID_BELLS[];
8663 static const char FFUUID_CHIMES[];
8665 static const char FFUUID_CROTALES[];
8667 static const char FFUUID_GLOCKENSPIEL[];
8669 static const char FFUUID_SOPRANOGLOCKENSPIEL[];
8671 static const char FFUUID_ALTOGLOCKENSPIEL[];
8673 static const char FFUUID_MARIMBA[];
8675 static const char FFUUID_BASSMARIMBA[];
8677 static const char FFUUID_MARIMBASINGLESTAFF[];
8679 static const char FFUUID_TUBULARBELLS[];
8681 static const char FFUUID_VIBRAPHONE[];
8683 static const char FFUUID_XYLOPHONE[];
8685 static const char FFUUID_SOPRANOXYLOPHONE[];
8687 static const char FFUUID_ALTOXYLOPHONE[];
8689 static const char FFUUID_BASSXYLOPHONE[];
8691 static const char FFUUID_XYLORIMBA[];
8693 static const char FFUUID_BELL_LYRE[];
8695 static const char FFUUID_BOOMWHACKERS[];
8699 static const char FFUUID_CARILLON[];
8701 static const char FFUUID_CRYSTALGLASSES[];
8704 static const char FFUUID_FLEXATONE_PITCHED[];
8706 static const char FFUUID_GLASSHARMONICA[];
8708 static const char FFUUID_GLASSMARIMBA[];
8710 static const char FFUUID_HANDBELLS[];
8712 static const char FFUUID_HANDBELLS_TCLEF[];
8714 static const char FFUUID_HANDBELLS_BCLEF[];
8716 static const char FFUUID_HANG_TCLEF[];
8718 static const char FFUUID_JAWHARP[];
8720 static const char FFUUID_KALIMBA[];
8722 static const char FFUUID_SOPRANOMETALLOPHONE[];
8724 static const char FFUUID_ALTOMETALLOPHONE[];
8726 static const char FFUUID_BASSMETALLOPHONE[];
8728 static const char FFUUID_MUSICALSAW[];
8730 static const char FFUUID_SLIDEWHISTLE[];
8732 static const char FFUUID_STEELDRUMS_TCLEF[];
8734 static const char FFUUID_STEELDRUMS_BCLEF[];
8736 static const char FFUUID_BONANGGAMELAN[];
8738 static const char FFUUID_GANGSAGAMELAN[];
8740 static const char FFUUID_GENDERGAMELAN[];
8742 static const char FFUUID_GIYINGGAMELAN[];
8744 static const char FFUUID_KANTILGAMELAN[];
8746 static const char FFUUID_PELOGPANERUSGAMELAN[];
8748 static const char FFUUID_PEMADEGAMELAN[];
8750 static const char FFUUID_PENYACAHGAMELAN[];
8752 static const char FFUUID_SARONBARUNGGAMELAN[];
8754 static const char FFUUID_SARONDEMONGGAMELAN[];
8756 static const char FFUUID_SARONPANERUSGAMELAN[];
8758 static const char FFUUID_SLENDROPANERUSGAMELAN[];
8760 static const char FFUUID_SLENTHEMSGAMELAN[];
8762 static const char FFUUID_ALMGLOCKEN[];
8764 static const char FFUUID_ANGKLUNG[];
8766 static const char FFUUID_ARRAYMBIRA[];
8768 static const char FFUUID_BALAFON[];
8770 static const char FFUUID_BALAPHON[];
8772 static const char FFUUID_BIANQING[];
8774 static const char FFUUID_BIANZHONG[];
8776 static const char FFUUID_FANGXIANG[];
8778 static const char FFUUID_GANDINGANAKAYO[];
8780 static const char FFUUID_GYIL[];
8782 static const char FFUUID_KUBING[];
8784 static const char FFUUID_KULINTANG[];
8786 static const char FFUUID_KULINTANGAKAYO[];
8788 static const char FFUUID_KULINTANGATINIOK[];
8790 static const char FFUUID_LAMELLAPHONE[];
8792 static const char FFUUID_LIKEMBE[];
8794 static const char FFUUID_LUNTANG[];
8796 static const char FFUUID_MBIRA[];
8798 static const char FFUUID_MURCHANG[];
8800 static const char FFUUID_RANATEKLEK[];
8802 static const char FFUUID_RANATTHUMLEK[];
8804 static const char FFUUID_SANZA[];
8806 static const char