]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music.hh
Fix some bugs in the dynamic engraver and PostScript backend
[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--2006 Han-Wen Nienhuys <hanwen@xs4all.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 #include "prob.hh"
17
18 #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x))
19
20 class Music : public Prob
21 {
22 public:
23   Music (SCM init);
24   Music (Music const &m);
25   VIRTUAL_COPY_CONSTRUCTOR (Music, Music);
26
27   Input *origin () const;
28   void set_spot (Input);
29
30   bool internal_is_music_type (SCM) const;
31
32   DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
33   Pitch to_relative_octave (Pitch);
34   Pitch generic_to_relative_octave (Pitch);
35   Moment get_length () const;
36   Moment start_mom () const;
37   void print () const;
38
39   /// Transpose, with the interval central C to #p#
40   void transpose (Pitch p);
41
42   /// Scale the music in time by #factor#.
43   void compress (Moment factor);
44   
45   // Broadcast the event in a context's event-source.
46   void send_to_context (Context *c);
47
48   DECLARE_SCHEME_CALLBACK (duration_length_callback, (SCM));
49   
50 protected:
51   virtual SCM copy_mutable_properties () const;
52   virtual void type_check_assignment (SCM, SCM) const;
53   virtual void derived_mark () const;
54 protected:
55   SCM length_callback_;
56   SCM start_callback_;
57   friend SCM ly_extended_make_music (SCM, SCM);
58 };
59
60 Music *unsmob_music (SCM);
61 Music *make_music_by_name (SCM sym);
62 SCM ly_music_deep_copy (SCM);
63 extern SCM ly_music_p_proc;
64
65 #endif /* MUSIC_HH */