+ return ip ? ip : &dummy_input_global;
+}
+
+/*
+ ES TODO: This method should probably be reworked or junked.
+*/
+Stream_event *
+Music::to_event () const
+{
+ /* UGH. Temp hack */
+ SCM orig_sym = get_property ("name");
+ char out[200];
+ string in = ly_symbol2string (orig_sym);
+ /* don't add '-' before first character */
+ out[0] = tolower (in[0]);
+ size_t outpos = 1;
+ for (size_t inpos = 1; inpos < in.size () && outpos < 190; inpos++)
+ {
+ if (isupper (in[inpos]))
+ out[outpos++] = '-';
+ out[outpos++] = tolower (in[inpos]);
+ }
+ out[outpos] = 0;
+ SCM class_name = ly_symbol2scm (out);
+
+ Stream_event *e = new Stream_event (class_name, mutable_property_alist_);
+ Moment length = get_length ();
+ if (length.to_bool ())
+ e->set_property ("length", length.smobbed_copy ());
+
+ /*
+ ES TODO: This is a temporary fix. Stream_events should not be
+ aware of music.
+ */
+ e->set_property ("music-cause", self_scm ());
+ return e;