Finale PDK Framework  0.54
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 
23 {
24 protected:
25 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
26  virtual __FCBaseData* CreateElement() { return new FCGroup(); }
27 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
28 public:
29  virtual const char* ClassName() { return "FCGroups"; }
30 
36  {
37  }
38 
44  FCGroup* Find(CMPER startstaff,
45  CMPER endstaff,
46  twobyte startmeasure = 1)
47  {
48  for (int i = 0; i < GetCount(); i++)
49  {
50  FCGroup* pGroup = (FCGroup*) GetItemAt(i);
51  if (pGroup->GetStartStaff() != startstaff) continue;
52  if (pGroup->GetEndStaff() != endstaff) continue;
53 #if FXT_VERSION >= FINALEVERSION_2011
54  if (pGroup->GetStartMeasure() != startmeasure) continue;
55 #endif
56  return pGroup;
57  }
58  return NULL;
59  }
60 
67 };
68 
89 {
90 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
91  bool _loadglobal; /* Internal flag. Defines how #LoadAllForSystem will behave. */
92 protected:
93  virtual __FCBaseData* CreateElement() { return new FCBaseline(); }
94 
96  void _SetGlobal(bool state) { _loadglobal = state; }
97 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
98 public:
99  virtual const char* ClassName() { return "FCBaselines"; }
100 
106  {
107  _loadglobal = false;
108  }
109 
119  int LoadAllForSystem(
120 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
122 #else
123  int
124 #endif
125  mode,
126  eSsys systemno
127  );
128 
136  int LoadAllForPiece(
137 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
139 #else
140  int
141 #endif
142  mode
143  );
144 
151 
158  FCBaseline* FindStaff(eStaff staffno)
159  {
160  for (int i = 0; i < GetCount(); i++)
161  {
162  FCBaseline* pBaseline = GetItemAt(i);
163  if (pBaseline->GetStaff() == staffno) return pBaseline;
164  }
165  return NULL;
166  }
167 
176  FCBaseline* FindLyricNumber(eStaff staffnumber, twobyte lyricnumber)
177  {
178  for (int i = 0; i < GetCount(); i++)
179  {
180  FCBaseline* pBaseline = GetItemAt(i);
181  if (pBaseline->GetStaff() != staffnumber) continue;
182  if (pBaseline->GetLyricNumber() != lyricnumber) continue;
183  return pBaseline;
184  }
185  return NULL;
186  }
187 
211 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
213 #else
214  int
215 #endif
216  mode,
217  eStaff staffnumber,
218  int lyricnumber
219  );
220 
241 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
243 #else
244  int
245 #endif
246  mode,
247  eStaff staffnumber
248  );
249 
273 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
275 #else
276  int
277 #endif
278  mode,
279  eSsys systemnumber,
280  eStaff staffnumber,
281  int lyricnumber
282  );
283 
306 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
308 #else
309  int
310 #endif
311  mode,
312  eSsys systemnumber,
313  eStaff staffnumber
314  );
315 
316 
317 
318 };
319 
320 
321 #endif /* FF_DETAILSCOLLECTION_H */
322 
__FCBase * GetItemAt(int index)
Returns the object at the index position. Index is 0-based.
Definition: finaleframework.cpp:12797
twobyte GetStartStaff() const
Returns the start staff number for the group.
Definition: ff_details.h:468
FCBaselines()
The constructor.
Definition: ff_detailscollection.h:105
FCBaseline * GetItemAt(int index)
Overridden GetItemAt() method.
Definition: ff_detailscollection.h:150
FCBaseline * AssureSavedLyricNumberForPiece(FCBaseline::BASELINEMODES mode, eStaff staffnumber, int lyricnumber)
Makes sure that there is a global lyric number base line (for a specific staff and lyric number) in t...
Definition: finaleframework.cpp:29762
Encapsulates baselines offset values for lyrics, expressions, fretboards and chords.
Definition: ff_details.h:1069
FCBaseline * FindLyricNumber(eStaff staffnumber, twobyte lyricnumber)
Finds an object with a specific lyric númber and staff number in the collection.
Definition: ff_detailscollection.h:176
FCGroup * Find(CMPER startstaff, CMPER endstaff, twobyte startmeasure=1)
Tries to find a matching group in the collection.
Definition: ff_detailscollection.h:44
FCBaseline * AssureSavedLyricNumber(FCBaseline::BASELINEMODES mode, eSsys systemnumber, eStaff staffnumber, int lyricnumber)
Makes sure that there is a lyric number baseline (for a specific staff/system) in the collection...
Definition: finaleframework.cpp:29848
BASELINEMODES
The mode constants of the object, used for both loading and saving objects.
Definition: ff_details.h:1078
Collection class for FCGroup class objects.
Definition: ff_detailscollection.h:22
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_detailscollection.h:29
FCGroups()
The constructor.
Definition: ff_detailscollection.h:35
twobyte GetStartMeasure() const
Returns the start measure for the group (for Finale 2011 and later)
Definition: ff_details.h:633
int GetCount() const
Returns the number of elements of the collection.
Definition: ff_basecollection.h:86
twobyte GetEndStaff() const
Returns the end staff number for the group.
Definition: ff_details.h:406
Base class specially designed for collections of detail classes.
Definition: ff_basecollection.h:716
Collection class for FCBaseline class objects.
Definition: ff_detailscollection.h:88
Base class for all data-related classes (that handles Finale data).
Definition: ff_base.h:628
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:29894
eStaff GetStaff() const
Returns the staff number ID for the baseline.
Definition: ff_details.h:1225
int LoadAllForSystem(FCBaseline::BASELINEMODES mode, eSsys systemno)
Loads all baseline objects for the staff system. These objects are part-specific. ...
Definition: finaleframework.cpp:29697
Base class specially designed for collections of detail classes that doesn't use the inci...
Definition: ff_basecollection.h:760
FCGroup * GetItemAt(int index)
Overridden GetItemAt() method.
Definition: ff_detailscollection.h:66
twobyte GetLyricNumber() const
Returns the connected lyric number for the baseline.
Definition: finaleframework.cpp:31459
FCBaseline * FindStaff(eStaff staffno)
Finds an object with a specific staff number in the collection.
Definition: ff_detailscollection.h:158
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_detailscollection.h:99
Encapsulates a staff group.
Definition: ff_details.h:69
int LoadAllForPiece(FCBaseline::BASELINEMODES mode)
Loads all baseline objects that controls independent staves throughout the entire piece...
Definition: finaleframework.cpp:29747
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:29806