blob: d246f08f0db4f2a191ad0f16a571d601095e63ce (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
/*
timing-grav.cc -- implement Timing_engraver
source file of the GNU LilyPond music typesetter
(c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <iostream.h>
#include "translator-group.hh"
#include "command-request.hh"
#include "grob-info.hh"
#include "multi-measure-rest.hh"
#include "timing-translator.hh"
#include "engraver.hh"
/**
Do time bookkeeping
*/
class Timing_engraver : public Timing_translator, public Engraver
{
protected:
virtual void start_translation_timestep ();
virtual void stop_translation_timestep ();
virtual void process_music ();
public:
VIRTUAL_COPY_CONS(Translator);
};
ADD_THIS_TRANSLATOR(Timing_engraver);
void
Timing_engraver::start_translation_timestep( )
{
Timing_translator::start_translation_timestep ();
SCM nonauto = get_property ("barNonAuto");
SCM which = get_property ("whichBar");
if (!gh_string_p (which))
which = now_mom ()
? SCM_EOL : ly_str02scm ("|");
if (!gh_string_p (which) && !to_boolean (nonauto))
{
SCM always = get_property ("barAlways");
if (!measure_position ()
|| (to_boolean (always)))
{
which=get_property ("defaultBarType" );
}
}
daddy_trans_l_->set_property ("whichBar", which);
}
void
Timing_engraver::stop_translation_timestep ()
{
Timing_translator::stop_translation_timestep ();
daddy_trans_l_->set_property ("whichBar", SCM_EOL);
}
/*
ugh. Translator doesn't do process_music ().
*/
void
Timing_engraver::process_music ()
{
Timing_translator::process_music ();
}
|