From: fred Date: Sun, 24 Mar 2002 19:29:01 +0000 (+0000) Subject: lilypond-0.0.26 X-Git-Tag: release/1.5.59~5545 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fde3f297cedc3ea9a42dc76ea6eae6dc78d7302e;p=lilypond.git lilypond-0.0.26 --- diff --git a/src/localkeyitem.cc b/src/localkeyitem.cc index b210dbdac3..383f875d42 100644 --- a/src/localkeyitem.cc +++ b/src/localkeyitem.cc @@ -3,22 +3,33 @@ #include "scalar.hh" #include "lookup.hh" #include "paper.hh" +#include "request.hh" #include "notehead.hh" + +NAME_METHOD(Local_key_item); Local_key_item::Local_key_item(int i) { c0_position = i; } - void -Local_key_item::add (int o, int p , int a,Notehead*head_p) +Local_key_item::add(Item*head_l) +{ + group.push(head_l); + dependencies.push(head_l); +} +void +Local_key_item::add(Melodic_req*m_l) +{ + add(m_l->octave, m_l->notename, m_l->accidental); +} +void +Local_key_item::add (int o, int p , int a) { Local_acc l; l.octave = o; l.name = p; l.acc = a; - accs.add(l); - group.add(head_p); - dependencies.add(head_p); + accs.push(l); } void @@ -26,11 +37,11 @@ Local_key_item::do_pre_processing() { accs.sort(Local_acc::compare); } + Molecule* Local_key_item::brew_molecule_p()const { - - Molecule* output = new Molecule; + Molecule* output = new Molecule; Molecule*octmol = 0; int lastoct = -100; for (int i = 0; i < accs.size(); i++) { @@ -58,6 +69,13 @@ Local_key_item::brew_molecule_p()const output->add(*octmol); delete octmol; } + + Interval head_width; + for (int i = 0; i < group.size(); i++) { + head_width.unite(group[i]->width()); + } + output->translate(Offset(-output->extent().x.right + head_width.left ,0)); + return output; } diff --git a/src/main.cc b/src/main.cc index 67ccf5dfeb..8ac50296ee 100644 --- a/src/main.cc +++ b/src/main.cc @@ -41,7 +41,9 @@ void notice() "LilyPond, a music typesetter.\n" "Copyright (C) 1996,97 by\n" " Han-Wen Nienhuys \n" + "Contributors\n" " Jan-Nieuwenhuizen \n" + " Mats Bengtsson \n" "\n" " This program is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU General Public License version 2\n" @@ -62,7 +64,7 @@ static File_path * path =0; struct Main_init { Main_init() { path = new File_path(LIBDIR); - path->add(String(LIBDIR)+"init/"); + path->push(String(LIBDIR)+"init/"); debug_init(); } ~Main_init() { @@ -86,7 +88,7 @@ main (int argc, char **argv) exit(0); break; case 'I': - path->add(oparser.optarg); + path->push(oparser.optarg); break; case 'h': help(); diff --git a/src/qlpsolve.cc b/src/qlpsolve.cc index 8482bfd875..dd9c4043a2 100644 --- a/src/qlpsolve.cc +++ b/src/qlpsolve.cc @@ -34,7 +34,7 @@ Active_constraints::OK() Array allcons; for (int i=0; i < opt->cons.size(); i++) - allcons.add(0); + allcons.push(0); for (int i=0; i < active.size(); i++) { int j = active[i]; allcons[j]++; @@ -61,7 +61,7 @@ Active_constraints::add(int k) { // add indices int cidx=inactive[k]; - active.add(cidx); + active.push(cidx); inactive.swap(k,inactive.size()-1); inactive.pop(); @@ -98,7 +98,7 @@ Active_constraints::drop(int k) int q=active.size()-1; // drop indices - inactive.add(active[k]); + inactive.push(active[k]); active.swap(k,q); A.swap_rows(k,q); active.pop(); @@ -128,7 +128,7 @@ Active_constraints::Active_constraints(Ineq_constrained_qp const *op) opt(op) { for (int i=0; i < op->cons.size(); i++) - inactive.add(i); + inactive.push(i); Choleski_decomposition chol(op->quad); H=chol.inverse(); }