+pl 33.uu2
+ - some performance cleanups: junked PointerList instance, plugged some leaks.
+ - style -> fontname now in scheme.
+ - minor Score_element brainsurgery:
+ * generic element properties.
+ * junked Score_element::junk_links, Score_element::unlink
+ * junked Directed_graph_node as superclass of
+Score_element, this should reduce mem usage a bit.
+
+pl 33.jcn2
+ - fixed autobeamer's beam->unlink ()
+
+pl 33.jcn1
+ - allow autobeaming according to duration iso (crude) multiplicity
+
+pl 33.jbr1
+ - change my email address
+ - Windows platform does a cp -r instead of a ln -s
+
+pl 33.uu1
+ - bf: ^ and _
+ - junked poor man's dynamics.
+
+*********
+pl 33
+
pl 32.mb1
- bf: \> and \< were interchanged!!
- Added property: textScriptPadding
#include "axis-group-element.hh"
#include "graphical-axis-group.hh"
-void
-Axis_group_element::do_unlink()
-{
- remove_all();
-}
-
-void
-Axis_group_element::do_junk_links()
-{
- elem_l_arr_.set_size (0);
-}
Link_array<Score_element>
{
my_item->transparent_b_ = true;
my_item->set_empty (true);
- /*my_item->unlink ();
- delete my_item;*/
}
}
staff_side_p_->padding_f_ = Real(padding);
}
- staff_side_p_->visibility_lambda_ = visibility_lambda_;
- text_p_->visibility_lambda_ = visibility_lambda_;
+
+ staff_side_p_->set_elt_property (ly_symbol ("visibility_lambda"),
+ visibility_lambda_);
+ text_p_->set_elt_property (ly_symbol ("visibility_lambda"),
+ visibility_lambda_);
announce_element (Score_element_info (text_p_, rq));
announce_element (Score_element_info (staff_side_p_, rq));
(c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include "lily-guile.hh"
#include "span-bar.hh"
#include "base-span-bar-engraver.hh"
#include "vertical-align-spanner.hh"
*/
{
spanbar_p_ = get_span_bar_p();
+ String visnam = String(name()) + "_visibility";
+
+ spanbar_p_->set_elt_property (ly_symbol ("visibility_lambda"),
+ gh_eval_str (visnam.ch_C()));
if (use_priority_b_)
{
Real r = do_height ()[octave_dir_] + g->extent (Y_AXIS)[-octave_dir_];
g->dim_cache_[Y_AXIS].set_offset (r);
}
+
if (default_b_)
{
- visibility_lambda_ = defvis;
+ set_elt_property (ly_symbol ("visibility_lambda"),
+ defvis);
+
if (g)
- g->visibility_lambda_ = defvis;
+ g->set_elt_property (ly_symbol ("visibility_lambda"),
+ defvis);
}
}
-
-
}
-
-
-
-
Molecule*
Clef_item::do_brew_molecule_p() const
{
#include "font-size-engraver.hh"
#include "score-element.hh"
+#include "lily-guile.hh"
Font_size_engraver::Font_size_engraver ()
{
void
Font_size_engraver::acknowledge_element (Score_element_info e)
{
- e.elem_l_->size_i_ = size_i_;
+ e.elem_l_->set_elt_property (ly_symbol ("fontsize"),
+ gh_int2scm (size_i_));
}
ADD_THIS_TRANSLATOR (Font_size_engraver);
return d->get_dim ();
}
-void
-Graphical_element::unlink ()
-{
- for (int a=X_AXIS; a < NO_AXES; a++)
- if (Dimension_cache * d = dim_cache_[a].parent_l_)
- {
- if (Graphical_axis_group * eg
- = dynamic_cast<Graphical_axis_group*> (d->elt_l_))
- eg->remove_element (this);
- }
-}
-
-void
-Graphical_element::junk_links ()
-{
-}
void
Graphical_element::do_print () const
#include "lily-proto.hh"
#include "moment.hh"
#include "pcursor.hh"
-
+#include "audio-element.hh"
/**
generic audio grouped vertically.
*/
-class Audio_column {
+class Audio_column : public Audio_element {
public:
Audio_column (Moment at_mom);
protected:
virtual void do_print() const;
virtual Link_array<Score_element> get_extra_dependencies() const;
- virtual void do_unlink();
- virtual void do_junk_links();
public:
virtual Link_array<Score_element> elem_l_arr() const;
virtual void do_breakable_col_processing();
void OK() const;
virtual void do_print() const;
- virtual void do_junk_links() {
- Item::do_junk_links();
- Axis_group_element::do_junk_links();
- }
- virtual void do_unlink() {
- Item::do_unlink();
- Axis_group_element::do_unlink();
- }
-public:
-
};
#endif // AXIS_ITEM_HH
{
void do_break_processing_if_unbroken();
protected:
- virtual void do_junk_links () {
- Spanner::do_junk_links();
- Axis_group_element::do_junk_links();
- }
- virtual void do_unlink() {
- Spanner::do_unlink();
- Axis_group_element::do_unlink();
- }
virtual void do_break_processing();
virtual void do_print() const;
Graphical_element *parent_l (Axis a) const;
- void unlink ();
- void junk_links ();
virtual void do_print () const;
protected:
virtual Interval do_height () const=0;
*/
class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element {
protected:
- virtual void do_unlink () {
- Axis_group_item::do_unlink ();
- }
- virtual void do_junk_links() {
- Axis_group_item::do_junk_links();
- }
virtual void do_print() const;
public:
Horizontal_group_item ();
class Horizontal_vertical_group_item : public Axis_group_item, public Horizontal_vertical_group_element {
protected:
virtual void do_print() const;
- virtual void do_unlink () {
- Axis_group_item::do_unlink ();
- }
VIRTUAL_COPY_CONS(Score_element);
public:
Horizontal_vertical_group_item ();
NB. This doesn't mean an Item has to initialize the output field before
spacing calculation.
-*/
+
+
+ @signature
+ visibility_lambda :: int -> (bool . bool)
+
+ @in
+ break direction
+
+ @out
+ (transparent, empty) cons
+
+ */
class Item : public virtual Score_element {
void do_break ();
void try_visibility_lambda ();
Drul_array<Item*> broken_to_drul_;
Item *unbroken_original_l_;
- /**
-
- visibility_lambda :: int -> (bool . bool)
-
- @in
- break direction
-
- @out
- (transparent, empty) cons
-
- */
- Protected_scm visibility_lambda_;
/// should be put in a breakable col.
bool breakable_b_;
- /// I am really to be broken?
+ /// I am really to be broken?
virtual bool breakable_b () const;
Direction break_status_dir_;
Item (Item const &);
protected:
- virtual void do_unlink ();
- virtual void do_junk_links();
- virtual void do_breakable_col_processing();
+ virtual void do_breakable_col_processing();
virtual void handle_prebroken_dependencies();
virtual void do_print() const;
virtual bool linked_b() const;
protected:
virtual Link_array<Score_element> get_extra_dependencies () const;
- virtual void do_unlink ();
- virtual void do_junk_links ();
virtual Interval do_width() const;
virtual void do_print() const;
#ifndef MIDI_ITEM_HH
#define MIDI_ITEM_HH
+#include "cons.hh"
#include "string.hh"
#include "lily-proto.hh"
#include "proto.hh"
-#include "plist.hh"
-#include "virtual-methods.hh"
#include "moment.hh"
/**
Maybe use base classes for RIFF files?
*/
struct Midi_item {
-
Midi_item (Audio_item* audio_item_l);
virtual ~Midi_item ();
static String i2varint_str (int i);
};
struct Midi_duration : public Midi_item {
-
Midi_duration (Real seconds_f);
virtual String str () const;
};
struct Midi_header : Midi_chunk {
-
-
Midi_header (int format_i, int tracks_i, int clocks_per_4_i);
};
Change instrument event
*/
struct Midi_instrument : public Midi_item {
-
Midi_instrument (int channel_i, String instrument_str);
virtual String str () const;
struct Midi_key : public Midi_item {
-
Midi_key (Audio_item* audio_item_l);
virtual String str () const;
};
struct Midi_time_signature : Midi_item {
-
-
Midi_time_signature (Audio_item* audio_item_l);
virtual String str () const;
Turn a note on (blond).
*/
struct Midi_note : public Midi_item {
-
Midi_note (Audio_item* audio_item_l);
Moment length_mom () const;
Turn a note off (dark).
*/
struct Midi_note_off : public Midi_item {
-
Midi_note_off (Midi_note*);
int pitch_i () const;
};
struct Midi_tempo : Midi_item {
-
Midi_tempo (int per_minute_4_i);
Midi_tempo (Audio_item* audio_item_l);
};
struct Midi_track : Midi_chunk {
-
int number_i_;
- Pointer_list<Midi_event*> event_p_list_;
-
+ Cons_list<Midi_event> event_p_list_;
+
Midi_track ();
~Midi_track ();
/// Midi outputfile
struct Midi_stream {
- Midi_stream (String filename_str);
- ~Midi_stream();
+ Midi_stream (String filename_str);
+ ~Midi_stream();
- Midi_stream& operator <<( String str);
- Midi_stream& operator <<( Midi_item const& mitem_c_r);
- Midi_stream& operator <<( int i);
+ Midi_stream& operator <<( String str);
+ Midi_stream& operator <<( Midi_item const& mitem_c_r);
+ Midi_stream& operator <<( int i);
- void open();
+ void open();
- ostream* os_p_;
- String filename_str_;
+ ostream* os_p_;
+ String filename_str_;
};
#endif // MIDI_STREAM_HH
#ifndef PERFORMANCE_HH
#define PERFORMANCE_HH
+#include "parray.hh"
#include "lily-proto.hh"
-#include "plist.hh"
+#include "cons.hh"
#include "music-output.hh"
/** all stuff which goes onto midi. notes, signs, symbols in a score
class Performance : public Music_output {
public:
Performance ();
- ~Performance () {}
+ ~Performance ();
void add_column (Audio_column*);
void add_staff (Audio_staff* l);
void print() const;
void process();
- Pointer_list<Audio_column*> audio_column_p_list_;
- Link_list<Audio_staff*> audio_staff_l_list_;
- Pointer_list<Audio_element*> audio_elem_p_list_;
+
+ Link_array<Audio_staff> audio_staff_l_arr_;
+ Cons<Audio_element> *audio_elem_p_list_;
Midi_def * midi_l_;
};
#include "virtual-methods.hh"
#include "directed-graph.hh"
#include "graphical-element.hh"
-
+#include "protected-scm.hh"
typedef void (Score_element::*Score_element_method_pointer) (void);
form an acyclic graph.
(elem) */
-class Score_element : private Directed_graph_node, public virtual Graphical_element {
+class Score_element : public virtual Graphical_element {
+ Protected_scm element_property_alist_;
+ Link_array<Score_element> dependency_arr_;
+
public:
/// delete after linebreak calculation.
bool break_helper_only_b_;
Score_element ();
Score_element (Score_element const&);
virtual void print () const;
-
+
+ SCM get_elt_property (SCM sym);
+ void set_elt_property (SCM sym, SCM val);
+
Paper_def *paper () const;
Lookup const *lookup_l () const;
virtual ~Score_element ();
-
-
void add_processing ();
- /**
- Remove all links (dependencies, dependents, Axis_group_elements.
- */
- void unlink ();
void substitute_dependency (Score_element*,Score_element*);
void remove_dependency (Score_element*);
/**
/// do not print anything black
bool transparent_b_;
- int size_i_;
-
// ugh: no protection. Denk na, Vrij Veilig
void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
-protected:
+public:
/**
Administration: Where are we?. This is mainly used by Super_element and
Score_element::calcalute_dependencies ()
-1 means deleted
*/
-public:
int status_i_;
+
protected:
Score_element* dependency (int) const;
- Score_element* dependent (int) const;
- int dependent_size () const;
int dependency_size () const;
virtual void output_processing ();
- void junk_links ();
virtual Interval do_height () const;
virtual Interval do_width () const;
/// do printing of derived info.
- virtual void do_print () const {}
+ virtual void do_print () const;
/// generate the molecule
virtual Molecule* do_brew_molecule_p () const;
///executed directly after the item is added to the Paper_score
virtual void handle_prebroken_dependencies ();
virtual void handle_prebroken_dependents ();
virtual Link_array<Score_element> get_extra_dependencies () const;
- virtual void do_unlink ();
- virtual void do_junk_links ();
};
Interval get_spanned_interval () const;
public:
Real extra_x_off_;
- bool no_width_b_;
Span_bar();
VIRTUAL_COPY_CONS(Score_element);
Spanner * unbroken_original_l_;
- virtual void do_unlink ();
- virtual void do_junk_links ();
virtual void output_processing ();
virtual void do_space_processing ();
virtual void do_break_processing ();
Stem size depends on flag.
*/
class Stem : public Item {
-
-
Drul_array<Real> yextent_drul_;
/// needed for determining direction/length
void break_processing();
void post_processing();
void output_all ();
- void unlink_all ();
protected:
public:
Music_output_def * output_def_l_;
String type_str_;
-
- bool is_alias_b (String) const;
-
+ virtual const char *name() const;
+ bool is_alias_b (String) const;
VIRTUAL_COPY_CONS(Translator);
Translator (Translator const &);
{
protected:
VIRTUAL_COPY_CONS(Score_element);
- virtual void do_junk_links () { Axis_group_spanner::do_junk_links (); }
- virtual void do_unlink () { Axis_group_spanner::do_unlink (); }
public:
Vertical_group_spanner ();
#include "item.hh"
#include "p-col.hh"
#include "spanner.hh"
+#include "lily-guile.hh"
Item::Item ()
{
void
Item::try_visibility_lambda ()
{
- if (visibility_lambda_)
+ SCM vis = get_elt_property (ly_symbol ("visibility_lambda"));
+ if (vis != SCM_BOOL_F)
{
SCM args = scm_listify (gh_int2scm (break_status_dir_), SCM_UNDEFINED);
- SCM result = gh_apply (visibility_lambda_, args);
+ SCM result = gh_apply ( SCM_CDR(vis), args);
int trans = gh_scm2bool (gh_car (result));
int empty = gh_scm2bool (gh_cdr (result));
return Score_element::linked_b() || attached_span_l_arr_.size();
}
-void
-Item::do_junk_links()
-{
- attached_span_l_arr_.set_size(0);
-}
-void
-Item::do_unlink()
-{
- Link_array<Spanner> attached=attached_span_l_arr_;
- for (int i=0; i < attached.size (); i++)
- {
- Spanner *s= attached[i];
-
- Direction d= LEFT;
- do {
- if (s->spanned_drul_[d] == this)
- s->set_bounds (d, 0);
- if (unbroken_original_l_
- && unbroken_original_l_-> broken_to_drul_[d] == this)
- unbroken_original_l_->broken_to_drul_[d] = 0;
- } while (flip (&d) != LEFT);
- }
- assert (!attached_span_l_arr_.size ());
- unbroken_original_l_ =0;
-}
Paper_column *
Item::column_l () const
unbroken_original_l_ = 0;
/* do not copy attached_span_l_arr_ */
breakable_b_ = s.breakable_b_;
- visibility_lambda_ = s.visibility_lambda_;
broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] =0;
break_status_dir_ = s.break_status_dir_;
break_priority_i_ = s.break_priority_i_;
return r;
}
-void
-Line_of_score::do_unlink ()
-{
- Spanner::do_unlink ();
- for (int i=0; i < cols_.size (); i++)
- cols_[i]->line_l_ =0;
- cols_.set_size (0);
-}
-void
-Line_of_score::do_junk_links ()
-{
- cols_.set_size (0);
-}
#include "scope.hh"
#include "molecule.hh"
#include "atom.hh"
+#include "lily-guile.hh"
SCM
array_to_list (SCM *a , int l)
}
-static Dict_initialiser<char const*> cmr_init[] = {
- {"bold", "cmbx"},
- {"dynamic", "feta-din"},
- {"finger", "feta-nummer"},
- {"typewriter", "cmtt"},
- {"italic", "cmti"},
- {"roman", "cmr"},
- {"large", "cmbx"},
- {"Large", "cmbx"},
- {"mark", "feta-nummer"},
- {"number", "feta-nummer"},
- {"volta", "feta-nummer"},
- {0,0}
-};
/**
Magnification steps. These are powers of 1.2. The numbers are
taken from Knuth's plain.tex: */
static Real mag_steps[] = {1, 1, 1.200, 1.440, 1.7280, 2.074, 2.488};
-static Dictionary<char const *> cmr_dict (cmr_init);
+
Molecule
Lookup::text (String style, String text) const
font_mag = (int)paper_l_->get_var ("magnification_" + style);
}
- if (cmr_dict.elem_b (style))
+ SCM l = gh_eval_str (("(style-to-cmr \"" + style + "\")").ch_C());
+ if (l != SCM_BOOL_F)
{
- style = String (cmr_dict [style]) + to_str ((int)font_h); // ugh
+ int len ;
+ char * s = gh_scm2newstr(SCM_CDR (l), &len);
+ style = String (s) + to_str ((int)font_h);
+ delete s;
}
Real w = 0;
;
else
{
- Character_metric *c = afm_l->get_char (text[i],false);
+ Character_metric *c = afm_l->get_char ((unsigned char)text[i],false);
+
w += c->dimensions()[X_AXIS].length ();
ydims.unite (c->dimensions()[Y_AXIS]);
}
if (font_mag > 1 && font_mag < 7 )
{
+ /* UGH */
style = style + String(" scaled \\magstep ") + to_str (font_mag);
w *= mag_steps[font_mag];
ydims *= mag_steps[font_mag];
DOUT << "\n" << to_str (w) << "\n";
m.dim_.x () = Interval (0, w);
m.dim_.y () = ydims;
+
+
Atom at (gh_list (ly_symbol ("text"),
gh_str02scm (text.ch_C()),
SCM_UNDEFINED));
#include "midi-stream.hh"
#include "audio-item.hh"
-
-
-
-
-
-
-
-
-
-
-
-
+#include "killing-cons.tcc"
Midi_chunk::Midi_chunk ()
: Midi_item (0)
set ("MThd", str, "");
}
+/* why doesn't this start at 0 ?
+ */
char const* const instrument_name_sz_a_[ ] = {
-
/* default is usually piano */
/* 0 "piano", */
- /* (1-8 piano) */
- /* 1 */ "acoustic grand",
+ /* (1-8 piano) */
+ /* 1 */ "acoustic grand",
/* 2 */ "bright acoustic",
/* 3 */ "electric grand",
/* 4 */ "honky-tonk",
String str = to_str ((char)status_byte);
str += to_str ((char) (pitch_i () + c0_pitch_i_c_));
+#if 0
// poor man's staff dynamics:
str += to_str ((char) (dynamic_byte_ - 0x10 * channel_i_));
-
+#endif
+
return str;
}
{
assert (delta_time_mom >= Moment (0));
- event_p_list_.bottom ().add (new Midi_event (delta_time_mom, mitem_p));
+ Midi_event * e = new Midi_event (delta_time_mom, mitem_p);
+ event_p_list_.append (new Killing_cons<Midi_event> (e, 0));
}
String
String str = Midi_chunk::data_str ();
if (check_debug && !monitor->silent_b ("Midistrings"))
str += "\n";
- for (PCursor<Midi_event*> i (event_p_list_); i.ok (); i++)
+ for (Cons<Midi_event> *i=event_p_list_.head_; i; i = i->next_)
{
- str += i->str ();
+ str += i->car_->str ();
if (check_debug && !monitor->silent_b ("Midistrings"))
str += "\n";
}
else if (dynamic_cast<Spanner*>(e))
type_stats["Spanner"] ++;
type_stats["Total"] ++;
-
- e->unlink ();
- assert (!e->linked_b ());
- delete e;
}
}
#include "file-results.hh"
#include "lily-version.hh"
+#include "killing-cons.tcc"
+
Performance::Performance ()
{
midi_l_ =0;
+ audio_elem_p_list_ = 0;
}
void
Performance::add_column (Audio_column* p)
{
p->performance_l_ = this;
- audio_column_p_list_.bottom().add (p);
+ add_element (p);
+}
+
+Performance::~Performance()
+{
+ delete audio_elem_p_list_;
}
void
-Performance::output (Midi_stream& midi_stream_r)
+Performance::output (Midi_stream& midi_stream)
{
- int tracks_i = audio_staff_l_list_.size() + 1;
+ int tracks_i = audio_staff_l_arr_.size() + 1;
+
// ugh
int clocks_per_4_i = 384;
- midi_stream_r << Midi_header (1, tracks_i, clocks_per_4_i);
- output_header_track (midi_stream_r);
+
+ midi_stream << Midi_header (1, tracks_i, clocks_per_4_i);
+ output_header_track (midi_stream);
int n = 1;
- for (PCursor<Audio_staff*> i (audio_staff_l_list_); i.ok(); i++)
- i->output (midi_stream_r, n++);
+ for (int i =0; i < audio_staff_l_arr_.size (); i++)
+ {
+ Audio_staff *s = audio_staff_l_arr_[i];
+ /*
+ Aargh, let's hear it for the MIDI standard.
+ MIDI players tend to ignore instrument settings on
+ channel 10, the percussion channel by default.
+ */
+ if (n == 10)
+ n++;
+ s->output (midi_stream, n++);
+ }
}
void
-Performance::output_header_track (Midi_stream& midi_stream_r)
+Performance::output_header_track (Midi_stream& midi_stream)
{
Midi_track midi_track;
Midi_tempo tempo (midi_l_->get_tempo_i (Moment (1, 4)));
midi_track.add (Moment (0), &tempo);
- midi_stream_r << midi_track;
+ midi_stream << midi_track;
}
void
Performance::add_staff (Audio_staff* l)
{
- audio_staff_l_list_.bottom().add (l);
+ audio_staff_l_arr_.push (l);
}
void
Performance::add_element (Audio_element *p)
{
- audio_elem_p_list_.bottom().add (p);
+ audio_elem_p_list_ = new Killing_cons<Audio_element> (p, audio_elem_p_list_);
}
void
#ifndef NPRINT
DOUT << "Performance { ";
DOUT << "Items: ";
- for (PCursor<Audio_element*> i (audio_elem_p_list_.top ()); i.ok (); i++)
- i->print ();
-
- DOUT << "\ncolumns: ";
- for (PCursor<Audio_column*> i (audio_column_p_list_); i.ok(); i++)
- i->print();
- DOUT << "}\n";
+ for (Cons<Audio_element>* i =audio_elem_p_list_; i; i = i->next_)
+ i->car_->print ();
+ DOUT << "}";
#endif
}
output_p_ =0;
break_helper_only_b_ = false;
transparent_b_ = false;
- size_i_ = 0;
pscore_l_=0;
status_i_ = 0;
+ element_property_alist_ = SCM_EOL;
}
Score_element::Score_element (Score_element const&s)
- : Directed_graph_node (s), Graphical_element (s)
+ : Graphical_element (s)
{
/* called from derived ctor, so most info points to the same deps
as (Directed_graph_node&)s. Nobody points to us, so don't copy
dependents.
*/
- copy_edges_out (s);
+
+
+ // deep copy ?
+ element_property_alist_ = s.element_property_alist_;
+ dependency_arr_ = s.dependency_arr_;
output_p_ =0;
break_helper_only_b_ = s.break_helper_only_b_;
transparent_b_ = s.transparent_b_;
status_i_ = s.status_i_;
pscore_l_ = s.pscore_l_;
- size_i_ = s.size_i_;
}
-
-
-
Score_element::~Score_element()
{
delete output_p_;
Score_element*
Score_element::dependency (int i) const
{
- return (Score_element*) (get_out_edge_arr ()[i]);
+ return dependency_arr_ [i];
}
int
Score_element::dependency_size () const
{
- return get_out_edge_arr ().size ();
+ return dependency_arr_.size ();
}
-Score_element*
-Score_element::dependent (int i) const
+
+
+SCM
+Score_element::get_elt_property (SCM s)
{
- return (Score_element *)( get_in_edge_arr()[i]);
+ return scm_assq(s, element_property_alist_);
}
-
-int
-Score_element::dependent_size() const
+void
+Score_element::set_elt_property (SCM s, SCM v)
{
- return get_in_edge_arr().size ();
+ element_property_alist_ =
+ scm_assoc_set_x (element_property_alist_, s, v);
}
-
-
Interval
Score_element::do_width() const
{
{
#ifndef NPRINT
DOUT << classname(this) << "{\n";
- DOUT << "dets: " << dependent_size() << "dependencies: " <<
- dependency_size();
+ DOUT << "dependencies: " << dependency_size();
Graphical_element::do_print ();
do_print();
Lookup const *
Score_element::lookup_l () const
{
- return pscore_l_->paper_l_->lookup_l (size_i_);
+ SCM sz = scm_assq (ly_symbol ("fontsize"), element_property_alist_);
+ if (sz != SCM_BOOL_F)
+ return pscore_l_->paper_l_->lookup_l (gh_scm2int (SCM_CDR (sz)));
+ else
+ return pscore_l_->paper_l_->lookup_l (0);
}
void
{
}
-void
-Score_element::do_unlink()
-{
-}
-
-void
-Score_element::do_junk_links()
-{
-}
-
-
Molecule*
Score_element::do_brew_molecule_p() const
void
Score_element::remove_dependency (Score_element*e)
{
- remove_edge_out (e);
+ int i;
+ while ((i = dependency_arr_.find_i (e)) >=0 )
+ dependency_arr_.unordered_del (i);
+
substitute_dependency (e, 0);
}
void
Score_element::add_dependency (Score_element*e)
{
- Directed_graph_node::add_edge (e);
+ if (e)
+ dependency_arr_.push (e);
+ else
+ warning("Null dependency added");
+
}
void
Score_element::substitute_dependency (Score_element* old, Score_element* new_l)
}
-void
-Score_element::junk_links ()
-{
- Directed_graph_node::junk_links();
- Graphical_element::junk_links ();
- do_junk_links();
-}
-
-void
-Score_element::unlink()
-{
- do_unlink();
- while (dependency_size())
- {
- do_substitute_element_pointer (dependency (0),0);
- remove_edge_out_idx (0);
- }
- while (dependent_size())
- {
- dependent (0)->remove_dependency (this);
- }
- Graphical_element::unlink ();
-}
-
Link_array<Score_element>
Score_element::get_extra_dependencies() const
return get_extra_dependencies().size() ||
dependency_size();
}
+void
+Score_element::do_print () const
+{
+}
class Span_bar_engraver : public Base_span_bar_engraver
{
-protected:
- Span_bar *get_span_bar_p ();
public:
Span_bar_engraver ();
VIRTUAL_COPY_CONS (Translator);
Interval
Span_bar::do_width () const
{
- if (no_width_b_)
- {
- return Interval (0,0);
- }
-
Molecule m = lookup_l ()->bar (type_str_, 40 PT);
return m.extent (X_AXIS);
{
type_str_ = "";
extra_x_off_ = 0.0;
- no_width_b_ = false;
}
Span_score_bar_engraver::get_span_bar_p () const
{
Span_bar*s = new Span_bar;
- s->visibility_lambda_
- = gh_eval_str ("Span_score_bar_visibility");
s->type_str_ = "scorebar";
return s;
Piano_bar_engraver::get_span_bar_p () const
{
Span_bar *s= new Span_bar;
- s->visibility_lambda_
- = gh_eval_str ("Piano_bar_visibility");
- s->no_width_b_ =true;
+ s->dim_cache_[X_AXIS].set_empty (true);
s->type_str_ = "{";
return s;
}
Staff_group_bar_engraver::get_span_bar_p () const
{
Span_bar *s= new Span_bar;
- s->visibility_lambda_
- = gh_eval_str ("Staff_group_bar_visibility");
- s->no_width_b_ =true;
+ s->dim_cache_[X_AXIS].set_empty (true);
s->type_str_ = "[";
return s;
}
return broken_info_.size();
}
-void
-Spanner::do_unlink()
-{
- set_bounds (LEFT, 0);
- set_bounds (RIGHT, 0);
- if (unbroken_original_l_)
- {
- for (int i=0; i < unbroken_original_l_->broken_info_.size (); i++)
- {
- if (unbroken_original_l_->broken_info_[i].broken_spanner_l_ == this)
- unbroken_original_l_->broken_info_[i].broken_spanner_l_ = 0;
- }
-
- }
-}
-void
-Spanner::do_junk_links()
-{
- spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0;
-}
Array<Rod>
Spanner::get_rods () const
}
-
-
/**
for administration of what was done already
*/
POSTCALCED, // after spacing calcs done
BREWING,
BREWED,
- UNLINKING,
- UNLINKED,
};
void
-void
-Super_element::unlink_all ()
-{
- calculate_dependencies (UNLINKING, UNLINKED, &Score_element::junk_links);
-}
#include "rational.hh"
+char const*
+Translator::name() const
+{
+ return classname(this);
+}
+
Translator::~Translator ()
{
}
;; Score_span_bars are only visible at start of line
;; i.e. if break_dir == RIGHT == 1
-(define Span_score_bar_visibility postbreak_only_visibility)
-(define Piano_bar_visibility postbreak_only_visibility)
-(define Staff_group_bar_visibility postbreak_only_visibility)
+(define Span_score_bar_engraver_visibility postbreak_only_visibility)
+(define Span_bar_engraver_visibility non_postbreak_visibility)
+(define Piano_bar_engraver_visibility postbreak_only_visibility)
+(define Staff_group_bar_engraver_visibility postbreak_only_visibility)
;;;;;;;; TeX
+(define cmr-alist
+ '(("bold" . "cmbx")
+ ("dynamic" . "feta-din")
+ ("finger" . "feta-nummer")
+ ("typewriter" . "cmtt")
+ ("italic" . "cmti")
+ ("roman" . "cmr")
+ ("large" . "cmbx")
+ ("Large" . "cmbx")
+ ("mark" . "feta-nummer")
+ ("number" . "feta-nummer")
+ ("volta" . "feta-nummer"))
+)
+
+
+;; Map style names to TeX font names. Return false if
+;; no font name found.
+(define (style-to-cmr s)
+ (assoc s cmr-alist )
+ )
+
+
(define (tex-scm action-name)
(define (unknown)
;;;;;;;;;;;; PS
(define (ps-scm action-name)
+
+ ;; alist containing fontname -> fontcommand assoc (both strings)
(define font-alist '())
(define font-count 0)
(define current-font "")
(set! font-count (+ 1 font-count))
(string-append "\n/" font-cmd " {/"
font-name
- " findfont 12 scalefont setfont} bind def\n"
- font-cmd "\n"))
- (cdr font-cmd)))
- "" ;no switch needed
+ " findfont 12 scalefont setfont} bind def \n"
+ font-cmd " \n"))
+ (string-append (cdr font-cmd) " ")))
+ ; font-name == current-font no switch needed
+ ""
))
(define (beam width slope thick)
(string-append
"\n/" (font i) " {/"
(substring s 0 (- (string-length s) 4))
- " findfont 12 scalefont setfont} bind def\n"))
+ " findfont 12 scalefont setfont} bind def \n"))
(define (font-switch i)
(string-append (font i) " "))
(define (placebox x y s)
(string-append
(number->string x) " " (number->string y) " {" s "} placebox "))
+ (define (pianobrace y)
+ ""
+ )
(define (rulesym x y)
(string-append
(define (stop-line)
"}\nstop_line\n")
- (define (text f s)
- (string-append "(" s ") set" f " "))
+ (define (text s)
+ (string-append "(" s ") show "))
(define (volta w thick last)
(define font-def ,font-def)
(define font-switch ,font-switch)
(define generalmeter ,generalmeter)
+ (define pianobrace ,pianobrace)
(define header-end ,header-end)
(define lily-def ,lily-def)
(define header ,header)