Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
/home/iurt/rpm/BUILD/canorus-0.7.R1002/src/core/staff.h
Go to the documentation of this file.
00001 
00008 #ifndef STAFF_H_
00009 #define STAFF_H_
00010 
00011 #include <QList>
00012 #include <QString>
00013 
00014 class QPainter;
00015 
00016 #include "core/context.h"
00017 #include "core/muselement.h"
00018 
00019 class CASheet;
00020 class CAContext;
00021 class CAVoice;
00022 class CANote;
00023 
00024 class CAStaff : public CAContext {
00025 public:
00026         CAStaff( const QString name, CASheet *s, int numberOfLines = 5);
00027         ~CAStaff();
00028 
00029         inline int numberOfLines() { return _numberOfLines; }
00030         inline void setNumberOfLines(int val) { _numberOfLines = val; }
00031         void clear();
00032         CAStaff *clone( CASheet *s );
00033 
00034         inline int voiceCount() { return _voiceList.size(); }
00035         inline CAVoice *voiceAt(int i) { return _voiceList[i]; }
00036         inline int voiceIndex(CAVoice *voice) { return _voiceList.indexOf(voice); }
00037         inline void removeVoice(CAVoice *voice) { _voiceList.removeAll(voice); }
00038         inline QList<CAVoice*> voiceList() { return _voiceList; }
00039         CAVoice *voiceByName(const QString name);
00040 
00041         void     addVoice(CAVoice *voice);
00042         CAVoice* addVoice();
00043 
00044         CAMusElement *next( CAMusElement *elt );
00045         CAMusElement *previous( CAMusElement *elt );
00046         bool remove( CAMusElement *elt, bool updateSignTimes );
00047         bool remove( CAMusElement *elt ) { return remove(elt, true); }
00048 
00049         int lastTimeEnd();
00050         QList<CAMusElement*> getEltByType( CAMusElement::CAMusElementType type, int startTime );
00051 
00052         QList<CAPlayable*> getChord( int time );
00053 
00054         bool synchronizeVoices();
00055 
00056 private:
00057         QList<CAVoice *> _voiceList;
00058 
00059         int _numberOfLines;
00060 };
00061 #endif /* STAFF_H_ */