]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music.hh
Run `make grand-replace'.
[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--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef MUSIC_HH
10 #define MUSIC_HH
11
12 #include "smobs.hh"
13 #include "moment.hh"
14 #include "pitch.hh"
15 #include "prob.hh"
16
17 #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x))
18
19 class Music : public Prob
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   bool internal_is_music_type (SCM) const;
30
31   Stream_event *to_event () const;
32
33   DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
34   Pitch to_relative_octave (Pitch);
35   Pitch generic_to_relative_octave (Pitch);
36   Moment get_length () const;
37   Moment start_mom () const;
38   void print () const;
39
40   /// Transpose, with the interval central C to #p#
41   void transpose (Pitch p);
42
43   /// Scale the music in time by #factor#.
44   void compress (Moment factor);
45   
46   // Broadcast the event in a context's event-source.
47   void send_to_context (Context *c);
48
49   DECLARE_SCHEME_CALLBACK (duration_length_callback, (SCM));
50  
51 protected:
52   virtual SCM copy_mutable_properties () const;
53   virtual void type_check_assignment (SCM, SCM) const;
54   virtual void derived_mark () const;
55 protected:
56   SCM length_callback_;
57   SCM start_callback_;
58   friend SCM ly_extended_make_music (SCM, SCM);
59 };
60
61 Music *unsmob_music (SCM);
62 Music *make_music_by_name (SCM sym);
63 SCM ly_music_deep_copy (SCM);
64 SCM ly_camel_case_2_lisp_identifier (SCM name_sym);
65
66 extern SCM ly_music_p_proc;
67
68 /* common transposition function for music and event */
69 void transpose_mutable (SCM alist, Pitch delta);
70
71 #endif /* MUSIC_HH */