Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sheet.h
Go to the documentation of this file.
1 
8 #ifndef SHEET_H_
9 #define SHEET_H_
10 
11 #include <QString>
12 #include <QList>
13 
14 #include "core/context.h"
15 #include "core/staff.h"
16 
17 class CADocument;
18 class CAPlayable;
19 
20 class CASheet {
21 public:
22  CASheet( const QString name, CADocument *doc );
23  ~CASheet();
24  CASheet *clone( CADocument *doc );
25  inline CASheet *clone() { return clone( document() ); }
26 
27  CAContext *contextAt(int i) { return _contextList[i]; }
28  CAContext *context(const QString name);
29  inline QList<CAContext*>& contextList() { return _contextList; }
30  inline int contextIndex(CAContext* context) { return _contextList.indexOf(context); }
31  void insertContextAfter( CAContext *after, CAContext *c);
32  void addContext(CAContext *);
33  inline void removeContext(CAContext* c) { _contextList.removeAll(c); }
34  inline int contextCount() { return _contextList.size(); }
35 
36  CAStaff *addStaff();
37  int staffCount();
38  CAStaff *staffAt(int i);
39  QList<CAStaff*> staffList();
40 
41  QList<CAVoice*> voiceList();
42  inline CAVoice *voiceAt(int i) { return voiceList().at(i); }
43  inline int voiceCount() { return voiceList().size(); }
44 
45  QList<CAPlayable*> getChord(int time);
46 
47  inline CADocument *document() { return _document; }
48  inline void setDocument(CADocument *doc) { _document = doc; }
49 
50  inline const QString name() { return _name; }
51  inline void setName(const QString name) { _name = name; }
52 
53  void clear();
54 
55 private:
56  QList<CAContext *> _contextList;
58 
59  QString _name;
60 };
61 #endif /*SHEET_H_*/
Represents a single sheet of paper in the document.
Definition: sheet.h:20
CADocument * _document
Definition: sheet.h:57
void insertContextAfter(CAContext *after, CAContext *c)
Definition: sheet.cpp:82
QList< CAStaff * > staffList()
Definition: sheet.cpp:169
int contextCount()
Definition: sheet.h:34
QList< CAVoice * > voiceList()
Definition: sheet.cpp:139
CAContext * contextAt(int i)
Definition: sheet.h:27
int voiceCount()
Definition: sheet.h:43
CASheet * clone()
Definition: sheet.h:25
Class which represents a voice in the staff.
Definition: voice.h:22
CAVoice * voiceAt(int i)
Definition: sheet.h:42
const QString name()
Definition: sheet.h:50
CAStaff * addStaff()
Definition: sheet.cpp:90
Class which represents the current document.
Definition: document.h:19
void removeContext(CAContext *c)
Definition: sheet.h:33
void clear()
Definition: sheet.cpp:99
CAStaff * staffAt(int i)
Definition: sheet.cpp:156
CAContext * context(const QString name)
Definition: sheet.cpp:111
CADocument * document()
Definition: sheet.h:47
QList< CAPlayable * > getChord(int time)
Definition: sheet.cpp:127
void addContext(CAContext *)
Definition: sheet.cpp:77
QList< CAContext * > & contextList()
Definition: sheet.h:29
int staffCount()
Definition: sheet.cpp:147
Playable instances of music elements.
Definition: playable.h:18
Represents a staff in the sheet.
Definition: staff.h:24
QString _name
Definition: sheet.h:59
int contextIndex(CAContext *context)
Definition: sheet.h:30
QList< CAContext * > _contextList
Definition: sheet.h:56
~CASheet()
Definition: sheet.cpp:38
void setName(const QString name)
Definition: sheet.h:51
void setDocument(CADocument *doc)
Definition: sheet.h:48
Line of music elements in the sheet.
Definition: context.h:16
CASheet(const QString name, CADocument *doc)
Definition: sheet.cpp:33