Finale PDK Framework 0.77
Power Up Your Finale Music Software
Loading...
Searching...
No Matches
ff_globals.h
1/*
2 * File: ff_globals.h
3 * Author: Jari Williamsson
4 *
5 * Created on den 28 november 2010, 16:47
6 */
7
8#ifndef FF_GLOBALS_H
9#define FF_GLOBALS_H
10
11#include "ff_basecollection.h"
12
13
20{
21public:
22 const char* ClassName() const override { return "__FCGlobals"; }
23
27
32 bool Load(twobyte globalnumber);
33
38 bool LoadFirst() override { return Load(0); }
39
40 bool LoadNext() override { return Load(_dataid.global.globalsNumber + 1); }
41};
42
50class FCClefDef : public __FCGlobals
51{
52 EDTClefDef _clefdefold;
53#if FXT_VERSION >= FINALEVERSION_2012
54 EDTClefDef2012 _clefdef2012;
55#endif
56protected:
57#ifndef DOXYGEN_SHOULD_IGNORE_THIS
58 bool _Use2012Version() const;
59
60 EXTAG Tag() const override { return gb_ClefDef; }
61 int DataSizeLoad() const override;
62 void* Allocate() override;
63 EVERSION EnigmaVersion() const override { return _Use2012Version() ? FINALEVERSION_2012 : FINALEVERSION_2010; }
64
69 void CloneMemoryFrom(__FCBaseData* pSource) override
70 {
71 memcpy(Allocate(), ((FCClefDef*)pSource)->_GetClefDef(), DataSizeLoad());
74 }
75
76 __FCBaseData* CreateObject() override { return new FCClefDef(); }
77#endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
78public:
79#ifndef DOXYGEN_SHOULD_IGNORE_THIS
80 const char* ClassName() const override { return "FCClefDef"; }
81 const PDKFRAMEWORK_CLASSID GetClassID() const override { return FCID_CLEFDEF; }
82
89 void* _GetClefDef() { return Allocate(); }
90#endif
91
97 {
99 DEFAULTCLEFID_TREBLE = CLEF_TREBLE,
100
103
106
109
111 DEFAULTCLEFID_PERCUSSION = CLEF_PERCUSSION,
112
114 DEFAULTCLEFID_TREBLE8VB = CLEF_TREBLE8VB,
115
117 DEFAULTCLEFID_BASS8VB = CLEF_BASS8VB,
118
120 DEFAULTCLEFID_BARITONE = CLEF_BARITONE,
121
123 DEFAULTCLEFID_FRENCHVIOLIN = CLEF_FRENCHVIOLIN,
124
126 DEFAULTCLEFID_BARITONEC = CLEF_BARITONEC,
127
129 DEFAULTCLEFID_MEZZOSOPRANO = CLEF_MEZZOSOPRANO,
130
132 DEFAULTCLEFID_SOPRANO = CLEF_SOPRANO,
133
135 DEFAULTCLEFID_ALTPERCUSSION = CLEF_ALTPERCUSSION,
136
138 DEFAULTCLEFID_TREBLE8VA = CLEF_TREBLE8VA,
139
141 DEFAULTCLEFID_BASS8VA = CLEF_BASS8VA,
142
145
148
150 DEFAULTCLEFID_TAB2 = CLEF_TAB2
151 };
152
158 {
159 memset(&_clefdefold, 0, sizeof(_clefdefold));
160#if FXT_VERSION >= FINALEVERSION_2012
161 memset(&_clefdef2012, 0, sizeof(_clefdef2012));
162#endif
163 }
164
172 twobyte GetVerticalAdjust() const;
173
179 Efix16 GetBaselineOffset() const;
180
185 eUniChar32 GetSymbol() const;
186
194 twobyte GetClefPosition() const;
195
200 bool GetUseCustomFont() const;
201
210 bool GetFontInfo(FCFontInfo* pFontInfo) const;
211
223
224#ifdef PDK_FRAMEWORK_LUAFRIENDLY_CPP
226 luabridge::RefCountedPtr<FCFontInfo> CreateEffectiveFontInfo_GC() const
227 { return makeLuaSharedPtr(CreateEffectiveFontInfo()); }
228#endif
229
234 CMPER GetClefIndex() const { return _dataid.global.globalsNumber; }
235
243 void SetFontInfo(FCFontInfo* pFontInfo);
244
249 void SetShapeID(twobyte shapeID);
250
255 void SetUseCustomFont(bool state);
256
264 void SetVerticalAdjust(twobyte value);
265
270 void SetBaselineOffset(Efix16 value);
271
276 void SetSymbol(eUniChar32 symbolchar);
277
285 void SetClefPosition(twobyte clefpos);
286
291 void SetIsShape(bool state);
292
297 bool GetIsShape() const;
298
303 twobyte GetShapeID() const;
304};
305
306
315{
316protected:
317#ifndef DOXYGEN_SHOULD_IGNORE_THIS
318 __FCBaseData* CreateElement() override { return new FCClefDef(); }
319#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
320public:
326
327 const char* ClassName() const override { return "FCClefDefs"; }
328
333 FCClefDef* GetItemAt(int index) const { return (FCClefDef*) __FCCollectionGlobal::GetItemAt(index); }
334};
335
336
337
338#endif /* FF_GLOBALS_H */
339
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.
const PDKFRAMEWORK_CLASSID GetClassID() const override=0
Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has...
EDataID _dataid
The EdataID for the last loaded/saved object.
Definition ff_base.h:712
void * _datablock
Pointer to the object's data block, the meaning is implementation-specific for each derived subclass.
Definition ff_base.h:695
virtual EVERSION EnigmaVersion() const
The Enigma version for save/load/create/delete operations.
Definition ff_base.h:812
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
PDKFRAMEWORK_CLASSID
Constants for the GetClassID method.
Definition ff_base.h:84
Base class for "Global" data.
Definition ff_basecollection.h:864
__FCBase * GetItemAt(int index) const
Returns the object at the index position. Index is 0-based.
Definition finaleframework.cpp:13767
Base class for all data that use the global part of the EDataID.
Definition ff_globals.h:20
bool LoadNext() override
Loads the next element from the database, if any.
Definition ff_globals.h:40
bool Load(twobyte globalnumber)
Loads a single member from the globals data storage.
Definition finaleframework.cpp:21659
bool LoadFirst() override
Loads first member from the globals data storage.
Definition ff_globals.h:38
__FCGlobals()
The constructor.
Definition ff_globals.h:26
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_globals.h:22
Data class for the global clef definitions.
Definition ff_globals.h:51
void SetFontInfo(FCFontInfo *pFontInfo)
Sets the font for the clef definition.
Definition finaleframework.cpp:21795
CMPER GetClefIndex() const
Returns the 0-based clef index/ID.
Definition ff_globals.h:234
void SetUseCustomFont(bool state)
Sets the custom font state.
Definition finaleframework.cpp:21827
DEFAULTCLEFIDS
Default GetClefIndex values. If the clefs have not been modified in the clef designer,...
Definition ff_globals.h:97
@ DEFAULTCLEFID_PERCUSSION
Definition ff_globals.h:111
@ DEFAULTCLEFID_ALTO
Definition ff_globals.h:102
@ DEFAULTCLEFID_TREBLE8VB
Definition ff_globals.h:114
@ DEFAULTCLEFID_ALTPERCUSSION
Definition ff_globals.h:135
@ DEFAULTCLEFID_BARITONEC
Definition ff_globals.h:126
@ DEFAULTCLEFID_TREBLE
Definition ff_globals.h:99
@ DEFAULTCLEFID_TREBLE8VA
Definition ff_globals.h:138
@ DEFAULTCLEFID_BASS8VB
Definition ff_globals.h:117
@ DEFAULTCLEFID_BASS
Definition ff_globals.h:108
@ DEFAULTCLEFID_FRENCHVIOLIN
Definition ff_globals.h:123
@ DEFAULTCLEFID_BLANK
Definition ff_globals.h:144
@ DEFAULTCLEFID_TAB1
Definition ff_globals.h:147
@ DEFAULTCLEFID_SOPRANO
Definition ff_globals.h:132
@ DEFAULTCLEFID_BARITONE
Definition ff_globals.h:120
@ DEFAULTCLEFID_BASS8VA
Definition ff_globals.h:141
@ DEFAULTCLEFID_MEZZOSOPRANO
Definition ff_globals.h:129
@ DEFAULTCLEFID_TENOR
Definition ff_globals.h:105
@ DEFAULTCLEFID_TAB2
Definition ff_globals.h:150
void SetShapeID(twobyte shapeID)
Sets the shape ID for the clef.
Definition finaleframework.cpp:21813
Efix16 GetBaselineOffset() const
Returns the baseline offset, as an EFIX value.
Definition finaleframework.cpp:21713
bool GetIsShape() const
Returns true if a shape is used as clef.
Definition finaleframework.cpp:21911
FCFontInfo * CreateEffectiveFontInfo() const
Creates the effective font for the clef. If the clef does not use a custom font or if the clef is a s...
Definition finaleframework.cpp:21781
void SetVerticalAdjust(twobyte value)
Sets the vertical adjustment (related to middle C) of the clef.
Definition finaleframework.cpp:21841
twobyte GetShapeID() const
Returns the shape ID (if any) for the clef. 0 if there is no shape clef.
Definition finaleframework.cpp:21922
void SetBaselineOffset(Efix16 value)
Sets the baseline offset, as an EFIX value.
Definition finaleframework.cpp:21855
bool GetUseCustomFont() const
Returns true if a custom font is used.
Definition finaleframework.cpp:21746
twobyte GetVerticalAdjust() const
Returns the vertical adjustment (related to middle C) of the clef.
Definition finaleframework.cpp:21702
FCClefDef()
The constructor.
Definition ff_globals.h:157
void SetClefPosition(twobyte clefpos)
Sets the vertical Clef Position.
Definition finaleframework.cpp:21883
void SetSymbol(eUniChar32 symbolchar)
Sets the symbol character for the clef definition.
Definition finaleframework.cpp:21869
twobyte GetClefPosition() const
Returns the vertical Clef Position.
Definition finaleframework.cpp:21735
bool GetFontInfo(FCFontInfo *pFontInfo) const
Gets the custom font for the clef.
Definition finaleframework.cpp:21757
eUniChar32 GetSymbol() const
Returns the symbol character for the clef definition.
Definition finaleframework.cpp:21724
void SetIsShape(bool state)
Sets if a shape is used as clef or not.
Definition finaleframework.cpp:21897
Collection class for FCClefDef class objects.
Definition ff_globals.h:315
FCClefDef * GetItemAt(int index) const
Overridden GetItemAt() method.
Definition ff_globals.h:333
FCClefDefs()
The constructor.
Definition ff_globals.h:325
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_globals.h:327
Class for document-independent font information.
Definition ff_base.h:1138