source file of the GNU LilyPond music typesetter
- (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "performer.hh"
/*
TODO:
+
handle multiple events
- */
-/**
- perform absolute (text) dynamics
+ perform absolute (text) dynamics
*/
class Dynamic_performer : public Performer
{
public:
- TRANSLATOR_DECLARATIONS(Dynamic_performer);
+ TRANSLATOR_DECLARATIONS (Dynamic_performer);
protected:
virtual bool try_music (Music* req);
virtual void stop_translation_timestep ();
Audio_dynamic* audio_;
};
-
-
Dynamic_performer::Dynamic_performer ()
{
script_req_ = 0;
if (gh_procedure_p (proc))
{
// urg
- svolume = gh_call1 (proc, script_req_->get_mus_property ("text"));
+ svolume = gh_call1 (proc, script_req_->get_property ("text"));
}
- Real volume = 0.5;
- if (gh_number_p (svolume))
- volume = gh_scm2double (svolume);
+ Real volume = robust_scm2double (svolume, 0.5);
/*
properties override default equaliser setting
s = gh_call1 (eq, s);
}
- if (gh_pair_p (s))
+ if (is_number_pair (s))
{
- Interval iv;
- iv[MIN] = gh_scm2double (ly_car (s));
- iv[MAX] = gh_scm2double (ly_cdr (s));
+ Interval iv = ly_scm2interval (s);
volume = iv[MIN] + iv.length () * volume;
}
}
{
if (!script_req_)
{
- if (r->is_mus_type ("dynamic-event")) // fixme.
+ if (r->is_mus_type ("absolute-dynamic-event")) // fixme.
{
script_req_ = r;
return true;
return false;
}
-ENTER_DESCRIPTION(Dynamic_performer,
+ENTER_DESCRIPTION (Dynamic_performer,
/*descr*/ "",
/* creats*/ "",
- /* accepts */ "note-column-interface script-interface",
+ /* accepts */ "absolute-dynamic-event",
/* acks */ "",
/*reads */"dynamicAbsoluteVolumeFunction midiMaximumVolume midiMinimumVolume midiInstrument instrumentEqualizer",
/*writes*/"");