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