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"
32 const EXTAG xot_PartDef = MAKEEXTAG(edOther,
'p',
'D');
35 const FLAG_16 __PARTDEF_PRINTPART = 0x0001;
36 const FLAG_16 __PARTDEF_EXTRACTPART = 0x0002;
37 const FLAG_16 __PARTDEF_APPLYFORMAT = 0x0004;
38 const FLAG_16 __PARTDEF_NEEDS_RECALC = 0x0008;
40 const FLAG_16 __PARTDEF_NEEDS_SPACING = 0x0010;
42 const FLAG_16 __PARTDEF_IS_NEW = 0x0020;
43 const FLAG_16 __PARTDEF_IS_MODIFIED = 0x0040;
46 const FLAG_16 __PARTDEF_NAMEISDEFAULT = 0x0080;
49 const FLAG_16 __PARTDEF_USE_AS_SMP_INST = 0x0100;
52 const FLAG_16 __PARTDEF_UNLINK_INSTS = 0x0200;
69 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
71 __XEDTPartDef _partdata;
75 EPARTID _previouspart;
77 virtual EXTAG
Tag() {
return MAKEEXTAG(edOther,
'p',
'D'); }
80 virtual void*
Allocate() {
return (
void*) &_partdata; }
88 memcpy(&_partdata, ((
FCPart*)pSource)->_GetDataPtr(),
sizeof(_partdata));
123 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
127 void* _GetDataPtr() {
return &_partdata; }
140 partid = FX_GetCurrentPartID();
143 _documentid = FX_GetCurrentEnigmaDocument();
145 memset(&_partdata, 0,
sizeof(_partdata));
151 #ifdef PDK_FRAMEWORK_DIAGNOSE
153 DebugOut(
"FCPart::SwitchTo() has been called without a FCPart::SwitchBack()!!!");
181 #ifdef PDK_FRAMEWORK_LUAFRIENDLY
183 FCString* CreateCustomTextString_GC();
226 _partid = pPart->
GetID();
227 _documentid = FX_GetCurrentEnigmaDocument();
243 _previouspart = FX_GetCurrentPartID();
244 FX_SetCurrentPartID(_partid);
260 FX_SetCurrentPartID(_previouspart);
273 FX_SetCurrentPartInView(_partid);
309 if (_partid != FX_GetCurrentPartID())
return false;
321 return (_documentid == FX_GetCurrentEnigmaDocument());
337 if (
GetID() != pComparePart->
GetID())
return false;
353 _documentid = FX_GetCurrentEnigmaDocument();
354 _partid = FX_GetCurrentPartID();
473 if (idvalue < 1)
return;
475 _partdata.partOrder = idvalue;
497 #ifdef PDK_FRAMEWORK_DEBUG
561 if (!pPart)
return -1;
584 return FX_CountParts();
612 if (!pPartFind)
return NULL;
613 for (
int i = 0; i <
GetCount(); i++)
617 if (pPart->
GetID() != pPartFind->
GetID())
continue;
__FCBase * GetItemAt(int index)
Returns the object at the index position. Index is 0-based.
Definition: finaleframework.cpp:12797
const char * GetCString() const
Returns a C-string version of the string.
Definition: finaleframework.cpp:1159
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:375
void GetName(FCString *pString)
Returns the local string object that stores the part string.
Definition: finaleframework.cpp:26968
virtual ~FCPart()
The destructor. Checks if SwitchBack has been called (if PDK_FRAMEWORK_DIAGNOSE has been defined)...
Definition: ff_parts.h:150
bool GetShouldUpdateLayout() const
Returns if the part is marked for a required layout update.
Definition: ff_parts.h:392
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:26921
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_parts.h:528
int LoadAll()
Loads all parts (including the "score part") for the document.
Definition: finaleframework.cpp:27034
Definition: ff_parts.h:113
twobyte GetPrintCopies() const
Returns the number of print copies for the part.
Definition: ff_parts.h:423
FCPart * GetScore()
Returns the score object from the collection.
Definition: finaleframework.cpp:27087
static void DebugOut(const char *pszLine)
Static method to output a line of text for debugging purposes.
Definition: finaleframework.cpp:465
void * _datablock
Pointer to the object's data block, the meaning is implementation-specific for each derived subclass...
Definition: ff_base.h:640
bool GetUnlinkedInstrument() const
Returns if the part's instrument info is unlinked for the part.
Definition: ff_parts.h:407
int ForEachWithScope(FCIteratorHandler *pIterator)
Works like ForEach, but sets each part into scope before calling the Iterate handler method...
Definition: finaleframework.cpp:27053
void Set16BitFlag(FLAG_16 *flag, FLAG_16 flagbits, bool state)
Sets a 16 bit flag in the data block.
Definition: finaleframework.cpp:573
bool IsScore()
Returns true if the part is the score.
Definition: ff_parts.h:289
PDKFRAMEWORK_CLASSID
Constants for the GetClassID method.
Definition: ff_base.h:60
FCPart(EPARTID partid=PARTID_CURRENT)
The constructor. Sets the basic data for the part.
Definition: ff_parts.h:138
EDOCID GetDocumentID() const
Returns the internal document ID that is connected to the part.
Definition: ff_parts.h:214
virtual void CloneMemoryFrom(__FCBaseData *pSource)
Definition: finaleframework.cpp:753
static void DebugOutDigit(const char *pszPrefixText, int i)
Static method that outputs a line for debugging purposes. The text appears with the extra digit (in d...
Definition: finaleframework.cpp:274
Base class for the "Other" (ot_*) Enigma structures that don't use the inci parameter.
Definition: ff_other.h:212
static int CountPartsOnly()
Returns the number of available parts in the active document, without loading any parts...
Definition: ff_parts.h:582
FCPart * GetCurrent()
Returns a pointer to the element in the parts collection that is the "current" part (that has the dat...
Definition: finaleframework.cpp:27077
Class that represent one part in a document. The class also provides methods to switch between parts...
Definition: ff_parts.h:67
Definition: ff_parts.h:116
virtual bool IsIdentical(__FCBase *pCompareObject)
Returns true if the data in the passed object is considered to be identical to the current object...
Definition: ff_base.h:492
bool SetID(FCPart *pPart)
Sets up the object's part ID to be assigned to another part.
Definition: ff_parts.h:224
int GetCount() const
Returns the number of elements of the collection.
Definition: ff_basecollection.h:86
bool IsPart()
Returns true if the part is a part (and not the score).
Definition: ff_parts.h:298
Collection class for FCPart objects.
Definition: ff_parts.h:517
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:449
void SetUnlinkedInstrument(bool state)
Sets if the part's instrument info is unlinked for the part.
Definition: ff_parts.h:459
virtual const PDKFRAMEWORK_CLASSID GetClassID()
Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has...
Definition: ff_parts.h:121
bool SetCurrent()
Maps the part to the part/document currently in focus.
Definition: ff_parts.h:350
virtual void * Allocate()=0
Definition: ff_parts.h:110
bool IsStaffIncluded(int staffno)
Returns true if the staff number is included in the part.
Definition: finaleframework.cpp:26990
void SetShouldUpdateLayout(bool state)
Sets if the part is marked for a required layout update.
Definition: ff_parts.h:444
int GetIndexOf(__FCBase *pObject)
Returns the 0-based order index for the object within the collection.
Definition: finaleframework.cpp:12805
bool ViewInDocument()
Switch the document display to another part.
Definition: ff_parts.h:271
EPARTID GetID() const
Returns the internal part ID.
Definition: ff_parts.h:163
Base class for the Finale Framework classes.
Definition: ff_base.h:47
void SetShouldUpdateSpacing(bool state)
Sets if the part is marked for a required music spacing update.
Definition: ff_parts.h:453
bool Print(FCPrintSettings *pSettings)
Quick-access method to print only one part in the currently active document.
Definition: finaleframework.cpp:27002
bool GetShouldUpdateSpacing() const
Returns if the part is marked for a required music spacing update.
Definition: ff_parts.h:401
int _loadedsize
Loaded size of the data block for a loaded object, in bytes. Since the datablock is implementation-sp...
Definition: ff_base.h:653
FCParts()
The construtor.
Definition: ff_parts.h:524
void SortByOrderID()
Sorts the loaded collection by order ID, which will result in the same order as in the parts definiti...
Definition: finaleframework.cpp:27113
Base class for all data-related classes (that handles Finale data).
Definition: ff_base.h:628
bool SwitchTo()
Sets the focus to this part (but does not set it in view).
Definition: ff_parts.h:240
bool HasCustomText() const
Returns true if part name is a custom text.
Definition: ff_parts.h:331
bool GetShouldPrint() const
Returns if the part should print or not.
Definition: ff_parts.h:377
virtual __FCBaseData * CreateObject()=0
Creates a new instance of the object.
PREDEFINED_PARTIDS
Predefined constants for part IDs.
Definition: ff_parts.h:108
Class for iterator handlers.
Definition: ff_iterator.h:25
void SetShouldExtract(bool state)
Sets if the part should be checked for part extraction.
Definition: ff_parts.h:435
Class containing printing settings (and the ability to print documents).
Definition: ff_base.h:3969
Class that provides storage for text. This is to achieve platform-transparent text handling...
Definition: ff_base.h:1473
bool IsCurrent()
Returns true if the part is the very same as the current part in the editing focus.
Definition: ff_parts.h:308
bool SaveCustomTextString(FCString *pString)
Saves the raw Enigma string as a custom text.
Definition: finaleframework.cpp:26947
utwobyte GetOrderID() const
Returns the part's internal (1-based) order ID.
Definition: ff_parts.h:417
virtual EXTAG Tag()=0
The Enigma tag for the derived class.
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:558
FCPart * GetItemAt(int index)
Definition: ff_parts.h:591
void SetOrderID(utwobyte idvalue)
Sets the part's internal (1-based) order ID. Use with care!!!
Definition: ff_parts.h:471
bool IsCurrentDocument()
Returns true if the document connected with the part in the object is the current document...
Definition: ff_parts.h:320
bool DeleteCustomText()
Deletes the custom text, resulting in the part using only default part names.
Definition: finaleframework.cpp:26938
virtual int DataSizeLoad()=0
Returns the data size for the data structure that should be loaded.
bool GetShouldExtract() const
Returns if the part should be checked for part extraction.
Definition: ff_parts.h:383
void SetPrintCopies(twobyte value)
Sets the number of print copies for the part.
Definition: ff_parts.h:482
virtual bool IsIdentical(__FCBase *pCompareObject)
Overridden method to provide comparison mechanism for parts.
Definition: ff_parts.h:334
void SetShouldPrint(bool state)
Sets if the part should print or not.
Definition: ff_parts.h:429
FCPart * FindPart(FCPart *pPartFind)
Finds a part by matching against a FCPart object.
Definition: ff_parts.h:610
virtual void DebugDump()
Outputs the class data/information for debugging purposes.
Definition: ff_parts.h:499
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_parts.h:120
Base class for all collection classes. A collection is a storage that can store multiple objects of s...
Definition: ff_basecollection.h:24
virtual void DebugDump()
Outputs the class data/information for debugging purposes.
Definition: finaleframework.cpp:547
bool SwitchBack()
Switches back yo the "original" current part, that was in focus at the call to SwitchTo.
Definition: ff_parts.h:256