]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music-list.hh
release: 0.0.68pre
[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     /// what kind of iterator needed to walk this music?
26     String type_str_;
27
28     /// what name (or look for this name)
29     String id_str_;    
30     Music_list(Music_list const&);    
31     Music_list();
32     NAME_MEMBERS();
33     VIRTUAL_COPY_CONS(Music_list,Music)
34     virtual void add(Music*);
35     virtual void transpose(Melodic_req const *);
36     
37     Pointer_list<Music*> music_p_list_;
38 protected:
39  
40     virtual void do_print() const;
41 };
42
43 /**
44   Chord is a list of music-elements which happen simultaneously
45  */
46
47 class Chord : public Music_list {
48 public:
49     Chord();
50     NAME_MEMBERS();
51     VIRTUAL_COPY_CONS(Chord,Music)
52     virtual void translate(Moment dt);
53     virtual MInterval time_int()const;
54 };
55
56 class Voice_element : public Chord {
57 public:
58     NAME_MEMBERS();
59     VIRTUAL_COPY_CONS(Voice_element,Music)
60 };
61
62 /**
63   Voice is a list of music-elements which are placed behind each other.
64  */
65 class Voice : public Music_list {
66     
67 public:
68     Moment offset_mom_;
69
70     Voice();
71     NAME_MEMBERS();
72     VIRTUAL_COPY_CONS(Voice, Music)
73     virtual void translate(Moment dt);
74     virtual MInterval time_int()const;
75 };
76
77 /** A simple piece of music, which wishes to change the spot of its
78   interpretor  */
79 class Change_reg : public Music {
80 public:
81     
82     /// what kind of iterator needed to walk this music?
83     String type_str_;
84
85     /// what name (or look for this name)
86     String id_str_;
87
88     NAME_MEMBERS();
89     VIRTUAL_COPY_CONS(Change_reg, Music)
90 };
91 #endif // MUSIC_LIST_HH