From: fred Date: Sun, 24 Mar 2002 19:41:11 +0000 (+0000) Subject: lilypond-0.0.17 X-Git-Tag: release/1.5.59~4846 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=13962c12e59e82812ad3126187113f43ecaf9c67;p=lilypond.git lilypond-0.0.17 --- diff --git a/src/inputcursor.cc b/src/inputcursor.cc deleted file mode 100644 index 4dc5f9310f..0000000000 --- a/src/inputcursor.cc +++ /dev/null @@ -1,116 +0,0 @@ -/* - it still sucks. - */ - -#include "inputcommands.hh" -#include "inputcommand.hh" -#include "debug.hh" -#include "staffcommands.hh" -#include "getcommand.hh" -#include "command.hh" - -void -interpret_meter(Input_command *c, int &beats_per_meas, int& one_beat, - Real& whole_per_measure) -{ - beats_per_meas = c->args[1].value(); - one_beat = c->args[2].value(); - whole_per_measure = beats_per_meas/Real(one_beat); -} - -Real -Input_cursor::when()const -{ - return (*this)->when; -} - -void -Input_cursor::print() const -{ -#ifndef NPRINT - mtor << "meter " << whole_per_measure - << " pos "<< bars << ":" << whole_in_measure <<'\n'; -#endif -} - -void -Input_cursor::reset() -{ - whole_per_measure = 1.0; // ? - whole_in_measure =0.0; - bars = 0; - last=0; -} - -Input_cursor :: Input_cursor(PCursorc) - :PCursor(c) -{ - reset(); -} - -void -Input_cursor::sync() -{ - assert(ok()); - - whole_in_measure += when() - last; - while (whole_per_measure > 0 && whole_in_measure >= whole_per_measure) { - bars ++; - whole_in_measure -= whole_per_measure; - } - if (whole_in_measure < 1e-5) // ugr - whole_in_measure = 0.0; -} - -void -Input_cursor::operator++(int) -{ - last = when(); - (*(PCursor *) this) ++; - - if (ok()) { - sync(); - if (ptr()->args[0] == "METER") { - int i,j; - interpret_meter(ptr(), i, j, whole_per_measure); - } - } -} - -void -Input_cursor::addbot(Input_command*c) -{ - assert(!ok()); - add(c); -} - - -void -Input_cursor::add(Input_command*c) -{ - PCursor ::add(c); - (*this)++; -} - -void -Input_cursor::last_command_here() -{ - assert(ok()); - PCursor next = (*this)+1; - while (next.ok() && next->when == when()){ - *this = next; - next = *this +1; - - } -} - -void -Input_cursor::setpartial(Real p) -{ - if (when()) - error_t ("Partial measure only allowed at beginning.", when() ); - if (p<0||p > whole_per_measure) - error_t ("Partial measure has incorrect size", when()); - - whole_in_measure = whole_per_measure - p; -}