]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music.hh
release: 1.3.108
[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--2000 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
20 /** Music is anything that has duration and supports both time compression and
21   transposition.
22   
23   In Lily, everything that can be thought to have a length and a pitch
24   (which has a duration which can be transposed) is considered "music",
25
26   Music is hierarchical: 
27
28   @see Music_sequence
29
30
31   TODO: make a equalp function for general music. 
32   */
33 class Music {
34 public:
35   Input *origin () const; 
36   void set_spot (Input);  
37   
38   SCM get_mus_property (const char*) const;
39   SCM get_mus_property (SCM) const;
40   void set_mus_property (const char * , SCM val);
41   void set_immutable_mus_property (const char * , SCM val);
42   void set_immutable_mus_property (SCM key, SCM val);  
43   void set_mus_property (SCM , SCM val);  
44   void set_mus_pointer (const char*, SCM val);
45   SCM remove_mus_property (const char* nm);
46
47   virtual Pitch to_relative_octave (Pitch);
48
49   /// The duration of this piece of music
50   virtual Moment length_mom () const;
51
52   void print() const;
53   /// Transpose, with the interval central C to #p#
54   virtual void transpose (Pitch p);
55
56   /// Scale the music in time by #factor#.
57   virtual void compress (Moment factor);
58   VIRTUAL_COPY_CONS(Music);
59   Music (Music const &m);
60   Music();
61 protected:
62
63   DECLARE_SMOBS(Music,);
64   SCM immutable_property_alist_;
65   SCM mutable_property_alist_;
66  
67 };
68
69
70 Music * unsmob_music (SCM);
71 #endif // MUSIC_HH
72
73
74