/* ***************/
- Text_item (General_script_def*,int dir=0);
+ Text_item (General_script_def*,Direction dir=0);
virtual ~Text_item();
DECLARE_MY_RUNTIME_TYPEINFO;
protected:
General_script_def * tdef_p_;
- virtual Interval symbol_height()const;
+ virtual Interval symbol_height() const;
virtual Molecule* brew_molecule_p() const;
virtual void do_pre_processing();
#ifndef NPRINT
String s = "";
if (init_parse_b_)
- s = "Init";
+ s = "Init";
set_yydebug (!monitor->silence (s+"Parser") && check_debug);
lexer_p_->set_debug (!monitor->silence (s+"Lexer") && check_debug);
#endif
String s = "";
if (init_parse_b_)
- s = "Init";
+ s = "Init";
if (!monitor->silence (s+"Declarations") && check_debug)
{
- lexer_p_->print_declarations (init_parse_b_);
+ lexer_p_->print_declarations (init_parse_b_);
}
#endif
}
print_declarations();
init_parse_b_ = false;
- set_debug();
+ set_debug();
lexer_p_->new_input (s , source_l_);
do_yyparse();
print_declarations();
if (!define_spot_array_.empty())
- warning ("Braces don't match.");
+ warning ("Braces don't match.");
}
My_lily_parser::~My_lily_parser()
}
char const *
-My_lily_parser::here_ch_C()const
+My_lily_parser::here_ch_C() const
{
return lexer_p_->here_ch_C();
}
My_lily_parser::parser_error (String s)
{
here_input().error (s);
- if ( fatal_error_i_)
- exit (fatal_error_i_);
+ if (fatal_error_i_)
+ exit (fatal_error_i_);
error_level_i_ = 1;
}
My_lily_parser::set_last_duration (Duration const *d)
{
if (last_duration_mode_b_)
- default_duration_ = *d;
+ default_duration_ = *d;
}
Chord* velt_p = new Request_chord;
velt_p->set_spot (here_input());
- if (s=="s") { /* Space */
- Skip_req * skip_p = new Skip_req;
- skip_p->duration_ = *duration_p;
+ if (s=="s")
+ { /* Space */
+ Skip_req * skip_p = new Skip_req;
+ skip_p->duration_ = *duration_p;
- skip_p->set_spot (here_input());
- velt_p->add (skip_p);
+ skip_p->set_spot (here_input());
+ velt_p->add (skip_p);
}
else
{
- Rest_req * rest_req_p = new Rest_req;
- rest_req_p->duration_ = *duration_p;
- rest_req_p->set_spot (here_input());
+ Rest_req * rest_req_p = new Rest_req;
+ rest_req_p->duration_ = *duration_p;
+ rest_req_p->set_spot (here_input());
- velt_p->add (rest_req_p);
+ velt_p->add (rest_req_p);
}
- Stem_req * stem_p = new Stem_req;
- stem_p->duration_ = *duration_p;
- stem_p->set_spot ( here_input());
- velt_p->add (stem_p);
delete duration_p;
return velt_p;
v->add (rq);
- if (duration_p->durlog_i_ >= 1)
- {
- Stem_req * stem_req_p = new Stem_req();
- stem_req_p->duration_ = *duration_p;
-
- stem_req_p->set_spot (here_input());
- v->add (stem_req_p);
- }
-
rq->set_duration (*duration_p);
rq->set_spot (here_input());
delete duration_p ;
switch (c)
{
- case '~':
- req_p = new Tie_req;
- break;
- case '[':
- case ']':
- {
+ case '~':
+ req_p = new Tie_req;
+ break;
+ case '[':
+ case ']':
+ {
Beam_req*b = new Beam_req;
int p_i=plet_.type_i_ ; // ugh . Should junk?
if (p_i!= 1)
- b->nplet = p_i;
+ b->nplet = p_i;
req_p = b;
- }
- break;
-
- case '>':
- case '!':
- case '<':
- req_p = new Span_dynamic_req;
- break;
+ }
+ break;
+
+ case '>':
+ case '!':
+ case '<':
+ req_p = new Span_dynamic_req;
+ break;
- case ')':
- case '(':
- req_p = new Slur_req;
- break;
- default:
- assert (false);
- break;
+ case ')':
+ case '(':
+ req_p = new Slur_req;
+ break;
+ default:
+ assert (false);
+ break;
}
switch (c)
{
- case '<':
- case '>':
- case '(':
- case '[':
- req_p->span()->spantype = Span_req::START;
- break;
- case '!':
- case ')':
- case ']':
- req_p->span()->spantype = Span_req::STOP;
- break;
+ case '<':
+ case '>':
+ case '(':
+ case '[':
+ req_p->span()->spantype = Span_req::START;
+ break;
+ case '!':
+ case ')':
+ case ']':
+ req_p->span()->spantype = Span_req::STOP;
+ break;
- default:
- break;
+ default:
+ break;
}
- if (req_p->musical()->span_dynamic ())
- {
- Span_dynamic_req* s_l= (req_p->musical()->span_dynamic ()) ;
- s_l->dynamic_dir_i_ = (c == '<') ? 1:-1;
+ if (req_p->musical()->span_dynamic ())
+ {
+ Span_dynamic_req* s_l= (req_p->musical()->span_dynamic ()) ;
+ s_l->dynamic_dir_ = (c == '<') ? UP:DOWN;
}
req_p->set_spot (here_input());
{
for (int i = 0; i < pre_reqs.size(); i++)
{
- v->add (pre_reqs[i]);
+ v->add (pre_reqs[i]);
}
pre_reqs.clear();
for (int i = 0; i <post_reqs.size(); i++)
{
- v->add (post_reqs[i]);
+ v->add (post_reqs[i]);
}
post_reqs.clear();
}
}
Input
-My_lily_parser::here_input()const
+My_lily_parser::here_input() const
{
Source_file * f_l= lexer_p_->source_file_l();
return Input (f_l, here_ch_C());
Box *box;
Chord * chord;
Duration *duration;
- Identifier *id;
+ Identifier *id;
Input_translator* itrans;
Music *music;
Music_list *musiclist;
Interval *interval;
Lookup*lookup;
Melodic_req * melreq;
+ Music_output_def * outputdef;
Midi_def* midi;
Moment *moment;
Note_req *notereq;
}
%{
-int
+int
yylex(YYSTYPE *s, void * v_l)
{
My_lily_parser *pars_l = (My_lily_parser*) v_l;
My_lily_lexer * lex_l = pars_l->lexer_p_;
-
+
lex_l->lexval_l = (void*) s;
return lex_l->yylex();
}
%token <melreq> NOTENAME_ID
%token <id> DURATION_IDENTIFIER
%token <id> IDENTIFIER
-%token <id> MELODIC_REQUEST_IDENTIFIER
+%token <id> MELODIC_REQUEST_IDENTIFIER
%token <id> MUSIC_IDENTIFIER
%token <id> VOICE_IDENTIFIER
%token <id> POST_REQUEST_IDENTIFIER
%token <id> MIDI_IDENTIFIER
%token <id> PAPER_IDENTIFIER
%token <id> REQUEST_IDENTIFIER
-%token <real> REAL
+%token <real> REAL
%token <string> DURATION RESTNAME
-%token <string> STRING
+%token <string> STRING
%token <string> FIELDNAME RECORDLINE
-%token <i> POST_QUOTES
+%token <i> POST_QUOTES
%token <i> PRE_QUOTES
-
+%type <outputdef> output_def
%type <header> mudela_header mudela_header_body
%type <box> box
%type <c> open_request_parens close_request_parens
%type <i> int
%type <i> script_dir
%type <id> identifier_init
-%type <duration> explicit_steno_duration notemode_duration
+%type <duration> explicit_steno_duration notemode_duration
%type <duration> entered_notemode_duration explicit_duration
%type <interval> dinterval
%type <intvec> intastint_list
%type <lookup> symtables symtables_body
%type <melreq> melodic_request steno_melodic_req
%type <notereq> steno_note_req
-%type <melreqvec> pitch_list
+%type <melreqvec> pitch_list
%type <midi> midi_block midi_body
%type <moment> duration_length
%type <music> Music transposed_music
-%type <musiclist> Voice Voice_body
+%type <musiclist> Voice Voice_body
%type <chord> Chord Chord_body
%type <paper> paper_block paper_body
%type <real> dim real
%type <real> unit
-%type <request> post_request pre_request command_req verbose_command_req
+%type <request> post_request pre_request command_req verbose_command_req
%type <request> abbrev_command_req
-%type <request> script_req dynamic_req
+%type <request> script_req dynamic_req
%type <score> score_block score_body
%type <script> script_definition script_body mudela_script gen_script_def
%type <textdef> text_def
THIS->default_header_p_ = $2;
}
| mudela score_block {
- add_score($2);
+ add_score($2);
}
| mudela add_declaration { }
| mudela error
- | mudela check_version { }
+ | mudela check_version { }
| mudela add_notenames { }
;
HEADER {
THIS->lexer_p_->push_header_state();
}
-
+
'{' mudela_header_body '}' {
$$ = $4;
THIS->lexer_p_->pop_state();
identifier_init:
score_block {
$$ = new Score_id($1, SCORE_IDENTIFIER);
-
+
}
| paper_block {
$$ = new Paper_def_id($1, PAPER_IDENTIFIER);
-
+
}
| midi_block {
$$ = new Midi_def_id($1, MIDI_IDENTIFIER);
-
+
}
| script_definition {
$$ = new Script_id($1, SCRIPT_IDENTIFIER);
-
+
}
| Music {
$$ = new Music_id($1, MUSIC_IDENTIFIER);
-
+
}
| symtables {
$$ = new Lookup_id($1, IDENTIFIER);
-
+
}
| real {
$$ = new Real_id(new Real($1), REAL_IDENTIFIER);
-
+
}
| int {
$$ = new Int_id(new int($1), INT_IDENTIFIER);
-
+
}
| post_request {
$$ = new Request_id($1, POST_REQUEST_IDENTIFIER);
-
+
}
| melodic_request {
$$ = new Request_id($1, MELODIC_REQUEST_IDENTIFIER);
-
+
}
| input_translator_spec {
$$ = new Input_translator_id ( $1, INPUT_TRANS_IDENTIFIER);
$$ = $1->input_translator();
$$-> set_spot( THIS->here_input() );
}
- | STRING STRING {
- $$ = new Input_translator;
+ | STRING STRING {
+ $$ = new Input_translator;
$$->base_str_ = *$1;
$$->type_str_ =*$2;
$$->set_spot ( THIS->here_input() );
/*cont*/ '{' score_body '}' {
$$ = $4;
$$->set_spot(THIS->pop_spot());
- if (!$$->paper_p_ && ! $$->midi_p_)
- $$->paper_p_ = THIS->default_paper();
+ if (!$$->def_p_arr_.size ())
+ $$->add ( THIS->default_paper());
/* handle error levels. */
$$->errorlevel_i_ = THIS->error_level_i_;
}
;
-score_body: {
- $$ = new Score;
+score_body: {
+ $$ = new Score;
}
| SCORE_IDENTIFIER {
$$ = $1->score();
| score_body Music {
$$->music_p_ = $2;
}
- | score_body paper_block {
- $$->paper_p_ = $2;
- }
- | score_body midi_block {
- $$->midi_p_ = $2;
+ | score_body output_def {
+ $$->add( $2);
}
| score_body error {
}
;
+output_def:
+ paper_block {
+ $$ = $1;
+ }
+ | midi_block {
+ $$= $1;
+ }
+ ;
+
intastint_list:
/* */ { $$ =new Array<int>; }
| intastint_list int '*' int {
| PAPER_IDENTIFIER {
$$ = $1->paperdef();
}
- | paper_body OUTPUT STRING ';' { $$->outfile_str_ = *$3;
+ | paper_body OUTPUT STRING ';' {
+ $$->outfile_str_ = *$3;
delete $3;
}
| paper_body symtables { $$->set($2); }
- | paper_body STRING '=' dim ';' {
+ | paper_body STRING '=' dim ';' {
$$->set_var(*$2, $4);
}
| paper_body STRING '=' real ';' {
midi_body: /* empty */ {
$$ = THIS->default_midi();
}
- | midi_body OUTPUT STRING ';' {
- $$->outfile_str_ = *$3;
- delete $3;
+ | midi_body OUTPUT STRING ';' {
+ $$->outfile_str_ = *$3;
+ delete $3;
}
| midi_body tempo_request ';' {
$$->set_tempo( $2->dur_.length(), $2->metronome_i_ );
}
| Voice_body ID STRING STRING ';' {
$$ = new Voice;
- $$->type_str_ = *$3;
+ $$->type_str_ = *$3;
$$->id_str_ = *$4;
delete $3;
delete $4;
| Chord { $$ = $1; }
| transposed_music { $$ = $1; }
| MUSIC_IDENTIFIER { $$ = $1->music(); }
- | MELODIC
- { THIS->lexer_p_->push_note_state(); }
+ | MELODIC
+ { THIS->lexer_p_->push_note_state(); }
Music
{ $$=$3; THIS->lexer_p_->pop_state(); }
- | LYRIC
- { THIS->lexer_p_->push_lyric_state(); }
+ | LYRIC
+ { THIS->lexer_p_->push_lyric_state(); }
Music
{ $$ = $3; THIS->lexer_p_->pop_state(); }
- ;
+ ;
Chord:
'<' Chord_body '>' { $$ = $2; }
$$->multi_level_i_=$3;
}
| Chord_body ID STRING STRING ';' {
- $$->type_str_ = *$3;
+ $$->type_str_ = *$3;
$$->id_str_ = *$4;
- delete $4;
+ delete $4;
delete $3;
}
| Chord_body Music {
}
| command_elt
| voice_command ';' { $$ = 0; }
- ;
+ ;
simple_element:
- music_elt
+ music_elt
| lyrics_elt
;
;
command_req:
- abbrev_command_req
+ abbrev_command_req
| verbose_command_req ';' { $$ = $1; }
;
abbrev_command_req:
- '|' {
+ '|' {
$$ = new Barcheck_req;
}
| COMMAND_IDENTIFIER {
// sorry hw, i need meter at output of track,
// but don-t know where to get it... statics should go.
// HW : default: 4/4, meterchange reqs may change it.
-
+
Midi_def::num_i_s = $2;
Midi_def::den_i_s = $4;
$$ = m;
}
| SKIP duration_length {
Skip_req * skip_p = new Skip_req;
- skip_p->duration_.set_plet($2->numerator().as_long(),
+ skip_p->duration_.set_plet($2->numerator().as_long(),
$2->denominator().as_long());
-
+
delete $2;
$$ = skip_p;
}
$$ = new Clef_change_req(*$2);
delete $2;
}
- | KEY pitch_list {
+ | KEY pitch_list {
Key_change_req *key_p= new Key_change_req;
key_p->melodic_p_arr_ = *$2;
$$ = key_p;
POST_REQUEST_IDENTIFIER {
$$ = (Request*)$1->request();
}
- |close_request_parens {
- $$ = THIS->get_parens_request($1);
+ |close_request_parens {
+ $$ = THIS->get_parens_request($1);
}
| script_req
| dynamic_req
$$ = $1->clone()->musical()->melodic();
$$->octave_i_ += THIS->default_octave_i_;
}
- | steno_melodic_req POST_QUOTES {
+ | steno_melodic_req POST_QUOTES {
$$-> octave_i_ += $2;
}
- | PRE_QUOTES steno_melodic_req {
+ | PRE_QUOTES steno_melodic_req {
$$ = $2;
$2-> octave_i_ -= $1;
}
}
| steno_note_req '!' {
$$->forceacc_b_ = ! $$->forceacc_b_;
- }
+ }
/* have to duration here. */
;
| SPANDYNAMIC '{' int int '}' {
Span_dynamic_req * sp_p = new Span_dynamic_req;
sp_p->spantype = $4;
- sp_p-> dynamic_dir_i_ = $3;
+ sp_p-> dynamic_dir_ = $3;
$$ = sp_p;
}
;
'~' {
$$ = '~';
}
- | '(' {
+ | '(' {
$$='(';
}
- | ']' {
+ | ']' {
$$ = ']';
}
| close_plet_parens {
E_EXCLAMATION {
$$ = '!';
}
- | ')' {
+ | ')' {
$$=')';
}
| '[' {
s->set_from_input(*$1,$2, $3,$4,$5, $6);
$$ = s;
delete $1;
- }
+ }
;
script_req:
- script_dir gen_script_def {
+ script_dir gen_script_def {
Musical_script_req *m = new Musical_script_req;
- $$ = m;
+ $$ = m;
m-> scriptdef_p_ = $2;
m-> set_spot ( THIS->here_input() );
- m-> dir_i_ = $1;
+ m-> dir_ = $1;
}
;
gen_script_def:
text_def { $$ = $1; }
- | mudela_script { $$ = $1;
+ | mudela_script { $$ = $1;
$$-> set_spot( THIS->here_input() );
}
;
text_def:
- STRING {
+ STRING {
Text_def *t = new Text_def;
$$ = t;
- t->text_str_ = *$1;
+ t->text_str_ = *$1;
delete $1;
t->style_str_ = THIS->textstyle_str_;
$$->set_spot( THIS->here_input() );
$$ = get_scriptdef('.');
}
;
-
+
mudela_script:
SCRIPT_IDENTIFIER { $$ = $1->script(); }
| script_definition { $$ = $1; }
- | script_abbreviation {
+ | script_abbreviation {
$$ = THIS->lexer_p_->lookup_identifier(*$1)->script();
delete $1;
}
}
;
-pre_request:
- open_request_parens {
- $$ = THIS->get_parens_request($1);
+pre_request:
+ open_request_parens {
+ $$ = THIS->get_parens_request($1);
}
;
THIS->set_default_duration($2);
delete $2;
}
- | OCTAVE {
+ | OCTAVE {
/*
This is weird, but default_octave_i_
is used in steno_note_req too
}
;
-duration_length:
+duration_length:
{
$$ = new Moment(0,1);
}
- | duration_length explicit_steno_duration {
+ | duration_length explicit_steno_duration {
*$$ += $2->length();
}
;
;
entered_notemode_duration:
- /* */ {
+ /* */ {
$$ = new Duration(THIS->default_duration_);
}
| dots {
- $$ = new Duration(THIS->default_duration_);
+ $$ = new Duration(THIS->default_duration_);
$$->dots_i_ = $1;
}
| explicit_steno_duration {
$$->dots_i_ ++;
}
| explicit_steno_duration '*' int {
- $$->plet_.iso_i_ *= $3;
+ $$->plet_.iso_i_ *= $3;
}
| explicit_steno_duration '/' int {
- $$->plet_.type_i_ *= $3;
+ $$->plet_.type_i_ *= $3;
}
;
delete r_p;
}
;
-
+
dim:
|MM_T { $$ = 1 MM; }
|PT_T { $$ = 1 PT; }
;
-
+
/*
symbol tables
*/
;
dinterval: dim dim {
- $$ = new Interval($1, $2);
+ $$ = new Interval($1, $2);
}
;
%%
-void
+void
My_lily_parser::set_yydebug(bool b )
{
#ifdef YYDEBUG
--- /dev/null
+/*
+ stem-grav.cc -- implement Stem_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "stem-grav.hh"
+#include "note-head.hh"
+#include "stem.hh"
+#include "musical-request.hh"
+#include "duration-convert.hh"
+
+Stem_engraver::Stem_engraver()
+{
+ stem_p_ =0;
+ dir_ =CENTER;
+}
+
+void
+Stem_engraver::acknowledge_element(Score_elem_info i)
+{
+ if (i.elem_l_->is_type_b (Note_head::static_name()))
+ {
+ Note_head *h = (Note_head*) i.elem_l_->item();
+ if (!stem_p_)
+ {
+ Rhythmic_req * r = i.req_l_->musical()->rhythmic();
+ stem_p_ = new Stem;
+ stem_p_->flag_i_ = Duration_convert::type2_i(r->duration_.durlog_i_);
+ announce_element (Score_elem_info (stem_p_, r));
+ }
+ stem_p_->add (h);
+ }
+}
+
+void
+Stem_engraver::do_pre_move_processing()
+{
+ if (stem_p_)
+ {
+ if (dir_)
+ stem_p_->dir_ = dir_;
+
+ typeset_element(stem_p_);
+ stem_p_ =0;
+ }
+}
+
+void
+Stem_engraver::set_feature (Feature i)
+{
+ if (i.type_ == "vdir")
+ dir_ = (Direction) int(i.value_);
+}
+
+IMPLEMENT_IS_TYPE_B1(Stem_engraver, Engraver);
+ADD_THIS_ENGRAVER(Stem_engraver);
Interval
Text_def::width (Paper_def * p) const
{
- Atom a = get_atom (p,0);
+ Atom a = get_atom (p,CENTER);
Real guess_width_f = text_str_.length_i() * a.sym_.dim.x ().length (); // ugh
Interval i (0, guess_width_f);
}
Atom
-Text_def::get_atom (Paper_def *p, int) const
+Text_def::get_atom (Paper_def *p, Direction) const
{
return p->lookup_l()->text (style_str_, text_str_, -align_i_);
}
#include "molecule.hh"
#include "lookup.hh"
-Text_item::Text_item (General_script_def*tdef_l, int d)
+Text_item::Text_item (General_script_def*tdef_l, Direction d)
{
- dir_i_ = d;
+ dir_ = d;
fat_b_ = false;
tdef_p_ = tdef_l->clone();
}
void
Text_item::do_pre_processing()
{
- if (!dir_i_)
- dir_i_ = -1;
+ if (!dir_)
+ dir_ = DOWN;
}
Interval
-Text_item::symbol_height()const
+Text_item::symbol_height() const
{
- return tdef_p_->get_atom (paper(), dir_i_).sym_.dim.y ();
+ return tdef_p_->get_atom (paper(), dir_).sym_.dim.y ();
}
Molecule*
Text_item::brew_molecule_p() const
{
- Atom a (tdef_p_->get_atom (paper(), dir_i_));
+ Atom a (tdef_p_->get_atom (paper(), dir_));
-/*
- if ( fat_b_)
- a.sym.dim.x = tdef_p_->width (paper());
- */
+ /*
+ if (fat_b_)
+ a.sym.dim.x = tdef_p_->width (paper());
+ */
Molecule* mol_p = new Molecule (a);
- if (dir_i_<0) // should do something better anyway.
- mol_p->translate (-mol_p->extent().y ().left , Y_AXIS);
+ if (dir_<0) // should do something better anyway.
+ mol_p->translate (-mol_p->extent().y ().left , Y_AXIS);
mol_p->translate (pos_i_ * paper()->internote_f (), Y_AXIS);
return mol_p;
Text_spanner::do_post_processing()
{
text_off_ = support_span_l_->center() +
- Offset (0,support_span_l_->dir_i_ * paper()->internote_f () * 4); // todo
+ Offset (0,support_span_l_->dir_ * paper()->internote_f () * 4); // todo
}
Molecule*
Text_spanner::brew_molecule_p() const
{
- Atom tsym (spec_p_->get_atom (paper(),0));
+ Atom tsym (spec_p_->get_atom (paper(),CENTER));
tsym.translate (text_off_);
Molecule*output = new Molecule;
void
Text_spanner::do_pre_processing()
{
- right_col_l_ = support_span_l_->right_col_l_;
- left_col_l_ = support_span_l_->left_col_l_;
- assert (left_col_l_ && right_col_l_);
+ spanned_drul_ = support_span_l_->spanned_drul_;
}
Interval
-Text_spanner::height()const
+Text_spanner::height() const
{
return brew_molecule_p()->extent ().y ();
}
void
-Tie::set_head (int x_pos, Note_head * head_l)
+Tie::set_head (Direction d, Note_head * head_l)
{
- if (x_pos >0)
- {
- assert (!right_head_l_);
- right_head_l_ = head_l;
- }
- else
- {
- assert (!left_head_l_);
- left_head_l_ = head_l;
- }
+ assert (!head_l_drul_[d]);
+ head_l_drul_[d] = head_l;
+
add_dependency (head_l);
}
Tie::Tie()
{
- right_head_l_ =0;
- left_head_l_ =0;
+ head_l_drul_[RIGHT] =0;
+ head_l_drul_[LEFT] =0;
same_pitch_b_ =false;
}
void
Tie::set_default_dir()
{
- int m= (left_head_l_->position_i_ + right_head_l_->position_i_) /2 ;
- dir_i_ = (m < 5)? -1:1; // ugh
+ int m= (head_l_drul_[LEFT]->position_i_ + head_l_drul_[RIGHT]->position_i_) /2 ;
+ dir_ = (m < 5)? DOWN : UP; // UGH
}
void
Tie::do_add_processing()
{
- assert (left_head_l_ && right_head_l_);
- left_col_l_ = left_head_l_ -> pcol_l_;
- right_col_l_ = right_head_l_ -> pcol_l_;
+ assert (head_l_drul_[LEFT] && head_l_drul_[RIGHT]);
+ set_bounds(LEFT,head_l_drul_[LEFT]);
+ set_bounds(RIGHT,head_l_drul_[RIGHT]);
}
-/**
- This is already getting hairy. Should use Note_head *heads[2]
- */
void
Tie::do_post_processing()
{
- assert (left_head_l_ || right_head_l_);
- left_pos_i_ = (left_head_l_)?
- left_head_l_->position_i_ : right_head_l_->position_i_;
- right_pos_i_ = (right_head_l_) ?
- right_head_l_->position_i_ : left_head_l_->position_i_;
-
- if ( right_head_l_ && right_head_l_->extremal_i_)
+ assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]);
+
+ Direction d = LEFT;
+ do
{
- right_pos_i_ += 2*dir_i_;
- right_dx_f_ -= 0.25;
+ pos_i_drul_[d] = (head_l_drul_[d])?
+ head_l_drul_[d]->position_i_ : head_l_drul_[(Direction)-d]->position_i_;
}
- else
- right_dx_f_ -= 0.5;
+ while ((d *= -1) != LEFT);
- if (left_head_l_ && left_head_l_->extremal_i_)
+ do
{
- left_pos_i_ += 2*dir_i_;
- left_dx_f_ += 0.25;
+ if (head_l_drul_[d] && head_l_drul_[d]->extremal_i_)
+ {
+ pos_i_drul_[d] += 2*dir_;
+ dx_f_drul_[d] += d * 0.25;
+ }
+ else
+ dx_f_drul_[d] += d*0.5;
}
- else
- left_dx_f_ += 0.5;
-
- if (!right_head_l_)
- right_pos_i_ = left_pos_i_;
- if (! left_head_l_)
- left_pos_i_ = right_pos_i_;
+ while ((d *= -1) != LEFT);
+
+ do
+ {
+ if (!head_l_drul_[d])
+ pos_i_drul_[d] = pos_i_drul_[(Direction)-d];
+ }
+ while ((d *= -1) != LEFT);
}
Tie::do_substitute_dependency (Score_elem*o, Score_elem*n)
{
Note_head *new_l =n?(Note_head*)n->item():0;
- if (o->item() == left_head_l_)
- left_head_l_ = new_l;
- else if (o->item() == right_head_l_)
- right_head_l_ = new_l;
+ if (o->item() == head_l_drul_[LEFT])
+ head_l_drul_[LEFT] = new_l;
+ else if (o->item() == head_l_drul_[RIGHT])
+ head_l_drul_[RIGHT] = new_l;
}
Voice_group_engravers::Voice_group_engravers()
{
- dir_i_ =0;
+ dir_ =CENTER;
}
bool
Command_req* c_l = r_l->command();
if (c_l&& c_l->groupfeature())
{
- Feature f;
- f.type_ = c_l->groupfeature()->type_str_;
- f.value_ = c_l->groupfeature()->value_str_;
- set_feature (f);
- return true;
+ Feature f;
+ f.type_ = c_l->groupfeature()->type_str_;
+ f.value_ = c_l->groupfeature()->value_str_;
+ set_feature (f);
+ return true;
}
return Engraver_group_engraver::do_try_request (r_l);
}
Voice_group_engravers::get_feature (String f)
{
if (f == "vdir")
- return dir_i_;
+ return dir_;
Engraver_group_engraver::get_feature (f);
}