]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music.hh
*** empty log message ***
[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--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef MUSIC_HH
10 #define MUSIC_HH
11
12 #include "virtual-methods.hh"
13 #include "minterval.hh"
14 #include "music-constructor.hh"
15
16 #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x))
17
18
19 class Music
20 {
21 public:
22   Music (SCM init);
23   Music (Music const &m);
24   VIRTUAL_COPY_CONSTRUCTOR (Music, Music);
25
26   Input *origin () const; 
27   void set_spot (Input);
28
29   SCM internal_get_property (SCM) const;
30   void internal_set_property (SCM , SCM val);
31   SCM get_property_alist (bool mutble) const;
32   bool internal_is_music_type (SCM) const;
33   int duration_log () const;
34   
35   DECLARE_SCHEME_CALLBACK(relative_callback,(SCM,SCM));
36   Pitch to_relative_octave (Pitch);
37   Pitch generic_to_relative_octave (Pitch);  
38   String name () const;
39   Moment get_length () const;
40   Moment start_mom () const;
41   void print () const;
42
43   /// Transpose, with the interval central C to #p#
44   void transpose (Pitch p);
45   
46   /// Scale the music in time by #factor#.
47   void compress (Moment factor);
48   
49 protected:
50   DECLARE_SMOBS (Music,);
51   SCM immutable_property_alist_;
52   SCM mutable_property_alist_;
53 protected:
54   SCM length_callback_;
55   SCM start_callback_;
56   friend SCM ly_extended_make_music (SCM, SCM);
57 };
58
59 DECLARE_TYPE_P(Music);
60 DECLARE_UNSMOB(Music,music);
61
62 Music *make_music_by_name (SCM sym);
63 SCM ly_music_deep_copy (SCM);
64 SCM ly_music_scorify (SCM, SCM);
65
66 #endif /* MUSIC_HH */