]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music.hh
* lily/lyric-phrasing-engraver.cc: remove
[lilypond.git] / lily / include / music.hh
1 /*
2   music.hh -- declare Music
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10
11 #ifndef MUSIC_HH
12 #define MUSIC_HH
13
14 #include "virtual-methods.hh"
15 #include "minterval.hh"
16 #include "lily-proto.hh"
17 #include "string.hh"
18 #include "smobs.hh"
19 #include "music-constructor.hh"
20
21
22 #define is_mus_type(x) internal_is_music_type(ly_symbol2scm (x))
23
24 /** Music is anything that has duration and supports both time compression and
25   transposition.
26   
27   In Lily, everything that can be thought to have a length and a pitch
28  (which has a duration which can be transposed) is considered "music",
29
30   Music is hierarchical: 
31
32   @see Music_sequence
33
34
35   TODO: make a equalp function for general music. 
36   */
37 class Music
38 {
39 public:
40   Music ();
41   Music (Music const &m);
42   VIRTUAL_COPY_CONSTRUCTOR (Music, Music);
43
44   Input *origin () const; 
45   void set_spot (Input);  
46
47   SCM internal_get_property (SCM) const;
48   void internal_set_property (SCM , SCM val);
49   SCM get_property_alist (bool mut) const;
50   bool internal_is_music_type (SCM) const;
51   
52   virtual Pitch to_relative_octave (Pitch);
53   String name () const;
54   /// The duration of this piece of music
55   virtual Moment get_length () const;
56   virtual Moment start_mom () const;
57   void print () const;
58   /// Transpose, with the interval central C to #p#
59   virtual void transpose (Pitch p);
60
61   /// Scale the music in time by #factor#.
62   virtual void compress (Moment factor);
63   
64 protected:
65   DECLARE_SMOBS (Music,);
66   SCM immutable_property_alist_;
67   SCM mutable_property_alist_;
68   friend SCM ly_extended_make_music(SCM,SCM);
69 };
70
71
72 DECLARE_UNSMOB(Music,music);
73
74 Music* make_music_by_name (SCM sym);
75 SCM ly_deep_mus_copy (SCM);
76
77 #endif // MUSIC_HH