#include "score.hh"
#include "pscore.hh"
#include "staff.hh"
+#include "paper.hh"
#include "misc.hh"
+#include "sccol.hh"
#include "debug.hh"
if (sc->musical)
for (int i=0; i < sc->durations.sz(); i++) {
Mtime d = sc->durations[i];
- Real dist = duration_to_idealspace(d);
+ Real dist = duration_to_idealspace(d, paper->whole_width);
PCol * c2 = find_col(sc->when + d,true)->pcol;
connect_nonmus(sc->pcol, c2, dist);
c2 = find_col(sc->when + d,false)->pcol;
-
#include "string.hh"
+#include "debug.hh"
#include "command.hh"
+bool
+Command::isbreak()const
+{
+ return (code >= BREAK_PRE&&code <= BREAK_END);
+}
Command*
get_bar_command(Real w)
c->args.add( "|");
return c;
}
+
+Command *
+get_meter_command(Real w, int n, int m)
+{
+ Command*c = new Command;
+
+ c->when = w;
+ c->code = TYPESET;
+ c->args.add( "METER");
+ c->args.add( n );
+ c->args.add( m );
+ return c;
+}
+
+
+
+Command::Command()
+{
+ code = NOP;
+ when = -1;
+}
+
+
+
+Command::Command(Real w)
+{
+ code = NOP;
+ when = w;
+}
+void
+Command::print() const
+{
+ mtor << "command code: " << code << " args: ";
+ for (int i = 0; i<args.sz(); i++)
+ mtor << args[i];
+ mtor << "\n";
+}
+/*
+ rhythmstaf.hh -- part of LilyPond
+
+ (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef RHYTHMSTAF_HH
+#define RHYTHMSTAF_HH
+#include "stcol.hh"
+
struct Rhythmic_staff;
/// column of Rhythmic_staff
Staff_column * create_col(Score_column*);
};
+
+#endif // RHYTHMSTAF_HH
+
+
#include "staff.hh"
+#include "stcol.hh"
+#include "sccol.hh"
#include "debug.hh"
-#include "pscore.hh"
+
void
Staff::clean_cols()
}
}
-/*
- maak een staff column, met specs in args.
-
- (sorry wat is het vroeg vandaag..)
- */
Staff_column *
Staff::get_col(Mtime w, bool mus)
{
}
// now integrate break commands with other commands.
- // may be do this in derived functions.
+ // maybe do this in derived functions.
}
void
void
Staff::print() const
{
+ #ifndef NPRINT
+
mtor << "Staff {\n";
for (PCursor<Voice*> vc(voices); vc.ok(); vc++) {
vc->print();
}
mtor <<"}\n";
+ #endif
}
-/****************************************************************/
-
-bool
-Staff_column::mus() const
-{
- return score_column->musical;
-}
-
-Mtime
-Staff_column::when() const
-{
- return score_column->when;
-}
-
-void
-Staff_column::add(Voice_element*ve)
-{
- Mtime d= ve->duration;
- if (d){
- score_column->durations.add(d);
- }
-
- v_elts.add(ve);
-}
-
-Staff_column::Staff_column(Score_column*s) {
- score_column = s;
-}
#include "voice.hh"
#include "command.hh"
-struct Staff_column {
- Score_column *score_column;
-
- /// fields to collect data vertically.
- svec<Voice_element *> v_elts;
- svec<Command *> s_commands;
-
- Staff_column(Score_column*s);
- bool mus() const ;
- Mtime when() const;
- void add(Voice_element*ve);
- /****************************************************************
- VIRTUAL
- ****************************************************************/
- virtual void process_requests()=0;
- virtual void process_commands()=0;
- virtual ~Staff_column() { }
-};
-
/// base class for a collection of voices.
struct Staff {
#include "voice.hh"
#include "staff.hh"
+#include "sccol.hh"
+#include "stcol.hh"
#include "list.cc"
#include "cursor.cc"
#include "molecule.hh"
#include "list.cc"
#include "cursor.cc"
-L_instantiate(Atom);
+PL_instantiate(Atom);
PL_instantiate(Command);
PL_instantiate(Request);