]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music.hh
* lily/system.cc (do_derived_mark): don't mark from object_alist_
[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 "smobs.hh"
14 #include "moment.hh"
15 #include "pitch.hh"
16
17 #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x))
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 internal_get_object (SCM) const;
32   void internal_set_object (SCM, SCM val);
33   SCM get_property_alist (bool mutble) const;
34   bool internal_is_music_type (SCM) const;
35
36   DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
37   Pitch to_relative_octave (Pitch);
38   Pitch generic_to_relative_octave (Pitch);
39   String name () const;
40   Moment get_length () const;
41   Moment start_mom () const;
42   void print () const;
43
44   /// Transpose, with the interval central C to #p#
45   void transpose (Pitch p);
46
47   /// Scale the music in time by #factor#.
48   void compress (Moment factor);
49
50   DECLARE_SCHEME_CALLBACK (duration_length_callback, (SCM));
51 protected:
52   DECLARE_SMOBS (Music,);
53
54   SCM immutable_property_alist_;
55   SCM mutable_property_alist_;
56 protected:
57   SCM length_callback_;
58   SCM start_callback_;
59   friend SCM ly_extended_make_music (SCM, SCM);
60 };
61
62 DECLARE_TYPE_P (Music);
63 DECLARE_UNSMOB (Music, music);
64
65 Music *make_music_by_name (SCM sym);
66 SCM ly_music_deep_copy (SCM);
67
68 #endif /* MUSIC_HH */