]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music-list.hh
release: 0.1.0
[lilypond.git] / lily / include / music-list.hh
1 /*
2   music-list.hh -- declare Music_list, Chord and Voice
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef MUSIC_LIST_HH
11 #define MUSIC_LIST_HH
12
13 #include "music.hh"
14 #include "plist.hh"
15
16
17 /**
18   Music can be a list of other "Music" elements
19  */
20 class Music_list : public Music {
21     
22 public:
23     int multi_level_i_;
24   
25     Music_list(Music_list const&);    
26     Music_list();
27     DECLARE_MY_RUNTIME_TYPEINFO;
28     VIRTUAL_COPY_CONS(Music_list,Music);
29     virtual void add(Music*);
30     virtual void transpose(Melodic_req const *);
31     
32     Pointer_list<Music*> music_p_list_;
33 protected:
34  
35     virtual void do_print() const;
36 };
37
38 /**
39   Chord is a list of music-elements which happen simultaneously
40  */
41
42 class Chord : public Music_list {
43 public:
44     Chord();
45     DECLARE_MY_RUNTIME_TYPEINFO;
46     VIRTUAL_COPY_CONS(Chord,Music);
47     virtual void translate(Moment dt);
48     virtual MInterval time_int()const;
49 };
50
51 class Request_chord : public Chord {
52 public:
53     DECLARE_MY_RUNTIME_TYPEINFO;
54     Request_chord();
55     VIRTUAL_COPY_CONS(Request_chord,Music);
56 };
57
58 /**
59   Voice is a list of music-elements which are placed behind each other.
60  */
61 class Voice : public Music_list {
62     
63 public:
64     Moment offset_mom_;
65
66     Voice();
67     DECLARE_MY_RUNTIME_TYPEINFO;
68     VIRTUAL_COPY_CONS(Voice, Music);
69     virtual void translate(Moment dt);
70     virtual MInterval time_int()const;
71 };
72
73 /** A simple piece of music, which wishes to change the spot of its
74   interpretor  */
75 class Change_reg : public Music {
76 public:
77     
78     /// what kind of iterator needed to walk this music?
79     String type_str_;
80
81     /// what name (or look for this name)
82     String id_str_;
83
84     DECLARE_MY_RUNTIME_TYPEINFO;
85     VIRTUAL_COPY_CONS(Change_reg, Music);
86 };
87 #endif // MUSIC_LIST_HH