+pl 14.jcn1
+ - moved most ugly lookup stuff
+ - {Ps,Tex}_{def,score}.{cc,hh}
+
+*********
+pl 14
+
pl 13.uu1
- bfs for footer
- bf: init/{book,center}-fragment.ly, YODL nofooter stuff.
MAJOR_VERSION=1
MINOR_VERSION=0
PATCH_LEVEL=14
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=jcn1
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
#include "array.hh"
#include "debug.hh"
#include "dimensions.hh"
-#include "lookup.hh"
+#include "paper-def.hh"
#include "main.hh"
inline bool
if (abs (off_[ax]) >= 100 CM)
{
warning (_f ("ridiculous dimension: %s, %s", axis_name_str (ax),
- global_lookup_l->print_dimen (off_[ax])));
+ dimension_str (off_[ax])));
if (experimental_features_global_b)
assert (false);
But Atom is used as a simple type *everywhere*,
and we don't have virtual contructors.
*/
- str_ = global_lookup_l->unknown_str ();
+ str_ = global_paper_l->unknown_str ();
}
Atom::Atom (String s, Box b)
--- /dev/null
+
+#include "warn.hh"
+#include "dimensions.hh"
+
+String
+dimension_str (Real r)
+{
+ String s = to_str (r, "%.3f");
+ if (s.index_i ("NaN") != -1)
+ {
+ warning (_ ("NaN"));
+ s = "0.0";
+ }
+ return s;
+}
+
#define CM *CM_TO_PT
#define INCH *INCH_TO_PT
+String dimension_str (Real r);
+
#endif // DIMENSIONS_HH
#ifndef FILE_RESULTS_HH
#define FILE_RESULTS_HH
-#include "fproto.hh"
+
+#include "lily-proto.hh"
+#include "string.hh"
void do_one_file (String init_str, String file_str);
extern Header *header_global_p;
struct Performer;
struct Performer_group_performer;
struct Property_iterator;
+struct Ps_score;
+struct Ps_def;
struct Ps_lookup;
struct Ps_outputter;
struct Ps_stream;
struct Super_element;
struct Translation_property;
struct Tempo_req;
+struct Tex_def;
+struct Tex_score;
struct Tex_lookup;
struct Tex_outputter;
struct Tex_stream;
virtual Atom* atom_p (String, int, Box) const = 0;
Atom ball (int) const;
Atom bar (String, Real height) const;
- String base_output_str () const;
Atom beam (Real,Real, Real) const;
virtual String character_str (int i) const;
Atom clef (String) const;
Atom fill (Box b) const;
Atom flag (int, Direction) const;
virtual Atom hairpin (Real width, bool decresc, bool continued) const = 0;
- virtual Lookup* lookup_p (Lookup const&) const = 0;
- virtual Lookup* lookup_p (Symtables const&) const = 0;
- virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Header*, String) const = 0;
- virtual Paper_stream* paper_stream_p () const = 0;
virtual Atom plet (Real dy, Real dx, Direction dir) const = 0;
void print () const;
virtual Atom ps_beam (Real slope, Real width, Real thick) const = 0;
- virtual String print_dimen (Real) const;
+ String print_dimen (Real) const;
Atom rest (int, bool outside) const;
Atom rule_symbol (Real height, Real width) const;
Atom script (String idx) const;
virtual Atom slur (Array<Offset> controls) const = 0;
Atom streepje (int type) const;
virtual Atom text (String style, String text) const;
- virtual String unknown_str () const = 0;
Atom vbrace (Real &dy) const;
virtual Atom vbracket (Real &dy) const = 0;
Atom special_time_signature (String, Array<Scalar>) const;
extern int exit_status_i_;
extern bool experimental_features_global_b;
extern Lookup* global_lookup_l;
+extern Paper_def* global_paper_l;
extern bool dependency_global_b;
extern bool version_ignore_global_b;
DECLARE_MY_RUNTIME_TYPEINFO;
virtual void print () const;
+ virtual Paper_def* paper_l ();
+ virtual Paper_score* paper_score_p () const;
+
Global_translator *get_global_translator_p ();
Translator_group *get_group_translator_p (String type) const;
String get_default_output () const;
Line_of_score * line_l_;
Paper_score ();
+
+ virtual ~Paper_score();
+ String base_output_str () const;
+ virtual Paper_outputter* paper_outputter_p (Paper_stream*) const = 0;
+ virtual Paper_stream* paper_stream_p () const = 0;
/// add to bottom of pcols
void add_column (Paper_column*);
/// add a Spanner
void typeset_unbroken_spanner (Spanner*);
-
- virtual ~Paper_score();
protected:
static int default_count_i_;
bool ps_b_;
-protected:
- VIRTUAL_COPY_CONS(Paper_def,Music_output_def);
-
public:
virtual ~Paper_def ();
DECLARE_MY_RUNTIME_TYPEINFO;
+ VIRTUAL_COPY_CONS (Paper_def,Music_output_def);
Array<Interval> shape_int_a_;
Lookup const * lookup_l (int sz) const; // TODO naming
+ virtual Paper_def* paper_l ();
+ virtual String dimension_str (Real r) const;
+ virtual Lookup* lookup_p (Lookup const&) const;
+ virtual Lookup* lookup_p (Symtables const&) const;
+ virtual String unknown_str () const;
+
/** convert a duration to an idealspacing
influence using the geometric_ and paratime_signatures.
*/
Real arithmetic_constant (Moment minimal_mom) const;
Real arithmetic_spacing (Moment mom,Real constant) const;
virtual int get_next_default_count () const;
- //urg
- String tex_output_settings_str () const;
- String ps_output_settings_str () const;
+ virtual String output_settings_str () const;
// urg
friend int yyparse (void*);
};
-#endif // Paper_def_HH
+#endif // PAPER_DEF_HH
--- /dev/null
+/*
+ ps-def.hh -- declare Ps_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Jan Nieuwenhuizen <jannneke@gnu.org>
+*/
+
+#ifndef PS_DEF_HH
+#define PS_DEF_HH
+
+#include "paper-def.hh"
+
+class Ps_def : public Paper_def
+{
+public:
+ VIRTUAL_COPY_CONS (Ps_def, Paper_def);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ virtual Lookup* lookup_p (Lookup const&) const;
+ virtual Lookup* lookup_p (Symtables const&) const;
+
+ virtual String output_settings_str () const;
+ virtual Paper_score* paper_score_p () const;
+ virtual String unknown_str () const;
+};
+
+#endif // PS_DEF_HH
virtual String character_str (int i) const;
virtual Atom dashed_slur (Array<Offset> controls, Real thick, Real dash) const;
virtual Atom hairpin (Real width, bool decresc, bool continued) const;
- virtual Lookup* lookup_p (Lookup const&) const;
- virtual Lookup* lookup_p (Symtables const&) const;
- virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Header*, String) const;
- virtual Paper_stream* paper_stream_p () const;
virtual Atom plet (Real dy , Real dx, Direction dir) const;
virtual Atom ps_beam (Real slope, Real width, Real thick) const;
virtual Atom slur (Array<Offset> controls) const;
virtual Atom stem (Real y1, Real y2) const;
virtual Atom text (String style, String text) const;
- virtual String unknown_str () const;
virtual Atom vbracket (Real &y) const;
};
--- /dev/null
+/*
+ ps-score.hh -- declare Ps_score
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Jan Nieuwenhuizen <jannneke@gnu.org>
+*/
+
+#ifndef PS_SCORE_HH
+#define PS_SCORE_HH
+
+#include "p-score.hh"
+
+class Ps_score : public Paper_score
+{
+public:
+ virtual Paper_outputter* paper_outputter_p (Paper_stream*) const;
+ virtual Paper_stream* paper_stream_p () const;
+};
+
+#endif // PS_SCORE_HH
--- /dev/null
+/*
+ tex-def.hh -- declare Tex_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Jan Nieuwenhuizen <jannneke@gnu.org>
+*/
+
+#ifndef TEX_DEF_HH
+#define TEX_DEF_HH
+
+#include "paper-def.hh"
+
+class Tex_def : public Paper_def
+{
+public:
+ VIRTUAL_COPY_CONS (Tex_def, Paper_def);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ virtual String dimension_str (Real r) const;
+ virtual Lookup* lookup_p (Lookup const&) const;
+ virtual Lookup* lookup_p (Symtables const&) const;
+
+ virtual String output_settings_str () const;
+ virtual Paper_score* paper_score_p () const;
+ virtual String unknown_str () const;
+};
+
+#endif // TEX_DEF_HH
virtual Atom* atom_p (String, int, Box) const;
Atom embed (Atom a) const;
virtual Atom hairpin (Real width, bool decresc, bool continued) const;
- virtual Lookup* lookup_p (Lookup const&) const;
- virtual Lookup* lookup_p (Symtables const&) const;
- virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Header*, String) const;
- virtual Paper_stream* paper_stream_p () const;
virtual Atom plet (Real dy , Real dx, Direction dir) const;
- virtual String print_dimen (Real) const;
virtual Atom ps_beam (Real slope, Real width, Real thick) const;
virtual Atom slur (Array<Offset> controls) const;
virtual Atom stem (Real y1, Real y2) const;
virtual Atom text (String style, String text) const;
- virtual String unknown_str () const;
virtual Atom vbracket (Real &y) const;
};
--- /dev/null
+/*
+ tex-score.hh -- declare Tex_score
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Jan Nieuwenhuizen <jannneke@gnu.org>
+*/
+
+#ifndef TEX_SCORE_HH
+#define TEX_SCORE_HH
+
+#include "p-score.hh"
+
+class Tex_score : public Paper_score
+{
+public:
+ virtual Paper_outputter* paper_outputter_p (Paper_stream*) const;
+ virtual Paper_stream* paper_stream_p () const;
+};
+
+#endif // TEX_SCORE_HH
source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "line-spacer.hh"
-Line_spacer::Line_spacer()
+Line_spacer::Line_spacer ()
{
- paper_l_ =0;
-}
-Paper_def*
-Line_spacer::paper_l() const
-{
- return paper_l_ ;
+ paper_l_ = 0;
}
Line_spacer::~Line_spacer ()
{
}
+
+Paper_def*
+Line_spacer::paper_l () const
+{
+ return paper_l_;
+}
+
return s;
}
-String
-Lookup::base_output_str () const
-{
- assert (paper_l_);
- String str = paper_l_->get_default_output ();
-
- if (str.empty_b ())
- {
- str = default_outname_base_global;
- int def = paper_l_->get_next_default_count ();
- if (def)
- str += "-" + to_str (def);
- }
- return str;
-}
Atom
Lookup::beam (Real slope, Real width, Real thick) const
String
Lookup::print_dimen (Real r) const
{
- String s = to_str (r, "%.3f");
- if (s.index_i ("NaN") != -1)
- {
- warning (_ ("NaN"));
- s = "0.0";
- }
- return s;
+ return paper_l_->dimension_str (r);
}
Atom
#include "config.hh"
#include "file-results.hh"
#include "debug.hh"
+#include "ps-def.hh"
+#include "tex-def.hh"
#include "ps-lookup.hh"
#include "tex-lookup.hh"
Tex_lookup tex_lookup;
Lookup* global_lookup_l = &tex_lookup;
+Ps_def ps_def;
+Tex_def tex_def;
+Paper_def* global_paper_l = &tex_def;
+
bool experimental_features_global_b = false;
bool dependency_global_b = false;
case 't':
experimental_features_global_b = true;
global_lookup_l = &ps_lookup;
+ global_paper_l = &ps_def;
break;
case 'o':
outname_str = oparser.optional_argument_ch_C_;
return g;
}
+Paper_def*
+Music_output_def::paper_l ()
+{
+ return 0;
+}
+
+Paper_score*
+Music_output_def::paper_score_p () const
+{
+ return 0;
+}
+
void
Music_output_def::print () const
{
My_lily_parser::default_paper_p ()
{
Identifier *id = lexer_p_->lookup_identifier ("$defaultpaper");
- return id ? id->access_Paper_def () : new Paper_def ;
+ return id ? id->access_Paper_def () : (Paper_def*)global_paper_l->clone ();
}
Midi_def*
#endif
}
+String
+Paper_score::base_output_str () const
+{
+ assert (paper_l_);
+ String str = paper_l_->get_default_output ();
+
+ if (str.empty_b ())
+ {
+ str = default_outname_base_global;
+ int def = paper_l_->get_next_default_count ();
+ if (def)
+ str += "-" + to_str (def);
+ }
+ return str;
+}
+
void
Paper_score::typeset_element (Score_element * elem_p)
{
Array<Column_x_positions> breaking = calc_breaking ();
- Paper_stream* paper_stream_p = global_lookup_l->paper_stream_p ();
- outputter_l_ = global_lookup_l->paper_outputter_p (paper_stream_p, paper_l_, header_l_, origin_str_);
+ Paper_stream* pstream_p = paper_stream_p ();
+ outputter_l_ = paper_outputter_p (pstream_p);
Link_array<Line_of_score> lines;
for (int i=0; i < breaking.size (); i++)
// huh?
delete outputter_l_;
- delete paper_stream_p;
+ delete pstream_p;
outputter_l_ = 0;
}
#include "scope.hh"
#include "assoc.hh"
#include "assoc-iter.hh"
+#include "dimensions.hh"
+
+IMPLEMENT_IS_TYPE_B1 (Paper_def, Music_output_def);
+
+int Paper_def::default_count_i_ = 0;
Paper_def::Paper_def ()
{
lookup_p_assoc_p_ = new Assoc<int, Lookup*>;
}
+Paper_def::Paper_def (Paper_def const&s)
+ : Music_output_def (s)
+{
+ lookup_p_assoc_p_ = new Assoc<int, Lookup*>;
+ for (Assoc_iter<int, Lookup*> ai(*s.lookup_p_assoc_p_); ai.ok (); ai++)
+ {
+ Lookup * l = lookup_p (*ai.val ());
+ l->paper_l_ = this;
+ set_lookup (ai.key(), l);
+ }
+}
Paper_def::~Paper_def ()
{
delete lookup_p_assoc_p_;
}
-Paper_def::Paper_def (Paper_def const&s)
- : Music_output_def (s)
+/**
+ Get the measure wide constant for arithmetic.
+
+ @see
+ John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
+ OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
+ The Ohio State University, 1987.
+
+ */
+Real
+Paper_def::arithmetic_constant (Moment d) const
{
- lookup_p_assoc_p_ = new Assoc<int, Lookup*>;
- for (Assoc_iter<int, Lookup*> ai(*s.lookup_p_assoc_p_); ai.ok (); ai++)
- {
- Lookup * l = global_lookup_l->lookup_p (*ai.val ());
- l->paper_l_ = this;
- set_lookup (ai.key(), l);
- }
+ return get_var ("arithmetic_basicspace") - log_2 (Moment (1,8) <? d);
+}
+
+Real
+Paper_def::arithmetic_spacing (Moment d ,Real k) const
+{
+ return (log_2 (d) + k)* get_var ("arithmetic_multiplier");
+}
+
+Real
+Paper_def::beam_thickness_f () const
+{
+ return get_var ("beam_thickness");
+}
+
+Real
+Paper_def::duration_to_dist (Moment d,Real k) const
+{
+ return arithmetic_spacing (d,k);
+}
+
+int
+Paper_def::get_next_default_count () const
+{
+ return default_count_i_ ++;
}
Real
return shape_int_a_[n];
}
-Real
-Paper_def::beam_thickness_f () const
-{
- return get_var ("beam_thickness");
-}
-
-Real
-Paper_def::linewidth_f () const
-{
- return get_var ("linewidth");
-}
-
-Real
-Paper_def::duration_to_dist (Moment d,Real k) const
-{
- return arithmetic_spacing (d,k);
-}
-
-
-/**
- Get the measure wide constant for arithmetic.
-
- @see
- John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
- OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
- The Ohio State University, 1987.
-
- */
-Real
-Paper_def::arithmetic_constant (Moment d) const
-{
- return get_var ("arithmetic_basicspace") - log_2 (Moment (1,8) <? d);
-}
-
-Real
-Paper_def::arithmetic_spacing (Moment d ,Real k) const
-{
- return (log_2 (d) + k)* get_var ("arithmetic_multiplier");
-}
-
Real
Paper_def::geometric_spacing (Moment d) const
{
return get_var ("basicspace") + get_var ("unitspace") * dur_f;
}
-void
-Paper_def::set_lookup (int i, Lookup*l)
-{
- if (lookup_p_assoc_p_->elem_b (i))
- {
- delete lookup_p_assoc_p_->elem (i);
- }
- l ->paper_l_ = this;
- (*lookup_p_assoc_p_)[i] = l;
-}
-
Real
Paper_def::interline_f () const
{
}
Real
-Paper_def::rule_thickness () const
+Paper_def::linewidth_f () const
{
- return get_var ("rulethickness");
+ return get_var ("linewidth");
}
Real
-Paper_def::staffline_f () const
+Paper_def::rule_thickness () const
{
return get_var ("rulethickness");
}
-Real
-Paper_def::staffheight_f () const
-{
- return get_var ("staffheight");
-}
-
Real
Paper_def::interbeam_f (int multiplicity_i) const
{
return get_var ("interline") /2.0 ;
}
+// urg, how c++ sucks
+// virtual_copy_cons wants these...
+
+// aarg, its even worse, Paper_def gets constructed via Identifier,
+// another input->output hardlink.
+Lookup*
+Paper_def::lookup_p (Lookup const& l) const
+{
+ // return 0;
+ return global_paper_l->lookup_p (l);
+}
+
+Lookup*
+Paper_def::lookup_p (Symtables const& s) const
+{
+ // return 0;
+ return global_paper_l->lookup_p (s);
+}
+
+String
+Paper_def::output_settings_str () const
+{
+ return "";
+}
+
Real
Paper_def::note_width () const
{
return get_var ("notewidth");
}
+Paper_def*
+Paper_def::paper_l ()
+{
+ return this;
+}
+
void
Paper_def::print () const
{
#endif
}
+String
+Paper_def::dimension_str (Real r) const
+{
+ return ::dimension_str (r);
+}
+
Lookup const *
Paper_def::lookup_l (int i) const
{
return (*lookup_p_assoc_p_)[i];
}
-IMPLEMENT_IS_TYPE_B1 (Paper_def, Music_output_def);
-
-String
-Paper_def::ps_output_settings_str () const
+void
+Paper_def::set_lookup (int i, Lookup*l)
{
- String s ("\n ");
- for (Assoc_iter<String,Identifier*> i (*scope_p_); i.ok (); i++)
- s += String ("/mudelapaper") + i.key ()
- + "{" + i.val ()->str () + "} bind def\n";
- s += *scope_p_->elem ("pssetting")->access_String ();
- return s;
+ if (lookup_p_assoc_p_->elem_b (i))
+ {
+ delete lookup_p_assoc_p_->elem (i);
+ }
+ l ->paper_l_ = this;
+ (*lookup_p_assoc_p_)[i] = l;
}
-String
-Paper_def::tex_output_settings_str () const
+Real
+Paper_def::staffline_f () const
{
- String s ("\n ");
- for (Assoc_iter<String,Identifier*> i (*scope_p_); i.ok (); i++)
- s += String ("\\def\\mudelapaper") + i.key ()
- + "{" + i.val ()->str () + "}\n";
- s += *scope_p_->elem ("texsetting")->access_String ();
- return s;
+ return get_var ("rulethickness");
}
-int Paper_def::default_count_i_ = 0;
-
-int
-Paper_def::get_next_default_count () const
+Real
+Paper_def::staffheight_f () const
{
- return default_count_i_ ++;
+ return get_var ("staffheight");
}
-
+String
+Paper_def::unknown_str () const
+{
+ return "";
+}
#include "paper-outputter.hh"
#include "paper-stream.hh"
+#include "paper-def.hh"
#include "molecule.hh"
#include "atom.hh"
#include "array.hh"
Array<String> a;
String r;
- a.push (global_lookup_l->print_dimen (a_off.y()));
- a.push (global_lookup_l->print_dimen (a_off.x()));
+ a.push (global_paper_l->dimension_str (a_off.y()));
+ a.push (global_paper_l->dimension_str (a_off.x()));
a.push (i->str_);
r += global_lookup_l->substitute_args (s, a);
*outstream_l_ << r;
#include "script-def.hh"
#include "symtable.hh"
#include "lookup.hh"
-#include "ps-lookup.hh"
-#include "tex-lookup.hh"
#include "misc.hh"
#include "my-lily-lexer.hh"
#include "paper-def.hh"
$$ = p;
}
| paper_def_body int '=' symtables { // ugh, what a syntax
- Lookup * l = global_lookup_l->lookup_p (*$4);
+ Lookup * l = THIS->default_paper_p ()->lookup_p (*$4);
$$->set_lookup ($2, l);
}
| paper_def_body STRING '=' simple_identifier_init ';' {
--- /dev/null
+/*
+ ps-def.cc -- implement Ps_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "assoc.hh"
+#include "assoc-iter.hh"
+#include "identifier.hh"
+#include "ps-def.hh"
+#include "ps-lookup.hh"
+#include "ps-score.hh"
+#include "scope.hh"
+
+IMPLEMENT_IS_TYPE_B1 (Ps_def, Paper_def);
+
+Lookup*
+Ps_def::lookup_p (Lookup const& l) const
+{
+ return new Ps_lookup (l);
+}
+
+Lookup*
+Ps_def::lookup_p (Symtables const& s) const
+{
+ return new Ps_lookup (s);
+}
+
+String
+Ps_def::output_settings_str () const
+{
+ String s ("\n ");
+ for (Assoc_iter<String,Identifier*> i (*scope_p_); i.ok (); i++)
+ s += String ("/mudelapaper") + i.key ()
+ + "{" + i.val ()->str () + "} bind def\n";
+ s += *scope_p_->elem ("pssetting")->access_String ();
+ return s;
+}
+
+Paper_score*
+Ps_def::paper_score_p () const
+{
+ return new Ps_score ();
+}
+
+String
+Ps_def::unknown_str () const
+{
+ return "unknown ";
+}
+
return a;
}
-Lookup*
-Ps_lookup::lookup_p (Lookup const& l) const
-{
- return new Ps_lookup (l);
-}
-
-Lookup*
-Ps_lookup::lookup_p (Symtables const& s) const
-{
- return new Ps_lookup (s);
-}
-
-Paper_outputter*
-Ps_lookup::paper_outputter_p (Paper_stream* os_p, Paper_def* paper_l, Header* header_l, String origin_str) const
-{
- if (header_global_p)
- *os_p << header_global_p->ps_string ();
-
- *os_p << _ ("\n% outputting Score, defined at: ") << origin_str << '\n';
-
- if (header_l)
- *os_p << header_l->ps_string ();
- *os_p << paper_l->ps_output_settings_str ();
-
- if (experimental_features_global_b)
- *os_p << "turnOnExperimentalFeatures\n";
-
- return new Ps_outputter (os_p);
-}
-
-Paper_stream*
-Ps_lookup::paper_stream_p () const
-{
-#if 1
- String outname = base_output_str ();
-#else
- String outname = "lelie";
-#endif
-
- if (outname != "-")
- outname += ".ps";
- *mlog << _f ("PostScript output to %s...",
- outname == "-" ? String ("<stdout>") : outname ) << endl;
- target_str_global_array.push (outname);
- return new Ps_stream (outname);
-}
-
Atom
Ps_lookup::plet (Real dy , Real dx, Direction dir) const
{
return Lookup::text (style, "(" + text + ")");
}
-String
-Ps_lookup::unknown_str () const
-{
- return "unknown ";
-}
-
Atom
Ps_lookup::vbracket (Real &y) const
{
--- /dev/null
+/*
+ ps-score.cc -- implement Ps_score
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "debug.hh"
+#include "file-results.hh"
+#include "header.hh"
+#include "main.hh"
+#include "paper-def.hh"
+#include "ps-stream.hh"
+#include "ps-outputter.hh"
+#include "ps-score.hh"
+
+Paper_outputter*
+Ps_score::paper_outputter_p (Paper_stream* os_p) const
+{
+ if (header_global_p)
+ *os_p << header_global_p->ps_string ();
+
+ *os_p << _ ("\n% outputting Score, defined at: ") << origin_str_ << '\n';
+
+ if (header_l_)
+ *os_p << header_l_->ps_string ();
+ *os_p << paper_l_->output_settings_str ();
+
+ if (experimental_features_global_b)
+ *os_p << "turnOnExperimentalFeatures\n";
+
+ return new Ps_outputter (os_p);
+}
+
+Paper_stream*
+Ps_score::paper_stream_p () const
+{
+ String outname = base_output_str ();
+
+ if (outname != "-")
+ outname += ".ps";
+ *mlog << _f ("PostScript output to %s...",
+ outname == "-" ? String ("<stdout>") : outname ) << endl;
+ target_str_global_array.push (outname);
+ return new Ps_stream (outname);
+}
+
#include "score-column.hh"
#include "command-request.hh"
#include "paper-def.hh"
+#include "main.hh"
Score_engraver::Score_engraver()
Score_engraver::do_add_processing ()
{
Translator_group::do_add_processing ();
- assert (output_def_l_->is_type_b (Paper_def::static_name ()));
+ //assert (output_def_l_->is_type_b (Paper_def::static_name ()));
+ // urg
+ pscore_p_ = output_def_l_->paper_score_p ();
+ // assert (pscore_p_);
+ // urg, via parser a Paper_def gets constructed
+ // this should never happen, but can't be prevented (Paper_def can't be
+ // abstract bo virtual_copy_cons etc.
+ if (!pscore_p_)
+ {
+ printf ("\nBRAAK\n");
+ output_def_l_ = global_paper_l->paper_l ()->clone ();
+ // pscore_p_ = output_def_l_->paper_score_p ();
+ pscore_p_ = global_paper_l->paper_score_p ();
+ pscore_p_->paper_l_ = global_paper_l->paper_l ();
+ }
+ else
+ pscore_p_->paper_l_ = output_def_l_->paper_l ();
+ assert (pscore_p_->paper_l_);
assert (!daddy_trans_l_);
- pscore_p_ = new Paper_score;
- pscore_p_->paper_l_ = (Paper_def*)output_def_l_;
}
parser.set_version_check (version_ignore_global_b);
parser.parse_file (init_str, file_str);
+#if 0
/*
urg
when calling {Ps,Tex}_lookup::paper_stream_p (),
(deleted without being reset maybe?)
*/
global_lookup_l->paper_l_ = parser.default_paper_p ();
+#endif
if (parser.error_level_i_)
{
#include "colhpos.hh"
Vector
-Spring_spacer::default_solution() const
+Spring_spacer::default_solution () const
{
- return try_initial_solution() ;
+ return try_initial_solution () ;
}
Score_column*
bool
Spring_spacer::contains_b (Paper_column const *w)
{
- for (int i=0; i< cols_.size(); i++)
+ for (int i=0; i< cols_.size (); i++)
if (cols_[i].pcol_l_ == w)
return true;
return false;
void
-Spring_spacer::OK() const
+Spring_spacer::OK () const
{
#ifndef NDEBUG
- for (int i = 1; i < cols_.size(); i++)
+ for (int i = 1; i < cols_.size (); i++)
assert (cols_[i].rank_i_ > cols_[i-1].rank_i_);
- for (int i = 1; i < loose_col_arr_.size(); i++)
+ for (int i = 1; i < loose_col_arr_.size (); i++)
assert (loose_col_arr_[i].rank_i_ > loose_col_arr_[i-1].rank_i_);
#endif
}
Make sure no unconnected columns happen.
*/
void
-Spring_spacer::handle_loose_cols()
+Spring_spacer::handle_loose_cols ()
{
- Union_find connected (cols_.size());
+ Union_find connected (cols_.size ());
Array<int> fixed;
- for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok (); i++)
+ for (PCursor<Idealspacing*> i (ideal_p_list_.top ()); i.ok (); i++)
{
connected.connect (i->left_i_,i->right_i_);
}
- for (int i = 0; i < cols_.size(); i++)
- if (cols_[i].fixed_b())
+ for (int i = 0; i < cols_.size (); i++)
+ if (cols_[i].fixed_b ())
fixed.push (i);
- for (int i=1; i < fixed.size(); i++)
+ for (int i=1; i < fixed.size (); i++)
connected.connect (fixed[i-1], fixed[i]);
- for (int i = cols_.size(); i--;)
+ for (int i = cols_.size (); i--;)
{
if (! connected.equiv (fixed[0], i))
{
loosen_column (i);
}
}
- OK();
+ OK ();
}
void
Spring_spacer::position_loose_cols (Vector &sol_vec) const
{
- if (!loose_col_arr_.size())
+ if (!loose_col_arr_.size ())
return ;
- assert (sol_vec.dim());
+ assert (sol_vec.dim ());
Array<bool> fix_b_arr;
- fix_b_arr.set_size (cols_.size() + loose_col_arr_.size ());
+ fix_b_arr.set_size (cols_.size () + loose_col_arr_.size ());
Real utter_right_f=-infinity_f;
Real utter_left_f =infinity_f;
- for (int i=0; i < loose_col_arr_.size(); i++)
+ for (int i=0; i < loose_col_arr_.size (); i++)
{
fix_b_arr[loose_col_arr_[i].rank_i_] = false;
}
- for (int i=0; i < cols_.size(); i++)
+ for (int i=0; i < cols_.size (); i++)
{
int r= cols_[i].rank_i_;
fix_b_arr[r] = true;
utter_right_f = utter_right_f >? sol_vec (i);
utter_left_f = utter_left_f <? sol_vec (i);
}
- Vector v (fix_b_arr.size());
+ Vector v (fix_b_arr.size ());
int j =0;
int k =0;
- for (int i=0; i < v.dim(); i++)
+ for (int i=0; i < v.dim (); i++)
{
if (fix_b_arr[i])
{
Real left_pos_f =
(j>0) ?sol_vec (j-1) : utter_left_f;
Real right_pos_f =
- (j < sol_vec.dim()) ? sol_vec (j) : utter_right_f;
+ (j < sol_vec.dim ()) ? sol_vec (j) : utter_right_f;
int left_rank = (j>0) ? cols_[j-1].rank_i_ : 0;
- int right_rank = (j<sol_vec.dim()) ? cols_[j].rank_i_ : sol_vec.dim ();
+ int right_rank = (j<sol_vec.dim ()) ? cols_[j].rank_i_ : sol_vec.dim ();
int d_r = right_rank - left_rank;
Column_info loose=loose_col_arr_[k++];
bool
Spring_spacer::check_constraints (Vector v) const
{
- int dim=v.dim();
- assert (dim == cols_.size());
+ int dim=v.dim ();
+ assert (dim == cols_.size ());
DOUT << "checking " << v;
for (int i=0; i < dim; i++)
{
- if (cols_[i].fixed_b() &&
- abs (cols_[i].fixed_position() - v (i)) > COLFUDGE)
+ if (cols_[i].fixed_b () &&
+ abs (cols_[i].fixed_position () - v (i)) > COLFUDGE)
{
DOUT << "Fixpos broken\n";
return false;
/** try to generate a solution which obeys the min distances and fixed positions
*/
Vector
-Spring_spacer::try_initial_solution() const
+Spring_spacer::try_initial_solution () const
{
Vector v;
if (!try_initial_solution_and_tell (v))
bool
Spring_spacer::try_initial_solution_and_tell (Vector &v) const
{
- int dim=cols_.size();
+ int dim=cols_.size ();
bool succeeded = true;
Vector initsol (dim);
for (int i=0; i < dim; i++)
{
Real min_x = i ? initsol (i-1) : cols_[0].fixed_position ();
- Array<Spacer_rod> const &sr_arr(cols_[i].rods_[LEFT]);
+ Array<Spacer_rod> const &sr_arr (cols_[i].rods_[LEFT]);
for (int j=0; j < sr_arr.size (); j++)
{
min_x = min_x >? (initsol (sr_arr[j].other_idx_) + sr_arr[j].distance_f_);
}
initsol (i) = min_x;
- if (cols_[i].fixed_b())
+ if (cols_[i].fixed_b ())
{
- initsol (i)=cols_[i].fixed_position();
+ initsol (i)=cols_[i].fixed_position ();
if (initsol (i) < min_x )
{
DOUT << "failing: init, min : " << initsol (i) << " " << min_x << '\n';
DOUT << "tried and told solution: " << v;
if (!succeeded)
- DOUT << "(failed)\n";
+ DOUT << " (failed)\n";
return succeeded;
}
lin.fill (0);
c = 0;
- for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok (); i++)
+ for (PCursor<Idealspacing*> i (ideal_p_list_.top ()); i.ok (); i++)
{
int l = i->left_i_;
int r = i->right_i_;
c += sqr (i->space_f_);
}
- if (quad.dim() > 10)
- quad.set_band();
+ if (quad.dim () > 10)
+ quad.set_band ();
}
void
Spring_spacer::set_fixed_cols (Mixed_qp &qp) const
{
- for (int j=0; j < cols_.size(); j++)
- if (cols_[j].fixed_b())
- qp.add_fixed_var (j,cols_[j].fixed_position());
+ for (int j=0; j < cols_.size (); j++)
+ if (cols_[j].fixed_b ())
+ qp.add_fixed_var (j,cols_[j].fixed_position ());
}
// put the constraints into the LP problem
void
Spring_spacer::make_constraints (Mixed_qp& lp) const
{
- int dim=cols_.size();
+ int dim=cols_.size ();
for (int j=0; j < dim -1; j++)
{
Array<Spacer_rod> const&rod_arr (cols_[j].rods_[RIGHT]);
for (int i = 0; i < rod_arr.size (); i++)
{
- Vector c1(dim);
- c1(rod_arr[i].other_idx_)=1.0 ;
- c1(j)=-1.0 ;
+ Vector c1 (dim);
+ c1 (rod_arr[i].other_idx_)=1.0 ;
+ c1 (j)=-1.0 ;
lp.add_inequality_cons (c1, rod_arr[i].distance_f_);
}
Spring_spacer::calculate_energy_f (Vector solution) const
{
Real e = 0.0;
- for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok(); i++)
+ for (PCursor<Idealspacing*> i (ideal_p_list_.top ()); i.ok (); i++)
{
- e += i->energy_f(solution(i->right_i_) - solution(i->left_i_));
+ e += i->energy_f (solution (i->right_i_) - solution (i->left_i_));
}
return e;
void
Spring_spacer::lower_bound_solution (Column_x_positions*positions) const
{
- Mixed_qp lp (cols_.size());
+ Mixed_qp lp (cols_.size ());
make_matrices (lp.quad_,lp.lin_, lp.const_term_);
set_fixed_cols (lp);
- Vector start (cols_.size());
+ Vector start (cols_.size ());
start.fill (0.0);
Vector solution_vec (lp.solve (start));
bool constraint_satisfaction = try_initial_solution_and_tell (solution_try);
if (constraint_satisfaction)
{
- Mixed_qp lp (cols_.size());
+ Mixed_qp lp (cols_.size ());
make_matrices (lp.quad_,lp.lin_, lp.const_term_);
make_constraints (lp);
set_fixed_cols (lp);
position_loose_cols (solution_vec);
positions->energy_f_ = calculate_energy_f (solution_vec);
positions->config = solution_vec;
- positions->error_col_l_arr_ = error_pcol_l_arr();
+ positions->error_col_l_arr_ = error_pcol_l_arr ();
}
else
{
void
Spring_spacer::add_column (Paper_column *col, bool fixed, Real fixpos)
{
- Column_info c (col,(fixed)? &fixpos : 0);
- int this_rank = cols_.size();
+ Column_info c (col, (fixed)? &fixpos : 0);
+ int this_rank = cols_.size ();
c.rank_i_ = this_rank;
for (int i=0; i < col->minimal_dists_arr_drul_[LEFT].size (); i++)
}
Line_of_cols
-Spring_spacer::error_pcol_l_arr() const
+Spring_spacer::error_pcol_l_arr () const
{
Array<Paper_column*> retval;
- for (int i=0; i< cols_.size(); i++)
+ for (int i=0; i< cols_.size (); i++)
if (cols_[i].ugh_b_)
retval.push (cols_[i].pcol_l_);
- for (int i=0; i < loose_col_arr_.size(); i++)
+ for (int i=0; i < loose_col_arr_.size (); i++)
{
retval.push (loose_col_arr_[i].pcol_l_);
}
Spring_spacer::loosen_column (int i)
{
Column_info c=cols_.get (i);
- for (PCursor<Idealspacing*> j (ideal_p_list_.top()); j.ok (); j++)
+ for (PCursor<Idealspacing*> j (ideal_p_list_.top ()); j.ok (); j++)
{
if (j->left_i_ == i|| j->right_i_ == i)
- j.del();
+ j.del ();
else
j++;
}
c.ugh_b_ = true;
int j=0;
- for (; j < loose_col_arr_.size(); j++)
+ for (; j < loose_col_arr_.size (); j++)
{
if (loose_col_arr_[j].rank_i_ > c.rank_i_)
break;
void
-Spring_spacer::print() const
+Spring_spacer::print () const
{
#ifndef NPRINT
- for (int i=0; i < cols_.size(); i++)
+ for (int i=0; i < cols_.size (); i++)
{
DOUT << "col " << i << " ";
- cols_[i].print();
+ cols_[i].print ();
}
- for (PCursor<Idealspacing*> i (ideal_p_list_.top()); i.ok (); i++)
+ for (PCursor<Idealspacing*> i (ideal_p_list_.top ()); i.ok (); i++)
{
- i->print();
+ i->print ();
}
#endif
}
void
Spring_spacer::connect (int i, int j, Real d, Real h)
{
- assert(d >= 0 && d <= 100 CM);
- assert(h >=0);
+ assert (d >= 0 && d <= 100 CM);
+ assert (h >=0);
Idealspacing * s = new Idealspacing;
s->space_f_ = d;
s->hooke_f_ = h;
- ideal_p_list_.bottom().add (s);
+ ideal_p_list_.bottom ().add (s);
}
void
-Spring_spacer::prepare()
+Spring_spacer::prepare ()
{
DOUT << "Preparing..";
- calc_idealspacing();
- handle_loose_cols();
- print();
+ calc_idealspacing ();
+ handle_loose_cols ();
+ print ();
DOUT << "finished preparing.\n";
}
Line_spacer*
-Spring_spacer::constructor()
+Spring_spacer::constructor ()
{
return new Spring_spacer;
}
/**
get the shortest_playing running note at a time. */
void
-Spring_spacer::get_ruling_durations(Array<Moment> &shortest_playing_arr,
+Spring_spacer::get_ruling_durations (Array<Moment> &shortest_playing_arr,
Array<Moment> &context_shortest_arr)
{
- for (int i=0; i < cols_.size(); i++)
+ for (int i=0; i < cols_.size (); i++)
{
- scol_l (i)->preprocess();
+ scol_l (i)->preprocess ();
scol_l (i)->print ();
}
int start_context_i=0;
Moment context_shortest;
context_shortest.set_infinite (1);
- context_shortest_arr.set_size(cols_.size());
+ context_shortest_arr.set_size (cols_.size ());
- for (int i=0; i < cols_.size(); i++)
+ for (int i=0; i < cols_.size (); i++)
{
- Moment now = scol_l (i)->when();
+ Moment now = scol_l (i)->when ();
Moment shortest_playing;
shortest_playing.set_infinite (1);
start_context_i = i;
context_shortest.set_infinite (1);
}
- if (scol_l (i)->durations.size())
+ if (scol_l (i)->durations.size ())
{
- context_shortest = context_shortest <? scol_l(i)->durations[0];
+ context_shortest = context_shortest <? scol_l (i)->durations[0];
}
// ji was j, but triggered ICE
for (int ji=i+1; ji --;)
{
- if (scol_l(ji)->durations.size() &&
- now - scol_l(ji)->when() >= shortest_playing)
+ if (scol_l (ji)->durations.size () &&
+ now - scol_l (ji)->when () >= shortest_playing)
break;
- for (int k = scol_l (ji)->durations.size();
- k-- && scol_l(ji)->durations[k] + scol_l(ji)->when() > now;
+ for (int k = scol_l (ji)->durations.size ();
+ k-- && scol_l (ji)->durations[k] + scol_l (ji)->when () > now;
)
{
- shortest_playing = shortest_playing <? scol_l(ji)->durations[k];
+ shortest_playing = shortest_playing <? scol_l (ji)->durations[k];
}
}
- shortest_playing_arr.push(shortest_playing);
+ shortest_playing_arr.push (shortest_playing);
}
#ifndef NPRINT
DOUT << "shortest_playing/:[ ";
- for (int i=0; i < shortest_playing_arr.size(); i++)
+ for (int i=0; i < shortest_playing_arr.size (); i++)
{
DOUT << shortest_playing_arr[i] << " ";
DOUT << context_shortest_arr[i] << ", ";
*/
void
-Spring_spacer::calc_idealspacing()
+Spring_spacer::calc_idealspacing ()
{
Array<Moment> shortest_playing_arr;
Array<Moment> context_shortest_arr;
- get_ruling_durations(shortest_playing_arr, context_shortest_arr);
+ get_ruling_durations (shortest_playing_arr, context_shortest_arr);
Real interline_f = paper_l ()->interline_f ();
Array<Real> ideal_arr_;
Array<Real> hooke_arr_;
- for (int i=0; i < cols_.size() - 1; i++){
+ for (int i=0; i < cols_.size () - 1; i++){
ideal_arr_.push (-1.0);
hooke_arr_.push (1.0);
}
/*
First do all non-musical columns
*/
- for (int i=0; i < cols_.size(); i++)
+ for (int i=0; i < cols_.size (); i++)
{
- if (!scol_l (i)->musical_b() && i+1 < cols_.size())
+ if (!scol_l (i)->musical_b () && i+1 < cols_.size ())
{
Real symbol_distance =cols_[i].width_[RIGHT] + 2 PT;
Real durational_distance = 0;
- Moment delta_t = scol_l (i+1)->when() - scol_l (i)->when () ;
+ Moment delta_t = scol_l (i+1)->when () - scol_l (i)->when () ;
/*
*/
if (delta_t)
{
- Real k= paper_l()->arithmetic_constant (context_shortest_arr[i]);
- durational_distance = paper_l()->duration_to_dist (delta_t,k);
+ Real k= paper_l ()->arithmetic_constant (context_shortest_arr[i]);
+ durational_distance = paper_l ()->duration_to_dist (delta_t,k);
}
symbol_distance += -cols_[i+1].width_[LEFT];
/*
Then musicals
*/
- for (int i=0; i < cols_.size(); i++)
+ for (int i=0; i < cols_.size (); i++)
{
- if (scol_l (i)->musical_b())
+ if (scol_l (i)->musical_b ())
{
Moment shortest_playing_len = shortest_playing_arr[i];
Moment context_shortest = context_shortest_arr[i];
if (! shortest_playing_len)
{
warning (_f ("can't find a ruling note at %s",
- scol_l (i)->when().str ()));
+ scol_l (i)->when ().str ()));
shortest_playing_len = 1;
}
if (! context_shortest)
{
warning (_f ("no minimum in measure at %s",
- scol_l (i)->when().str ()));
+ scol_l (i)->when ().str ()));
context_shortest = 1;
}
- Moment delta_t = scol_l (i+1)->when() - scol_l (i)->when ();
- Real k= paper_l()->arithmetic_constant(context_shortest);
- Real dist = paper_l()->duration_to_dist (shortest_playing_len, k);
- dist *= (double)(delta_t / shortest_playing_len);
+ Moment delta_t = scol_l (i+1)->when () - scol_l (i)->when ();
+ Real k= paper_l ()->arithmetic_constant (context_shortest);
+ Real dist = paper_l ()->duration_to_dist (shortest_playing_len, k);
+ dist *= (double) (delta_t / shortest_playing_len);
/*
According to [Ross] and [Wanske], and from what i've seen:
/*
last musical column of bar
*/
- if (i + 1 < cols_.size () && scol_l(i+1)->breakable_b_)
+ if (i + 1 < cols_.size () && scol_l (i+1)->breakable_b_)
{
// hmm, how bout?
dist = dist >? interline_f;
}
}
- for (int i=0; i < ideal_arr_.size(); i++)
+ for (int i=0; i < ideal_arr_.size (); i++)
{
assert (ideal_arr_[i] >=0 && hooke_arr_[i] >=0);
connect (i, i+1, ideal_arr_[i], hooke_arr_[i]);
--- /dev/null
+/*
+ tex-def.cc -- implement Tex_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "assoc.hh"
+#include "assoc-iter.hh"
+#include "identifier.hh"
+#include "scope.hh"
+#include "tex-def.hh"
+#include "tex-lookup.hh"
+#include "tex-score.hh"
+
+IMPLEMENT_IS_TYPE_B1 (Tex_def, Paper_def);
+
+String
+Tex_def::dimension_str (Real r) const
+{
+ return Paper_def::dimension_str (r) + "pt";
+}
+
+Lookup*
+Tex_def::lookup_p (Lookup const& l) const
+{
+ return new Tex_lookup (l);
+}
+
+Lookup*
+Tex_def::lookup_p (Symtables const& s) const
+{
+ return new Tex_lookup (s);
+}
+
+String
+Tex_def::output_settings_str () const
+{
+ String s ("\n ");
+ for (Assoc_iter<String,Identifier*> i (*scope_p_); i.ok (); i++)
+ s += String ("\\def\\mudelapaper") + i.key ()
+ + "{" + i.val ()->str () + "}\n";
+ s += *scope_p_->elem ("texsetting")->access_String ();
+ return s;
+}
+
+Paper_score*
+Tex_def::paper_score_p () const
+{
+ return new Tex_score ();
+}
+
+String
+Tex_def::unknown_str () const
+{
+ return "\\unknown";
+}
+
return embed (Ps_lookup::plet (dy, dx, dir));
}
-Lookup*
-Tex_lookup::lookup_p (Lookup const& l) const
-{
- return new Tex_lookup (l);
-}
-
-Lookup*
-Tex_lookup::lookup_p (Symtables const& s) const
-{
- return new Tex_lookup (s);
-}
-
-Paper_outputter*
-Tex_lookup::paper_outputter_p (Paper_stream* os_p, Paper_def* paper_l, Header* header_l, String origin_str) const
-{
- if (header_global_p)
- *os_p << header_global_p->tex_string ();
-
- *os_p << _ ("\n% outputting Score, defined at: ") << origin_str << '\n';
-
- if (header_l)
- *os_p << header_l->tex_string();
- *os_p << paper_l->tex_output_settings_str ();
-
- if (experimental_features_global_b)
- *os_p << "\\turnOnExperimentalFeatures%\n";
-
- *os_p << "\\turnOnPostScript%\n";
-
- return new Tex_outputter (os_p);
-}
-
-Paper_stream *
-Tex_lookup::paper_stream_p () const
-{
-#if 1
- String outname = base_output_str ();
-#else
- String outname = "lelie";
-#endif
-
- Paper_stream* p;
- if (outname != "-")
- outname += ".tex";
- *mlog << _f ("TeX output to %s...",
- outname == "-" ? String ("<stdout>") : outname ) << endl;
- p = new Tex_stream (outname);
- target_str_global_array.push (outname);
- return p;
-}
-
-String
-Tex_lookup::print_dimen (Real r) const
-{
- String s = to_str (r, "%.3f");
- if (s.index_i ("NaN") != -1)
- {
- warning (_ ("NaN"));
- s = "0.0";
- }
- return Lookup::print_dimen (r) + "pt";
-}
-
Atom
Tex_lookup::ps_beam (Real slope, Real width, Real thick) const
{
return Lookup::text (style, text);
}
-String
-Tex_lookup::unknown_str () const
-{
- return "\\unknown";
-}
-
Atom
Tex_lookup::vbracket (Real &y) const
{
--- /dev/null
+/*
+ tex-score.cc -- implement Tex_score
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "debug.hh"
+#include "file-results.hh"
+#include "header.hh"
+#include "main.hh"
+#include "paper-def.hh"
+#include "tex-stream.hh"
+#include "tex-outputter.hh"
+#include "tex-score.hh"
+
+Paper_outputter*
+Tex_score::paper_outputter_p (Paper_stream* os_p) const
+{
+ if (header_global_p)
+ *os_p << header_global_p->tex_string ();
+
+ *os_p << _ ("\n% outputting Score, defined at: ") << origin_str_ << '\n';
+
+ if (header_l_)
+ *os_p << header_l_->tex_string();
+ *os_p << paper_l_->output_settings_str ();
+
+ if (experimental_features_global_b)
+ *os_p << "\\turnOnExperimentalFeatures%\n";
+
+ *os_p << "\\turnOnPostScript%\n";
+
+ return new Tex_outputter (os_p);
+}
+
+Paper_stream *
+Tex_score::paper_stream_p () const
+{
+ String outname = base_output_str ();
+
+ Paper_stream* p;
+ if (outname != "-")
+ outname += ".tex";
+ *mlog << _f ("TeX output to %s...",
+ outname == "-" ? String ("<stdout>") : outname ) << endl;
+ p = new Tex_stream (outname);
+ target_str_global_array.push (outname);
+ return p;
+}
+
1.0.13.jcn4
1.0.13.jcn5
1.0.14
+1.0.14.jcn1