]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.26
authorfred <fred>
Sun, 24 Mar 2002 19:29:01 +0000 (19:29 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:29:01 +0000 (19:29 +0000)
src/localkeyitem.cc
src/main.cc
src/qlpsolve.cc

index b210dbdac3ee2c5a0762fca35151c8f51fa516dc..383f875d42b8e3657427541253d1948c446334d6 100644 (file)
@@ -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;
 }
 
index 67ccf5dfeb24f8250e5b7bfef26573a9ad030eb5..8ac50296eefed0697451d3067b30ade549430faa 100644 (file)
@@ -41,7 +41,9 @@ void notice()
        "LilyPond, a music typesetter.\n"
        "Copyright (C) 1996,97 by\n"
        "  Han-Wen Nienhuys <hanwen@stack.nl>\n"
+       "Contributors\n"
        "  Jan-Nieuwenhuizen <jan@digicash.com>\n"
+       "  Mats Bengtsson <matsb@s3.kth.se>\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();
index 8482bfd8752616df03c35f855569e6de5a623620..dd9c4043a2983b89c5b89a587623e6d7ad123308 100644 (file)
@@ -34,7 +34,7 @@ Active_constraints::OK()
     Array<int> 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();
 }