~ubuntu-branches/ubuntu/precise/lilypond/precise

« back to all changes in this revision

Viewing changes to lily/pitch-squash-engraver.cc

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2006-12-19 10:18:12 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061219101812-7awtjkp0i393wxty
Tags: 2.8.7-3
scripts/midi2ly.py: When setting DATADIR, find Lilypond python files
in the @TOPLEVEL_VERSION@ directory, not 'current'.  Patch thanks to
Chris Lamb (chris@chris-lamb.co.uk).  (Closes: #400550)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*   
2
 
  pitch-squash-grav.cc --  implement Pitch_squash_engraver
3
 
  
 
1
/*
 
2
  pitch-squash-engraver.cc -- implement Pitch_squash_engraver
 
3
 
4
4
  source file of the GNU LilyPond music typesetter
5
 
  
6
 
  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7
 
  
8
 
 */
 
5
 
 
6
  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
7
*/
9
8
#include "staff-symbol-referencer.hh"
10
9
#include "note-head.hh"
11
10
#include "rhythmic-head.hh"
12
11
#include "engraver.hh"
13
12
 
14
 
class Pitch_squash_engraver : public Engraver {
 
13
class Pitch_squash_engraver : public Engraver
 
14
{
15
15
public:
16
16
  TRANSLATOR_DECLARATIONS (Pitch_squash_engraver);
17
 
  virtual void acknowledge_grob (Grob_info);
 
17
  DECLARE_ACKNOWLEDGER (note_head);
18
18
};
19
19
 
20
 
 
21
20
void
22
 
Pitch_squash_engraver::acknowledge_grob (Grob_info i)
 
21
Pitch_squash_engraver::acknowledge_note_head (Grob_info i)
23
22
{
24
23
  SCM newpos = get_property ("squashedPosition");
25
 
  if (gh_number_p (newpos)
26
 
      && Note_head::has_interface (i.grob_))
27
 
    {
28
 
      i.grob_->set_property ("staff-position", newpos);
29
 
    }
 
24
  if (scm_is_number (newpos))
 
25
    i.grob ()->set_property ("staff-position", newpos);
30
26
}
31
27
 
32
 
 
33
 
 
34
28
Pitch_squash_engraver::Pitch_squash_engraver ()
35
29
{
36
30
}
37
31
 
38
 
ENTER_DESCRIPTION (Pitch_squash_engraver,
39
 
/* descr */       
40
 
                  "Set the vertical position of noteheads to "
41
 
                  "@code{squashedPosition}, if that "
42
 
                  "property is set. "
43
 
                  "This can be used to make  a single line staff "
44
 
                  "demonstrating the rhythm of a melody.",
 
32
#include "translator.icc"
 
33
ADD_ACKNOWLEDGER (Pitch_squash_engraver, note_head);
 
34
ADD_TRANSLATOR (Pitch_squash_engraver,
 
35
                /* doc */
 
36
                "Set the vertical position of noteheads to "
 
37
                "@code{squashedPosition}, if that "
 
38
                "property is set. "
 
39
                "This can be used to make  a single line staff "
 
40
                "demonstrating the rhythm of a melody.",
45
41
 
46
 
/* creats*/       "",
47
 
/* accepts */     "",
48
 
/* acks  */      "note-head-interface",
49
 
/* reads */       "squashedPosition",
50
 
/* write */       "");
 
42
                /* create */ "",
 
43
                /* accept */ "",
 
44
                /* read */ "squashedPosition",
 
45
                /* write */ "");