11#include "ff_basecollection.h"
12#include "ff_othercollection.h"
14#ifndef DOXYGEN_SHOULD_IGNORE_THIS
16#include "pragma_align_begin.h"
24 twobyte m_nSmartMusicInst;
26 twobyte m_DefaultNameStaffOrGroup;
29#include "pragma_align_end.h"
32const EXTAG xot_PartDef = MAKEEXTAG(edOther,
'p',
'D');
35const FLAG_16 __PARTDEF_PRINTPART = 0x0001;
36const FLAG_16 __PARTDEF_EXTRACTPART = 0x0002;
37const FLAG_16 __PARTDEF_APPLYFORMAT = 0x0004;
38const FLAG_16 __PARTDEF_NEEDS_RECALC = 0x0008;
40const FLAG_16 __PARTDEF_NEEDS_SPACING = 0x0010;
42const FLAG_16 __PARTDEF_IS_NEW = 0x0020;
43const FLAG_16 __PARTDEF_IS_MODIFIED = 0x0040;
46const FLAG_16 __PARTDEF_NAMEISDEFAULT = 0x0080;
49const FLAG_16 __PARTDEF_USE_AS_SMP_INST = 0x0100;
52const FLAG_16 __PARTDEF_UNLINK_INSTS = 0x0200;
62const FLAG_16 __VOICING_ENABLED = 0x0004;
66const FLAG_16 __VOICING_USE_SINGLELAYER = 0x0000;
67const FLAG_16 __VOICING_USE_MULTILAYER = 0x0001;
69const FLAG_16 __VOICING_USEMASK = 0x0003;
72const FLAG_16 __VOICING_SINGLELAYER_ALL = 0x0000;
73const FLAG_16 __VOICING_SINGLELAYER_TOP = 0x0008;
74const FLAG_16 __VOICING_SINGLELAYER_BOT = 0x0010;
75const FLAG_16 __VOICING_SINGLELAYER_SELECT = 0x0018;
77const FLAG_16 __VOICING_SINGLELAYER_MASK = 0x0038;
79const FLAG_16 __VOICING_SINGLELAYER_SELECT_1ST = 0x0040;
80const FLAG_16 __VOICING_SINGLELAYER_SELECT_2ND = 0x0080;
81const FLAG_16 __VOICING_SINGLELAYER_SELECT_3RD = 0x0100;
82const FLAG_16 __VOICING_SINGLELAYER_SELECT_4TH = 0x0200;
83const FLAG_16 __VOICING_SINGLELAYER_SELECT_5TH = 0x0400;
84const FLAG_16 __VOICING_SINGLELAYER_SELECT_FROMBOTTOM = 0x2000;
85const FLAG_16 __VOICING_SINGLELAYER_SELECT_SINGLENOTE = 0x1000;
87#include "pragma_align_begin.h"
88struct __XEDTVoicingDef
99 __XEDTVoicingDef() : voicingFlags(0), singleLayer(0), multiLayer(0), AAAA(0), BBBB(0), CCCC(0) {}
101#include "pragma_align_end.h"
103const EXTAG xot_VoicingDef = MAKEEXTAG(edOther,
'V',
'D');
120#ifndef DOXYGEN_SHOULD_IGNORE_THIS
122 __XEDTPartDef _partdata;
126 EPARTID _previouspart;
128 EXTAG
Tag()
const override {
return xot_PartDef; }
130 int DataSizeLoad()
const override {
return sizeof(_partdata); }
131 void*
Allocate()
override {
return (
void*) &_partdata; }
139 memcpy(&_partdata, ((
FCPart*)pSource)->_GetDataPtr(),
sizeof(_partdata));
171 const char*
ClassName()
const override {
return "FCPart"; }
174#ifndef DOXYGEN_SHOULD_IGNORE_THIS
178 void* _GetDataPtr() {
return &_partdata; }
191 partid = FX_GetCurrentPartID();
194 _documentid = FX_GetCurrentEnigmaDocument();
196 memset(&_partdata, 0,
sizeof(_partdata));
202#ifdef PDK_FRAMEWORK_DIAGNOSE
204 DebugOut(
"FCPart::SwitchTo() has been called without a FCPart::SwitchBack()!!!");
232#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
234 luabridge::RefCountedPtr<FCString> CreateCustomTextString_GC()
278 _partid = pPart->
GetID();
279 _documentid = FX_GetCurrentEnigmaDocument();
295 _previouspart = FX_GetCurrentPartID();
296 FX_SetCurrentPartID(_partid);
312 FX_SetCurrentPartID(_previouspart);
325 FX_SetCurrentPartInView(_partid);
361 if (_partid != FX_GetCurrentPartID())
return false;
373 return (_documentid == FX_GetCurrentEnigmaDocument());
388 const FCPart* pComparePart =
dynamic_cast<const FCPart*
>(pCompareObject);
389 if (!pComparePart)
return false;
390 if (
GetID() != pComparePart->
GetID())
return false;
406 _documentid = FX_GetCurrentEnigmaDocument();
407 _partid = FX_GetCurrentPartID();
526 if (idvalue < 1)
return;
528 _partdata.partOrder = idvalue;
550#ifdef PDK_FRAMEWORK_DEBUG
616 if (!pPart)
return -1;
639 return FX_CountParts();
667 if (!pPartFind)
return NULL;
668 for (
int i = 0; i <
GetCount(); i++)
672 if (pPart->
GetID() != pPartFind->
GetID())
continue;
684 for (
int i = 0; i <
GetCount(); i++)
687 if (pPart->
GetID() != partid)
continue;
703#if FXT_VERSION >= FINALEVERSION_26_1
704 return FX_GenerateParts();
725#ifndef DOXYGEN_SHOULD_IGNORE_THIS
727 __XEDTVoicingDef _voicingdata;
729 EXTAG
Tag()
const override {
return xot_VoicingDef; }
731 int DataSizeLoad()
const override {
return sizeof(_voicingdata); }
732 void*
Allocate()
override {
return _GetDataPtr(); }
741 if (! pSourceTyped)
return;
742 memcpy(_GetDataPtr(), pSourceTyped->_GetDataPtr(),
DataSizeLoad());
799 const char*
ClassName()
const override {
return "FCPartStaffVoicing"; }
802#ifndef DOXYGEN_SHOULD_IGNORE_THIS
806 void* _GetDataPtr() {
return &_voicingdata; }
816 memset(&_voicingdata, 0,
sizeof(_voicingdata));
824 return GetBitFlag(_voicingdata.voicingFlags, __VOICING_ENABLED);
832 Set16BitFlag(&_voicingdata.voicingFlags, __VOICING_ENABLED, value);
841#ifndef PDK_FRAMEWORK_LUAFRIENDLY
847 return static_cast<PARTWILLDISPLAY>(_voicingdata.voicingFlags & __VOICING_USEMASK);
857#ifndef PDK_FRAMEWORK_LUAFRIENDLY
865 _voicingdata.voicingFlags &= ~__VOICING_USEMASK;
866 _voicingdata.voicingFlags |= value;
876 return _voicingdata.singleLayer + 1;
886 _voicingdata.singleLayer = value - 1;
897#ifndef PDK_FRAMEWORK_LUAFRIENDLY
903 return static_cast<VOICINGLAYERRULES>((_voicingdata.voicingFlags & __VOICING_SINGLELAYER_MASK) >> 3);
915#ifndef PDK_FRAMEWORK_LUAFRIENDLY
923 _voicingdata.voicingFlags &= ~__VOICING_SINGLELAYER_MASK;
924 _voicingdata.voicingFlags |= value << 3;
934 return _voicingdata.multiLayer + 1;
944 _voicingdata.multiLayer = value - 1;
955 return GetBitFlag(_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_1ST);
966 Set16BitFlag(&_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_1ST, value);
977 return GetBitFlag(_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_2ND);
988 Set16BitFlag(&_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_2ND, value);
999 return GetBitFlag(_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_3RD);
1010 Set16BitFlag(&_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_3RD, value);
1021 return GetBitFlag(_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_4TH);
1032 Set16BitFlag(&_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_4TH, value);
1043 return GetBitFlag(_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_5TH);
1054 Set16BitFlag(&_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_5TH, value);
1066#ifndef PDK_FRAMEWORK_LUAFRIENDLY
1072 if (
GetBitFlag(_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_FROMBOTTOM))
1087#ifndef PDK_FRAMEWORK_LUAFRIENDLY
1106 return GetBitFlag(_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_SINGLENOTE);
1117 Set16BitFlag(&_voicingdata.voicingFlags, __VOICING_SINGLELAYER_SELECT_SINGLENOTE, value);
1120#ifdef PDK_FRAMEWORK_DEBUG
Base class for all data-related classes (that handles Finale data).
Definition ff_base.h:676
virtual __FCBaseData * CreateObject()=0
Creates a new instance of the object.
void * _datablock
Pointer to the object's data block, the meaning is implementation-specific for each derived subclass.
Definition ff_base.h:695
virtual int DataSizeLoad() const =0
Returns the data size for the data structure that should be loaded.
virtual EXTAG Tag() const =0
The Enigma tag for the derived class.
virtual void CloneMemoryFrom(__FCBaseData *pSource)
Definition finaleframework.cpp:838
virtual void * Allocate()=0
int _loadedsize
Loaded size of the data block for a loaded object, in bytes. Since the datablock is implementation-sp...
Definition ff_base.h:708
Base class for the Finale Framework classes.
Definition ff_base.h:71
static void DebugOutString(const char *pszPrefixText, const char *thestring)
Static method that outputs a line for debugging purposes (C string version). The text appears with th...
Definition finaleframework.cpp:436
void Set16BitFlag(FLAG_16 *flag, FLAG_16 flagbits, bool state)
Sets a 16 bit flag.
Definition finaleframework.cpp:635
PDKFRAMEWORK_CLASSID
Constants for the GetClassID method.
Definition ff_base.h:84
virtual bool IsIdentical(const __FCBase *pCompareObject) const
Returns true if the data in the passed object is considered to be identical to the current object,...
Definition ff_base.h:539
static void DebugOutInt(const char *pszPrefixText, int i)
Static method that outputs a line for debugging purposes. The text appears with the extra digit (in d...
Definition finaleframework.cpp:335
static void DebugOut(const char *pszLine)
Static method to output a line of text for debugging purposes.
Definition finaleframework.cpp:526
bool GetBitFlag(FLAG_32 flag, FLAG_32 flagbits) const
Gets a state from flag bits. Returns true if any bit in the mask is set.
Definition ff_base.h:485
virtual void DebugDump()
Outputs the class data/information for debugging purposes.
Definition finaleframework.cpp:609
Base class for all collection classes. A collection is a storage that can store multiple objects of s...
Definition ff_basecollection.h:26
int GetIndexOf(__FCBase *pObject) const
Returns the 0-based order index for the object within the collection.
Definition finaleframework.cpp:13775
int GetCount() const
Returns the number of elements of the collection.
Definition ff_basecollection.h:102
__FCBase * GetItemAt(int index) const
Returns the object at the index position. Index is 0-based.
Definition finaleframework.cpp:13767
Base class for the "Other" (ot_*) Enigma structures that don't use the inci parameter.
Definition ff_other.h:231
void DebugDump() override
Outputs the class data/information for debugging purposes.
Definition ff_other.h:349
Class for iterator handlers.
Definition ff_iterator.h:26
Class that represents one linked part in a document. The class also provides methods to switch betwee...
Definition ff_parts.h:119
bool SetID(FCPart *pPart)
Sets up the object's part ID to be assigned to another part.
Definition ff_parts.h:276
const PDKFRAMEWORK_CLASSID GetClassID() const override
Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has...
Definition ff_parts.h:172
FCPart(EPARTID partid=PARTID_CURRENT)
The constructor. Sets the basic data for the part.
Definition ff_parts.h:189
void SetShouldPrint(bool state)
Sets if the part should print or not.
Definition ff_parts.h:482
bool IsIdentical(const __FCBase *pCompareObject) const override
Overridden method to provide comparison mechanism for parts.
Definition ff_parts.h:386
bool SwitchBack()
Switches back yo the "original" current part, that was in focus at the call to SwitchTo.
Definition ff_parts.h:308
bool GetShouldExtract() const
Returns if the part should be checked for part extraction.
Definition ff_parts.h:436
PREDEFINED_PARTIDS
Predefined constants for part IDs.
Definition ff_parts.h:159
@ PARTID_SCORE
Definition ff_parts.h:161
@ PARTID_CURRENT
Definition ff_parts.h:164
@ PARTID_UNKNOWN
Definition ff_parts.h:167
bool GetShouldPrint() const
Returns if the part should print or not.
Definition ff_parts.h:430
EDOCID GetDocumentID() const
Returns the internal document ID that is connected to the part.
Definition ff_parts.h:266
bool GetShouldUpdateSpacing() const
Returns if the part is marked for a required music spacing update.
Definition ff_parts.h:454
bool DeleteCustomText()
Deletes the custom text, resulting in the part using only default part names.
Definition finaleframework.cpp:32299
bool IsCurrent()
Returns true if the part is the very same as the current part in the editing focus.
Definition ff_parts.h:360
void SetShouldUpdateSpacing(bool state)
Sets if the part is marked for a required music spacing update.
Definition ff_parts.h:506
bool Print(FCPrintSettings *pSettings)
Quick-access method to print only one part in the currently active document.
Definition finaleframework.cpp:32363
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_parts.h:171
bool GetUnlinkedInstrument() const
Returns if the part's instrument info is unlinked for the part.
Definition ff_parts.h:460
bool SetCurrent()
Maps the part to the part/document currently in focus.
Definition ff_parts.h:403
FCString * CreateCustomTextString()
Creates the raw string part name as a FCString object, for the parts that doesn't use the default-gen...
Definition finaleframework.cpp:32291
twobyte GetPrintCopies() const
Returns the number of print copies for the part.
Definition ff_parts.h:476
bool HasCustomText() const
Returns true if part name is a custom text.
Definition ff_parts.h:383
EPARTID GetID() const
Returns the internal part ID.
Definition ff_parts.h:214
bool GetShouldUpdateLayout() const
Returns if the part is marked for a required layout update.
Definition ff_parts.h:445
utwobyte GetOrderID() const
Returns the part's internal (1-based) order ID.
Definition ff_parts.h:470
void SetShouldUpdateLayout(bool state)
Sets if the part is marked for a required layout update.
Definition ff_parts.h:497
void GetName(FCString *pString)
Returns the local string object that stores the part string.
Definition finaleframework.cpp:32329
void SetPrintCopies(twobyte value)
Sets the number of print copies for the part.
Definition ff_parts.h:535
bool ViewInDocument()
Switch the document display to another part.
Definition ff_parts.h:323
bool SwitchTo()
Sets the focus to this part (but does not set it in view).
Definition ff_parts.h:292
bool IsPart()
Returns true if the part is a part (and not the score).
Definition ff_parts.h:350
void SetUnlinkedInstrument(bool state)
Sets if the part's instrument info is unlinked for the part.
Definition ff_parts.h:512
bool IsCurrentDocument()
Returns true if the document connected with the part in the object is the current document.
Definition ff_parts.h:372
bool IsStaffIncluded(int staffno)
Returns true if the staff number is included in the part.
Definition finaleframework.cpp:32351
virtual ~FCPart()
The destructor. Checks if SwitchBack has been called (if PDK_FRAMEWORK_DIAGNOSE has been defined).
Definition ff_parts.h:201
void SetOrderID(utwobyte idvalue)
Sets the part's internal (1-based) order ID. Use with care!!!
Definition ff_parts.h:524
bool IsScore()
Returns true if the part is the score.
Definition ff_parts.h:341
void SetShouldExtract(bool state)
Sets if the part should be checked for part extraction.
Definition ff_parts.h:488
bool SaveCustomTextString(FCString *pString)
Saves the raw Enigma string as a custom text.
Definition finaleframework.cpp:32308
void DebugDump() override
Outputs the class data/information for debugging purposes.
Definition ff_parts.h:552
Class that represents the Voicing information for a single staff in a part.
Definition ff_parts.h:724
bool GetSingleLayerSelect3rd() const
If true, uses the 3rd note in a single layer.
Definition ff_parts.h:998
bool GetSingleLayerSelect2nd() const
If true, uses the 2nd note in a single layer.
Definition ff_parts.h:976
void SetIsVoicingEnabled(bool value)
Sets whether the staff has Voicing enabled.
Definition ff_parts.h:831
VOICINGCOUNTNOTES GetCountNotesRule() const
Returns the rule for "Count Notes".
Definition ff_parts.h:1071
void SetWillDisplay(PARTWILLDISPLAY value)
Sets the value for "This Staff in This Part Will Display".
Definition ff_parts.h:856
bool GetSingleLayerSelect1st() const
If true, uses the 1st note in a single layer.
Definition ff_parts.h:954
void SetIncludeSingleNotePassages(bool value)
Sets whether to include single-note passages.
Definition ff_parts.h:1116
bool GetSingleLayerSelect4th() const
If true, uses the 4th note in a single layer.
Definition ff_parts.h:1020
bool GetSingleLayerSelect5th() const
If true, uses the 5th note in a single layer.
Definition ff_parts.h:1042
PARTWILLDISPLAY
Predefined constants for "will display" rules.
Definition ff_parts.h:760
@ PARTDISP_SELECTED_NOTES_MULTIPLE_LAYERS
Definition ff_parts.h:765
@ PARTDISP_ALLNOTES_IN_SINGLE_LAYER
Definition ff_parts.h:762
void SetSingleLayerSelect3rd(bool value)
Sets whether to use the 3rd note in a single layer.
Definition ff_parts.h:1009
VOICINGCOUNTNOTES
Predefined constants for how to count notes when selecting notes.
Definition ff_parts.h:790
@ VCOUNTNOTES_FROM_THE_BOTTOM
Definition ff_parts.h:795
@ VCOUNTNOTES_FROM_THE_TOP
Definition ff_parts.h:792
void SetSingleLayerSelect1st(bool value)
Sets whether to use the 1st note in a single layer.
Definition ff_parts.h:965
void SetSingleLayerSelect5th(bool value)
Sets whether to use the 5th note in a single layer.
Definition ff_parts.h:1053
void DebugDump() override
Outputs the class data/information for debugging purposes.
Definition ff_parts.h:1121
bool GetIncludeSingleNotePassages() const
If true, include single-note passages.
Definition ff_parts.h:1105
void SetSingleLayerNumber(int value)
Sets the 1-based single layer number from which to display notes.
Definition ff_parts.h:885
void SetSingleLayerSelect4th(bool value)
Sets whether to use the 4th note in a single layer.
Definition ff_parts.h:1031
int GetSingleLayerNumber() const
Returns the 1-based single layer number from which to display notes.
Definition ff_parts.h:875
const PDKFRAMEWORK_CLASSID GetClassID() const override
Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has...
Definition ff_parts.h:800
bool GetIsVoicingEnabled() const
Returns true if the staff has Voicing enabled.
Definition ff_parts.h:823
FCPartStaffVoicing()
The constructor. Sets the basic data for the part.
Definition ff_parts.h:814
void SetCountNotesRule(VOICINGCOUNTNOTES value)
Sets the rule for "Count Notes".
Definition ff_parts.h:1086
void SetSingleLayerSelect2nd(bool value)
Sets whether to use the 2nd note in a single layer.
Definition ff_parts.h:987
VOICINGLAYERRULES GetSingleLayerDisplayRule() const
Returns the value for "In Measures Containing a Single Layer, Display".
Definition ff_parts.h:902
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_parts.h:799
void SetSingleLayerDisplayRule(VOICINGLAYERRULES value)
Sets the value for "In Measures Containing a Single Layer, Display".
Definition ff_parts.h:914
void SetMultipleLayerNumber(int value)
Sets the 1-based layer number from which to display notes when there are multiple layers.
Definition ff_parts.h:943
PARTWILLDISPLAY GetWillDisplay() const
Returns the value for "This Staff in This Part Will Display".
Definition ff_parts.h:846
VOICINGLAYERRULES
Predefined constants for "In Measures Containing a Single Layer, Display* rules.
Definition ff_parts.h:772
@ VOICINGLAYERRULE_TOP_NOTE
Definition ff_parts.h:777
@ VOICINGLAYERRULE_SELECTED_NOTES
Definition ff_parts.h:783
@ VOICINGLAYERRULE_ALL_NOTES
Definition ff_parts.h:774
@ VOICINGLAYERRULE_BOTTOM_NOTE
Definition ff_parts.h:780
int GetMultipleLayerNumber() const
Returns the 1-based layer number from which to display notes when there are multiple layers.
Definition ff_parts.h:933
Collection class for FCPart objects.
Definition ff_parts.h:572
FCPart * GetScore()
Returns the score object from the collection.
Definition finaleframework.cpp:32448
int ForEachWithScope(FCIteratorHandler *pIterator)
Works like ForEach, but sets each part into scope before calling the Iterate handler method.
Definition finaleframework.cpp:32414
static bool GenerateParts()
Static function that generates linked parts in the current document. It deletes any linked parts that...
Definition ff_parts.h:701
int LoadAll()
Loads all parts (including the "score part") for the document.
Definition finaleframework.cpp:32395
FCPart * GetItemAt(int index) const
Definition ff_parts.h:646
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_parts.h:583
static int CountPartsOnly()
Returns the number of available parts in the active document, without loading any parts....
Definition ff_parts.h:637
FCParts()
The construtor.
Definition ff_parts.h:579
FCPart * FindID(EPARTID partid)
Finds a part by matching against a part ID.
Definition ff_parts.h:682
void SortByOrderID()
Sorts the loaded collection by order ID, which will result in the same order as in the parts definiti...
Definition finaleframework.cpp:32476
FCPart * FindPart(FCPart *pPartFind)
Finds a part by matching against a FCPart object.
Definition ff_parts.h:665
FCPart * GetCurrent()
Returns a pointer to the element in the parts collection that is the "current" part (that has the dat...
Definition finaleframework.cpp:32438
int GetCurrentIndex()
Returns the 0-based index to the element in the parts collection that is the "current" part (that has...
Definition ff_parts.h:613
Class containing printing settings (and the ability to print documents).
Definition ff_base.h:4969
Class that provides storage for text. This is to achieve platform-transparent text handling,...
Definition ff_base.h:1877
const char * GetCString() const
Returns a C-string version of the string.
Definition finaleframework.cpp:1338