Finale PDK Framework 0.77
Power Up Your Finale Music Software
Loading...
Searching...
No Matches
ff_detailscollection.h
1/*
2 * File: ff_detailscollection.h
3 * Author: Jari Williamsson
4 *
5 * Created on den 7 december 2011, 12:42
6 */
7
8#ifndef FF_DETAILSCOLLECTION_H
9#define FF_DETAILSCOLLECTION_H
10
11#include "ff_details.h"
12#include "ff_basecollection.h"
13
14
25{
26protected:
27#ifndef DOXYGEN_SHOULD_IGNORE_THIS
28 __FCBaseData* CreateElement() override { return new FCGroup(); }
29#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
30public:
31 const char* ClassName() const override { return "FCGroups"; }
32
40
46 FCGroup* Find(CMPER startstaff,
47 CMPER endstaff,
48 twobyte startmeasure = 1)
49 {
50 for (int i = 0; i < GetCount(); i++)
51 {
52 FCGroup* pGroup = (FCGroup*) GetItemAt(i);
53 if (pGroup->GetStartStaff() != startstaff) continue;
54 if (pGroup->GetEndStaff() != endstaff) continue;
55#if FXT_VERSION >= FINALEVERSION_2011
56 if (pGroup->GetStartMeasure() != startmeasure) continue;
57#endif
58 return pGroup;
59 }
60 return NULL;
61 }
62
68 FCGroup* GetItemAt(int index) const { return (FCGroup*)__FCCollectionNoInciDetail::GetItemAt(index); }
69};
70
93{
94#ifndef DOXYGEN_SHOULD_IGNORE_THIS
95 bool _loadglobal; /* Internal flag. Defines how #LoadAllForSystem will behave. */
96
97 void _LoadAllForSystemStaffRaw(FCBaseline::BASELINEMODES mode, eSsys systemnumber, eStaff staffno);
98protected:
99 __FCBaseData* CreateElement() override { return new FCBaseline(); }
100
102 void _SetGlobal(bool state) { _loadglobal = state; }
103#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
104public:
105 const char* ClassName() const override { return "FCBaselines"; }
106
112 {
113 _loadglobal = false;
114 }
115
131#ifndef PDK_FRAMEWORK_LUAFRIENDLY
133#else
134 int
135#endif
136 mode,
137 eSsys systemno,
138 eStaff staffno
139 );
140
153#ifndef PDK_FRAMEWORK_LUAFRIENDLY
155#else
156 int
157#endif
158 mode,
159 eSsys systemno
160 )
161 {
162 return LoadAllForSystemStaff(mode, systemno, 0);
163 }
164
174 int LoadAllForPiece(
175#ifndef PDK_FRAMEWORK_LUAFRIENDLY
177#else
178 int
179#endif
180 mode
181 );
182
193#ifndef PDK_FRAMEWORK_LUAFRIENDLY
195#else
196 int
197#endif
198 mode
199 );
200
206 FCBaseline* GetItemAt(int index) const { return (FCBaseline*)__FCCollectionDetail::GetItemAt(index); }
207
216 FCBaseline* FindStaff(eStaff staffno)
217 {
218 for (int i = 0; i < GetCount(); i++)
219 {
220 FCBaseline* pBaseline = GetItemAt(i);
221 if (pBaseline->GetStaff() == staffno) return pBaseline;
222 }
223 return NULL;
224 }
225
236 FCBaseline* FindLyricNumber(eStaff staffnumber, eLyric lyricnumber)
237 {
238 for (int i = 0; i < GetCount(); i++)
239 {
240 FCBaseline* pBaseline = GetItemAt(i);
241 if (pBaseline->GetStaff() != staffnumber) continue;
242 if (pBaseline->GetLyricNumber() != lyricnumber) continue;
243 return pBaseline;
244 }
245 return NULL;
246 }
247
271#ifndef PDK_FRAMEWORK_LUAFRIENDLY
273#else
274 int
275#endif
276 mode,
277 eStaff staffnumber,
278 eLyric lyricnumber
279 );
280
301#ifndef PDK_FRAMEWORK_LUAFRIENDLY
303#else
304 int
305#endif
306 mode,
307 eStaff staffnumber
308 );
309
333#ifndef PDK_FRAMEWORK_LUAFRIENDLY
335#else
336 int
337#endif
338 mode,
339 eSsys systemnumber,
340 eStaff staffnumber,
341 eLyric lyricnumber
342 );
343
366#ifndef PDK_FRAMEWORK_LUAFRIENDLY
368#else
369 int
370#endif
371 mode,
372 eSsys systemnumber,
373 eStaff staffnumber
374 );
375
376
377
378};
379
380
381#if FXT_VERSION >= FINALEVERSION_2012
382
389{
390public:
391 const char* ClassName() const override { return "__FCFretItemsBase"; }
392
396};
397
403{
404public:
405 const char* ClassName() const override { return "FCFretItems"; }
406
410
417 bool AddFretItem(const FCFretItem& item)
418 {
419 if (item.IsBarre()) return false;
420 Add(new FCFretItem(item));
421 return true;
422 }
423
428 FCFretItem* GetItemAt(int index) const { return (FCFretItem*)__FCCollection::GetItemAt(index); }
429};
430
436{
437public:
438 const char* ClassName() const override { return "FCFretBarreItems"; }
439
443
450 bool AddFretItem(const FCFretBarreItem& item)
451 {
452 if (!item.IsBarre()) return false;
453 Add(new FCFretBarreItem(item));
454 return true;
455 }
456
462};
463
464
465#endif // FXT_VERSION >= FINALEVERSION_2012
466
467#if FXT_VERSION >= FINALEVERSION_2012
468
476{
477 CMPER _fretboardGroupID;
478 twobyte _fretboardGroupInci;
479
480public:
481 const char* ClassName() const override { return "FCFretboardGroup"; }
482
487 FCFretboardGroup() : __FCCollection(), _fretboardGroupID(0), _fretboardGroupInci(0)
488 {}
489
495
496
505 bool LoadAllForItem(CMPER fretboardGroupID, twobyte fretboardGroupInci);
506
513 bool SaveAll();
514
523 bool SaveAllForItem(CMPER fretboardGroupID, twobyte fretboardGroupInci);
524
530 bool DeleteDataForItem(CMPER fretboardGroupID, twobyte fretboardGroupInci);
531};
532
533#endif // FXT_VERSION >= FINALEVERSION_2012
534
535#endif /* FF_DETAILSCOLLECTION_H */
Base class for all data-related classes (that handles Finale data).
Definition ff_base.h:676
Base class specially designed for collections of detail classes.
Definition ff_basecollection.h:880
Base class for all collection classes. A collection is a storage that can store multiple objects of s...
Definition ff_basecollection.h:26
void Add(__FCBase *pNewItem)
Adds an element to the end of the collection.
Definition finaleframework.cpp:13726
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 specially designed for collections of detail classes that doesn't use the inci.
Definition ff_basecollection.h:919
bool IsBarre() const
returns true if this item is a barre rather than a fret symbol.
Definition ff_details.h:1794
Base collection class of FCFretItem class objects. Inherit from this to get get FCFretItems or FCFret...
Definition ff_detailscollection.h:389
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_detailscollection.h:391
__FCFretItemsBase()
Definition ff_detailscollection.h:394
Encapsulates baselines offset values for lyrics, expressions, fretboards and chords.
Definition ff_details.h:1096
eStaff GetStaff() const
Returns the staff number ID for the baseline.
Definition ff_details.h:1255
BASELINEMODES
The mode constants of the object, used for both loading and saving objects.
Definition ff_details.h:1105
twobyte GetLyricNumber() const
Returns the connected lyric number for the baseline.
Definition ff_details.h:1210
Collection class for FCBaseline class objects.
Definition ff_detailscollection.h:93
int LoadAllForSystemStaff(FCBaseline::BASELINEMODES mode, eSsys systemno, eStaff staffno)
Loads all baseline objects for the staff system in a single staff. These objects are part-specific....
Definition finaleframework.cpp:35586
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_detailscollection.h:105
int LoadAllDefaultsForLyrics(FCBaseline::BASELINEMODES mode)
Loads default baseline values for all lyric numbers that have them. You can also call this for non-ly...
Definition finaleframework.cpp:35625
FCBaseline * AssureSavedLyricNumberForPiece(FCBaseline::BASELINEMODES mode, eStaff staffnumber, eLyric lyricnumber)
Makes sure that there is a global lyric number base line (for a specific staff and lyric number) in t...
Definition finaleframework.cpp:35640
FCBaseline * FindStaff(eStaff staffno)
Finds an object with a specific staff number in the collection.
Definition ff_detailscollection.h:216
FCBaseline * FindLyricNumber(eStaff staffnumber, eLyric lyricnumber)
Finds an object with a specific lyric númber and staff number in the collection.
Definition ff_detailscollection.h:236
FCBaseline * AssureSavedStaffForPiece(FCBaseline::BASELINEMODES mode, eStaff staffnumber)
Makes sure that there is a non-lyric global baseline (for a specific staff) in the collection....
Definition finaleframework.cpp:35676
int LoadAllForSystem(FCBaseline::BASELINEMODES mode, eSsys systemno)
Loads all baseline objects for the staff system. These objects are part-specific.
Definition ff_detailscollection.h:152
FCBaseline * AssureSavedLyricNumber(FCBaseline::BASELINEMODES mode, eSsys systemnumber, eStaff staffnumber, eLyric lyricnumber)
Makes sure that there is a lyric number baseline (for a specific staff/system) in the collection....
Definition finaleframework.cpp:35718
int LoadAllForPiece(FCBaseline::BASELINEMODES mode)
Loads all baseline objects that controls independent staves throughout the entire piece.
Definition finaleframework.cpp:35610
FCBaseline * GetItemAt(int index) const
Overridden GetItemAt() method.
Definition ff_detailscollection.h:206
FCBaseline * AssureSavedStaff(FCBaseline::BASELINEMODES mode, eSsys systemnumber, eStaff staffnumber)
Makes sure that there is a non-lyric baseline (for a specific staff/system) in the collection....
Definition finaleframework.cpp:35756
FCBaselines()
The constructor.
Definition ff_detailscollection.h:111
Class that describes a single fret item on a fret and string.
Definition ff_details.h:1948
Collection class of FCFretItem class objects that are barres.
Definition ff_detailscollection.h:436
bool AddFretItem(const FCFretBarreItem &item)
Adds a FCFretItem to the collection if it is the correct type for the collection (barre or non-barre)...
Definition ff_detailscollection.h:450
FCFretBarreItem * GetItemAt(int index) const
Overridden version of GetItemAt()
Definition ff_detailscollection.h:461
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_detailscollection.h:438
FCFretBarreItems()
internal constructor
Definition ff_detailscollection.h:441
Class that describes a single fret item on a fret and string.
Definition ff_details.h:1809
Collection class of FCFretItem class objects that are not barres.
Definition ff_detailscollection.h:403
FCFretItem * GetItemAt(int index) const
Overridden version of GetItemAt()
Definition ff_detailscollection.h:428
FCFretItems()
internal constructor
Definition ff_detailscollection.h:408
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_detailscollection.h:405
bool AddFretItem(const FCFretItem &item)
Adds a FCFretItem to the collection if it is the correct type for the collection (barre or non-barre)...
Definition ff_detailscollection.h:417
Class that represents a fretboard group. A correctly constructed fretboard group has exactly 12 FCFre...
Definition ff_detailscollection.h:476
bool LoadAllForItem(CMPER fretboardGroupID, twobyte fretboardGroupInci)
Loads the fretboard group for the given key pair.
Definition finaleframework.cpp:35807
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_detailscollection.h:481
bool DeleteDataForItem(CMPER fretboardGroupID, twobyte fretboardGroupInci)
Deletes all items for the given FCFretboardGroupDef key pair. (Does not affect the data in the collec...
Definition finaleframework.cpp:35825
FCFretboardGroup()
Constructor.
Definition ff_detailscollection.h:487
bool SaveAllForItem(CMPER fretboardGroupID, twobyte fretboardGroupInci)
Saves a loaded or newly constructed fretboard group to a new FCFretboardGroupDef.
Definition finaleframework.cpp:35851
FCFretboardGroupItem * GetItemAt(int index) const
Overridden version of GetItemAt()
Definition ff_detailscollection.h:494
bool SaveAll()
Saves a loaded fretboard group.
Definition finaleframework.cpp:35838
Class that represents a single fretboard group item. The fretboard group item has a header and a list...
Definition ff_details.h:2023
Encapsulates a staff group.
Definition ff_details.h:79
twobyte GetStartStaff() const
Returns the start staff number for the group.
Definition ff_details.h:499
twobyte GetEndStaff() const
Returns the end staff number for the group.
Definition ff_details.h:437
twobyte GetStartMeasure() const
Returns the start measure for the group (for Finale 2011 and later)
Definition ff_details.h:661
Collection class for FCGroup class objects.
Definition ff_detailscollection.h:25
const char * ClassName() const override
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition ff_detailscollection.h:31
FCGroup * GetItemAt(int index) const
Overridden GetItemAt() method.
Definition ff_detailscollection.h:68
FCGroups()
The constructor.
Definition ff_detailscollection.h:37
FCGroup * Find(CMPER startstaff, CMPER endstaff, twobyte startmeasure=1)
Tries to find a matching group in the collection.
Definition ff_detailscollection.h:46