2002-07-26 Jan Nieuwenhuizen <janneke@gnu.org>
+ * lily, flower: Ran buildscripts/ontgaar.py. See also
+ http://lilypond.org/wiki/?CodingStandards.
+
* Documentation/GNUmakefile: Remove regression-test stuff.
(deep-WWW-clean): Remove wiki-dump. Fixes web-clean target.
Optional suffixes:
- _b : _b, bool
- _p : _p as in lispy pair_p ()?
- _x : _x, x-coor
- _y : _y, y-coor
-
- _byte : _byte
- _char : _char
- _count : _count counter
- _drul : _drul Drul_array
- _global : _global global var
- _grob : _grob Grob
- _req : _req Request
- _scm : _scm SCM
- _str : _str C string
- _str0 : _str0 C string
- _string : _string C++ string
+ _b : bool
+ _p : as in lispy pair_p ()?
+ _x : x-coor
+ _y : y-coor
+
+ _byte :
+ _char :
+ _count : counter
+ _drul : Drul_array
+ _global : global var
+ _grob : Grob
+ _mom : moment
+ _req : Request
+ _scm : SCM
+ _str : C string
+ _str0 : C string
+ _string : C++ string
Prefixes:
get_ :
#include "string.hh"
String
-axis_name_str (Axis a)
+axis_name_string (Axis a)
{
- return to_str (char (a + 'x'));
+ return to_string (char (a + 'x'));
}
#include "binary-source-file.hh"
#include "string-convert.hh"
-Binary_source_file::Binary_source_file (String& filename_str)
- : Source_file (filename_str)
+Binary_source_file::Binary_source_file (String& filename_string)
+ : Source_file (filename_string)
{
}
}
String
-Binary_source_file::error_str (char const* pos_ch_C) const
+Binary_source_file::error_string (char const* pos_str0) const
{
assert (this);
- if (!in_b (pos_ch_C))
+ if (!in_b (pos_str0))
return "";
- char const* begin_ch_C = pos_ch_C - 8 >? ch_C ();
- char const* end_ch_C = pos_ch_C + 7 <? ch_C () + length_i ();
-
- String pre_str ((Byte const*)begin_ch_C, pos_ch_C - begin_ch_C);
- pre_str = String_convert::bin2hex_str (pre_str);
- for (int i = 2; i < pre_str.length_i (); i += 3)
- pre_str = pre_str.left_str (i) + " " + pre_str.cut_str (i, INT_MAX);
- String post_str ((Byte const*)pos_ch_C, end_ch_C - pos_ch_C);
- post_str = String_convert::bin2hex_str (post_str);
- for (int i = 2; i < post_str.length_i (); i += 3)
- post_str = post_str.left_str (i) + " " + post_str.cut_str (i, INT_MAX);
-
- String str = pre_str
- + to_str ('\n')
- + to_str (' ', pre_str.length_i () + 1)
- + post_str;
+ char const* begin_str0 = pos_str0 - 8 >? to_str0 ();
+ char const* end_str0 = pos_str0 + 7 <? to_str0 () + length ();
+
+ String pre_string ((Byte const*)begin_str0, pos_str0 - begin_str0);
+ pre_string = String_convert::bin2hex (pre_string);
+ for (int i = 2; i < pre_string.length (); i += 3)
+ pre_string = pre_string.left_string (i) + " " + pre_string.cut_string (i, INT_MAX);
+ String post_string ((Byte const*)pos_str0, end_str0 - pos_str0);
+ post_string = String_convert::bin2hex (post_string);
+ for (int i = 2; i < post_string.length (); i += 3)
+ post_string = post_string.left_string (i) + " " + post_string.cut_string (i, INT_MAX);
+
+ String str = pre_string
+ + to_string ('\n')
+ + to_string (' ', pre_string.length () + 1)
+ + post_string;
return str;
}
int
-Binary_source_file::line_i (char const* pos_ch_C) const
+Binary_source_file::get_line (char const* pos_str0) const
{
- if (!in_b (pos_ch_C))
+ if (!in_b (pos_str0))
return 0;
- return pos_ch_C - ch_C ();
+ return pos_str0 - to_str0 ();
}
U8
Binary_source_file::get_U8 ()
{
- return * (U8*)forward_ch_C (1);
+ return * (U8*)forward_str0 (1);
}
#include "string.hh"
String
-direction_str (Direction d, Axis a)
+direction_string (Direction d, Axis a)
{
String s ("center");
if (a == Y_AXIS)
dos_to_posix (String path)
{
char buf[PATH_MAX];
- char *filename = path.copy_ch_p ();
+ char *filename = path.get_copy_str0 ();
/* urg, wtf? char const* argument gets modified! */
cygwin_conv_to_posix_path (filename, buf);
delete filename;
static String
dos_to_posix_list (String path)
{
- char *filename = path.copy_ch_p ();
+ char *filename = path.get_copy_str0 ();
int len = cygwin_win32_to_posix_path_list_buf_size (filename);
if (len < PATH_MAX)
len = PATH_MAX;
/* Join components to full path. */
String
-Path::str () const
+Path::string () const
{
String s;
if (!root.empty_b ())
- s = root + to_str (ROOTSEP);
+ s = root + to_string (ROOTSEP);
if (!dir.empty_b ())
- s += dir + to_str (DIRSEP);
+ s += dir + to_string (DIRSEP);
s += base;
if (!ext.empty_b ())
- s += to_str (EXTSEP) + ext;
+ s += to_string (EXTSEP) + ext;
return s;
}
#endif
Path p;
- int i = path.index_i (ROOTSEP);
+ int i = path.index (ROOTSEP);
if (i >= 0)
{
- p.root = path.left_str (i);
- path = path.right_str (path.length_i () - i - 1);
+ p.root = path.left_string (i);
+ path = path.right_string (path.length () - i - 1);
}
- i = path.index_last_i (DIRSEP);
+ i = path.index_last (DIRSEP);
if (i >= 0)
{
- p.dir = path.left_str (i);
- path = path.right_str (path.length_i () - i - 1);
+ p.dir = path.left_string (i);
+ path = path.right_string (path.length () - i - 1);
}
- i = path.index_last_i ('.');
+ i = path.index_last ('.');
if (i >= 0)
{
- p.base = path.left_str (i);
- p.ext = path.right_str (path.length_i () - i - 1);
+ p.base = path.left_string (i);
+ p.ext = path.right_string (path.length () - i - 1);
}
else
p.base = path;
int l;
- while ((l = p.length_i ()) )
+ while ((l = p.length ()) )
{
- int i = p.index_i (PATHSEP);
+ int i = p.index (PATHSEP);
if (i <0)
i = l;
- add (p.left_str (i));
- p = p.right_str (l- i - 1);
+ add (p.left_string (i));
+ p = p.right_string (l- i - 1);
}
}
String
File_path::find (String nm) const
{
- if (!nm.length_i () || (nm == "-") )
+ if (!nm.length () || (nm == "-") )
return nm;
for (int i=0; i < size (); i++)
{
String path = elem (i);
- String sep = to_str (DIRSEP);
- String right (path.right_str (1));
- if (path.length_i () && right != sep)
- path += to_str (DIRSEP);
+ String sep = to_string (DIRSEP);
+ String right (path.right_string (1));
+ if (path.length () && right != sep)
+ path += to_string (DIRSEP);
path += nm;
Check if directory. TODO: encapsulate for autoconf
*/
struct stat sbuf;
- if (stat (path.ch_C (), &sbuf) == ENOENT)
+ if (stat (path.to_str0 (), &sbuf) == ENOENT)
continue;
if (! (sbuf.st_mode & __S_IFREG))
#endif
#if !STAT_MACROS_BROKEN
struct stat sbuf;
- if (stat (path.ch_C (), &sbuf) == ENOENT)
+ if (stat (path.to_str0 (), &sbuf) == ENOENT)
continue;
if (S_ISDIR (sbuf.st_mode))
continue;
#endif
- FILE *f = fopen (path.ch_C (), "r"); // ugh!
+ FILE *f = fopen (path.to_str0 (), "r"); // ugh!
if (f)
{
fclose (f);
{
if (s == "")
s = ".";
- FILE * f = fopen (s.ch_C (), "r");
+ FILE * f = fopen (s.to_str0 (), "r");
if (!f)
return false;
fclose (f);
}
String
-File_path::str () const
+File_path::string () const
{
String s;
for (int i=0; i< size (); i++)
#endif
long
-Getopt_long::argument_to_i ()
+Getopt_long::get_argument_index ()
{
long l;
- if (!optional_argument_ch_C_
- || sscanf (optional_argument_ch_C_, "%ld", &l) != 1)
+ if (!optional_argument_str0_
+ || sscanf (optional_argument_str0_, "%ld", &l) != 1)
report (E_ILLEGALARG);
return l;
const Long_option_init *
Getopt_long::parselong ()
{
- char const *optnm = arg_value_ch_a_a_[array_index_i_] + 2 ;
+ char const *optnm = arg_value_char_a_a_[array_index_] + 2 ;
assert (*optnm);
char const *endopt = strchr (optnm, '=');
int searchlen = (endopt) ? endopt - optnm : strlen (optnm);
- found_option_l_=0;
- for (int i=0; i< table_len_i_; i++)
+ found_option_=0;
+ for (int i=0; i< table_len_; i++)
{
- char const *ln = option_a_[i].longname_sz_;
+ char const *ln = option_a_[i].longname_str0_;
if (ln && !strncmp (ln, optnm, searchlen))
{
- found_option_l_ = option_a_+i;
+ found_option_ = option_a_+i;
break;
}
}
- if (!found_option_l_)
+ if (!found_option_)
{
report (E_UNKNOWNOPTION);
return 0;
}
- array_index_i_++;
- argument_index_i_ = 0;
+ array_index_++;
+ argument_index_ = 0;
- if (found_option_l_->take_arg_sz_)
+ if (found_option_->take_arg_str0_)
{
if (endopt)
- optional_argument_ch_C_ = endopt +1; // a '='
+ optional_argument_str0_ = endopt +1; // a '='
else
{
- optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
- array_index_i_++;
+ optional_argument_str0_ = arg_value_char_a_a_[array_index_];
+ array_index_++;
}
- if (!optional_argument_ch_C_)
+ if (!optional_argument_str0_)
report (E_ARGEXPECT);
}
else
{
- optional_argument_ch_C_ = 0;
+ optional_argument_str0_ = 0;
if (endopt)
report (E_NOARGEXPECT);
}
- return found_option_l_;
+ return found_option_;
}
String
-Long_option_init::str () const
+Long_option_init::string () const
{
String str;
- if (shortname_ch_)
- str += "-" + shortname_ch_;
- if (shortname_ch_ && longname_sz_)
+ if (shortname_char_)
+ str += "-" + shortname_char_;
+ if (shortname_char_ && longname_str0_)
str += ", ";
- if (longname_sz_)
- str += String ("`--") + longname_sz_ + "'";
+ if (longname_str0_)
+ str += String ("`--") + longname_str0_ + "'";
return str;
}
Long_option_init::str_for_help () const
{
String s;
- if (shortname_ch_)
- s = "-" + to_str (shortname_ch_);
+ if (shortname_char_)
+ s = "-" + to_string (shortname_char_);
else
s = " ";
- s = s + ((shortname_ch_ && longname_sz_) ? "," : " ");
+ s = s + ((shortname_char_ && longname_str0_) ? "," : " ");
- if (longname_sz_)
- s = s + "--" + longname_sz_;
+ if (longname_str0_)
+ s = s + "--" + longname_str0_;
- if (take_arg_sz_)
+ if (take_arg_str0_)
{
- if (longname_sz_)
+ if (longname_str0_)
s = s + "=";
else
s = s + " ";
- s = s + gettext (take_arg_sz_);
+ s = s + gettext (take_arg_str0_);
}
return s;
}
if (!error_out_)
return;
- String str = arg_value_ch_a_a_[0];
+ String str = arg_value_char_a_a_[0];
str += ": ";
switch (c)
{
case E_ARGEXPECT:
str += _f ("option `%s' requires an argument",
- found_option_l_->str ());
+ found_option_->string ());
break;
case E_NOARGEXPECT:
str += _f ("option `%s' doesn't allow an argument",
- found_option_l_->str ());
+ found_option_->string ());
break;
case E_UNKNOWNOPTION:
str += _f ("unrecognized option: `%s'",
- String (argument_index_i_
- ? String ("-" + String_convert::form_str ("%c",
- arg_value_ch_a_a_[array_index_i_][argument_index_i_]))
- : String (arg_value_ch_a_a_[array_index_i_])));
+ String (argument_index_
+ ? String ("-" + String_convert::form_string ("%c",
+ arg_value_char_a_a_[array_index_][argument_index_]))
+ : String (arg_value_char_a_a_[array_index_])));
break;
case E_ILLEGALARG:
str += _f ("invalid argument `%s' to option `%s'",
- optional_argument_ch_C_, found_option_l_->str ());
+ optional_argument_str0_, found_option_->string ());
break;
default:
assert (false);
}
- fprintf(error_out_, "%s\n", str.ch_C());
+ fprintf(error_out_, "%s\n", str.to_str0 ());
exit (2);
}
const Long_option_init *
Getopt_long::parseshort ()
{
- char c=arg_value_ch_a_a_[array_index_i_][argument_index_i_];
- found_option_l_=0;
+ char c=arg_value_char_a_a_[array_index_][argument_index_];
+ found_option_=0;
assert (c);
- for (int i=0; i < table_len_i_; i++)
- if (option_a_[i].shortname_ch_ == c)
+ for (int i=0; i < table_len_; i++)
+ if (option_a_[i].shortname_char_ == c)
{
- found_option_l_ = option_a_+i;
+ found_option_ = option_a_+i;
break;
}
- if (!found_option_l_)
+ if (!found_option_)
{
report (E_UNKNOWNOPTION);
return 0;
}
- argument_index_i_++;
- if (!found_option_l_->take_arg_sz_)
+ argument_index_++;
+ if (!found_option_->take_arg_str0_)
{
- optional_argument_ch_C_ = 0;
- return found_option_l_;
+ optional_argument_str0_ = 0;
+ return found_option_;
}
- optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_] + argument_index_i_;
+ optional_argument_str0_ = arg_value_char_a_a_[array_index_] + argument_index_;
- array_index_i_ ++;
- argument_index_i_ = 0;
+ array_index_ ++;
+ argument_index_ = 0;
- if (!optional_argument_ch_C_[0])
+ if (!optional_argument_str0_[0])
{
- optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
- array_index_i_ ++;
+ optional_argument_str0_ = arg_value_char_a_a_[array_index_];
+ array_index_ ++;
}
- if (!optional_argument_ch_C_)
+ if (!optional_argument_str0_)
{
report (E_ARGEXPECT);
}
- return found_option_l_;
+ return found_option_;
}
const Long_option_init *
if (!ok ())
return 0;
- if (argument_index_i_)
+ if (argument_index_)
return parseshort ();
- const char * argument_C = arg_value_ch_a_a_[array_index_i_];
+ const char * argument = arg_value_char_a_a_[array_index_];
- if (argument_C[0] != '-')
+ if (argument[0] != '-')
return 0;
- if (argument_C[1] == '-') {// what to do with "command -- bla"
- if (argument_C[2])
+ if (argument[1] == '-') {// what to do with "command -- bla"
+ if (argument[2])
return parselong ();
else
return 0;
}
else
{
- if (argument_C[ 1 ])
+ if (argument[ 1 ])
{
- argument_index_i_ = 1;
+ argument_index_ = 1;
return parseshort ();
}
else
{
option_a_ = lo;
error_out_ = stderr;
- arg_value_ch_a_a_ = v;
- argument_count_i_ = c;
- array_index_i_ = 1;
- argument_index_i_ = 0;
+ arg_value_char_a_a_ = v;
+ argument_count_ = c;
+ array_index_ = 1;
+ argument_index_ = 0;
// reached end of option table?
- table_len_i_ =0;
- for (int i = 0; option_a_[i].longname_sz_ ||option_a_[i].shortname_ch_; i++)
- table_len_i_ ++;
+ table_len_ =0;
+ for (int i = 0; option_a_[i].longname_str0_ ||option_a_[i].shortname_char_; i++)
+ table_len_ ++;
}
bool
Getopt_long::ok () const
{
- return array_index_i_ < argument_count_i_;
+ return array_index_ < argument_count_;
}
void
Getopt_long::next ()
{
error_ = E_NOERROR;
- while (array_index_i_ < argument_count_i_
- && !arg_value_ch_a_a_[array_index_i_][argument_index_i_])
+ while (array_index_ < argument_count_
+ && !arg_value_char_a_a_[array_index_][argument_index_])
{
- array_index_i_++;
- argument_index_i_ = 0;
+ array_index_++;
+ argument_index_ = 0;
}
}
char const *
Getopt_long::current_arg ()
{
- if (array_index_i_ >= argument_count_i_)
+ if (array_index_ >= argument_count_)
return 0;
- char const * a = arg_value_ch_a_a_[array_index_i_];
- return a + argument_index_i_;
+ char const * a = arg_value_char_a_a_[array_index_];
+ return a + argument_index_;
}
char const *
char const * a = current_arg ();
if (a)
{
- array_index_i_ ++;
- argument_index_i_= 0;
+ array_index_ ++;
+ argument_index_= 0;
}
return a;
}
const int EXTRA_SPACES = 5;
String
-Long_option_init::table_str (Long_option_init *l)
+Long_option_init::table_string (Long_option_init *l)
{
String argstr = "ARG";
String tabstr = "";
int wid = 0;
- for (int i=0; l[i].shortname_ch_ || l[i].longname_sz_; i++)
+ for (int i=0; l[i].shortname_char_ || l[i].longname_str0_; i++)
{
- wid = wid >? l[i].str_for_help ().length_i ();
+ wid = wid >? l[i].str_for_help ().length ();
}
- for (int i=0; l[i].shortname_ch_ || l[i].longname_sz_; i++)
+ for (int i=0; l[i].shortname_char_ || l[i].longname_str0_; i++)
{
String s = " " + l[i].str_for_help ();
- s += String_convert::char_str (' ', wid - s.length_i () + EXTRA_SPACES);
+ s += String_convert::char_string (' ', wid - s.length () + EXTRA_SPACES);
- tabstr += s + gettext (l[i].help_sz_) + "\n";
+ tabstr += s + gettext (l[i].help_str0_) + "\n";
}
int
Long_option_init::compare (Long_option_init const &a, Long_option_init const &b)
{
- if (a.shortname_ch_ && b.shortname_ch_ && a.shortname_ch_- b.shortname_ch_)
- return a.shortname_ch_ - b.shortname_ch_;
+ if (a.shortname_char_ && b.shortname_char_ && a.shortname_char_- b.shortname_char_)
+ return a.shortname_char_ - b.shortname_char_;
- if (b.shortname_ch_ && a.longname_sz_)
+ if (b.shortname_char_ && a.longname_str0_)
{
- char s[2] = {b.shortname_ch_, 0};
- return strcmp (a.longname_sz_, s);
+ char s[2] = {b.shortname_char_, 0};
+ return strcmp (a.longname_str0_, s);
}
- if (a.shortname_ch_ && b.longname_sz_)
+ if (a.shortname_char_ && b.longname_str0_)
{
- char s[2] = {a.shortname_ch_, 0};
- return strcmp (s, b.longname_sz_);
+ char s[2] = {a.shortname_char_, 0};
+ return strcmp (s, b.longname_str0_);
}
- return strcmp (a.longname_sz_, b.longname_sz_);
+ return strcmp (a.longname_str0_, b.longname_str0_);
}
unsigned int
string_hash (String s)
{
- const char* str = s.ch_C ();
+ const char* str = s.to_str0 ();
unsigned int result = 0;
while (1) {
char c = *str++;
int max_;
/// the data itself
- T *array_p_;
+ T *array_;
/// stretch or shrink array.
void remax (int newmax)
{
T* newarr = new T[newmax];
size_ = (newmax < size_) ? newmax : size_;
- arrcpy (newarr, array_p_, size_);
+ arrcpy (newarr, array_, size_);
- delete[] array_p_;
- array_p_ = newarr;
+ delete[] array_;
+ array_ = newarr;
max_ = newmax;
}
int size_;
Array (T *tp, int n)
{
- array_p_ = new T[n];
+ array_ = new T[n];
max_ =size_ = n;
- arrcpy (array_p_, tp, n);
+ arrcpy (array_, tp, n);
}
Array ()
- { array_p_ = 0; max_ =0; size_ =0; }
+ { array_ = 0; max_ =0; size_ =0; }
// ugh, get around gcc 2.8.1 ice; see bezier.cc
Array (int i)
{
max_ = size_ = i;
- array_p_ = new T[i];
+ array_ = new T[i];
}
}
~Array ()
- { delete[] array_p_; }
+ { delete[] array_; }
/// return a "new"ed copy of array
- T* copy_array () const
+ T* copys () const
{
T* Tarray = new T[size_];
- arrcpy (Tarray, array_p_, size_);
+ arrcpy (Tarray, array_, size_);
return Tarray;
}
- T const *access_array () const
+ T const *accesses () const
{
- return array_p_;
+ return array_;
}
void operator= (Array const & src)
{
set_size (src.size_);
- arrcpy (array_p_,src.array_p_, size_);
+ arrcpy (array_,src.array_, size_);
}
Array (Array const & src)
{
- array_p_ = src.copy_array ();
+ array_ = src.copys ();
max_ = size_ = src.size_;
}
remax (size_);
}
- T * remove_array_p ();
+ T * remove_array ();
/// access element
T &operator[] (int i)
T &elem_ref (int i) const
{
assert (i >=0&&i<size_);
- return ((T*)array_p_)[i];
+ return ((T*)array_)[i];
}
/// access element
T elem (int i) const
// T::operator= (T &) is called here. Safe to use with automatic
// vars
- array_p_[size_++] = x;
+ array_[size_++] = x;
}
/// remove and return last entry
T pop ()
void del (int i)
{
assert (i >=0&& i < size_);
- arrcpy (array_p_+i, array_p_+i+1, size_-i-1);
+ arrcpy (array_+i, array_+i+1, size_-i-1);
size_--;
}
// quicksort.
{
int s = size_;
set_size (size_ + src.size_);
- arrcpy (array_p_+s,src.array_p_, src.size_);
+ arrcpy (array_+s,src.array_, src.size_);
}
Array<T> slice (int lower, int upper) const;
void reverse ();
assert (j >=0 && j<= size_);
set_size (size_+1);
for (int i=size_-1; i > j; i--)
- array_p_[i] = array_p_[i-1];
- array_p_[j] = k;
+ array_[i] = array_[i-1];
+ array_[j] = k;
}
template<class T> INLINE void
swap (lower, (lower+upper)/2);
int last = lower;
for (int i= lower +1; i <= upper; i++)
- if (compare (array_p_[i], array_p_[lower]) < 0)
+ if (compare (array_[i], array_[lower]) < 0)
swap (++last,i);
swap (lower, last);
sort (compare, lower, last-1);
Array<T>::OK () const
{
assert (max_ >= size_ && size_ >=0);
- if (max_) assert (array_p_);
+ if (max_) assert (array_);
}
template<class T> INLINE
T *
-Array<T>::remove_array_p ()
+Array<T>::remove_array ()
{
- T * p = array_p_;
+ T * p = array_;
size_ = 0;
max_ = 0;
- array_p_ =0;
+ array_ =0;
return p;
}
Array<T> r;
int s =upper-lower;
r.set_size (s);
- arrcpy (r.array_p_, array_p_ + lower, s);
+ arrcpy (r.array_, array_ + lower, s);
return r;
}
class String;
-String axis_name_str (Axis);
+String axis_name_string (Axis);
/**
class Binary_source_file : public Source_file
{
public:
- Binary_source_file (String& filename_str );
+ Binary_source_file (String& filename_string );
virtual ~Binary_source_file ();
U8 get_U8 ();
Byte get_Byte () {return get_U8 (); }
int get_int () { return get_U32 (); }
- virtual String error_str (char const* pos_ch_C ) const;
- virtual int line_i (char const* pos_ch_C ) const;
+ virtual String error_string (char const* pos_str0 ) const;
+ virtual int get_line (char const* pos_str0 ) const;
};
#endif // BINARY_SOURCE_FILE_HH
return knip;
}
-template<class T> int cons_list_size_i (Cons<T> *l)
+template<class T> int cons_list_size (Cons<T> *l)
{
int i=0;
while (l)
{
junk ();
}
- int size_i ()
+ int size ()
{
- return cons_list_size_i (head_);
+ return cons_list_size (head_);
}
};
*/
template<class T> T minmax (Direction d, T, T);
-// String direction_str (Direction, Axis);
+// String direction_string (Direction, Axis);
#endif // DIRECTION_HH
String base;
String ext;
- String str () const;
+ String string () const;
};
class File_path : private Array<String>
String find (String nm) const;
Array<String>::push;
- String str ()const;
+ String string ()const;
bool try_add (String str);
void add (String);
void parse_path (String);
class File_storage
{
public:
- virtual char const* ch_C () const=0;
- virtual int length_i () const=0;
+ virtual char const* to_str0 () const=0;
+ virtual int length () const=0;
virtual ~File_storage (){}
};
#define FPROTO_HH
-char const * flower_version_sz ();
+char const * flower_version_str0 ();
template<class T> struct Link_array;
template<class T> struct Array;
a struct this for initialising the commandline options.
*/
struct Long_option_init {
- char const * take_arg_sz_;
- char const * longname_sz_;
- char shortname_ch_;
+ char const * take_arg_str0_;
+ char const * longname_str0_;
+ char shortname_char_;
- char const * help_sz_;
+ char const * help_str0_;
- String str () const;
+ String string () const;
String str_for_help () const;
// NO constructor!
static int compare (Long_option_init const&,Long_option_init const&);
- static String table_str (Long_option_init *);
+ static String table_string (Long_option_init *);
};
/// the option info.
const Long_option_init *option_a_;
- int table_len_i_;
+ int table_len_;
- /// if doing short option, arg_value_ch_a_a_[optind][optindind] is processed next.
- int argument_index_i_;
+ /// if doing short option, arg_value_char_a_a_[optind][optindind] is processed next.
+ int argument_index_;
/// the option found
- const Long_option_init *found_option_l_;
+ const Long_option_init *found_option_;
public:
E_ILLEGALARG } ;
/// argument. Set to 0 if not present
- char const * optional_argument_ch_C_;
+ char const * optional_argument_str0_;
/// current error status
Errorcod error_;
- /// arg_value_ch_a_a_[array_index_i_] will be processed next.
- int array_index_i_;
+ /// arg_value_char_a_a_[array_index_] will be processed next.
+ int array_index_;
/// the arguments
- char **arg_value_ch_a_a_;
+ char **arg_value_char_a_a_;
/// the arg. count
- int argument_count_i_;
+ int argument_count_;
FILE *error_out_;
/// return an integer (with err. detect)
- long argument_to_i ();
+ long get_argument_index ();
/**
Base class for anything that records its poisition in the parse file.
*/
class Input {
- char const *defined_ch_C_ ;
- Source_file * source_file_l_;
+ char const *defined_str0_ ;
+ Source_file * source_file_;
public:
void warning (String) const; // should use member func?
void message (String) const;
void set_spot (Input const &);
Input spot () const;
- String location_str () const;
- String line_number_str () const;
+ String location_string () const;
+ String line_number_string () const;
- String file_str ()const;
+ String file_string ()const;
int line_number ()const;
int column_number ()const;
/* ************** */
static T infinity () ;
- static String T_to_str (T arg);
+ static String T_to_string (T arg);
T center () const {
assert (!empty_b ());
return (elem (LEFT) + elem (RIGHT)) / T (2);
Real linear_combination (Real x) const {
return ((1.0 - x) * Real (elem (LEFT)) + (x + 1.0) * Real (elem (RIGHT))) * 0.5;
}
- String str () const;
+ String string () const;
bool elem_b (T r);
void negate () {
template<class T>
String
-Interval_t<T>::str () const
+Interval_t<T>::string () const
{
if (empty_b ())
return "[empty]";
String s ("[");
- return s + T_to_str (elem (LEFT)) + String ("," ) + T_to_str (elem (RIGHT) ) + String ("]" );
+ return s + T_to_string (elem (LEFT)) + String ("," ) + T_to_string (elem (RIGHT) ) + String ("]" );
}
template<class T>
#include <cstddef>
#include <stdarg.h>
-char* strnlwr (char* start_l ,int n);
-char* strnupr (char* start_l, int n);
+char* strnlwr (char* start ,int n);
+char* strnupr (char* start, int n);
#if !HAVE_MEMMEM // GNU extension.
void *memmem (void const * haystack, int haystack_len,
#endif
Byte *memrchr (Byte const * p, int n, char c);
-Byte *strrev (Byte* byte_l, int length_i);
+Byte *strrev (Byte* byte, int length_i);
#endif // LIBC_EXTENSION_HH
public:
Mapped_file_storage (String);
protected:
- virtual char const* ch_C () const;
- virtual int length_i () const;
+ virtual char const* to_str0 () const;
+ virtual int length () const;
virtual ~Mapped_file_storage ();
private:
void open (String name);
void map ();
void unmap ();
- int fildes_i_;
+ int fildes_;
off_t size_off_;
caddr_t data_caddr_;
};
0.0;
}
- String str () const;
+ String string () const;
void mirror (Axis);
Real arg () const;
{
return (T*&) Array<void*>::top (i);
}
- void substitute (T *old, T*new_l)
+ void substitute (T *old, T*new_p)
{
int i;
- while ((i = find_i (old)) >=0)
- if (new_l)
- elem_ref (i) =new_l;
+ while ((i = find_index (old)) >=0)
+ if (new_p)
+ elem_ref (i) =new_p;
else
del (i);
}
- void unordered_substitute (T* old, T * new_l)
+ void unordered_substitute (T* old, T * new_p)
{
int i;
- while ((i = find_i (old)) >=0)
- if (new_l)
- elem_ref (i) =new_l;
+ while ((i = find_index (old)) >=0)
+ if (new_p)
+ elem_ref (i) =new_p;
else {
unordered_del (i);
}
int lower = -1, int upper = -1);
void uniq () {
- Link_array<T> l_arr;
+ Link_array<T> ls;
for (int i=0; i < size (); i++)
if (!i || elem (i-1) != elem (i))
- l_arr.push (elem (i));
- *this = l_arr;
+ ls.push (elem (i));
+ *this = ls;
}
Array<void*>::del;
Array<void*>::unordered_del;
}
- T ** access_array () const
+ T ** accesses () const
{
- return (T**) Array<void*>::access_array ();
+ return (T**) Array<void*>::accesses ();
}
T * get (int i)
{
{
Array<void*>::concat (a2);
}
- int find_i (T const * t) const {
+ int find_index (T const * t) const {
for (int i=0; i < size (); i++)
if (elem (i) == t)
return i;
return -1;
}
- T *find_l (T const *t) const
+ T *find (T const *t) const
{
- int i = find_i (t);
+ int i = find_index (t);
if (i >= 0)
return elem (i);
else
template<class T, class V>
Link_array<T>
-typecast_array (Link_array<V> const &a, T * /* dummy */ )
+typecasts (Link_array<V> const &a, T * /* dummy */ )
{
Link_array<T> ret;
for (int i=a.size (); i-- ; )
template<class T>
void
-junk_pointer_array (Link_array<T> &a)
+junk_pointers (Link_array<T> &a)
{
for (int i=0; i < a.size (); i++)
{
*/
template<class T>
int
-binsearch_array (Array<T> const &arr, T t, int (*compare) (T const&,T const&))
+binsearchs (Array<T> const &arr, T t, int (*compare) (T const&,T const&))
{
int lo;
int hi;
template<class T>
int
-binsearch_link_array (Link_array<T> const &arr, T *t,
+binsearch_links (Link_array<T> const &arr, T *t,
int (*compare) (T *const&,T *const&),
int lo = 0, int hi = -1 )
{
*/
template<class T>
class PQueue {
- Array<T> heap_arr_;
+ Array<T> heap_array_;
T &elt (int i) {
- return heap_arr_[i-1];
+ return heap_array_[i-1];
}
T const&elt (int i) const {
- return heap_arr_[i-1];
+ return heap_array_[i-1];
}
public:
/** acces an heap element. Careful with this, as changing the
priority might fuck up the invariants
@param 1 <= i < size () */
- T& operator[] (int i) { return heap_arr_[i]; }
- T operator[] (int i) const { return heap_arr_[i]; }
+ T& operator[] (int i) { return heap_array_[i]; }
+ T operator[] (int i) const { return heap_array_[i]; }
void OK () const
{
#ifndef NDEBUG
#endif
}
T front () const { return elt (1); }
- int size () const { return heap_arr_.size (); }
+ int size () const { return heap_array_.size (); }
void insert (T v) {
- heap_arr_.push (v);
- int i = heap_arr_.size ();
+ heap_array_.push (v);
+ int i = heap_array_.size ();
int j = i / 2 ;
while (j) {
if (compare (elt (j), v) > 0) {
}
void delmin () {
assert (size ());
- T last = heap_arr_.top ();
+ T last = heap_array_.top ();
int mini=2;
int lasti=1;
mini *= 2;
}
elt (lasti) = last;
- heap_arr_.pop ();
+ heap_array_.pop ();
OK ();
}
T get () {
Rational &operator %= (Rational);
static int compare (Rational const&, Rational const&);
int sign () const;
- String str () const;
+ String string () const;
};
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, / );
*/
class Simple_file_storage : public File_storage
{
- char * data_p_;
- int len_i_;
+ char * data_;
+ int len_;
void load_stdin ();
void load_file (String);
public:
- virtual char const*ch_C () const;
- virtual int length_i () const;
+ virtual char const*to_str0 () const;
+ virtual int length () const;
virtual ~Simple_file_storage ();
Simple_file_storage (String);
};
public:
/** Ugh! filename gets changed! The path to the opened file may
change, since it might be searched in multiple directories. */
- Source_file (String filename_str_r );
+ Source_file (String filename_string_r );
- Source_file (String name_str, String data_str);
+ Source_file (String name_string, String data_string);
virtual ~Source_file ();
- char const* ch_C () const;
- virtual String error_str (char const* pos_ch_C ) const;
- std::istream * istream_l ();
- bool in_b (char const* pos_ch_C ) const;
- int length_i () const;
- virtual int line_i (char const* pos_ch_C ) const;
- String name_str () const;
- String file_line_column_str (char const* ch_C ) const;
+ char const* to_str0 () const;
+ virtual String error_string (char const* pos_str0 ) const;
+ std::istream * get_istream ();
+ bool in_b (char const* pos_str0 ) const;
+ int length () const;
+ virtual int get_line (char const* pos_str0 ) const;
+ String name_string () const;
+ String file_line_column_string (char const* str0 ) const;
// return start + n
- char const* seek_ch_C (int n);
+ char const* seek_str0 (int n);
// return here + n bytes
- char const* forward_ch_C (int n);
- char const* pos_ch_C () { return pos_ch_C_; }
- String get_str (int n);
- void set_pos (char const * pos_ch_C);
+ char const* forward_str0 (int n);
+ char const* pos_str0 () { return pos_str0_; }
+ String get_string (int n);
+ void set_pos (char const * pos_str0);
public:
- Slice line_slice (char const* pos_ch_C) const;
- String line_str (char const* pos_ch_C) const;
- int column_i (char const* pos_ch_C) const;
- int char_i (char const* pos_ch_C) const;
+ Slice line_slice (char const* pos_str0) const;
+ String line_string (char const* pos_str0) const;
+ int get_column (char const* pos_str0) const;
+ int get_char (char const* pos_str0) const;
/*
DOCUMENT-ME
*/
- char const* pos_ch_C_;
+ char const* pos_str0_;
private:
- String name_str_;
- std::istream* istream_p_;
- File_storage * storage_p_;
+ String name_string_;
+ std::istream* istream_;
+ File_storage * storage_;
};
#endif // SOURCE_FILE_HH //
Sources ();
~Sources ();
- Source_file * get_file_l (String &filename );
- Source_file* sourcefile_l (char const* ch_C );
- void add (Source_file* sourcefile_p );
- void set_path (File_path*p_C);
+ Source_file * get_file (String &filename );
+ Source_file* get_sourcefile (char const* str0 );
+ void add (Source_file* sourcefile );
+ void set_path (File_path*p);
void set_binary (bool);
const File_path * path_C_;
/** The functor String_convert handles all conversions to/from String
(some time, anyway). The class is quite empty from data view. */
class String_convert {
- static int hex2bin_i (String hex_str, String& bin_str_r);
- static int hex2nibble_i (Byte byte);
+ static int hex2bin (String hex_string, String& bin_string_r);
+ static int hex2nibble (Byte byte);
static Byte nibble2hex_byte (Byte byte);
public:
static String pad_to (String s, int length);
- static String bool_str (bool b);
- static String bin2dec_str (String bin_str);
- static String bin2hex_str (String bin_str);
- static String dec2bin_str (String str);
- static int bin2_i (String bin_str);
- static unsigned bin2_u (String bin_str);
- static String char_str (char c, int n);
- static int dec2_i (String dec_str);
- static double dec2_f (String dec_str);
- static String double_str (double f, char const* fmt=0);
- static String form_str (char const* format, ...);
- static String vform_str (char const* format, va_list args);
- static int hex2_i (String str);
- static unsigned hex2_u (String str);
- static String hex2bin_str (String str);
- static String int_str (int i, char const *fmt=0 );
- static String long_str (long);
- static String i2hex_str (int i, int length_i, char ch);
- static String u2hex_str (unsigned u, int length_i, char ch);
- static String i2dec_str (int i, int length_i, char ch);
- static String rational_str (Rational);
- static String pointer_str (void const *);
- static String precision_str (double x, int n);
- static Array<String> split_arr (String str, char c);
- static String i64_str (I64, char const * fmt = 0);
+ static String bool_string (bool b);
+ static String bin2dec (String bin_string);
+ static String bin2hex (String bin_string);
+ static String dec2bin (String str);
+ static int bin2int (String bin_string);
+ static unsigned bin2unsigned (String bin_string);
+ static String char_string (char c, int n);
+ static int dec2int (String dec_string);
+ static double dec2double (String dec_string);
+ static String double_string (double f, char const* fmt=0);
+ static String form_string (char const* format, ...);
+ static String vform_string (char const* format, va_list args);
+ static int hex2int (String str);
+ static unsigned hex2unsigned (String str);
+ static String hex2bin (String str);
+ static String int_string (int i, char const *fmt=0 );
+ static String long_string (long);
+ static String int2hex (int i, int length_i, char ch);
+ static String unsigned2hex (unsigned u, int length_i, char ch);
+ static String int2dec (int i, int length_i, char ch);
+ static String rational_string (Rational);
+ static String pointer_string (void const *);
+ static String precision_string (double x, int n);
+ static Array<String> split (String str, char c);
+ static String i64_string (I64, char const * fmt = 0);
};
#endif // __STRING_CONVERT_HH //
friend class String_handle;
int maxlen; // maxlen is arraysize-1
- int length_i_;
- Byte* data_byte_p_;
+ int length_;
+ Byte* data_byte_;
int references;
/// init to ""
~String_data ();
/** POST: maxlen >= j.
- @param j, maximum stringlength_i_.
+ @param j, maximum stringlength_.
contents thrown away.
*/
void setmax (int j);
/** POST: maxlen >= j.
- @param j, maximum stringlength_i_.
+ @param j, maximum stringlength_.
contents are kept if it grows.
*/
void remax (int j);
void tighten ();
// assignment.
- void set (Byte const* byte_C, int length_i);
+ void set (Byte const* byte, int length_i);
- void set (char const* ch_C);
+ void set (char const* str0);
/// concatenation.
- void append (Byte const* byte_C, int length_i);
+ void append (Byte const* byte, int length_i);
- void operator += (char const* ch_C);
+ void operator += (char const* str0);
- char const* ch_C () const;
+ char const* to_str0 () const;
- char* ch_l ();
+ char* get_str0 ();
- Byte const* byte_C () const;
+ Byte const* to_bytes () const;
// idem, non const
- Byte* byte_l ();
+ Byte* get_bytes ();
void trunc (int j);
- /** access element. not really safe. Can alter length_i_ without
+ /** access element. not really safe. Can alter length_ without
#String_data# knowing it. */
Byte &operator [] (int j);
Byte operator [] (int j) const;
INLINE void
String_data::OK ()
{
- assert (maxlen >= length_i_);
- assert (bool (data_byte_p_));
+ assert (maxlen >= length_);
+ assert (bool (data_byte_));
assert (references >= 1);
}
{
references=0;
maxlen = INITIALMAX;
- data_byte_p_ = new Byte[maxlen + 1];
- data_byte_p_[0] = 0;
- length_i_ = 0;
+ data_byte_ = new Byte[maxlen + 1];
+ data_byte_[0] = 0;
+ length_ = 0;
}
INLINE
String_data::String_data (String_data const &src)
{
references=0;
- maxlen = length_i_ = src.length_i_;
- data_byte_p_ = new Byte[maxlen+1]; // should calc GNU 8byte overhead.
- memcpy (data_byte_p_, src.data_byte_p_, length_i_ + 1);
+ maxlen = length_ = src.length_;
+ data_byte_ = new Byte[maxlen+1]; // should calc GNU 8byte overhead.
+ memcpy (data_byte_, src.data_byte_, length_ + 1);
}
INLINE
String_data::~String_data ()
{
assert (references == 0);
- delete[] data_byte_p_;
+ delete[] data_byte_;
}
INLINE void
OKW ();
if (j > maxlen)
{
- delete data_byte_p_;
+ delete data_byte_;
maxlen = j;
- data_byte_p_ = new Byte[maxlen + 1];
+ data_byte_ = new Byte[maxlen + 1];
- data_byte_p_[0] = 0;
- length_i_ = 0;
+ data_byte_[0] = 0;
+ length_ = 0;
}
}
/* this is all quite hairy:
- update of length_i_
+ update of length_
update of maxlen
alloc of buffer
copying of buffer
if (j > maxlen)
{
Byte *p = new Byte[j + 1];
- memcpy (p, data_byte_p_, (maxlen <? length_i_) + 1 );
+ memcpy (p, data_byte_, (maxlen <? length_) + 1 );
maxlen = j;
- delete[] data_byte_p_;
- data_byte_p_ = p;
+ delete[] data_byte_;
+ data_byte_ = p;
}
}
INLINE void
String_data::tighten ()
{ // should be dec'd const
- maxlen = length_i_;
+ maxlen = length_;
Byte *p = new Byte[maxlen + 1];
- memcpy (p, data_byte_p_, length_i_ + 1);
- delete[] data_byte_p_;
- data_byte_p_ = p;
+ memcpy (p, data_byte_, length_ + 1);
+ delete[] data_byte_;
+ data_byte_ = p;
}
// assignment.
INLINE void
-String_data::set (Byte const* byte_C, int length_i)
+String_data::set (Byte const* byte, int length_i)
{
OKW ();
- assert (byte_C && byte_C != data_byte_p_);
+ assert (byte && byte != data_byte_);
- length_i_ = length_i;
- remax (length_i_); // copies too
- memcpy (data_byte_p_, byte_C, length_i_);
- data_byte_p_[ length_i_ ] = 0;
+ length_ = length_i;
+ remax (length_); // copies too
+ memcpy (data_byte_, byte, length_);
+ data_byte_[ length_ ] = 0;
}
INLINE
void
-String_data::set (char const* ch_C)
+String_data::set (char const* str0)
{
- set ((Byte const*)ch_C, strlen (ch_C) );
+ set ((Byte const*)str0, strlen (str0) );
}
/// concatenation.
INLINE void
-String_data::append (Byte const* byte_C, int length_i)
+String_data::append (Byte const* byte, int length_i)
{
OK ();
OKW ();
- int old_i = length_i_;
+ int old_i = length_;
- length_i_ += length_i;
- remax (length_i_);
- memcpy (data_byte_p_ + old_i, byte_C, length_i);
- data_byte_p_[ length_i_ ] = 0;
+ length_ += length_i;
+ remax (length_);
+ memcpy (data_byte_ + old_i, byte, length_i);
+ data_byte_[ length_ ] = 0;
}
INLINE
void
-String_data::operator += (char const* ch_C)
+String_data::operator += (char const* str0)
{
- append ((Byte const*)ch_C, strlen (ch_C) );
+ append ((Byte const*)str0, strlen (str0) );
}
INLINE
char const*
-String_data::ch_C () const
+String_data::to_str0 () const
{
- return (char const*)data_byte_p_;
+ return (char const*)data_byte_;
}
INLINE char*
-String_data::ch_l ()
+String_data::get_str0 ()
{
- return (char*)data_byte_p_;
+ return (char*)data_byte_;
}
INLINE Byte const*
-String_data::byte_C () const
+String_data::to_bytes () const
{
- return data_byte_p_;
+ return data_byte_;
}
INLINE Byte*
-String_data::byte_l ()
+String_data::get_bytes ()
{
OKW ();
- return data_byte_p_;
+ return data_byte_;
}
INLINE
String_data::trunc (int j)
{
OKW ();
- assert (j >= 0 && j <= length_i_);
- data_byte_p_[j] = 0;
- length_i_ = j;
+ assert (j >= 0 && j <= length_);
+ data_byte_[j] = 0;
+ length_ = j;
}
INLINE bool
String_data::is_binary_bo () const
{
- // return !memchr (data_byte_p_, length_i_, 0);
- return ((int)strlen ((char const*)data_byte_p_) != length_i_ );
+ // return !memchr (data_byte_, length_, 0);
+ return ((int)strlen ((char const*)data_byte_) != length_ );
}
INLINE Byte&
String_data::operator [] (int j)
{
- assert (j >= 0 && j <= length_i_);
- return data_byte_p_[j] ;
+ assert (j >= 0 && j <= length_);
+ return data_byte_[j] ;
}
INLINE Byte
String_data::operator [] (int j) const
{
- assert (j >= 0 && j <= length_i_);
- return data_byte_p_[j];
+ assert (j >= 0 && j <= length_);
+ return data_byte_[j];
}
~String_handle ();
String_handle (String_handle const & src);
- Byte const* byte_C () const;
- char const* ch_C () const;
- Byte* byte_l ();
- char* ch_l ();
+ Byte const* to_bytes () const;
+ char const* to_str0 () const;
+ Byte* get_bytes ();
+ char* get_str0 ();
bool is_binary_bo () const;
void operator = (String_handle const &src);
void operator += (char const *s);
Byte operator[] (int j) const;
/** Access elements. WARNING: NOT SAFE
- don't use this for loops. Use byte_C ()
+ don't use this for loops. Use to_bytes ()
*/
Byte &operator[] (int j);
- void append (Byte const* byte_C, int length_i);
- void set (Byte const* byte_C, int length_i);
+ void append (Byte const* byte, int length_i);
+ void set (Byte const* byte, int length_i);
void operator = (char const *p);
void trunc (int j);
- int length_i () const;
+ int length () const;
};
#ifdef STRING_UTILS_INLINED
}
INLINE Byte*
-String_handle::byte_l ()
+String_handle::get_bytes ()
{
copy ();
- return data->byte_l ();
+ return data->get_bytes ();
}
INLINE char*
-String_handle::ch_l ()
+String_handle::get_str0 ()
{
copy ();
- return (char*)data->byte_l ();
+ return (char*)data->get_bytes ();
}
INLINE Byte
-const* String_handle::byte_C () const
+const* String_handle::to_bytes () const
{
- return data->byte_C ();
+ return data->to_bytes ();
}
INLINE char const*
-String_handle::ch_C () const
+String_handle::to_str0 () const
{
- return (char const*)data->byte_C ();
+ return (char const*)data->to_bytes ();
}
INLINE void
}
// !NOT SAFE!
-// don't use this for loops. Use byte_C ()
+// don't use this for loops. Use to_bytes ()
INLINE Byte &
String_handle::operator[] (int j)
{
copy (); // hmm. Not efficient
- return data->byte_l ()[j];
+ return data->get_bytes ()[j];
}
INLINE void
-String_handle::append (Byte const* byte_C, int length_i)
+String_handle::append (Byte const* byte, int length_i)
{
copy ();
- data->append (byte_C, length_i);
+ data->append (byte, length_i);
}
INLINE void
-String_handle::set (Byte const* byte_C, int length_i)
+String_handle::set (Byte const* byte, int length_i)
{
copy ();
- data->set (byte_C, length_i);
+ data->set (byte, length_i);
}
INLINE void
}
INLINE int
-String_handle::length_i () const
+String_handle::length () const
{
- return data->length_i_;
+ return data->length_;
}
INLINE bool
String_storage (String s) : String (s) { }
protected:
- virtual char const* ch_C () const { return String::ch_C (); }
- virtual int length_i () const { return String::length_i (); }
+ virtual char const* to_str0 () const { return String::to_str0 (); }
+ virtual int length () const { return String::length (); }
};
#endif /* STRING_STORAGE_HH */
indexing (index_i, index_any_i, last_index_i)
\item
- cutting (left_str, right_str, mid_str)
+ cutting (left_string, right_string, mid_string)
\item
concat (+=, +)
/// String s = "abc";
String (char const* source);
- String (Byte const* byte_C, int length_i);
+ String (Byte const* byte, int length_i);
/// return "new"-ed copy of contents
- Byte* copy_byte_p () const;
- char* copy_ch_p () const;
+ Byte* get_copy_byte () const;
+ char* get_copy_str0 () const;
- char const* ch_C () const;
- Byte const* byte_C () const;
- char* ch_l ();
- Byte* byte_l ();
+ char const* to_str0 () const;
+ Byte const* to_bytes () const;
+ char* get_str0 ();
+ Byte* get_bytes ();
String &operator = (String const & source);
char operator [] (int n) const;
/// return n leftmost chars
- String left_str (int n) const;
+ String left_string (int n) const;
/// return n rightmost chars
- String right_str (int n) const;
+ String right_string (int n) const;
/// return uppercase of *this
- String upper_str () const;
+ String upper_string () const;
/// return lowercase of *this
- String lower_str () const;
+ String lower_string () const;
/// return the "esrever" of *this
- String reversed_str () const;
+ String reversed_string () const;
- /// return a piece starting at index_i (first char = index_i 0), length n
- String cut_str (int index_i, int n) const;
+ /// return a piece starting at index (first char = index_i 0), length n
+ String cut_string (int index_i, int n) const;
/// cut out a middle piece, return remainder
- String nomid_str (int index_i, int n) const;
+ String nomid_string (int index_i, int n) const;
/// signed comparison, analogous to memcmp;
- static int compare_i (String const & s1,const String& s2);
+ static int compare (String const & s1,const String& s2);
/// index of rightmost c
- int index_last_i (char c) const;
+ int index_last (char c) const;
/// index of rightmost element of string (???)
- int index_last_i (char const* string) const;
+ int index_last (char const* string) const;
- int index_i (char c) const;
+ int index (char c) const;
/// index of leftmost occurance of STRING
- int index_i (String) const;
+ int index (String) const;
- int index_any_i (String) const;
+ int index_any (String) const;
void to_upper ();
void to_lower ();
#endif
/// the length of the string
- int length_i () const;
+ int length () const;
/// convert to an integer
- int value_i () const;
+ int to_int () const;
/// convert to a double
- double value_f () const;
+ double to_double () const;
};
/*
*/
/// for completeness (=handy)
-inline String to_str (String s) { return s; }
+inline String to_string (String s) { return s; }
/// "cccc"
-String to_str (char c, int n = 1);
-String to_str (int i, char const* format = 0);
-String to_str (double f , char const* format = 0);
-String to_str (long b);
-String to_str (bool b);
-String to_str (char const* format, ... );
+String to_string (char c, int n = 1);
+String to_string (int i, char const* format = 0);
+String to_string (double f , char const* format = 0);
+String to_string (long b);
+String to_string (bool b);
+String to_string (char const* format, ... );
/*
technically incorrect, but lets keep it here: this is a
#include "compare.hh"
-INSTANTIATE_COMPARE (String const &, String::compare_i);
+INSTANTIATE_COMPARE (String const &, String::compare);
#ifdef STRING_UTILS_INLINED
#ifndef INLINE
#include "string.hh"
void programming_error (String s);
-void warning (String message_str);
-void error (String message_str);
+void warning (String message_string);
+void error (String message_string);
void non_fatal_error (String);
#endif // WARN_HH
Input::Input (Source_file*s, char const *cl)
{
- source_file_l_=s;
- defined_ch_C_=cl;
+ source_file_=s;
+ defined_str0_=cl;
}
Input::Input ()
{
- source_file_l_ = 0;
- defined_ch_C_ = 0;
+ source_file_ = 0;
+ defined_str0_ = 0;
}
Input
*/
void
-Input::message (String message_str) const
+Input::message (String message_string) const
{
String str;
if (col > 0)
str += "\n";
- if (source_file_l_)
- str += location_str () + String (": ");
+ if (source_file_)
+ str += location_string () + String (": ");
- str += message_str;
- if (source_file_l_)
+ str += message_string;
+ if (source_file_)
{
str += ":\n";
- str += source_file_l_->error_str (defined_ch_C_);
+ str += source_file_->error_string (defined_str0_);
}
- fprintf (stderr, "%s\n", str.ch_C());
+ fprintf (stderr, "%s\n", str.to_str0 ());
}
void
-Input::warning (String message_str) const
+Input::warning (String message_string) const
{
- message (_ ("warning: ") + message_str);
+ message (_ ("warning: ") + message_string);
}
void
Input::error (String s) const
message (_ ("non fatal error: ") + s);
}
String
-Input::location_str () const
+Input::location_string () const
{
- if (source_file_l_)
- return source_file_l_->file_line_column_str (defined_ch_C_);
+ if (source_file_)
+ return source_file_->file_line_column_string (defined_str0_);
else
return " (" + _ ("position unknown") + ")";
}
String
-Input::line_number_str () const
+Input::line_number_string () const
{
- if (source_file_l_)
- return to_str (source_file_l_->line_i (defined_ch_C_));
+ if (source_file_)
+ return to_string (source_file_->get_line (defined_str0_));
else
return "?";
}
String
-Input::file_str () const
+Input::file_string () const
{
- if (source_file_l_)
- return source_file_l_->name_str ();
+ if (source_file_)
+ return source_file_->name_string ();
else
return "";
}
int
Input::line_number () const
{
- if (source_file_l_)
- return source_file_l_->line_i (defined_ch_C_);
+ if (source_file_)
+ return source_file_->get_line (defined_str0_);
else
return 0;
int
Input::column_number () const
{
- if (source_file_l_)
- return source_file_l_->column_i (defined_ch_C_);
+ if (source_file_)
+ return source_file_->get_column (defined_str0_);
else
return 0;
{
va_list args;
va_start (args, format);
- String str = String_convert::vform_str (gettext (format), args);
+ String str = String_convert::vform_string (gettext (format), args);
va_end (args);
return str;
}
String
_f (char const* format, String s, String s2, String s3)
{
- return String_convert::form_str (gettext (format), s.ch_C (), s2.ch_C (),
- s3.ch_C ());
+ return String_convert::form_string (gettext (format), s.to_str0 (), s2.to_str0 (),
+ s3.to_str0 ());
}
}
String
-Interval_t<Real>::T_to_str (Real r)
+Interval_t<Real>::T_to_string (Real r)
{
- return to_str (r);
+ return to_string (r);
}
}
String
-Interval_t<int>::T_to_str (int i)
+Interval_t<int>::T_to_string (int i)
{
- return to_str (i);
+ return to_string (i);
}
template INTERVAL__INSTANTIATE (int);
urg: why soo wierd?
*/
char*
-strnlwr (char* start_l ,int n)
+strnlwr (char* start ,int n)
{
- char * p = start_l + n;
- while (--p >= start_l)
+ char * p = start + n;
+ while (--p >= start)
{
*p = tolower (*p); /* a macro on some compilers */
}
- return start_l;
+ return start;
}
char*
-strnupr (char* start_l, int n)
+strnupr (char* start, int n)
{
- char * p = start_l + n;
- while (--p >= start_l)
+ char * p = start + n;
+ while (--p >= start)
{
*p = toupper (*p); /* a macro on some compilers */
}
- return start_l;
+ return start;
}
is the spice of life */
while (haystack < end_haystack)
{
- Byte const *subneedle_l = needle;
- Byte const *subhaystack_l = haystack;
- while (subneedle_l < end_needle)
- if (*subneedle_l++ != *subhaystack_l++)
+ Byte const *subneedle = needle;
+ Byte const *subhaystack = haystack;
+ while (subneedle < end_needle)
+ if (*subneedle++ != *subhaystack++)
goto next;
// completed the needle. Gotcha.
memmem (void const *haystack, int haystack_len,
void const *needle,int needle_len)
{
- Byte const* haystack_byte_c_l = (Byte const*)haystack;
- Byte const* needle_byte_c_l = (Byte const*)needle;
- return _memmem (haystack_byte_c_l, haystack_len, needle_byte_c_l, needle_len);
+ Byte const* haystack_byte_c = (Byte const*)haystack;
+ Byte const* needle_byte_c = (Byte const*)needle;
+ return _memmem (haystack_byte_c, haystack_len, needle_byte_c, needle_len);
}
#endif
}
Byte*
-strrev (Byte* byte_l, int length_i)
+strrev (Byte* byte, int length_i)
{
Byte tmp_byte;
- Byte* left_l = byte_l;
- Byte* right_l = byte_l + length_i;
+ Byte* left = byte;
+ Byte* right = byte + length_i;
- while (right_l > left_l)
+ while (right > left)
{
- my_swap (*right_l-- , *left_l++ , tmp_byte);
+ my_swap (*right-- , *left++ , tmp_byte);
}
- return byte_l;
+ return byte;
}
#if ! HAVE_SNPRINTF
Mapped_file_storage::Mapped_file_storage (String s)
{
data_caddr_ = 0;
- fildes_i_ = 0;
+ fildes_ = 0;
size_off_ = 0;
open (s);
}
char const*
-Mapped_file_storage::ch_C () const
+Mapped_file_storage::to_str0 () const
{
return (char const*)data_caddr_;
}
void
Mapped_file_storage::map ()
{
- if (fildes_i_ == -1)
+ if (fildes_ == -1)
return;
#ifdef __NeXT__
vm_offset_t address;
kern_return_t r;
- r = map_fd (fildes_i_, (vm_offset_t) 0, &address, TRUE, size_off_);
+ r = map_fd (fildes_, (vm_offset_t) 0, &address, TRUE, size_off_);
if (r != KERN_SUCCESS)
warning (String ("map_fd: ") + mach_error_string (r));
else
}
#else
- data_caddr_ = (caddr_t)mmap ((void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0);
+ data_caddr_ = (caddr_t)mmap ((void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_, 0);
if ((int)data_caddr_ == -1)
warning (_ ("can't map file") + ": " + strerror (errno));
void
-Mapped_file_storage::open (String name_str)
+Mapped_file_storage::open (String name_string)
{
- fildes_i_ = ::open (name_str.ch_C (), O_RDONLY);
+ fildes_ = ::open (name_string.to_str0 (), O_RDONLY);
- if (fildes_i_ == -1)
+ if (fildes_ == -1)
{
- warning (_f ("can't open file: `%s'", name_str)
+ warning (_f ("can't open file: `%s'", name_string)
+ ": " + strerror (errno));
return;
}
struct stat file_stat;
- fstat (fildes_i_, &file_stat);
+ fstat (fildes_, &file_stat);
size_off_ = file_stat.st_size;
map ();
}
Mapped_file_storage::close ()
{
unmap ();
- if (fildes_i_)
+ if (fildes_)
{
- ::close (fildes_i_);
- fildes_i_ = 0;
+ ::close (fildes_);
+ fildes_ = 0;
}
}
int
-Mapped_file_storage::length_i () const
+Mapped_file_storage::length () const
{
return size_off_;
}
#ifndef STANDALONE
String
-Offset::str () const
+Offset::string () const
{
String s;
- s = String (" (") + to_str (coordinate_a_[X_AXIS]) + ", "
- + to_str (coordinate_a_[Y_AXIS]) + ")";
+ s = String (" (") + to_string (coordinate_a_[X_AXIS]) + ", "
+ + to_string (coordinate_a_[Y_AXIS]) + ")";
return s;
}
#endif
/* use Cardano's formula */
- Real cb_p = p * p * p;
- Real D = q * q + cb_p;
+ Real cb = p * p * p;
+ Real D = q * q + cb;
if (iszero (D)) {
if (iszero (q)) { /* one triple solution */
sol.push (-u);
}
} else if (D < 0) { /* Casus irreducibilis: three real solutions */
- Real phi = 1.0 / 3 * acos (-q / sqrt (-cb_p));
+ Real phi = 1.0 / 3 * acos (-q / sqrt (-cb));
Real t = 2 * sqrt (-p);
sol.push (t * cos (phi));
ostream &
operator << (ostream &o, Rational r)
{
- o << r.str ();
+ o << r.string ();
return o;
}
#endif
}
String
-Rational::str () const
+Rational::string () const
{
if (infty_b ())
{
String s (sign_ > 0 ? "" : "-" );
return String (s + "infinity");
}
- String s = to_str (num ());
+ String s = to_string (num ());
if (den () != 1 && num ())
- s += "/" + to_str (den ());
+ s += "/" + to_string (den ());
return s;
}
void
Simple_file_storage::load_stdin ()
{
- len_i_ = 0;
+ len_ = 0;
int c;
- Array<char> ch_arr;
+ Array<char> chs;
while ((c = fgetc (stdin)) != EOF)
- ch_arr.push (c);
- len_i_ = ch_arr.size ();
- data_p_ = ch_arr.remove_array_p ();
+ chs.push (c);
+ len_ = chs.size ();
+ data_ = chs.remove_array ();
}
void
let's hope that "b" opens anything binary, and does not apply
CR/LF translation
*/
- FILE * f = fopen (s.ch_C (), "rb");
+ FILE * f = fopen (s.to_str0 (), "rb");
if (!f)
{
}
int ret = fseek (f, 0, SEEK_END);
- len_i_ = ftell (f);
+ len_ = ftell (f);
rewind (f);
- data_p_ = new char[len_i_+1];
- data_p_[len_i_] = 0;
- ret = fread (data_p_, sizeof (char), len_i_, f);
+ data_ = new char[len_+1];
+ data_[len_] = 0;
+ ret = fread (data_, sizeof (char), len_, f);
- if (ret!=len_i_)
- warning (_f ("Huh? Got %d, expected %d characters", ret, len_i_));
+ if (ret!=len_)
+ warning (_f ("Huh? Got %d, expected %d characters", ret, len_));
fclose (f);
}
Simple_file_storage::Simple_file_storage (String s)
{
- data_p_ = 0;
- len_i_ = 0;
+ data_ = 0;
+ len_ = 0;
if ((s == "-"))
load_stdin ();
}
char const*
-Simple_file_storage::ch_C () const
+Simple_file_storage::to_str0 () const
{
- return data_p_;
+ return data_;
}
int
-Simple_file_storage::length_i () const
+Simple_file_storage::length () const
{
- return len_i_;
+ return len_;
}
Simple_file_storage::~Simple_file_storage ()
{
- delete []data_p_;
+ delete []data_;
}
#include <sstream>
#else
#include <strstream.h>
-#define istringstream(x) istrstream(x, length_i ())
+#define istringstream(x) istrstream(x, length ())
#endif
#include "string.hh"
#include "simple-file-storage.hh"
#include "string-storage.hh"
-Source_file::Source_file (String filename_str)
+Source_file::Source_file (String filename_string)
{
- name_str_ = filename_str;
- istream_p_ = 0;
- storage_p_ = new Simple_file_storage (filename_str);
- pos_ch_C_ = ch_C ();
+ name_string_ = filename_string;
+ istream_ = 0;
+ storage_ = new Simple_file_storage (filename_string);
+ pos_str0_ = to_str0 ();
}
-Source_file::Source_file (String name_str, String data_str)
+Source_file::Source_file (String name_string, String data_string)
{
- name_str_ = name_str;
- istream_p_ = 0;
- storage_p_ = new String_storage (data_str);
- pos_ch_C_ = ch_C ();
+ name_string_ = name_string;
+ istream_ = 0;
+ storage_ = new String_storage (data_string);
+ pos_str0_ = to_str0 ();
}
std::istream*
-Source_file::istream_l ()
+Source_file::get_istream ()
{
/*
- if (!name_str_.length_i ())
+ if (!name_string_.length ())
return &cin;
*/
- if (!istream_p_)
+ if (!istream_)
{
- if (length_i ()) // can-t this be done without such a hack?
- istream_p_ = new std::istringstream (ch_C ());
+ if (length ()) // can-t this be done without such a hack?
+ istream_ = new std::istringstream (to_str0 ());
else
{
- istream_p_ = new std::istringstream ("");
- istream_p_->setstate (std::ios::eofbit);
- // istream_p_->set (ios::eofbit);
+ istream_ = new std::istringstream ("");
+ istream_->setstate (std::ios::eofbit);
+ // istream_->set (ios::eofbit);
}
}
- return istream_p_;
+ return istream_;
}
String
-Source_file::file_line_column_str (char const *context_ch_C) const
+Source_file::file_line_column_string (char const *context_str0) const
{
- if (!ch_C ())
+ if (!to_str0 ())
return " (" + _ ("position unknown") + ")";
else
- return name_str () + ":" + to_str (line_i (context_ch_C))
- + ":" + to_str (char_i (context_ch_C));
+ return name_string () + ":" + to_string (get_line (context_str0))
+ + ":" + to_string (get_char (context_str0));
}
String
-Source_file::name_str () const
+Source_file::name_string () const
{
- return name_str_;
+ return name_string_;
}
Source_file::~Source_file ()
{
- delete istream_p_;
- istream_p_ = 0;
- delete storage_p_;
+ delete istream_;
+ istream_ = 0;
+ delete storage_;
}
Slice
-Source_file::line_slice (char const* pos_ch_C) const
+Source_file::line_slice (char const* pos_str0) const
{
- if (!in_b (pos_ch_C))
+ if (!in_b (pos_str0))
return Slice (0,0);
- char const* data_ch_C = ch_C ();
- char const * eof_C_ = data_ch_C + length_i ();
+ char const* data_str0 = to_str0 ();
+ char const * eof_C_ = data_str0 + length ();
- if (pos_ch_C == eof_C_)
- pos_ch_C --;
- char const* begin_ch_C = pos_ch_C;
- while (begin_ch_C > data_ch_C)
- if (*--begin_ch_C == '\n')
+ if (pos_str0 == eof_C_)
+ pos_str0 --;
+ char const* begin_str0 = pos_str0;
+ while (begin_str0 > data_str0)
+ if (*--begin_str0 == '\n')
{
- begin_ch_C++;
+ begin_str0++;
break;
}
- char const* end_ch_C = pos_ch_C;
- while (end_ch_C < eof_C_)
- if (*end_ch_C++ == '\n')
+ char const* end_str0 = pos_str0;
+ while (end_str0 < eof_C_)
+ if (*end_str0++ == '\n')
{
- end_ch_C--;
+ end_str0--;
break;
}
- return Slice (begin_ch_C - data_ch_C, end_ch_C - data_ch_C);
+ return Slice (begin_str0 - data_str0, end_str0 - data_str0);
}
String
-Source_file::line_str (char const* pos_ch_C) const
+Source_file::line_string (char const* pos_str0) const
{
- if (!in_b (pos_ch_C))
+ if (!in_b (pos_str0))
return "";
- Slice line = line_slice (pos_ch_C);
- char const* data_ch_C = ch_C ();
- return String ((Byte const*)data_ch_C + line[LEFT], line.length ());
+ Slice line = line_slice (pos_str0);
+ char const* data_str0 = to_str0 ();
+ return String ((Byte const*)data_str0 + line[LEFT], line.length ());
}
int
-Source_file::char_i (char const* pos_ch_C) const
+Source_file::get_char (char const* pos_str0) const
{
- if (!in_b (pos_ch_C))
+ if (!in_b (pos_str0))
return 0;
- char const* data_ch_C = ch_C ();
- return pos_ch_C - (line_slice (pos_ch_C)[SMALLER] + data_ch_C);
+ char const* data_str0 = to_str0 ();
+ return pos_str0 - (line_slice (pos_str0)[SMALLER] + data_str0);
}
int
-Source_file::column_i (char const* pos_ch_C) const
+Source_file::get_column (char const* pos_str0) const
{
- if (!in_b (pos_ch_C))
+ if (!in_b (pos_str0))
return 0;
- int ch_i = char_i (pos_ch_C);
- String line = line_str (pos_ch_C);
+ int ch_i = get_char (pos_str0);
+ String line = line_string (pos_str0);
int col_i = 0;
for (int i = 0; i < ch_i; i++)
}
String
-Source_file::error_str (char const* pos_ch_C) const
+Source_file::error_string (char const* pos_str0) const
{
- if (!in_b (pos_ch_C))
+ if (!in_b (pos_str0))
return " (" + _ ("position unknown") + ")";
- int ch_i = char_i (pos_ch_C);
- String line = line_str (pos_ch_C);
- String context = line.left_str (ch_i)
- + to_str ('\n')
- + to_str (' ', column_i (pos_ch_C))
- + line.cut_str (ch_i, INT_MAX);
+ int ch_i = get_char (pos_str0);
+ String line = line_string (pos_str0);
+ String context = line.left_string (ch_i)
+ + to_string ('\n')
+ + to_string (' ', get_column (pos_str0))
+ + line.cut_string (ch_i, INT_MAX);
return context;
}
bool
-Source_file::in_b (char const* pos_ch_C) const
+Source_file::in_b (char const* pos_str0) const
{
- return (pos_ch_C && (pos_ch_C >= ch_C ()) && (pos_ch_C <= ch_C () + length_i ()));
+ return (pos_str0 && (pos_str0 >= to_str0 ()) && (pos_str0 <= to_str0 () + length ()));
}
int
-Source_file::line_i (char const* pos_ch_C) const
+Source_file::get_line (char const* pos_str0) const
{
- if (!in_b (pos_ch_C))
+ if (!in_b (pos_str0))
return 0;
int i = 1;
- char const* scan_ch_C = ch_C ();
- if (!scan_ch_C)
+ char const* scan_str0 = to_str0 ();
+ if (!scan_str0)
return 0;
- while (scan_ch_C < pos_ch_C)
- if (*scan_ch_C++ == '\n')
+ while (scan_str0 < pos_str0)
+ if (*scan_str0++ == '\n')
i++;
return i;
}
int
-Source_file::length_i () const
+Source_file::length () const
{
- return storage_p_->length_i ();
+ return storage_->length ();
}
char const *
-Source_file::ch_C () const
+Source_file::to_str0 () const
{
- return storage_p_->ch_C ();
+ return storage_->to_str0 ();
}
void
-Source_file::set_pos (char const * pos_ch_C)
+Source_file::set_pos (char const * pos_str0)
{
- if (in_b (pos_ch_C))
- pos_ch_C_ = pos_ch_C;
+ if (in_b (pos_str0))
+ pos_str0_ = pos_str0;
else
- error (error_str (pos_ch_C) + "invalid pos");
+ error (error_string (pos_str0) + "invalid pos");
}
char const*
-Source_file::seek_ch_C (int n)
+Source_file::seek_str0 (int n)
{
- char const* new_ch_C = ch_C () + n;
+ char const* new_str0 = to_str0 () + n;
if (n < 0)
- new_ch_C += length_i ();
- if (in_b (new_ch_C))
- pos_ch_C_ = new_ch_C;
+ new_str0 += length ();
+ if (in_b (new_str0))
+ pos_str0_ = new_str0;
else
- error (error_str (new_ch_C) + "seek past eof");
+ error (error_string (new_str0) + "seek past eof");
- return pos_ch_C_;
+ return pos_str0_;
}
char const*
-Source_file::forward_ch_C (int n)
+Source_file::forward_str0 (int n)
{
- char const* old_pos_C = pos_ch_C_;
- char const* new_ch_C = pos_ch_C_ + n;
- if (in_b (new_ch_C))
- pos_ch_C_ = new_ch_C;
+ char const* old_pos = pos_str0_;
+ char const* new_str0 = pos_str0_ + n;
+ if (in_b (new_str0))
+ pos_str0_ = new_str0;
else
- error (error_str (new_ch_C) + "forward past eof");
+ error (error_string (new_str0) + "forward past eof");
- return old_pos_C;
+ return old_pos;
}
String
-Source_file::get_str (int n)
+Source_file::get_string (int n)
{
- String str = String ((Byte const*)forward_ch_C (n), n);
+ String str = String ((Byte const*)forward_str0 (n), n);
return str;
}
}
void
-Sources::set_path (File_path *f_C)
+Sources::set_path (File_path *f)
{
- path_C_ = f_C;
+ path_C_ = f;
}
/**
open a file
- @param file_str the file to be opened, name might be changed if it
+ @param file_string the file to be opened, name might be changed if it
is found in a search path. UGH!
@return 0 if no file found
*/
Source_file*
-Sources::get_file_l (String &file_str) //UGH
+Sources::get_file (String &file_string) //UGH
{
- if ((file_str != "-") && path_C_)
+ if ((file_string != "-") && path_C_)
{
- String file_str_o = path_C_->find (file_str);
- if ((file_str_o == "") && (file_str != ""))
+ String file_string_o = path_C_->find (file_string);
+ if ((file_string_o == "") && (file_string != ""))
return 0;
- file_str = file_str_o;
+ file_string = file_string_o;
}
- Source_file * f_p = (!binary_b_) ?
- new Source_file (file_str) : new Binary_source_file (file_str);
- add (f_p);
- return f_p;
+ Source_file * f = (!binary_b_) ?
+ new Source_file (file_string) : new Binary_source_file (file_string);
+ add (f);
+ return f;
}
void
-Sources::add (Source_file* sourcefile_p)
+Sources::add (Source_file* sourcefile)
{
- sourcefile_p_list_ = new Killing_cons<Source_file> (sourcefile_p, sourcefile_p_list_);
+ sourcefile_p_list_ = new Killing_cons<Source_file> (sourcefile, sourcefile_p_list_);
}
Sources::~Sources ()
delete sourcefile_p_list_;
}
/**
- search the list for file whose map contains pointer #ch_C#
+ search the list for file whose map contains pointer #str0#
@return 0 if not found.
*/
Source_file*
-Sources::sourcefile_l (char const* ch_C)
+Sources::get_sourcefile (char const* str0)
{
for (Cons<Source_file> *i = sourcefile_p_list_; i; i = i->next_)
- if (i->car_->in_b (ch_C))
+ if (i->car_->in_b (str0))
return i->car_;
return 0;
}
static const int STRING_BUFFER_LEN=1024;
String
-String_convert::bool_str (bool b)
+String_convert::bool_string (bool b)
{
return String (b ? "true" : "false");
}
String
-String_convert::bin2hex_str (String bin_str)
+String_convert::bin2hex (String bin_string)
{
String str;
- Byte const* byte_C = bin_str.byte_C ();
- for (int i = 0; i < bin_str.length_i (); i++)
+ Byte const* byte = bin_string.to_bytes ();
+ for (int i = 0; i < bin_string.length (); i++)
{
- str += to_str ((char)nibble2hex_byte (*byte_C >> 4));
- str += to_str ((char)nibble2hex_byte (*byte_C++));
+ str += to_string ((char)nibble2hex_byte (*byte >> 4));
+ str += to_string ((char)nibble2hex_byte (*byte++));
}
return str;
}
int
-String_convert::bin2_i (String bin_str)
+String_convert::bin2int (String bin_string)
{
- return bin2_u (bin_str);
+ return bin2unsigned (bin_string);
}
unsigned
-String_convert::bin2_u (String bin_str)
+String_convert::bin2unsigned (String bin_string)
{
- assert (bin_str.length_i () <= (int)sizeof (unsigned));
+ assert (bin_string.length () <= (int)sizeof (unsigned));
unsigned result_u = 0;
- for (int i = 0; i < bin_str.length_i (); i++)
+ for (int i = 0; i < bin_string.length (); i++)
{
result_u <<= 8;
- result_u += (Byte)bin_str[ i ];
+ result_u += (Byte)bin_string[ i ];
}
return result_u;
}
// breendet imp from String
int
-String_convert::dec2_i (String dec_str)
+String_convert::dec2int (String dec_string)
{
- if (!dec_str.length_i ())
+ if (!dec_string.length ())
return 0;
long l = 0;
- int conv = sscanf (dec_str.ch_C (), "%ld", &l);
+ int conv = sscanf (dec_string.to_str0 (), "%ld", &l);
assert (conv);
return (int)l;
}
String
-String_convert::i64_str (I64 i64, char const* fmt)
+String_convert::i64_string (I64 i64, char const* fmt)
{
char buffer[STRING_BUFFER_LEN];
snprintf (buffer, STRING_BUFFER_LEN,
}
// breendet imp from String
double
-String_convert::dec2_f (String dec_str)
+String_convert::dec2double (String dec_string)
{
- if (!dec_str.length_i ())
+ if (!dec_string.length ())
return 0;
double d = 0;
- int conv = sscanf (dec_str.ch_C (), "%lf", &d);
+ int conv = sscanf (dec_string.to_str0 (), "%lf", &d);
assert (conv);
return d;
}
int
-String_convert::hex2bin_i (String hex_str, String& bin_str_r)
+String_convert::hex2bin (String hex_string, String& bin_string_r)
{
- if (hex_str.length_i () % 2)
- hex_str = "0" + hex_str;
+ if (hex_string.length () % 2)
+ hex_string = "0" + hex_string;
- bin_str_r = "";
- Byte const* byte_C= hex_str.byte_C ();
+ bin_string_r = "";
+ Byte const* byte= hex_string.to_bytes ();
int i = 0;
- while (i < hex_str.length_i ())
+ while (i < hex_string.length ())
{
- int high_i = hex2nibble_i (*byte_C++);
- int low_i = hex2nibble_i (*byte_C++);
+ int high_i = hex2nibble (*byte++);
+ int low_i = hex2nibble (*byte++);
if (high_i < 0 || low_i < 0)
return 1; // illegal char
- bin_str_r += to_str ((char) (high_i << 4 | low_i), 1 );
+ bin_string_r += to_string ((char) (high_i << 4 | low_i), 1 );
i += 2;
}
return 0;
}
String
-String_convert::hex2bin_str (String hex_str)
+String_convert::hex2bin (String hex_string)
{
String str;
// silly, asserts should alway be "on"!
- // assert (!hex2bin_i (hex_str, str) );
- int error_i = hex2bin_i (hex_str, str);
+ // assert (!hex2bin (hex_string, str) );
+ int error_i = hex2bin (hex_string, str);
assert (!error_i);
return str;
}
int
-String_convert::hex2nibble_i (Byte byte)
+String_convert::hex2nibble (Byte byte)
{
if (byte >= '0' && byte <= '9')
return byte - '0';
return -1;
}
-// stupido. Should use int_str ()
+// stupido. Should use int_string ()
String
-String_convert::i2dec_str (int i, int length_i, char ch)
+String_convert::int2dec (int i, int length_i, char ch)
{
- char fill_ch = ch;
- if (fill_ch)
- fill_ch = '0';
+ char fill_char = ch;
+ if (fill_char)
+ fill_char = '0';
// ugh
- String dec_str = to_str (i);
+ String dec_string = to_string (i);
// ugh
- return to_str (fill_ch, length_i - dec_str.length_i ()) + dec_str;
+ return to_string (fill_char, length_i - dec_string.length ()) + dec_string;
}
-// stupido. Should use int_str ()
+// stupido. Should use int_string ()
String
-String_convert::u2hex_str (unsigned u, int length_i, char fill_ch)
+String_convert::unsigned2hex (unsigned u, int length_i, char fill_char)
{
String str;
if (!u)
#if 1 // both go...
while (u)
{
- str = to_str ((char) ((u % 16)["0123456789abcdef"] ) ) + str;
+ str = to_string ((char) ((u % 16)["0123456789abcdef"] ) ) + str;
u /= 16;
}
#else
- str += int_str (u, "%x"); // hmm. %lx vs. %x -> portability?
+ str += int_string (u, "%x"); // hmm. %lx vs. %x -> portability?
#endif
- str = to_str (fill_ch, length_i - str.length_i ()) + str;
- while ((str.length_i () > length_i) && (str[ 0 ] == 'f' ) )
- str = str.cut_str (2, INT_MAX);
+ str = to_string (fill_char, length_i - str.length ()) + str;
+ while ((str.length () > length_i) && (str[ 0 ] == 'f' ) )
+ str = str.cut_string (2, INT_MAX);
return str;
}
String
-String_convert::i2hex_str (int i, int length_i, char fill_ch)
+String_convert::int2hex (int i, int length_i, char fill_char)
{
- return u2hex_str ((unsigned)i, length_i, fill_ch);
+ return unsigned2hex ((unsigned)i, length_i, fill_char);
}
Byte
#fmt# is a printf style format, default assumes "%d" as format.
*/
String
-String_convert::int_str (int i, char const* fmt)
+String_convert::int_string (int i, char const* fmt)
{
char buffer[STRING_BUFFER_LEN];
snprintf (buffer, STRING_BUFFER_LEN,
}
String
-String_convert::form_str (char const* format, ...)
+String_convert::form_string (char const* format, ...)
{
va_list args;
va_start (args, format);
}
String
-String_convert::vform_str (char const* format, va_list args)
+String_convert::vform_string (char const* format, va_list args)
{
char buffer[STRING_BUFFER_LEN];
vsnprintf (buffer, STRING_BUFFER_LEN, format, args);
@param #fmt# is a printf style format, default assumes "%lf" as format
*/
String
-String_convert::double_str (double f, char const* fmt)
+String_convert::double_string (double f, char const* fmt)
{
char buf[STRING_BUFFER_LEN];
#n# is a repetition count, default value is 1
*/
String
-String_convert::char_str (char c, int n)
+String_convert::char_string (char c, int n)
{
n = n >= 0 ? n : 0;
- char* ch_p = new char[ n ];
- memset (ch_p, c, n);
- String s ((Byte*)ch_p, n);
- delete[] ch_p;
+ char* ch = new char[ n ];
+ memset (ch, c, n);
+ String s ((Byte*)ch, n);
+ delete[] ch;
return s;
}
String
-String_convert::rational_str (Rational r)
+String_convert::rational_string (Rational r)
{
- return r.str ();
+ return r.string ();
}
String
-String_convert::pointer_str (void const *l)
+String_convert::pointer_string (void const *l)
{
char buffer[STRING_BUFFER_LEN];
snprintf (buffer, STRING_BUFFER_LEN, "%p", l); // assume radix 10
#n# is the number of nonzero digits
*/
String
-String_convert::precision_str (double x, int n)
+String_convert::precision_string (double x, int n)
{
- String format = "%." + to_str (0 >? n - 1) + "e";
- String str = double_str (abs (x), format.ch_C ());
+ String format = "%." + to_string (0 >? n - 1) + "e";
+ String str = double_string (abs (x), format.to_str0 ());
- int exp = str.right_str (3).value_i ();
- str = str.left_str (str.length_i () - 4);
+ int exp = str.right_string (3).to_int ();
+ str = str.left_string (str.length () - 4);
- while (str[str.length_i () - 1] == '0')
- str = str.left_str (str.length_i () - 1);
- if (str[str.length_i () - 1] == '.')
- str = str.left_str (str.length_i () - 1);
+ while (str[str.length () - 1] == '0')
+ str = str.left_string (str.length () - 1);
+ if (str[str.length () - 1] == '.')
+ str = str.left_string (str.length () - 1);
if (exp == 0)
return (sign (x) > 0 ? str : "-" + str);
- str = str.left_str (1) + str.cut_str (2, INT_MAX);
+ str = str.left_string (1) + str.cut_string (2, INT_MAX);
int dot = 1 + exp;
if (dot <= 0)
- str = "0." + to_str ('0', -dot) + str;
- else if (dot >= str.length_i ())
- str += to_str ('0', dot - str.length_i ());
- else if (( dot > 0) && (dot < str.length_i ()))
- str = str.left_str (dot) + "." + str.cut_str (dot, INT_MAX);
+ str = "0." + to_string ('0', -dot) + str;
+ else if (dot >= str.length ())
+ str += to_string ('0', dot - str.length ());
+ else if (( dot > 0) && (dot < str.length ()))
+ str = str.left_string (dot) + "." + str.cut_string (dot, INT_MAX);
else
assert (0);
}
Array<String>
-String_convert::split_arr (String str, char c)
+String_convert::split (String str, char c)
{
Array<String> a;
- int i = str.index_i (c);
+ int i = str.index (c);
while (i >=0)
{
- String s = str.left_str (i);
+ String s = str.left_string (i);
a.push (s);
while (str[++i] == c)
;
- str = str.cut_str (i, INT_MAX);
- i = str.index_i (c);
+ str = str.cut_string (i, INT_MAX);
+ i = str.index (c);
}
- if (str.length_i ())
+ if (str.length ())
a.push (str);
return a;
}
String
-String_convert::long_str (long l)
+String_convert::long_string (long l)
{
char s[STRING_BUFFER_LEN];
sprintf (s,"%ld", l);
String
String_convert::pad_to (String s, int n)
{
- return s + to_str (' ' , (n - s.length_i ()) >? 0);
+ return s + to_string (' ' , (n - s.length ()) >? 0);
}
// return array, alloced with new.
Byte*
-String::copy_byte_p () const
+String::get_copy_byte () const
{
- Byte const* src = strh_.byte_C ();
- Byte* dest = new Byte[strh_.length_i () + 1];
- memcpy (dest, src, strh_.length_i () + 1);
+ Byte const* src = strh_.to_bytes ();
+ Byte* dest = new Byte[strh_.length () + 1];
+ memcpy (dest, src, strh_.length () + 1);
return dest;
}
char*
-String::copy_ch_p () const
+String::get_copy_str0 () const
{
- return (char*)copy_byte_p ();
+ return (char*)get_copy_byte ();
}
\f
}
-String::String (Byte const* byte_l, int len_i)
+String::String (Byte const* byte, int len_i)
{
- strh_.set (byte_l, len_i);
+ strh_.set (byte, len_i);
}
/**
String_convert::
*/
String
-to_str (char c, int n)
+to_string (char c, int n)
{
- return String_convert::char_str (c, n);
+ return String_convert::char_string (c, n);
}
String
-to_str (double f, char const* format)
+to_string (double f, char const* format)
{
- return String_convert::double_str (f, format);
+ return String_convert::double_string (f, format);
}
String
-to_str (int i, char const * format)
+to_string (int i, char const * format)
{
- return String_convert::int_str (i, format);
+ return String_convert::int_string (i, format);
}
String
-to_str (bool b)
+to_string (bool b)
{
- return String_convert::bool_str (b);
+ return String_convert::bool_string (b);
}
String
-to_str (long b)
+to_string (long b)
{
- return String_convert::long_str (b);
+ return String_convert::long_string (b);
}
String
-to_str (char const* format, ... )
+to_string (char const* format, ... )
{
va_list args;
va_start (args, format);
- String str = String_convert::vform_str (format, args);
+ String str = String_convert::vform_string (format, args);
va_end (args);
return str;
}
void
String::append (String s)
{
- strh_.append (s.byte_C (), s.length_i ());
+ strh_.append (s.to_bytes (), s.length ());
}
void
String::operator += (String s)
}
int
-String::length_i () const
+String::length () const
{
- return strh_.length_i ();
+ return strh_.length ();
}
Byte const*
-String::byte_C () const
+String::to_bytes () const
{
- return strh_.byte_C ();
+ return strh_.to_bytes ();
}
char const*
-String::ch_C () const
+String::to_str0 () const
{
- return strh_.ch_C ();
+ return strh_.to_str0 ();
}
Byte*
-String::byte_l ()
+String::get_bytes ()
{
- return strh_.byte_l ();
+ return strh_.get_bytes ();
}
char*
-String::ch_l ()
+String::get_str0 ()
{
- return strh_.ch_l ();
+ return strh_.get_str0 ();
}
bool
String::empty_b () const
{
- return !length_i ();
+ return !length ();
}
/**
Do a signed comparison, analogous to memcmp;
*/
int
-String::compare_i (String const& s1, String const& s2)
+String::compare (String const& s1, String const& s2)
{
- Byte const* p1 = s1.byte_C ();
- Byte const* p2 = s2.byte_C ();
+ Byte const* p1 = s1.to_bytes ();
+ Byte const* p2 = s2.to_bytes ();
if (p1 == p2)
return 0;
/*
don't forget the terminating '\0'
*/
- int f = (s1.length_i () <? s2.length_i ());
+ int f = (s1.length () <? s2.length ());
int cmp_length = 1+ f;
int i = memcmp (p1, p2, cmp_length);
return i;
\f
int
-String::index_last_i (char const c) const
+String::index_last (char const c) const
{
- if (!length_i ())
+ if (!length ())
return -1;
- char const* me = strh_.ch_C ();
- char const* p = (char const*)memrchr ((Byte*)me, length_i (), c);
+ char const* me = strh_.to_str0 ();
+ char const* p = (char const*)memrchr ((Byte*)me, length (), c);
if (p)
return p - me;
return -1;
}
int
-String::index_last_i (char const* string) const // UGK!
+String::index_last (char const* string) const // UGK!
{
assert (false); // broken
int len = strlen (string); // ugrh
- if (!length_i () || !len)
+ if (!length () || !len)
return -1;
- int next_i = index_i (string);
+ int next_i = index (string);
if (next_i == -1)
return -1;
while (next_i >= 0)
{
index_i += next_i;
- next_i = right_str (length_i () - index_i - len).index_i (string );
+ next_i = right_string (length () - index_i - len).index (string );
}
return index_i;
}
/** find a character.
@return
- the index of the leftmost character #c# (0 <= return < length_i ()),
+ the index of the leftmost character #c# (0 <= return < length ()),
or -1 if not found.
- ? should return length_i ()?, as in string.left_str (index_i (delimiter))
+ ? should return length ()?, as in string.left_string (index (delimiter))
*/
int
-String::index_i (char c) const
+String::index (char c) const
{
- char const* me = strh_.ch_C ();
- char const* p = (char const *) memchr (me,c, length_i ());
+ char const* me = strh_.to_str0 ();
+ char const* p = (char const *) memchr (me,c, length ());
if (p)
return p - me;
return -1;
1 index of leftmost occurrence of #searchfor#
*/
int
-String::index_i (String searchfor) const
+String::index (String searchfor) const
{
- char const* me = strh_.ch_C ();
+ char const* me = strh_.to_str0 ();
char const* p = (char const *)
- memmem (me, length_i (), searchfor.ch_C (), searchfor.length_i ());
+ memmem (me, length (), searchfor.to_str0 (), searchfor.length ());
if (p)
return p - me;
*/
int
-String::index_any_i (String set) const
+String::index_any (String set) const
{
- int n = length_i ();
+ int n = length ();
if (!n)
return -1;
- void const * me_l = (void const *) strh_.ch_C ();
- for (int i=0; i < set.length_i (); i++)
+ void const * me = (void const *) strh_.to_str0 ();
+ for (int i=0; i < set.length (); i++)
{
- char * found= (char*) memchr (me_l, set[i], n );
+ char * found= (char*) memchr (me, set[i], n );
if (found)
{
- return found - (char const*)me_l;
+ return found - (char const*)me;
}
}
return -1;
}
\f
String
-String::left_str (int n) const
+String::left_string (int n) const
{
- if (n >= length_i ())
+ if (n >= length ())
return *this;
String retval;
}
String
-String::right_str (int n) const
+String::right_string (int n) const
{
- if (n > length_i ())
+ if (n > length ())
return *this;
if (n < 1)
return "";
- return String (strh_.byte_C () + length_i () - n, n);
+ return String (strh_.to_bytes () + length () - n, n);
}
String
-String::nomid_str (int index_i, int n) const
+String::nomid_string (int index_i, int n) const
{
if (index_i < 0)
{
return *this;
return
- left_str (index_i) +
- right_str (length_i () - index_i - n) ;
+ left_string (index_i) +
+ right_string (length () - index_i - n) ;
}
String
-String::cut_str (int index_i, int n) const
+String::cut_string (int index_i, int n) const
{
if (index_i <0)
{
index_i=0;
}
- if (!length_i () || (index_i < 0) || (index_i >= length_i () ) || (n < 1 ) )
+ if (!length () || (index_i < 0) || (index_i >= length () ) || (n < 1 ) )
return String ();
- if ((n > length_i ()) || (index_i + n > length_i () ) )
- n = length_i () - index_i;
+ if ((n > length ()) || (index_i + n > length () ) )
+ n = length () - index_i;
- return String (byte_C () + index_i, n);
+ return String (to_bytes () + index_i, n);
}
\f
String
-String::upper_str () const
+String::upper_string () const
{
String str = *this;
str.to_upper ();
void
String::to_upper ()
{
- char *s = (char*)strh_.byte_l ();
- strnupr (s ,length_i ());
+ char *s = (char*)strh_.get_bytes ();
+ strnupr (s ,length ());
}
void
String::to_lower ()
{
- char* s = strh_.ch_l ();
- strnlwr (s,length_i ());
+ char* s = strh_.get_str0 ();
+ strnlwr (s,length ());
}
String
-String::lower_str () const
+String::lower_string () const
{
String str = *this;
str.to_lower ();
return str;
}
String
-String::reversed_str () const
+String::reversed_string () const
{
String str = *this;
- strrev (str.byte_l (), str.length_i ());
+ strrev (str.get_bytes (), str.length ());
return str;
}
int
-String::value_i () const
+String::to_int () const
{
- return String_convert::dec2_i (*this);
+ return String_convert::dec2int (*this);
}
double
-String::value_f () const
+String::to_double () const
{
- return String_convert::dec2_f (*this);
+ return String_convert::dec2double (*this);
}
#ifdef STREAM_SUPPORT
String::print_on (ostream& os) const
{
if (!strh_.is_binary_bo ())
- os << ch_C ();
+ os << to_str0 ();
else
- for (int i = 0; i < length_i (); i++)
+ for (int i = 0; i < length (); i++)
os << (Byte) (*this)[ i ];
}
#endif
void
message (String s)
{
- fputs (s.ch_C (), stderr);
+ fputs (s.to_str0 (), stderr);
}
void
warning (String s)
{
- message (_f ("warning: %s\n", s.ch_C ()));
+ message (_f ("warning: %s\n", s.to_str0 ()));
}
void
non_fatal_error (String s)
{
- message (_f ("error: %s\n", s.ch_C ()));
+ message (_f ("error: %s\n", s.to_str0 ()));
}
void
programming_error (String s)
{
message (_f ("programming error: %s (Continuing; cross thumbs)\n",
- s.ch_C ()));
+ s.to_str0 ()));
}
virtual void process_acknowledged_grobs ();
virtual void stop_translation_timestep ();
private:
- Item* text_p_;
+ Item* text_;
enum State { SOLO, SPLIT_INTERVAL, UNIRHYTHM, UNISILENCE, UNISON } state_;
};
A2_engraver::A2_engraver ()
{
- text_p_ = 0;
+ text_ = 0;
state_ = UNISILENCE;
}
{
if (!to_boolean (get_property ("combineParts")))
return ;
- if (!text_p_)
+ if (!text_)
{
SCM unison = get_property ("unison");
SCM solo = get_property ("solo");
if (solo_adue == SCM_BOOL_T
&& ((solo == SCM_BOOL_T && state_ != SOLO)
|| (unison == SCM_BOOL_T && state_ != UNISON
- && daddy_trans_l_->id_str_.left_str (3) == "one")))
+ && daddy_trans_->id_string_.left_string (3) == "one")))
{
- text_p_ = new Item (get_property ("TextScript"));
- Side_position_interface::set_axis (text_p_, Y_AXIS);
- announce_grob(text_p_, SCM_EOL);
+ text_ = new Item (get_property ("TextScript"));
+ Side_position_interface::set_axis (text_, Y_AXIS);
+ announce_grob(text_, SCM_EOL);
Direction dir = UP;
SCM text = SCM_EOL;
if (solo == SCM_BOOL_T)
{
state_ = SOLO;
- if (daddy_trans_l_->id_str_.left_str (3) == "one")
+ if (daddy_trans_->id_string_.left_string (3) == "one")
{
text = get_property ("soloText");
}
else if (unison == SCM_BOOL_T)
{
state_ = UNISON;
- if (daddy_trans_l_->id_str_.left_str (3) == "one")
+ if (daddy_trans_->id_string_.left_string (3) == "one")
text = get_property ("aDueText");
}
- Side_position_interface::set_direction (text_p_, dir);
- text_p_->set_grob_property ("text", text);
+ Side_position_interface::set_direction (text_, dir);
+ text_->set_grob_property ("text", text);
}
}
}
if (!to_boolean (get_property ("combineParts")))
return ;
- if (text_p_)
+ if (text_)
{
- if (Note_head::has_interface (i.grob_l_))
+ if (Note_head::has_interface (i.grob_))
{
- Grob*t = text_p_;
- Side_position_interface::add_support (t, i.grob_l_);
+ Grob*t = text_;
+ Side_position_interface::add_support (t, i.grob_);
if (Side_position_interface::get_axis (t) == X_AXIS
&& !t->get_parent (Y_AXIS))
- t->set_parent (i.grob_l_, Y_AXIS);
+ t->set_parent (i.grob_, Y_AXIS);
}
- if (Stem::has_interface (i.grob_l_))
+ if (Stem::has_interface (i.grob_))
{
- Side_position_interface::add_support (text_p_, i.grob_l_);
+ Side_position_interface::add_support (text_, i.grob_);
}
}
state_ = UNIRHYTHM;
Direction d = CENTER;
- if (daddy_trans_l_->id_str_.left_str (3) == "one")
+ if (daddy_trans_->id_string_.left_string (3) == "one")
d = UP;
- else if (daddy_trans_l_->id_str_.left_str (3) == "two")
+ else if (daddy_trans_->id_string_.left_string (3) == "two")
d = DOWN;
/* Must only set direction for VoiceCombines, not for StaffCombines:
we can't detect that here, so we use yet another property */
if (!to_boolean (get_property ("noDirection"))
- && (Stem::has_interface (i.grob_l_)
- || Slur::has_interface (i.grob_l_)
- || Tie::has_interface (i.grob_l_)
+ && (Stem::has_interface (i.grob_)
+ || Slur::has_interface (i.grob_)
+ || Tie::has_interface (i.grob_)
/* Usually, dynamics are removed by *_devnull_engravers for
the second voice. On the one hand, we don't want all
dynamics for the first voice to be placed above the
staff. On the other hand, colliding of scripts may be
worse. So, we don't set directions for these when we're
playing solo. */
- || (i.grob_l_->internal_has_interface (ly_symbol2scm
+ || (i.grob_->internal_has_interface (ly_symbol2scm
("dynamic-interface"))
&& state_ != SOLO)
- || (i.grob_l_->internal_has_interface (ly_symbol2scm
+ || (i.grob_->internal_has_interface (ly_symbol2scm
("text-interface"))
&& state_ != SOLO)
))
{
/* Blunt axe method: every grob gets a propertysetting. */
- i.grob_l_->set_grob_property ("direction", gh_int2scm (d));
+ i.grob_->set_grob_property ("direction", gh_int2scm (d));
}
}
/* Should we have separate state variable for being "rest
while other has solo?" */
- if (Multi_measure_rest::has_interface (i.grob_l_) && d)
+ if (Multi_measure_rest::has_interface (i.grob_) && d)
if (state_ == UNIRHYTHM
&& unisilence != SCM_BOOL_T)
{
- i.grob_l_->set_grob_property ("staff-position", gh_int2scm (d * 6));
+ i.grob_->set_grob_property ("staff-position", gh_int2scm (d * 6));
}
}
void
A2_engraver::stop_translation_timestep ()
{
- if (text_p_)
+ if (text_)
{
- Side_position_interface::add_staff_support (text_p_);
- typeset_grob (text_p_);
- text_p_ = 0;
+ Side_position_interface::add_staff_support (text_);
+ typeset_grob (text_);
+ text_ = 0;
}
}
/*
The next
*/
- Array<Accidental_entry> accidental_arr_;
+ Array<Accidental_entry> accidentals_;
- Link_array<Grob> tie_arr_;
+ Link_array<Grob> ties_;
};
{
last_keysig_ = get_property ("keySignature");
- Translator_group * trans_ = daddy_trans_l_;
+ Translator_group * trans_ = daddy_trans_;
while (trans_)
{
trans_ -> set_property ("localKeySignature", ly_deep_copy (last_keysig_));
- trans_ = trans_->daddy_trans_l_;
+ trans_ = trans_->daddy_trans_;
}
- set_property_on_children (daddy_trans_l_,"localKeySignature", last_keysig_);
+ set_property_on_children (daddy_trans_,"localKeySignature", last_keysig_);
}
/*
*/
static int
-number_accidentals (SCM sig, Note_req * note_l, Pitch *pitch, SCM curbarnum, SCM lazyness,
+number_accidentals (SCM sig, Note_req * note, Pitch *pitch, SCM curbarnum, SCM lazyness,
bool ignore_octave_b)
{
- int n = pitch->notename_i_;
- int o = pitch->octave_i_;
- int a = pitch->alteration_i_;
+ int n = pitch->notename_;
+ int o = pitch->octave_;
+ int a = pitch->alteration_;
int curbarnum_i = gh_scm2int (curbarnum);
int accbarnum_i = 0;
int num;
if (a == p
- && !to_boolean (note_l->get_mus_property ("force-accidental"))
+ && !to_boolean (note->get_mus_property ("force-accidental"))
&& gh_number_p (prev_acc))
num = 0;
else if ( (abs (a)<abs (p) || p*a<0) && a != 0 )
}
static int
-number_accidentals (Note_req * note_l, Pitch *pitch, Translator_group * origin_l,
+number_accidentals (Note_req * note, Pitch *pitch, Translator_group * origin,
SCM accidentals, SCM curbarnum)
{
int number = 0;
bool diff = false;
if (gh_pair_p (accidentals) && !gh_symbol_p (ly_car (accidentals)))
warning (_f ("Accidental typesetting list must begin with context-name: %s",
- ly_scm2string (ly_car (accidentals)).ch_C ()));
+ ly_scm2string (ly_car (accidentals)).to_str0 ()));
- while (gh_pair_p (accidentals) && origin_l)
+ while (gh_pair_p (accidentals) && origin)
{
// If pair then it is a new accidentals typesetting rule to be checked
if (gh_pair_p (ly_car (accidentals)))
{
SCM type = gh_caar (accidentals);
SCM lazyness = gh_cdar (accidentals);
- SCM localsig = origin_l->get_property ("localKeySignature");
+ SCM localsig = origin->get_property ("localKeySignature");
bool same_octave_b =
gh_eq_p (ly_symbol2scm ("same-octave"), type);
if (same_octave_b || any_octave_b)
{
int n = number_accidentals
- (localsig, note_l, pitch, curbarnum, lazyness, any_octave_b);
+ (localsig, note, pitch, curbarnum, lazyness, any_octave_b);
diff = diff || (n < 0);
number = max (number, abs (n));
}
else
warning (_f ("unknown accidental typesetting: %s. Ignored",
- ly_symbol2string (type).ch_C ()));
+ ly_symbol2string (type).to_str0 ()));
}
{
String context = ly_symbol2string (ly_car (accidentals));
- while (origin_l && !origin_l->is_alias_b (context))
- origin_l = origin_l->daddy_trans_l_;
+ while (origin && !origin->is_alias_b (context))
+ origin = origin->daddy_trans_;
- if (!origin_l)
+ if (!origin)
warning (_f ("Symbol is not a parent context: %s. Ignored",
- context.ch_C ()));
+ context.to_str0 ()));
}
else warning (_f ("Accidental typesetting must be pair or context-name: %s",
- ly_scm2string (ly_car (accidentals)).ch_C ()));
+ ly_scm2string (ly_car (accidentals)).to_str0 ()));
accidentals = ly_cdr (accidentals);
}
void
Accidental_engraver::process_acknowledged_grobs ()
{
- if (accidental_arr_.size () && !accidental_arr_.top().done_)
+ if (accidentals_.size () && !accidentals_.top().done_)
{
//SCM localsig = get_property ("localKeySignature");
SCM accidentals = get_property ("autoAccidentals");
SCM barnum = get_property ("currentBarNumber");
bool extra_natural_b = get_property ("extraNatural") == SCM_BOOL_T;
- for (int i = 0; i < accidental_arr_.size (); i++)
+ for (int i = 0; i < accidentals_.size (); i++)
{
- if (accidental_arr_[i].done_ )
+ if (accidentals_[i].done_ )
continue;
- accidental_arr_[i].done_ = true;
- Grob * support_l = accidental_arr_[i].head_;
- Note_req * note_l = accidental_arr_[i].melodic_;
- Translator_group * origin_l = accidental_arr_[i].origin_;
-
- Pitch * pitch = unsmob_pitch (note_l->get_mus_property ("pitch"));
- int num = number_accidentals (note_l, pitch, origin_l, accidentals, barnum);
- int num_caut = number_accidentals (note_l, pitch, origin_l, cautionaries, barnum);
- bool cautionary = to_boolean (note_l->get_mus_property ("cautionary"));
+ accidentals_[i].done_ = true;
+ Grob * support = accidentals_[i].head_;
+ Note_req * note = accidentals_[i].melodic_;
+ Translator_group * origin = accidentals_[i].origin_;
+
+ Pitch * pitch = unsmob_pitch (note->get_mus_property ("pitch"));
+ int num = number_accidentals (note, pitch, origin, accidentals, barnum);
+ int num_caut = number_accidentals (note, pitch, origin, cautionaries, barnum);
+ bool cautionary = to_boolean (note->get_mus_property ("cautionary"));
if (abs (num_caut) > abs (num))
{
Grob *tie_break_reminder = 0;
bool tie_changes = false;
- for (int j = 0; j < tie_arr_.size (); j++)
- if (support_l == Tie::head (tie_arr_[j], RIGHT))
+ for (int j = 0; j < ties_.size (); j++)
+ if (support == Tie::head (ties_[j], RIGHT))
{
tie_changes = different;
Maybe check property noTieBreakForceAccidental? */
if (different)
- tie_break_reminder = tie_arr_[j];
+ tie_break_reminder = ties_[j];
break;
}
if (num)
{
Grob * a = new Item (get_property ("Accidental"));
- a->set_parent (support_l, Y_AXIS);
+ a->set_parent (support, Y_AXIS);
if (!accidental_placement_)
{
announce_grob (a, SCM_EOL);
- SCM accs = gh_cons (gh_int2scm (pitch->alteration_i_), SCM_EOL);
+ SCM accs = gh_cons (gh_int2scm (pitch->alteration_), SCM_EOL);
if (num == 2 && extra_natural_b)
accs = gh_cons (gh_int2scm (0), accs);
}
- support_l->set_grob_property ("accidental-grob", a->self_scm ());
+ support->set_grob_property ("accidental-grob", a->self_scm ());
a->set_grob_property ("accidentals", accs);
- accidental_arr_[i].accidental_ = a;
+ accidentals_[i].accidental_ = a;
/*
We add the accidentals to the support of the arpeggio, so it is put left of the
accidentals.
*/
- int n = pitch->notename_i_;
- int o = pitch->octave_i_;
- int a = pitch->alteration_i_;
+ int n = pitch->notename_;
+ int o = pitch->octave_;
+ int a = pitch->alteration_;
SCM on_s = gh_cons (gh_int2scm (o), gh_int2scm (n));
/*
*/
- while (origin_l)
+ while (origin)
{
- SCM localsig = origin_l->get_property ("localKeySignature");
+ SCM localsig = origin->get_property ("localKeySignature");
if (tie_changes)
{
/*
localsig = ly_assoc_front_x
(localsig, on_s, gh_cons (gh_int2scm (a), barnum));
}
- origin_l->set_property ("localKeySignature", localsig);
- origin_l = origin_l->daddy_trans_l_;
+ origin->set_property ("localKeySignature", localsig);
+ origin = origin->daddy_trans_;
}
}
}
void
Accidental_engraver::stop_translation_timestep ()
{
- for (int i = 0; i < accidental_arr_.size(); i++)
+ for (int i = 0; i < accidentals_.size(); i++)
{
- Grob *a = accidental_arr_[i].accidental_;
+ Grob *a = accidentals_[i].accidental_;
if (a)
{
typeset_grob (a);
typeset_grob(accidental_placement_);
accidental_placement_ = 00;
- accidental_arr_.clear();
+ accidentals_.clear();
arpeggios_.clear ();
- tie_arr_.clear ();
+ ties_.clear ();
}
void
Accidental_engraver::acknowledge_grob (Grob_info info)
{
- Note_req * note_l = dynamic_cast <Note_req *> (info.music_cause ());
+ Note_req * note = dynamic_cast <Note_req *> (info.music_cause ());
- if (note_l && Rhythmic_head::has_interface (info.grob_l_))
+ if (note && Rhythmic_head::has_interface (info.grob_))
{
Accidental_entry entry ;
- entry.head_ = info.grob_l_;
- entry.origin_ = info.origin_trans_l_->daddy_trans_l_;
- entry.melodic_ = note_l;
+ entry.head_ = info.grob_;
+ entry.origin_ = info.origin_trans_->daddy_trans_;
+ entry.melodic_ = note;
- accidental_arr_.push (entry);
+ accidentals_.push (entry);
}
- else if (Tie::has_interface (info.grob_l_))
+ else if (Tie::has_interface (info.grob_))
{
- tie_arr_.push (info.grob_l_);
+ ties_.push (info.grob_);
}
- else if (Arpeggio::has_interface (info.grob_l_))
+ else if (Arpeggio::has_interface (info.grob_))
{
- arpeggios_.push (info.grob_l_);
+ arpeggios_.push (info.grob_);
}
}
*/
if (last_keysig_ != sig)
{
- Translator_group * trans_ = daddy_trans_l_;
+ Translator_group * trans_ = daddy_trans_;
while (trans_)
{
trans_ -> set_property ("localKeySignature", ly_deep_copy (sig));
- trans_ = trans_->daddy_trans_l_;
+ trans_ = trans_->daddy_trans_;
}
- set_property_on_children(daddy_trans_l_,"localKeySignature", sig);
+ set_property_on_children(daddy_trans_,"localKeySignature", sig);
last_keysig_ = sig;
}
Pitch *p= unsmob_pitch (mcause->get_mus_property ("pitch"));
- int n = p->notename_i_;
+ int n = p->notename_;
SCM accs = me->get_grob_property ("accidental-grobs");
SCM key = gh_int2scm (n);
Grob *me = unsmob_grob (smob);
Grob *tie = unsmob_grob (me->get_grob_property ("tie"));
- if (tie && !tie->original_l_)
+ if (tie && !tie->original_)
{
me->suicide ();
}
Molecule acc (fm->find_by_name (String ("accidentals-") +
style +
- to_str (gh_scm2int(entry))));
+ to_string (gh_scm2int(entry))));
mol.add_at_edge (X_AXIS, RIGHT, acc, 0.1);
}
{
if (warn)
{
- warning (_f ("can't find character called: `%s'", nm.ch_C ()));
+ warning (_f ("can't find character called: `%s'", nm.to_str0 ()));
}
return 0;
}
SCM
read_afm_file (String nm)
{
- FILE *f = fopen (nm.ch_C () , "r");
+ FILE *f = fopen (nm.to_str0 () , "r");
char s[2048];
char *check_key = "TfmCheckSum";
fgets (s, sizeof (s), f);
if (ok)
{
- error (_f ("Error parsing AFM file: `%s'", nm.ch_C ()));
+ error (_f ("Error parsing AFM file: `%s'", nm.to_str0 ()));
exit (2);
}
fclose (f);
#include "scm-hash.hh"
#include "kpath.hh"
-static const char * default_font_sz_ = "cmr10";
+static const char * default_font_str0_ = "cmr10";
All_font_metrics::All_font_metrics (String path)
{
Adobe_font_metric *
All_font_metrics::find_afm (String name)
{
- SCM sname = ly_symbol2scm (name.ch_C ());
+ SCM sname = ly_symbol2scm (name.to_str0 ());
- SCM name_str = ly_str02scm (name.ch_C ());
+ SCM name_string = ly_str02scm (name.to_str0 ());
SCM val;
if (path.empty_b ())
{
- String p = ly_find_afm (name.ch_C ());
- if (p.length_i ())
+ String p = ly_find_afm (name.to_str0 ());
+ if (p.length ())
path = p;
}
val = read_afm_file (path);
unsmob_metrics (val)->path_ = path;
- unsmob_metrics (val)->description_ = gh_cons (name_str, gh_double2scm (1.0));
+ unsmob_metrics (val)->description_ = gh_cons (name_string, gh_double2scm (1.0));
if (verbose_global_b)
progress_indication ("]");
if (tfm && tfm->info_.checksum != afm->checksum_)
{
String s = _f ("checksum mismatch for font file: `%s'",
- path.ch_C ());
- s += " " + _f ("does not match: `%s'", tfm->path_.ch_C ()); // FIXME
+ path.to_str0 ());
+ s += " " + _f ("does not match: `%s'", tfm->path_.to_str0 ()); // FIXME
s += "\n";
- s += " TFM: " + to_str ((int) tfm->info_.checksum);
- s += " AFM: " + to_str ((int) afm->checksum_);
+ s += " TFM: " + to_string ((int) tfm->info_.checksum);
+ s += " AFM: " + to_string ((int) afm->checksum_);
s += "\n";
s += _ (" Rebuild all .afm files, and remove all .pk and .tfm files. Rerun with -V to show font paths.");
Tex_font_metric *
All_font_metrics::find_tfm (String name)
{
- SCM sname = ly_symbol2scm (name.ch_C ());
- SCM name_str = ly_str02scm (name.ch_C ());
+ SCM sname = ly_symbol2scm (name.to_str0 ());
+ SCM name_string = ly_str02scm (name.to_str0 ());
SCM val;
if (!tfm_p_dict_->try_retrieve (sname, &val))
if (path.empty_b ())
{
- String p = ly_find_tfm (name.ch_C ());
- if (p.length_i ())
+ String p = ly_find_tfm (name.to_str0 ());
+ if (p.length ())
path = p;
}
progress_indication ("]");
unsmob_metrics (val)->path_ = path;
- unsmob_metrics (val)->description_ = gh_cons (name_str, gh_double2scm (1.0));
+ unsmob_metrics (val)->description_ = gh_cons (name_string, gh_double2scm (1.0));
tfm_p_dict_->set (sname, val);
scm_gc_unprotect_object (val);
if (f)
return f;
- warning (_f ("can't find font: `%s'", name.ch_C ()));
+ warning (_f ("can't find font: `%s'", name.to_str0 ()));
warning (_ ("Loading default font"));
- String def_name = default_font_sz_;
+ String def_name = default_font_str0_;
/*
we're in emergency recovery mode here anyway, so don't try to do
if (f)
return f;
- error (_f ("can't find default font: `%s'", def_name.ch_C ()));
- error (_f ("(search path: `%s')", search_path_.str ()));
+ error (_f ("can't find default font: `%s'", def_name.to_str0 ()));
+ error (_f ("(search path: `%s')", search_path_.string ()));
error (_ ("Giving up"));
return 0;
private:
void create_ambitus ();
- Item *ambitus_p_;
+ Item *ambitus_;
int/*bool*/ is_typeset;
Pitch pitch_min, pitch_max;
};
Ambitus_engraver::Ambitus_engraver ()
{
- ambitus_p_ = 0;
+ ambitus_ = 0;
is_typeset = 0;
/*
* Otherwise, if a voice begins with a rest, the ambitus grob will
* be placed after the rest.
*/
- if (!ambitus_p_) {
+ if (!ambitus_) {
create_ambitus ();
}
}
void
Ambitus_engraver::stop_translation_timestep ()
{
- if (ambitus_p_ && !is_typeset)
+ if (ambitus_ && !is_typeset)
{
/*
* Evaluate centralCPosition not until now, since otherwise we
* assumed to be 0.
*/
SCM c0 = get_property ("centralCPosition");
- ambitus_p_->set_grob_property ("centralCPosition", c0);
+ ambitus_->set_grob_property ("centralCPosition", c0);
/*
* Similar for keySignature.
*/
SCM key_signature = get_property ("keySignature");
- ambitus_p_->set_grob_property ("keySignature", key_signature);
+ ambitus_->set_grob_property ("keySignature", key_signature);
- typeset_grob (ambitus_p_);
+ typeset_grob (ambitus_);
is_typeset = 1;
}
}
void
Ambitus_engraver::acknowledge_grob (Grob_info info)
{
- Item *item = dynamic_cast <Item *>(info.grob_l_);
+ Item *item = dynamic_cast <Item *>(info.grob_);
if (item)
{
- if (Note_head::has_interface (info.grob_l_))
+ if (Note_head::has_interface (info.grob_))
{
Note_req *nr = dynamic_cast<Note_req*> (info.music_cause ());
if (nr)
Ambitus_engraver::create_ambitus ()
{
SCM basicProperties = get_property ("Ambitus");
- ambitus_p_ = new Item (basicProperties); is_typeset = 0;
- announce_grob (ambitus_p_, SCM_EOL);
+ ambitus_ = new Item (basicProperties); is_typeset = 0;
+ announce_grob (ambitus_, SCM_EOL);
}
void
Ambitus_engraver::finalize ()
{
- if (ambitus_p_)
+ if (ambitus_)
{
if (Pitch::compare (pitch_min, pitch_max) <= 0)
{
- ambitus_p_->set_grob_property ("pitch-min",
+ ambitus_->set_grob_property ("pitch-min",
pitch_min.smobbed_copy ());
- ambitus_p_->set_grob_property ("pitch-max",
+ ambitus_->set_grob_property ("pitch-max",
pitch_max.smobbed_copy ());
}
else // have not seen any pitch, so forget about the ambitus
* global timesig/clef definitions.
*/
#if 0
- ambitus_p_->warning("empty ambitus range [ignored]");
+ ambitus_->warning("empty ambitus range [ignored]");
#endif
- ambitus_p_->suicide();
+ ambitus_->suicide();
}
}
}
* Possible return values:
*
* 0: do not show any accidental
- * 1: show pitch->alteration_i_ only
- * 2: show pitch->alteration_i_, preceded by a natural sign
+ * 1: show pitch->alteration_ only
+ * 2: show pitch->alteration_, preceded by a natural sign
*/
static int
number_accidentals (SCM key_signature, Pitch *pitch,
bool ignore_octave_b, bool force_accidental)
{
- int notename = pitch->notename_i_;
- int octave = pitch->octave_i_;
- int alteration = pitch->alteration_i_;
+ int notename = pitch->notename_;
+ int octave = pitch->octave_;
+ int alteration = pitch->alteration_;
if (force_accidental) // ignore key signature
return 1;
{
if (!num_acc)
return;
- if (pitch->alteration_i_)
+ if (pitch->alteration_)
{
Molecule accidental (Font_interface::get_default_font (me)->
find_by_name (String ("accidentals-") +
accidentals_style +
- to_str (pitch->alteration_i_)));
+ to_string (pitch->alteration_)));
accidental.translate_axis (yoffs, Y_AXIS);
head->add_at_edge (X_AXIS, LEFT, accidental, 0.1);
}
Molecule natural (Font_interface::get_default_font (me)->
find_by_name (String ("accidentals-") +
accidentals_style +
- to_str ("0")));
+ to_string ("0")));
natural.translate_axis (yoffs, Y_AXIS);
head->add_at_edge (X_AXIS, LEFT, natural, 0.1);
}
if (Font_interface::get_default_font (me)->find_by_name (note_head_style).empty_b ())
{
String message = "Ambitus: no such note head: `" + note_head_style + "'";
- me->warning (_ (message.ch_C ()));
+ me->warning (_ (message.to_str0 ()));
return SCM_EOL;
}
if (to_boolean (me->get_grob_property ("join-heads")) &&
((p_max - p_min) >= 3))
{
- Real linethickness = me->paper_l ()->get_var ("linethickness");
- Real blotdiameter = me->paper_l ()->get_var ("blotdiameter");
+ Real linethickness = me->get_paper ()->get_var ("linethickness");
+ Real blotdiameter = me->get_paper ()->get_var ("blotdiameter");
Interval x_extent = 0.5 * Interval (-linethickness, +linethickness);
Interval y_extent = 0.5 * Interval (p_min + 1.35, p_max - 1.35);
Box line_box (x_extent, y_extent);
{
if (arpeggio_)
{
- if (Stem::has_interface (info.grob_l_))
+ if (Stem::has_interface (info.grob_))
{
if (!arpeggio_->get_parent (Y_AXIS))
- arpeggio_->set_parent (info.grob_l_, Y_AXIS);
+ arpeggio_->set_parent (info.grob_, Y_AXIS);
- Pointer_group_interface::add_grob (arpeggio_, ly_symbol2scm ("stems"), info.grob_l_);
+ Pointer_group_interface::add_grob (arpeggio_, ly_symbol2scm ("stems"), info.grob_);
}
/*
We can't catch local key items (accidentals) from Voice context,
see Local_key_engraver
*/
- else if (Rhythmic_head::has_interface (info.grob_l_))
+ else if (Rhythmic_head::has_interface (info.grob_))
{
- Side_position_interface::add_support (arpeggio_, info.grob_l_);
+ Side_position_interface::add_support (arpeggio_, info.grob_);
}
- else if (Note_column::has_interface (info.grob_l_ ))
+ else if (Note_column::has_interface (info.grob_ ))
{
- info.grob_l_->set_grob_property ("arpeggio", arpeggio_->self_scm ());
+ info.grob_->set_grob_property ("arpeggio", arpeggio_->self_scm ());
}
}
}
for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
- common = common->common_refpoint (Staff_symbol_referencer::staff_symbol_l (stem),
+ common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
Y_AXIS);
}
for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
- Grob * ss = Staff_symbol_referencer::staff_symbol_l (stem);
+ Grob * ss = Staff_symbol_referencer::get_staff_symbol (stem);
Interval iv =Stem::head_positions (stem);
iv *= Staff_symbol::staff_space (ss)/2.0;
mol.translate_axis (heads[LEFT], Y_AXIS);
if (dir)
mol.add_at_edge (Y_AXIS, dir,
- fm->find_by_name ("scripts-arpeggio-arrow-" + to_str (dir)), 0.0);
+ fm->find_by_name ("scripts-arpeggio-arrow-" + to_string (dir)), 0.0);
return mol.smobbed_copy () ;
}
for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
- common = common->common_refpoint (Staff_symbol_referencer::staff_symbol_l (stem),
+ common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
Y_AXIS);
}
for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
- Grob * ss = Staff_symbol_referencer::staff_symbol_l (stem);
+ Grob * ss = Staff_symbol_referencer::get_staff_symbol (stem);
Interval iv = Stem::head_positions (stem);
iv *= Staff_symbol::staff_space (ss)/2.0;
heads.unite (iv + ss->relative_coordinate (common, Y_AXIS) - my_y);
}
- Real lt = me->paper_l ()->get_var ("linethickness");
+ Real lt = me->get_paper ()->get_var ("linethickness");
Real sp = 1.5 * Staff_symbol_referencer::staff_space (me);
Real dy = heads.length() + sp;
Real x = 0.7;
Audio_column::Audio_column (Moment at_mom)
{
at_mom_ = at_mom;
- performance_l_ = 0;
+ performance_ = 0;
}
void
Audio_column::add_audio_item (Audio_item* l)
{
- audio_item_l_arr_.push (l);
- l->audio_column_l_ = this;
+ audio_items_.push (l);
+ l->audio_column_ = this;
}
Moment
#include "audio-element-info.hh"
#include "translator-group.hh"
-Audio_element_info::Audio_element_info (Audio_element*s_l, Music *r_l)
+Audio_element_info::Audio_element_info (Audio_element*s, Music *r)
{
- elem_l_ = s_l;
- origin_trans_l_ =0;
- req_l_ = r_l;
+ elem_ = s;
+ origin_trans_ =0;
+ req_ = r;
}
Audio_element_info::Audio_element_info ()
{
- elem_l_ = 0;
- req_l_ = 0;
- origin_trans_l_ =0;
+ elem_ = 0;
+ req_ = 0;
+ origin_trans_ =0;
}
Link_array<Translator>
-Audio_element_info::origin_trans_l_arr (Translator* end) const
+Audio_element_info::origin_transes (Translator* end) const
{
- Translator * t = origin_trans_l_;
+ Translator * t = origin_trans_;
Link_array<Translator> r;
do {
r.push (t);
- t = t->daddy_trans_l_;
- } while (t && t != end->daddy_trans_l_);
+ t = t->daddy_trans_;
+ } while (t && t != end->daddy_trans_);
return r;
}
#include "midi-item.hh"
#include "audio-column.hh"
-Audio_instrument::Audio_instrument (String instrument_str)
+Audio_instrument::Audio_instrument (String instrument_string)
{
- str_ = instrument_str;
+ str_ = instrument_string;
}
Audio_item::Audio_item ()
{
- audio_column_l_ = 0;
+ audio_column_ = 0;
}
Audio_note::Audio_note (Pitch p, Moment m, int transposing_i)
pitch_ = p;
length_mom_ = m;
tied_ = 0;
- transposing_i_ = transposing_i;
+ transposing_ = transposing_i;
}
void
Audio_tempo::Audio_tempo (int per_minute_4_i)
{
- per_minute_4_i_ = per_minute_4_i;
+ per_minute_4_ = per_minute_4_i;
}
Audio_time_signature::Audio_time_signature (int beats, int one_beat)
{
- beats_i_ = beats;
- one_beat_i_ = one_beat;
+ beats_ = beats;
+ one_beat_ = one_beat;
}
-Audio_text::Audio_text (Audio_text::Type type, String text_str)
+Audio_text::Audio_text (Audio_text::Type type, String text_string)
{
- text_str_ = text_str;
+ text_string_ = text_string;
type_ = type;
}
}
void
-Audio_tie::set_note (Direction d, Audio_note* note_l)
+Audio_tie::set_note (Direction d, Audio_note* note)
{
assert (!note_l_drul_[d]);
- note_l_drul_[d] = note_l;
- //set_bound (d, head_l);
+ note_l_drul_[d] = note;
+ //set_bound (d, head);
- // add_dependency (head_l);
+ // add_dependency (head);
}
void
Audio_staff::add_audio_item (Audio_item* l)
{
- audio_item_l_arr_.push (l);
+ audio_items_.push (l);
}
Audio_staff::output (Midi_stream& midi_stream_r, int track_i)
{
Midi_track midi_track;
- midi_track.number_i_ = track_i;
- midi_track.channel_i_ = channel_i_;
+ midi_track.number_ = track_i;
+ midi_track.channel_ = channel_;
for (Midi_walker i (this, &midi_track); i.ok (); i++)
i.process ();
midi_stream_r << midi_track;
bool test_moment (Direction, Moment);
void consider_begin (Moment);
void consider_end (Moment);
- Spanner* create_beam_p ();
+ Spanner* create_beam ();
void begin_beam ();
void end_beam ();
void junk_beam ();
shortest_mom is the shortest note in the beam.
*/
Moment shortest_mom_;
- Spanner *finished_beam_p_;
- Link_array<Item>* stem_l_arr_p_;
+ Spanner *finished_beam_;
+ Link_array<Item>* stems_;
- int count_i_;
+ int count_;
Moment last_add_mom_;
/*
Projected ending of the beam we're working on.
Moment beat_length_;
// We act as if beam were created, and start a grouping anyway.
- Beaming_info_list*grouping_p_;
+ Beaming_info_list*grouping_;
SCM beam_settings_ ; // ugh. should protect ?
- Beaming_info_list*finished_grouping_p_;
+ Beaming_info_list*finished_grouping_;
};
Auto_beam_engraver::Auto_beam_engraver ()
{
- count_i_ = 0;
- stem_l_arr_p_ = 0;
+ count_ = 0;
+ stems_ = 0;
shortest_mom_ = Moment (Rational (1, 8));
- finished_beam_p_ = 0;
- finished_grouping_p_ = 0;
- grouping_p_ = 0;
+ finished_beam_ = 0;
+ finished_grouping_ = 0;
+ grouping_ = 0;
beam_settings_ = SCM_EOL;
}
Auto_beam_engraver::consider_begin (Moment test_mom)
{
bool on = to_boolean (get_property ("autoBeaming"));
- if (!stem_l_arr_p_ && on)
+ if (!stems_ && on)
{
bool b = test_moment (START, test_mom);
if (b)
void
Auto_beam_engraver::consider_end (Moment test_mom)
{
- if (stem_l_arr_p_)
+ if (stems_)
{
/* Allow already started autobeam to end:
don't check for autoBeaming */
}
Spanner*
-Auto_beam_engraver::create_beam_p ()
+Auto_beam_engraver::create_beam ()
{
if (to_boolean (get_property ("skipTypesetting")))
{
return 0;
}
- Spanner* beam_p = new Spanner (beam_settings_);
- for (int i = 0; i < stem_l_arr_p_->size (); i++)
+ Spanner* beam = new Spanner (beam_settings_);
+ for (int i = 0; i < stems_->size (); i++)
{
/*
watch out for stem tremolos and abbreviation beams
*/
- if (Stem::beam_l ((*stem_l_arr_p_)[i]))
+ if (Stem::get_beam ((*stems_)[i]))
{
- scm_gc_unprotect_object (beam_p->self_scm ());
+ scm_gc_unprotect_object (beam->self_scm ());
return 0;
}
- Beam::add_stem (beam_p, (*stem_l_arr_p_)[i]);
+ Beam::add_stem (beam, (*stems_)[i]);
}
- announce_grob(beam_p, SCM_EOL);
+ announce_grob(beam, SCM_EOL);
- return beam_p;
+ return beam;
}
void
Auto_beam_engraver::begin_beam ()
{
- assert (!stem_l_arr_p_);
- stem_l_arr_p_ = new Link_array<Item>;
- assert (!grouping_p_);
- grouping_p_ = new Beaming_info_list;
+ assert (!stems_);
+ stems_ = new Link_array<Item>;
+ assert (!grouping_);
+ grouping_ = new Beaming_info_list;
beam_settings_ = get_property ("Beam");
beam_start_moment_ = now_mom ();
void
Auto_beam_engraver::junk_beam ()
{
- assert (stem_l_arr_p_);
+ assert (stems_);
- delete stem_l_arr_p_;
- stem_l_arr_p_ = 0;
- delete grouping_p_;
- grouping_p_ = 0;
+ delete stems_;
+ stems_ = 0;
+ delete grouping_;
+ grouping_ = 0;
beam_settings_ = SCM_EOL;
shortest_mom_ = Moment (Rational (1, 8));
void
Auto_beam_engraver::end_beam ()
{
- if (stem_l_arr_p_->size () < 2)
+ if (stems_->size () < 2)
{
junk_beam ();
}
else
{
- finished_beam_p_ = create_beam_p ();
- if (finished_beam_p_)
- finished_grouping_p_ = grouping_p_;
- delete stem_l_arr_p_;
- stem_l_arr_p_ = 0;
- grouping_p_ = 0;
+ finished_beam_ = create_beam ();
+ if (finished_beam_)
+ finished_grouping_ = grouping_;
+ delete stems_;
+ stems_ = 0;
+ grouping_ = 0;
beam_settings_ = SCM_EOL;
}
void
Auto_beam_engraver::typeset_beam ()
{
- if (finished_beam_p_)
+ if (finished_beam_)
{
- finished_grouping_p_->beamify(beat_length_, subdivide_beams_);
- Beam::set_beaming (finished_beam_p_, finished_grouping_p_);
- typeset_grob (finished_beam_p_);
- finished_beam_p_ = 0;
+ finished_grouping_->beamify(beat_length_, subdivide_beams_);
+ Beam::set_beaming (finished_beam_, finished_grouping_);
+ typeset_grob (finished_beam_);
+ finished_beam_ = 0;
- delete finished_grouping_p_;
- finished_grouping_p_= 0;
+ delete finished_grouping_;
+ finished_grouping_= 0;
}
}
void
Auto_beam_engraver::start_translation_timestep ()
{
- count_i_ = 0;
+ count_ = 0;
/*
don't beam over skips
*/
- if (stem_l_arr_p_)
+ if (stems_)
{
Moment now = now_mom ();
if (extend_mom_ < now)
/* finished beams may be typeset */
typeset_beam ();
/* but unfinished may need another announce/acknowledge pass */
- if (stem_l_arr_p_)
+ if (stems_)
junk_beam ();
}
void
Auto_beam_engraver::acknowledge_grob (Grob_info info)
{
- if (stem_l_arr_p_)
+ if (stems_)
{
- if (Beam::has_interface (info.grob_l_))
+ if (Beam::has_interface (info.grob_))
{
end_beam ();
}
- else if (Bar_line::has_interface (info.grob_l_))
+ else if (Bar_line::has_interface (info.grob_))
{
end_beam ();
}
- else if (Rest::has_interface (info.grob_l_))
+ else if (Rest::has_interface (info.grob_))
{
end_beam ();
}
}
- if (Stem::has_interface (info.grob_l_))
+ if (Stem::has_interface (info.grob_))
{
- Item* stem_l = dynamic_cast<Item *> (info.grob_l_);
+ Item* stem = dynamic_cast<Item *> (info.grob_);
Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.music_cause ());
if (!rhythmic_req)
/*
Don't (start) auto-beam over empty stems; skips or rests
*/
- if (!Stem::head_count (stem_l))
+ if (!Stem::head_count (stem))
{
- if (stem_l_arr_p_)
+ if (stems_)
end_beam ();
return;
}
- if (Stem::beam_l (stem_l))
+ if (Stem::get_beam (stem))
{
- if (stem_l_arr_p_)
+ if (stems_)
junk_beam ();
return ;
}
if (durlog <= 2)
{
- if (stem_l_arr_p_)
+ if (stems_)
end_beam ();
return;
}
consider_begin (shortest_mom_);
#endif
- if (!stem_l_arr_p_)
+ if (!stems_)
return;
Moment now = now_mom ();
- grouping_p_->add_stem (now - beam_start_moment_ + beam_start_location_,
+ grouping_->add_stem (now - beam_start_moment_ + beam_start_location_,
durlog - 2);
- stem_l_arr_p_->push (stem_l);
+ stems_->push (stem);
last_add_mom_ = now;
extend_mom_ = (extend_mom_ >? now) + rhythmic_req->length_mom ();
}
void
Auto_beam_engraver::process_acknowledged_grobs ()
{
- if (!count_i_)
+ if (!count_)
{
consider_end (shortest_mom_);
consider_begin (shortest_mom_);
}
- else if (count_i_ > 1)
+ else if (count_ > 1)
{
- if (stem_l_arr_p_)
+ if (stems_)
{
Moment now = now_mom ();
if ((extend_mom_ < now)
{
end_beam ();
}
- else if (!stem_l_arr_p_->size ())
+ else if (!stems_->size ())
{
junk_beam ();
}
}
/*
- count_i_++ ->
+ count_++ ->
auto-beam-engraver.cc:459: warning: value computed is not used (gcc: 2.96) */
- count_i_ = count_i_ + 1;
+ count_ = count_ + 1;
}
ENTER_DESCRIPTION(Auto_beam_engraver,
/* descr */ "Generate beams based on measure characteristics and observed
Auto_change_iterator::change_to (Music_iterator *it, String to_type,
String to_id)
{
- Translator_group * current = it->report_to_l ();
+ Translator_group * current = it->report_to ();
Translator_group * last = 0;
/*
If \translator Staff = bass, then look for Staff = *
*/
- while (current && current->type_str_ != to_type)
+ while (current && current->type_string_ != to_type)
{
last = current;
- current = current->daddy_trans_l_;
+ current = current->daddy_trans_;
}
- if (current && current->id_str_ == to_id)
+ if (current && current->id_string_ == to_id)
{
String msg;
msg += _ ("Can't switch translators, I'm there already");
if (last)
{
Translator_group * dest =
- it->report_to_l ()->find_create_translator_l (to_type, to_id);
- current->remove_translator_p (last);
+ it->report_to ()->find_create_translator (to_type, to_id);
+ current->remove_translator (last);
dest->add_used_group_translator (last);
}
else
We could change the current translator's id, but that would make
errors hard to catch
- last->translator_id_str_ = change_l ()->change_to_id_str_;
+ last->translator_id_string_ = get_change ()->change_to_id_string_;
*/
// error (_ ("I'm one myself"));
}
Array<Pitch>
Auto_change_iterator::pending_pitch (Moment m) const
{
- Music_iterator * iter = child_iter_p_ ->clone ();
+ Music_iterator * iter = child_iter_ ->clone ();
Array<Pitch> ps;
while (1)
{
{
where_dir_ = s;
String to_id = (s >= 0) ? "up" : "down";
- String wh = ly_scm2string (music_l ()->get_mus_property ("what"));
- change_to (child_iter_p_, wh, to_id);
+ String wh = ly_scm2string (get_music ()->get_mus_property ("what"));
+ change_to (child_iter_, wh, to_id);
}
}
}
class Axis_group_engraver : public Engraver
{
protected:
- Spanner *staffline_p_;
+ Spanner *staffline_;
Link_array<Grob> elts_;
virtual void initialize ();
virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
virtual void process_acknowledged_grobs ();
- virtual Spanner* get_spanner_p () const;
+ virtual Spanner* get_spanner () const;
virtual void add_element (Grob*) ;
public:
TRANSLATOR_DECLARATIONS(Axis_group_engraver );
Axis_group_engraver::Axis_group_engraver ()
{
- staffline_p_ = 0;
+ staffline_ = 0;
}
void
Axis_group_engraver::initialize ()
{
- staffline_p_ = get_spanner_p ();
+ staffline_ = get_spanner ();
Grob * it = unsmob_grob (get_property ("currentCommandColumn"));
- staffline_p_->set_bound (LEFT,it);
+ staffline_->set_bound (LEFT,it);
- announce_grob(staffline_p_, SCM_EOL);
+ announce_grob(staffline_, SCM_EOL);
}
Spanner*
-Axis_group_engraver::get_spanner_p () const
+Axis_group_engraver::get_spanner () const
{
return new Spanner (get_property ("VerticalAxisGroup"));
}
void
Axis_group_engraver::finalize ()
{
- String type = daddy_grav_l ()->type_str_ ;
+ String type = get_daddy_grav ()->type_string_ ;
SCM dims = get_property ("verticalExtent");
if (gh_pair_p (dims) && gh_number_p (ly_car (dims))
&& gh_number_p (ly_cdr (dims)))
{
- staffline_p_->set_extent (Grob::preset_extent_proc, Y_AXIS);
- staffline_p_->set_grob_property ("extent-Y", dims);
+ staffline_->set_extent (Grob::preset_extent_proc, Y_AXIS);
+ staffline_->set_grob_property ("extent-Y", dims);
}
dims = get_property ("minimumVerticalExtent");
if (gh_pair_p (dims) && gh_number_p (ly_car (dims))
&& gh_number_p (ly_cdr (dims)))
- staffline_p_->set_grob_property ("minimum-extent-Y", dims);
+ staffline_->set_grob_property ("minimum-extent-Y", dims);
dims = get_property ("extraVerticalExtent");
if (gh_pair_p (dims) && gh_number_p (ly_car (dims))
&& gh_number_p (ly_cdr (dims)))
- staffline_p_->set_grob_property ("extra-extent-Y", dims);
+ staffline_->set_grob_property ("extra-extent-Y", dims);
Grob * it = unsmob_grob (get_property ("currentCommandColumn"));
- staffline_p_->set_bound (RIGHT,it);
+ staffline_->set_bound (RIGHT,it);
- typeset_grob (staffline_p_);
- staffline_p_ = 0;
+ typeset_grob (staffline_);
+ staffline_ = 0;
}
void
Axis_group_engraver::acknowledge_grob (Grob_info i)
{
- elts_.push (i.grob_l_);
+ elts_.push (i.grob_);
}
/*
- maybe should check if our parent_l is set, because we now get a
+ maybe should check if our parent is set, because we now get a
cyclic parent relationship if we have two Axis_group_engravers in
the context. */
void
void
Axis_group_engraver::add_element (Grob*e)
{
- Axis_group_interface::add_element (staffline_p_, e);
+ Axis_group_interface::add_element (staffline_, e);
}
////////////////////////////////////////////////////////
class Hara_kiri_engraver : public Axis_group_engraver
{
protected:
- virtual Spanner*get_spanner_p ()const;
+ virtual Spanner*get_spanner ()const;
virtual void acknowledge_grob (Grob_info);
virtual void add_element (Grob *e);
public:
void
Hara_kiri_engraver::add_element (Grob*e)
{
- Hara_kiri_group_spanner::add_element (staffline_p_, e);
+ Hara_kiri_group_spanner::add_element (staffline_, e);
}
Spanner*
-Hara_kiri_engraver::get_spanner_p () const
+Hara_kiri_engraver::get_spanner () const
{
Spanner * sp = new Spanner (get_property ("HaraKiriVerticalGroup"));
Hara_kiri_engraver::acknowledge_grob (Grob_info i)
{
Axis_group_engraver::acknowledge_grob (i);
- if (Rhythmic_head::has_interface (i.grob_l_)
- || i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+ if (Rhythmic_head::has_interface (i.grob_)
+ || i.grob_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
{
- Hara_kiri_group_spanner::add_interesting_item (staffline_p_, i.grob_l_);
+ Hara_kiri_group_spanner::add_interesting_item (staffline_, i.grob_);
}
}
Simple_music_iterator::process(m);
if (!m.to_bool ())
{
- Translator_group *tr = report_to_l ();
+ Translator_group *tr = report_to ();
SCM mp = tr->get_property ("measurePosition");
SCM sync= tr->get_property ("barCheckSynchronize");
if (where->main_part_)
{
- music_l ()->origin ()->warning (_f ("barcheck failed at: %s",
- where->str ()));
+ get_music ()->origin ()->warning (_f ("barcheck failed at: %s",
+ where->string ()));
if (to_boolean (sync))
{
tr = tr->where_defined (ly_symbol2scm("measurePosition"));
{
public:
TRANSLATOR_DECLARATIONS( Bar_engraver );
- void request_bar (String type_str);
+ void request_bar (String type_string);
protected:
virtual void finalize ();
void typeset_bar ();
void create_bar ();
- Item * bar_p_;
+ Item * bar_;
};
Bar_engraver::Bar_engraver ()
{
- bar_p_ =0;
+ bar_ =0;
}
void
Bar_engraver::create_bar ()
{
- if (!bar_p_)
+ if (!bar_)
{
- bar_p_ = new Item (get_property ("BarLine"));
+ bar_ = new Item (get_property ("BarLine"));
SCM gl = get_property ("whichBar");
- if (scm_equal_p (gl, bar_p_->get_grob_property ("glyph")) != SCM_BOOL_T)
- bar_p_->set_grob_property ("glyph", gl);
+ if (scm_equal_p (gl, bar_->get_grob_property ("glyph")) != SCM_BOOL_T)
+ bar_->set_grob_property ("glyph", gl);
- announce_grob(bar_p_, SCM_EOL);
+ announce_grob(bar_, SCM_EOL);
}
}
void
Bar_engraver::process_acknowledged_grobs ()
{
- if (!bar_p_ && gh_string_p (get_property ("whichBar")))
+ if (!bar_ && gh_string_p (get_property ("whichBar")))
{
create_bar ();
}
void
Bar_engraver::typeset_bar ()
{
- if (bar_p_)
+ if (bar_)
{
- typeset_grob (bar_p_);
- bar_p_ =0;
+ typeset_grob (bar_);
+ bar_ =0;
}
}
void
Bar_engraver::stop_translation_timestep ()
{
- if (!bar_p_)
+ if (!bar_)
{
top_engraver ()->forbid_breaks (); // guh. Use properties!
}
Real hair = gh_scm2double (me->get_grob_property ("hair-thickness"));
Real fatline = gh_scm2double (me->get_grob_property ("thick-thickness"));
- Real staffline = me->paper_l ()->get_var ("linethickness");
+ Real staffline = me->get_paper ()->get_var ("linethickness");
Real staff_space = Staff_symbol_referencer::staff_space (me);
kern *= staffline;
SCM size = me->get_grob_property ("bar-size");
if (gh_number_p (size))
return gh_double2scm (gh_scm2double (size)*ss);
- else if (Staff_symbol_referencer::staff_symbol_l (me))
+ else if (Staff_symbol_referencer::get_staff_symbol (me))
{
/*
If there is no staff-symbol, we get -1 from the next
class Bar_number_engraver : public Engraver
{
protected:
- Item* text_p_;
+ Item* text_;
protected:
virtual void stop_translation_timestep ();
virtual void acknowledge_grob (Grob_info);
create_items ();
// guh.
- text_p_->set_grob_property ("text",
- ly_str02scm (to_str (gh_scm2int (bn)).ch_C ()));
+ text_->set_grob_property ("text",
+ ly_str02scm (to_string (gh_scm2int (bn)).to_str0 ()));
}
}
Bar_number_engraver::Bar_number_engraver ()
{
- text_p_ =0;
+ text_ =0;
}
void
Bar_number_engraver::acknowledge_grob (Grob_info inf)
{
- Grob * s = inf.grob_l_;
- if (text_p_
+ Grob * s = inf.grob_;
+ if (text_
&& dynamic_cast<Item*> (s)
&& s->get_grob_property ("break-align-symbol") == ly_symbol2scm ("left-edge"))
{
/*
By default this would land on the Paper_column -- so why
doesn't it work when you leave this out? */
- text_p_->set_parent (s, X_AXIS);
+ text_->set_parent (s, X_AXIS);
}
}
void
Bar_number_engraver::stop_translation_timestep ()
{
- if (text_p_)
+ if (text_)
{
- text_p_->set_grob_property ("side-support-elements", get_property ("stavesFound"));
- typeset_grob (text_p_);
- text_p_ =0;
+ text_->set_grob_property ("side-support-elements", get_property ("stavesFound"));
+ typeset_grob (text_);
+ text_ =0;
}
}
void
Bar_number_engraver::create_items ()
{
- if (text_p_)
+ if (text_)
return;
SCM b = get_property ("BarNumber");
- text_p_ = new Item (b);
- Side_position_interface::set_axis (text_p_,Y_AXIS);
+ text_ = new Item (b);
+ Side_position_interface::set_axis (text_,Y_AXIS);
- announce_grob(text_p_, SCM_EOL);
+ announce_grob(text_, SCM_EOL);
}
ENTER_DESCRIPTION(Bar_number_engraver,
protected:
Drul_array<Span_req*> reqs_drul_;
- Spanner *finished_beam_p_;
- Spanner *beam_p_;
+ Spanner *finished_beam_;
+ Spanner *beam_;
Span_req * prev_start_req_;
- Beaming_info_list * beam_info_p_;
- Beaming_info_list * finished_beam_info_p_;
+ Beaming_info_list * beam_info_;
+ Beaming_info_list * finished_beam_info_;
/// location within measure where beam started.
Moment beam_start_location_;
Beam_engraver::Beam_engraver ()
{
- beam_p_ = 0;
- finished_beam_p_ =0;
- finished_beam_info_p_=0;
- beam_info_p_ =0;
+ beam_ = 0;
+ finished_beam_ =0;
+ finished_beam_info_=0;
+ beam_info_ =0;
reqs_drul_[LEFT] = reqs_drul_[RIGHT] =0;
prev_start_req_ =0;
{
reqs_drul_[START] = 0;
reqs_drul_[STOP] = 0;
- if (beam_p_)
- beam_p_->suicide ();
- beam_p_ = 0;
+ if (beam_)
+ beam_->suicide ();
+ beam_ = 0;
}
else if (scm_equal_p (c->get_mus_property ("span-type"),
ly_str02scm ("beam")) == SCM_BOOL_T)
void
Beam_engraver::set_melisma (bool m)
{
- daddy_trans_l_->set_property ("beamMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
+ daddy_trans_->set_property ("beamMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
}
void
if (reqs_drul_[STOP])
{
prev_start_req_ =0;
- finished_beam_p_ = beam_p_;
- finished_beam_info_p_ = beam_info_p_;
+ finished_beam_ = beam_;
+ finished_beam_info_ = beam_info_;
- beam_info_p_ =0;
- beam_p_ = 0;
+ beam_info_ =0;
+ beam_ = 0;
}
- if (beam_p_)
+ if (beam_)
{
top_engraver ()->forbid_breaks ();
}
if (reqs_drul_[START])
{
- if (beam_p_)
+ if (beam_)
{
reqs_drul_[START]->origin ()->warning (_ ("already have a beam"));
return;
}
prev_start_req_ = reqs_drul_[START];
- beam_p_ = new Spanner (get_property ("Beam"));
+ beam_ = new Spanner (get_property ("Beam"));
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
beam_start_location_ = mp;
beam_start_mom_ = now_mom ();
- beam_info_p_ = new Beaming_info_list;
+ beam_info_ = new Beaming_info_list;
/* urg, must copy to Auto_beam_engraver too */
- announce_grob(beam_p_, reqs_drul_[START]->self_scm());
+ announce_grob(beam_, reqs_drul_[START]->self_scm());
}
}
void
Beam_engraver::typeset_beam ()
{
- if (finished_beam_p_)
+ if (finished_beam_)
{
- finished_beam_info_p_->beamify(beat_length_, subdivide_beams_);
- Beam::set_beaming (finished_beam_p_, finished_beam_info_p_);
- typeset_grob (finished_beam_p_);
- delete finished_beam_info_p_;
- finished_beam_info_p_ =0;
- finished_beam_p_ = 0;
+ finished_beam_info_->beamify(beat_length_, subdivide_beams_);
+ Beam::set_beaming (finished_beam_, finished_beam_info_);
+ typeset_grob (finished_beam_);
+ delete finished_beam_info_;
+ finished_beam_info_ =0;
+ finished_beam_ = 0;
}
}
reqs_drul_ [START] =0;
reqs_drul_[STOP] = 0;
- if (beam_p_)
+ if (beam_)
{
SCM m = get_property ("automaticMelismata");
SCM b = get_property ("autoBeaming");
Beam_engraver::finalize ()
{
typeset_beam ();
- if (beam_p_)
+ if (beam_)
{
prev_start_req_->origin ()->warning (_ ("unterminated beam"));
/*
we don't typeset it, (we used to, but it was commented
out. Reason unknown) */
- beam_p_->suicide ();
- delete beam_info_p_;
+ beam_->suicide ();
+ delete beam_info_;
}
}
void
Beam_engraver::acknowledge_grob (Grob_info info)
{
- if (beam_p_)
+ if (beam_)
{
- if (Rest::has_interface (info.grob_l_))
+ if (Rest::has_interface (info.grob_))
{
- info.grob_l_->add_offset_callback (Beam::rest_collision_callback_proc, Y_AXIS);
+ info.grob_->add_offset_callback (Beam::rest_collision_callback_proc, Y_AXIS);
}
- else if (Stem::has_interface (info.grob_l_))
+ else if (Stem::has_interface (info.grob_))
{
Moment now = now_mom();
if (!valid_start_moment ())
return ;
- Item *stem_l = dynamic_cast<Item*> (info.grob_l_);
- if (Stem::beam_l (stem_l))
+ Item *stem = dynamic_cast<Item*> (info.grob_);
+ if (Stem::get_beam (stem))
return;
Rhythmic_req *rhythmic_req = dynamic_cast <Rhythmic_req *> (info.music_cause ());
*/
}
- stem_l->set_grob_property ("duration-log",
+ stem->set_grob_property ("duration-log",
gh_int2scm (durlog));
Moment stem_location = now - beam_start_mom_ + beam_start_location_;
- beam_info_p_->add_stem (stem_location,
+ beam_info_->add_stem (stem_location,
(durlog- 2) >? 0);
- Beam::add_stem (beam_p_, stem_l);
+ Beam::add_stem (beam_, stem);
}
}
}
bool
Grace_beam_engraver::valid_end_moment ()
{
- return beam_p_ && last_stem_added_at_.grace_part_ != Rational(0);
+ return beam_ && last_stem_added_at_.grace_part_ != Rational(0);
}
Real ss = Staff_symbol_referencer::staff_space (me);
Real thickness = gh_scm2double (me->get_grob_property ("thickness")) / ss;
- Real slt = me->paper_l ()->get_var ("linethickness") / ss;
+ Real slt = me->get_paper ()->get_var ("linethickness") / ss;
SCM sdy = me->get_grob_property ("least-squares-dy");
s->add_dependency (me);
- assert (!Stem::beam_l (s));
+ assert (!Stem::get_beam (s));
s->set_grob_property ("beam", me->self_scm ());
add_bound_item (dynamic_cast<Spanner*> (me), dynamic_cast<Item*> (s));
Grob *me = unsmob_grob (smob);
Real staff_space = Staff_symbol_referencer::staff_space (me);
- Real line = me->paper_l ()->get_var ("linethickness");
+ Real line = me->get_paper ()->get_var ("linethickness");
Real thickness = gh_scm2double (me->get_grob_property ("thickness"))
* staff_space;
SCM gap = me->get_grob_property ("gap");
Molecule the_beam;
- Real lt = me->paper_l ()->get_var ("linethickness");
+ Real lt = me->get_paper ()->get_var ("linethickness");
for (int i = 0; i< stems.size(); i++)
{
Grob * st =stems[i];
String str;
if (1)
{
- str += to_str (gh_scm2int (me->get_grob_property ("best-idx")));
+ str += to_string (gh_scm2int (me->get_grob_property ("best-idx")));
str += ":";
}
- str += to_str (gh_scm2double (me->get_grob_property ("quant-score")),
+ str += to_string (gh_scm2double (me->get_grob_property ("quant-score")),
"%.2f");
SCM properties = Font_interface::font_alist_chain (me);
- Molecule tm = Text_item::text2molecule (me, ly_str02scm (str.ch_C ()), properties);
+ Molecule tm = Text_item::text2molecule (me, ly_str02scm (str.to_str0 ()), properties);
the_beam.add_at_edge (Y_AXIS, UP, tm, 5.0);
}
#endif
Grob *s = stems[i];
/* For knees, non-forced stems should probably have their
natural direction. In any case, when knee, beam direction is
- foe. */
+ foe.
+
+ TODO: for x staff knees, set direction pointing to 'the other' staff, rather than natural.
+ */
if (knee_b(me))
Stem::get_direction (s); // this actually sets it, if necessary
else
}
void
-scale (Array<Offset>* arr_p, Real x , Real y)
+scale (Array<Offset>* array, Real x , Real y)
{
- for (int i = 0; i < arr_p->size (); i++)
+ for (int i = 0; i < array->size (); i++)
{
- (*arr_p)[i][X_AXIS] = x* (*arr_p)[i][X_AXIS];
- (*arr_p)[i][Y_AXIS] = y* (*arr_p)[i][Y_AXIS];
+ (*array)[i][X_AXIS] = x* (*array)[i][X_AXIS];
+ (*array)[i][Y_AXIS] = y* (*array)[i][Y_AXIS];
}
}
void
-rotate (Array<Offset>* arr_p, Real phi)
+rotate (Array<Offset>* array, Real phi)
{
Offset rot (complex_exp (Offset (0, phi)));
- for (int i = 0; i < arr_p->size (); i++)
- (*arr_p)[i] = complex_multiply (rot, (*arr_p)[i]);
+ for (int i = 0; i < array->size (); i++)
+ (*array)[i] = complex_multiply (rot, (*array)[i]);
}
void
-translate (Array<Offset>* arr_p, Offset o)
+translate (Array<Offset>* array, Offset o)
{
- for (int i = 0; i < arr_p->size (); i++)
- (*arr_p)[i] += o;
+ for (int i = 0; i < array->size (); i++)
+ (*array)[i] += o;
}
/*
Array<int>
Break_algorithm::find_break_indices () const
{
- Link_array<Grob> all = pscore_l_->system_->column_l_arr ();
+ Link_array<Grob> all = pscore_->system_->columns ();
Array<int> retval;
for (int i=0; i < all.size (); i++)
if (Item::breakable_b (all[i]))
retval.push (i);
- if (linewidth_f_ <=0)
+ if (linewidth_ <=0)
while (retval.size () >2)
retval.del (1);
Link_array<Grob>
Break_algorithm::find_breaks () const
{
- Link_array<Grob> all = pscore_l_->system_->column_l_arr ();
+ Link_array<Grob> all = pscore_->system_->columns ();
Link_array<Grob> retval;
for (int i=0; i < all.size (); i++)
if (Item::breakable_b (all[i]))
retval.push (all[i]);
- if (linewidth_f_ <=0)
+ if (linewidth_ <=0)
while (retval.size () >2)
retval.del (1);
this is hardcoded, but this shouldn't happen anyway.
used to be get_var ("loose_column_distance");
*/
- sp->default_space_f_ = 1.0;
+ sp->default_space_ = 1.0;
- sp->indent_f_ = line[LEFT];
+ sp->indent_ = line[LEFT];
/*
sort out how interfacing this should work;
*/
if (line.empty_b ())
{
- sp->line_len_f_ = -1;
+ sp->line_len_ = -1;
}
else
- sp->line_len_f_ = line.length ();
+ sp->line_len_ = line.length ();
sp->add_columns (curline);
Break_algorithm::Break_algorithm ()
{
- pscore_l_ = 0;
- linewidth_f_ = 0;
+ pscore_ = 0;
+ linewidth_ = 0;
}
void
Break_algorithm::set_pscore (Paper_score*s)
{
- pscore_l_ = s;
- linewidth_f_ = s->paper_l_->get_var ("linewidth");
+ pscore_ = s;
+ linewidth_ = s->paper_->get_var ("linewidth");
}
Array<Column_x_positions>
class Break_align_engraver : public Engraver
{
- Item *align_l_;
+ Item *align_;
Protected_scm column_alist_;
void add_to_group (SCM,Item*);
protected:
Break_align_engraver::add_column (SCM smob)
{
Grob * e = unsmob_grob (smob);
- Break_align_interface::add_element (align_l_,e);
+ Break_align_interface::add_element (align_,e);
typeset_grob (e);
}
column_alist_ = SCM_EOL;
- if (align_l_)
+ if (align_)
{
- typeset_grob (align_l_);
- align_l_ = 0;
+ typeset_grob (align_);
+ align_ = 0;
}
}
Break_align_engraver::Break_align_engraver ()
{
column_alist_ = SCM_EOL;
- align_l_ =0;
+ align_ =0;
}
void
Break_align_engraver::acknowledge_grob (Grob_info inf)
{
- if (Item * item_l = dynamic_cast <Item *> (inf.grob_l_))
+ if (Item * item = dynamic_cast <Item *> (inf.grob_))
{
- if (item_l->empty_b (X_AXIS) || item_l->get_parent (X_AXIS))
+ if (item->empty_b (X_AXIS) || item->get_parent (X_AXIS))
return;
- SCM bp=item_l->get_grob_property ("breakable");
+ SCM bp=item->get_grob_property ("breakable");
bool breakable = (to_boolean (bp));
if (!breakable)
return ;
- SCM align_name = item_l->get_grob_property ("break-align-symbol");
+ SCM align_name = item->get_grob_property ("break-align-symbol");
if (!gh_symbol_p (align_name))
return ;
- if (!align_l_)
+ if (!align_)
{
- align_l_ = new Item (get_property ("BreakAlignment"));
+ align_ = new Item (get_property ("BreakAlignment"));
- announce_grob (align_l_, SCM_EOL);
+ announce_grob (align_, SCM_EOL);
Item * edge = new Item (get_property ("LeftEdge"));
add_to_group (edge->get_grob_property ("break-align-symbol"), edge);
announce_grob(edge, SCM_EOL);
}
- add_to_group (align_name, item_l);
+ add_to_group (align_name, item);
}
}
void
-Break_align_engraver::add_to_group(SCM align_name, Item*item_l)
+Break_align_engraver::add_to_group(SCM align_name, Item*item)
{
SCM s = scm_assoc (align_name, column_alist_);
Item * group = 0;
group = new Item (get_property ("BreakAlignGroup"));
group->set_grob_property ("break-align-symbol", align_name);
- group->set_parent (align_l_, Y_AXIS);
- announce_grob(group, item_l->self_scm());
+ group->set_parent (align_, Y_AXIS);
+ announce_grob(group, item->self_scm());
column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ());
}
- Axis_group_interface::add_element (group, item_l);
+ Axis_group_interface::add_element (group, item);
}
ENTER_DESCRIPTION(Break_align_engraver,
bool entry_found = gh_pair_p (entry);
if (!entry_found)
{
- String sym_str;
- if(gh_symbol_p(rsym))
- sym_str = ly_symbol2string (rsym);
+ String sym_string;
+ if(gh_symbol_p (rsym))
+ sym_string = ly_symbol2string (rsym);
- String orig_str ;
+ String orig_string ;
if (unsmob_grob (l->get_grob_property ("cause")))
- orig_str = unsmob_grob (l->get_grob_property ("cause"))->name ();
+ orig_string = unsmob_grob (l->get_grob_property ("cause"))->name ();
programming_error (_f("No spacing entry from %s to `%s'",
- orig_str.ch_C (),
- sym_str.ch_C()));
+ orig_string.to_str0 (),
+ sym_string.to_str0 ()));
}
Real distance = 1.0;
TRANSLATOR_DECLARATIONS(Breathing_sign_engraver);
protected:
- virtual bool try_music (Music *req_l);
+ virtual bool try_music (Music *req);
virtual void process_acknowledged_grobs ();
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
private:
- Breathing_sign_req * breathing_sign_req_l_;
- Grob * breathing_sign_p_;
+ Breathing_sign_req * breathing_sign_req_;
+ Grob * breathing_sign_;
};
Breathing_sign_engraver::Breathing_sign_engraver ()
{
- breathing_sign_p_ = 0;
- breathing_sign_req_l_ = 0;
+ breathing_sign_ = 0;
+ breathing_sign_req_ = 0;
}
bool
-Breathing_sign_engraver::try_music (Music*r_l)
+Breathing_sign_engraver::try_music (Music*r)
{
- if (Breathing_sign_req * b= dynamic_cast <Breathing_sign_req *> (r_l))
+ if (Breathing_sign_req * b= dynamic_cast <Breathing_sign_req *> (r))
{
- breathing_sign_req_l_ = b;
+ breathing_sign_req_ = b;
return true;
}
void
Breathing_sign_engraver::process_acknowledged_grobs ()
{
- if (breathing_sign_req_l_ && ! breathing_sign_p_)
+ if (breathing_sign_req_ && ! breathing_sign_)
{
SCM b = get_property ("BreathingSign");
- breathing_sign_p_ = new Item (b);
+ breathing_sign_ = new Item (b);
- announce_grob(breathing_sign_p_, breathing_sign_req_l_->self_scm());
- breathing_sign_req_l_ = 0;
+ announce_grob(breathing_sign_, breathing_sign_req_->self_scm());
+ breathing_sign_req_ = 0;
}
}
void
Breathing_sign_engraver::stop_translation_timestep ()
{
- if (breathing_sign_p_)
+ if (breathing_sign_)
{
- typeset_grob (breathing_sign_p_);
- breathing_sign_p_ = 0;
+ typeset_grob (breathing_sign_);
+ breathing_sign_ = 0;
}
}
void
Breathing_sign_engraver::start_translation_timestep ()
{
- breathing_sign_req_l_ = 0;
+ breathing_sign_req_ = 0;
}
void
Change_iterator::error (String reason)
{
- String to_type = ly_scm2string (music_l ()->get_mus_property ("change-to-type"));
- String to_id = ly_scm2string (music_l ()->get_mus_property ("change-to-id"));
+ String to_type = ly_scm2string (get_music ()->get_mus_property ("change-to-type"));
+ String to_id = ly_scm2string (get_music ()->get_mus_property ("change-to-id"));
String warn1 = _f ("can't change `%s' to `%s'", to_type, to_id)
+ ": " + reason;
GUHG!
*/
String warn2= "Change_iterator::process (): "
- + report_to_l ()->type_str_ + " = `"
- + report_to_l ()->id_str_ + "': ";
+ + report_to ()->type_string_ + " = `"
+ + report_to ()->id_string_ + "': ";
warning (warn2);
- music_l ()->origin ()->warning (warn1);
+ get_music ()->origin ()->warning (warn1);
}
/*
void
Change_iterator::process (Moment m)
{
- Translator_group * current = report_to_l ();
+ Translator_group * current = report_to ();
Translator_group * last = 0;
- String to_type = ly_scm2string (music_l ()->get_mus_property ("change-to-type"));
- String to_id = ly_scm2string (music_l ()->get_mus_property ("change-to-id"));
+ String to_type = ly_scm2string (get_music ()->get_mus_property ("change-to-type"));
+ String to_id = ly_scm2string (get_music ()->get_mus_property ("change-to-id"));
/* find the type of translator that we're changing.
If \translator Staff = bass, then look for Staff = *
*/
- while (current && current->type_str_ != to_type)
+ while (current && current->type_string_ != to_type)
{
last = current;
- current = current->daddy_trans_l_;
+ current = current->daddy_trans_;
}
- if (current && current->id_str_ == to_id)
+ if (current && current->id_string_ == to_id)
{
String msg;
msg += _ ("Can't switch translators, I'm there already");
if (last)
{
Translator_group * dest =
- report_to_l ()->find_create_translator_l (to_type, to_id);
- current->remove_translator_p (last);
+ report_to ()->find_create_translator (to_type, to_id);
+ current->remove_translator (last);
dest->add_used_group_translator (last);
}
else
We could change the current translator's id, but that would make
errors hard to catch
- last->translator_id_str_ = change_l ()->change_to_id_str_;
+ last->translator_id_string_ = get_change ()->change_to_id_string_;
*/
error (_ ("I'm one myself"));
}
private:
void add_note (Note_req *);
- Item* chord_name_p_;
+ Item* chord_name_;
Protected_scm chord_;
Protected_scm last_chord_;
Chord_name_engraver::Chord_name_engraver ()
{
- chord_name_p_ = 0;
+ chord_name_ = 0;
chord_ = gh_cons (SCM_EOL, gh_cons (SCM_EOL, SCM_EOL));
last_chord_ = chord_;
}
{
if (ly_car (chord_) != SCM_EOL)
{
- chord_name_p_ = new Item (get_property ("ChordName"));
- chord_name_p_->set_grob_property ("chord", chord_);
- announce_grob(chord_name_p_, SCM_EOL);
+ chord_name_ = new Item (get_property ("ChordName"));
+ chord_name_->set_grob_property ("chord", chord_);
+ announce_grob(chord_name_, SCM_EOL);
SCM s = get_property ("chordChanges");
if (to_boolean (s) && ly_car (last_chord_) != SCM_EOL
&& gh_equal_p (chord_, last_chord_))
- chord_name_p_->set_grob_property ("begin-of-line-visible", SCM_BOOL_T);
+ chord_name_->set_grob_property ("begin-of-line-visible", SCM_BOOL_T);
}
}
void
Chord_name_engraver::stop_translation_timestep ()
{
- if (chord_name_p_)
+ if (chord_name_)
{
- typeset_grob (chord_name_p_);
+ typeset_grob (chord_name_);
}
- chord_name_p_ = 0;
+ chord_name_ = 0;
if (ly_car (chord_) != SCM_EOL)
last_chord_ = chord_;
SCM s = me->get_grob_property ("begin-of-line-visible");
if (to_boolean (s))
{
- if (Paper_column::rank_i (me->column_l ()) -
+ if (Paper_column::get_rank (me->get_column ()) -
me->get_system ()->spanned_rank_iv ()[LEFT] > 1)
me->suicide ();
}
/// moment (global time) where beam started.
Moment start_mom_;
Moment stop_mom_;
- int flags_i_ ;
+ int flags_ ;
/// location within measure where beam started.
Moment beam_start_location_;
bool sequential_body_b_;
- Spanner * beam_p_;
- Spanner * finished_beam_p_;
+ Spanner * beam_;
+ Spanner * finished_beam_;
Item * stem_tremolo_;
protected:
virtual void finalize ();
Chord_tremolo_engraver::Chord_tremolo_engraver ()
{
- beam_p_ = finished_beam_p_ = 0;
+ beam_ = finished_beam_ = 0;
repeat_ =0;
- flags_i_ = 0;
+ flags_ = 0;
stem_tremolo_ = 0;
sequential_body_b_ = false;
}
Rational total_dur = l.main_part_;
Rational note_dur = (total_dur / Rational (repeat_->repeat_count ()));
- flags_i_ = intlog2 ((total_dur / note_dur).num ());
+ flags_ = intlog2 ((total_dur / note_dur).num ());
return true;
}
{
if (repeat_)
{
- if (sequential_body_b_ && !beam_p_)
+ if (sequential_body_b_ && !beam_)
{
- beam_p_ = new Spanner (get_property ("Beam"));
- beam_p_->set_grob_property ("chord-tremolo", SCM_BOOL_T);
+ beam_ = new Spanner (get_property ("Beam"));
+ beam_->set_grob_property ("chord-tremolo", SCM_BOOL_T);
SCM smp = get_property ("measurePosition");
Moment mp
= (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
beam_start_location_ = mp;
- announce_grob(beam_p_, repeat_->self_scm());
+ announce_grob(beam_, repeat_->self_scm());
}
else if (!sequential_body_b_ && !stem_tremolo_)
{
- if (flags_i_)
+ if (flags_)
{
stem_tremolo_ = new Item (get_property ("StemTremolo"));
announce_grob(stem_tremolo_, repeat_->self_scm());
stem_tremolo_->set_grob_property ("flag-count",
- gh_int2scm (flags_i_));
+ gh_int2scm (flags_));
}
}
Chord_tremolo_engraver::finalize ()
{
typeset_beam ();
- if (beam_p_)
+ if (beam_)
{
repeat_->origin ()->warning (_ ("unterminated chord tremolo"));
- beam_p_->suicide ();
+ beam_->suicide ();
}
}
void
Chord_tremolo_engraver::typeset_beam ()
{
- if (finished_beam_p_)
+ if (finished_beam_)
{
- typeset_grob (finished_beam_p_);
- finished_beam_p_ = 0;
+ typeset_grob (finished_beam_);
+ finished_beam_ = 0;
}
}
void
Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
{
- if (beam_p_ && Stem::has_interface (info.grob_l_))
+ if (beam_ && Stem::has_interface (info.grob_))
{
- Grob * s = info.grob_l_;
- Stem::set_beaming (s, flags_i_, LEFT);
- Stem::set_beaming (s, flags_i_, RIGHT);
+ Grob * s = info.grob_;
+ Stem::set_beaming (s, flags_, LEFT);
+ Stem::set_beaming (s, flags_, RIGHT);
SCM d = s->get_grob_property ("direction");
if (Stem::duration_log (s) != 1)
{
- beam_p_->set_grob_property ("gap", gh_double2scm (0.8));
+ beam_->set_grob_property ("gap", gh_double2scm (0.8));
}
s->set_grob_property ("direction", d);
if (dynamic_cast <Rhythmic_req *> (info.music_cause ()))
{
- Beam::add_stem (beam_p_, s);
+ Beam::add_stem (beam_, s);
}
else
{
::warning (s);
}
}
- else if (stem_tremolo_ && Stem::has_interface (info.grob_l_))
+ else if (stem_tremolo_ && Stem::has_interface (info.grob_))
{
- Stem_tremolo::set_stem (stem_tremolo_, info.grob_l_);
- stem_tremolo_->set_parent (info.grob_l_,X_AXIS);
+ Stem_tremolo::set_stem (stem_tremolo_, info.grob_);
+ stem_tremolo_->set_parent (info.grob_,X_AXIS);
}
}
void
Chord_tremolo_engraver::start_translation_timestep ()
{
- if (beam_p_ && stop_mom_ == now_mom ())
+ if (beam_ && stop_mom_ == now_mom ())
{
- finished_beam_p_ = beam_p_;
+ finished_beam_ = beam_;
repeat_ = 0;
- beam_p_ = 0;
+ beam_ = 0;
}
}
void
Chord_tremolo_iterator::construct_children ()
{
- Repeated_music * rep = dynamic_cast<Repeated_music*> (music_l ());
+ Repeated_music * rep = dynamic_cast<Repeated_music*> (get_music ());
factor_ = Moment (Rational(1, 1));
- child_iter_p_ = get_iterator_p (rep->body ());
+ child_iter_ = get_iterator (rep->body ());
}
Chord_tremolo_iterator::Chord_tremolo_iterator ()
{
factor_ = 1;
- child_iter_p_ = 0;
+ child_iter_ = 0;
}
Chord_tremolo_iterator::Chord_tremolo_iterator (Chord_tremolo_iterator const &src)
: Music_iterator (src)
{
factor_ = src.factor_;
- child_iter_p_ = src.child_iter_p_ ? src.child_iter_p_->clone () : 0;
+ child_iter_ = src.child_iter_ ? src.child_iter_->clone () : 0;
}
void
{
if (!m.to_bool () )
{
- Music_iterator *yeah = try_music (music_l ());
+ Music_iterator *yeah = try_music (get_music ());
if (yeah)
- set_translator (yeah->report_to_l ());
+ set_translator (yeah->report_to ());
else
- music_l ()->origin ()->warning (_ ("no one to print a tremolos"));
+ get_music ()->origin ()->warning (_ ("no one to print a tremolos"));
}
- child_iter_p_->process (factor_ * m);
+ child_iter_->process (factor_ * m);
}
Moment
Chord_tremolo_iterator::pending_moment () const
{
- return child_iter_p_->pending_moment () / factor_;
+ return child_iter_->pending_moment () / factor_;
}
bool
Chord_tremolo_iterator::ok () const
{
- return child_iter_p_ && child_iter_p_->ok ();
+ return child_iter_ && child_iter_->ok ();
}
Chord_tremolo_iterator::~Chord_tremolo_iterator ()
{
- delete child_iter_p_;
+ delete child_iter_;
}
Music_iterator*
Chord_tremolo_iterator::try_music_in_children (Music *m) const
{
- return child_iter_p_->try_music (m);
+ return child_iter_->try_music (m);
}
Urg, eindelijk gevonden: () != #f, kan maar niet aan wennen.
Anders kon iets korter...
*/
- if (unsmob_pitch (p)->notename_i_
- == unsmob_pitch (ly_car (i))->notename_i_)
+ if (unsmob_pitch (p)->notename_
+ == unsmob_pitch (ly_car (i))->notename_)
{
member = ly_car (i);
break;
{
for (SCM i = pitches; gh_pair_p (i); i = ly_cdr (i))
{
- if (unsmob_pitch (p)->notename_i_
- == unsmob_pitch (ly_car (i))->notename_i_
- && unsmob_pitch (p)->alteration_i_
- == unsmob_pitch (ly_car (i))->alteration_i_)
+ if (unsmob_pitch (p)->notename_
+ == unsmob_pitch (ly_car (i))->notename_
+ && unsmob_pitch (p)->alteration_
+ == unsmob_pitch (ly_car (i))->alteration_)
{
member = ly_car (i);
break;
Chord::step_scm (SCM tonic, SCM p)
{
/* De Pitch intervaas is nog beetje sleutelgat? */
- int i = unsmob_pitch (p)->notename_i_
- - unsmob_pitch (tonic)->notename_i_
- + (unsmob_pitch (p)->octave_i_
- - unsmob_pitch (tonic)->octave_i_) * 7;
+ int i = unsmob_pitch (p)->notename_
+ - unsmob_pitch (tonic)->notename_
+ + (unsmob_pitch (p)->octave_
+ - unsmob_pitch (tonic)->octave_) * 7;
while (i < 0)
i += 7;
i++;
SCM p = ly_car (i);
int step = gh_scm2int (step_scm (tonic, p));
- if (unsmob_pitch (last)->notename_i_ == unsmob_pitch (p)->notename_i_)
+ if (unsmob_pitch (last)->notename_ == unsmob_pitch (p)->notename_)
{
- int third = (unsmob_pitch (last)->notename_i_
- - unsmob_pitch (tonic)-> notename_i_ + 7) % 7;
+ int third = (unsmob_pitch (last)->notename_
+ - unsmob_pitch (tonic)-> notename_ + 7) % 7;
last = ly_pitch_transpose (last, scm_vector_ref (thirds, gh_int2scm (third)));
}
while (step > gh_scm2int (step_scm (tonic, last)))
{
missing = gh_cons (last, missing);
- int third = (unsmob_pitch (last)->notename_i_
- - unsmob_pitch (tonic)->notename_i_ + 7) % 7;
+ int third = (unsmob_pitch (last)->notename_
+ - unsmob_pitch (tonic)->notename_ + 7) % 7;
last = ly_pitch_transpose (last, scm_vector_ref (thirds,
gh_int2scm (third)));
}
This chord modifier stuff should really be fixed
Cmaj7 yields C 7/7-
*/
- if (p->octave_i () == -100)
+ if (p->get_octave () == -100)
{
- p->octave_i_ = 0;
+ p->octave_ = 0;
dim_b = true;
}
}
for (SCM i = sub; gh_pair_p (i); i = ly_cdr (i))
warning (_f ("invalid subtraction: not part of chord: %s",
- unsmob_pitch (ly_car (i))->str ()));
+ unsmob_pitch (ly_car (i))->string ()));
return pitches;
}
}
else
warning (_f ("invalid inversion pitch: not part of chord: %s",
- unsmob_pitch (inversion)->str ()));
+ unsmob_pitch (inversion)->string ()));
}
/* Bass is easy, just add if requested */
virtual void process_music ();
virtual void acknowledge_grob (Grob_info);
private:
- Item * clef_p_;
- Item * octavate_p_;
+ Item * clef_;
+ Item * octavate_;
SCM prev_glyph_;
SCM prev_cpos_;
Clef_engraver::Clef_engraver ()
{
- clef_p_ = 0;
+ clef_ = 0;
octave_dir_ = CENTER;
- octavate_p_ = 0;
+ octavate_ = 0;
/*
will trigger a clef at the start since #f != ' ()
SCM basic = ly_symbol2scm ("Clef");
- daddy_trans_l_->execute_single_pushpop_property (basic, glyph_sym, SCM_UNDEFINED);
- daddy_trans_l_->execute_single_pushpop_property (basic, glyph_sym, glyph);
+ daddy_trans_->execute_single_pushpop_property (basic, glyph_sym, SCM_UNDEFINED);
+ daddy_trans_->execute_single_pushpop_property (basic, glyph_sym, glyph);
}
/**
void
Clef_engraver::acknowledge_grob (Grob_info info)
{
- Item * item =dynamic_cast <Item *> (info.grob_l_);
+ Item * item =dynamic_cast <Item *> (info.grob_);
if (item)
{
- if (Bar_line::has_interface (info.grob_l_)
+ if (Bar_line::has_interface (info.grob_)
&& gh_string_p (get_property ("clefGlyph")))
create_clef ();
void
Clef_engraver::create_clef ()
{
- if (!clef_p_)
+ if (!clef_)
{
Item *c= new Item (get_property ("Clef"));
announce_grob(c, SCM_EOL);
- clef_p_ = c;
+ clef_ = c;
}
SCM cpos = get_property ("clefPosition");
if (gh_number_p (cpos))
- Staff_symbol_referencer::set_position (clef_p_, gh_scm2int (cpos));
+ Staff_symbol_referencer::set_position (clef_, gh_scm2int (cpos));
SCM oct = get_property ("clefOctavation");
if (gh_number_p (oct) && gh_scm2int (oct))
{
Item * g = new Item (get_property ("OctavateEight"));
- Side_position_interface::add_support (g,clef_p_);
+ Side_position_interface::add_support (g,clef_);
- g->set_parent (clef_p_, Y_AXIS);
- g->set_parent (clef_p_, X_AXIS);
+ g->set_parent (clef_, Y_AXIS);
+ g->set_parent (clef_, X_AXIS);
g->set_grob_property ("direction", gh_int2scm (sign (gh_scm2int (oct))));
- octavate_p_ = g;
- announce_grob(octavate_p_, SCM_EOL);
+ octavate_ = g;
+ announce_grob(octavate_, SCM_EOL);
}
}
set_glyph ();
create_clef ();
- clef_p_->set_grob_property ("non-default", SCM_BOOL_T);
+ clef_->set_grob_property ("non-default", SCM_BOOL_T);
prev_cpos_ = clefpos;
prev_glyph_ = glyph;
if (to_boolean (force_clef))
{
- Translator_group * w = daddy_trans_l_->where_defined (ly_symbol2scm ("forceClef"));
+ Translator_group * w = daddy_trans_->where_defined (ly_symbol2scm ("forceClef"));
w->set_property ("forceClef", SCM_EOL);
}
}
void
Clef_engraver::stop_translation_timestep ()
{
- if (clef_p_)
+ if (clef_)
{
SCM vis = 0;
- if (to_boolean (clef_p_->get_grob_property ("non-default")))
+ if (to_boolean (clef_->get_grob_property ("non-default")))
{
vis = get_property ("explicitClefVisibility");
}
if (vis)
{
- clef_p_->set_grob_property ("break-visibility", vis);
- if (octavate_p_)
+ clef_->set_grob_property ("break-visibility", vis);
+ if (octavate_)
{
- octavate_p_->set_grob_property ("break-visibility", vis);
+ octavate_->set_grob_property ("break-visibility", vis);
}
}
- typeset_grob (clef_p_);
- clef_p_ =0;
+ typeset_grob (clef_);
+ clef_ =0;
- if (octavate_p_)
+ if (octavate_)
{
- Side_position_interface::add_staff_support (octavate_p_);
- typeset_grob (octavate_p_);
+ Side_position_interface::add_staff_support (octavate_);
+ typeset_grob (octavate_);
}
- octavate_p_ = 0;
+ octavate_ = 0;
}
}
&& !to_boolean (s->get_grob_property ("full-size-change")))
{
str += "_change";
- s->set_grob_property ("glyph-name", ly_str02scm (str.ch_C ()));
+ s->set_grob_property ("glyph-name", ly_str02scm (str.to_str0 ()));
}
}
else
collect Note_column, and as soon as there are 2 or more, put them in
a collision object. */
class Collision_engraver : public Engraver {
- Item * col_p_;
- Link_array<Grob> note_column_l_arr_;
+ Item * col_;
+ Link_array<Grob> note_columns_;
protected:
virtual void acknowledge_grob (Grob_info);
void
Collision_engraver::process_acknowledged_grobs ()
{
- if (col_p_ || note_column_l_arr_.size () < 2)
+ if (col_ || note_columns_.size () < 2)
return ;
- if (!col_p_)
+ if (!col_)
{
- col_p_ = new Item (get_property ("NoteCollision"));
- announce_grob (col_p_, SCM_EOL);
+ col_ = new Item (get_property ("NoteCollision"));
+ announce_grob (col_, SCM_EOL);
}
- for (int i=0; i< note_column_l_arr_.size (); i++)
- Note_collision_interface::add_column (col_p_,note_column_l_arr_[i]);
+ for (int i=0; i< note_columns_.size (); i++)
+ Note_collision_interface::add_column (col_,note_columns_[i]);
}
void
Collision_engraver::acknowledge_grob (Grob_info i)
{
- if (Note_column::has_interface (i.grob_l_))
+ if (Note_column::has_interface (i.grob_))
{
/*should check Y axis? */
- if (Note_column::rest_b (i.grob_l_) || i.grob_l_->get_parent (X_AXIS))
+ if (Note_column::rest_b (i.grob_) || i.grob_->get_parent (X_AXIS))
return ;
- note_column_l_arr_.push (i.grob_l_);
+ note_columns_.push (i.grob_);
}
}
void
Collision_engraver::stop_translation_timestep ()
{
- if (col_p_)
+ if (col_)
{
- typeset_grob (col_p_);
- col_p_ =0;
+ typeset_grob (col_);
+ col_ =0;
}
- note_column_l_arr_.clear ();
+ note_columns_.clear ();
}
Collision_engraver::Collision_engraver ()
{
- col_p_ =0;
+ col_ =0;
}
Column_x_positions::Column_x_positions ()
{
satisfies_constraints_b_ = false;
- force_f_ = 0;
+ force_ = 0;
}
orig.transpose (p);
- SCM key = gh_cons (gh_int2scm (orig.octave_i ()),
- gh_int2scm (orig.notename_i_));
+ SCM key = gh_cons (gh_int2scm (orig.get_octave ()),
+ gh_int2scm (orig.notename_));
- newlist = gh_cons (gh_cons (key, gh_int2scm (orig.alteration_i_)),
+ newlist = gh_cons (gh_cons (key, gh_int2scm (orig.alteration_)),
newlist);
}
else if (gh_number_p (key))
Pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
orig.transpose (p);
- key =gh_int2scm (orig.notename_i_);
- alter = gh_int2scm (orig.alteration_i_);
+ key =gh_int2scm (orig.notename_);
+ alter = gh_int2scm (orig.alteration_);
newlist = gh_cons (gh_cons (key, alter), newlist);
}
}
class Completion_heads_engraver : public Engraver
{
- Link_array<Item> note_p_arr_;
+ Link_array<Item> notes_;
- Link_array<Item> dot_p_arr_;
- Link_array<Music> note_req_l_arr_;
+ Link_array<Item> dots_;
+ Link_array<Music> note_reqs_;
Link_array<Music> scratch_note_reqs_;
Moment note_end_mom_;
protected:
virtual void initialize ();
virtual void start_translation_timestep ();
- virtual bool try_music (Music *req_l) ;
+ virtual bool try_music (Music *req) ;
virtual void process_music ();
virtual void stop_translation_timestep ();
};
{
if (Note_req * n =dynamic_cast <Note_req *> (m))
{
- note_req_l_arr_.push (n);
+ note_reqs_.push (n);
first_b_ = true;
Moment musiclen = m->length_mom ();
}
else if (dynamic_cast<Busy_playing_req*> (m))
{
- return note_req_l_arr_.size ();
+ return note_reqs_.size ();
}
return false;
}
else
{
- orig = unsmob_duration (note_req_l_arr_[0]->get_mus_property ("duration"));
+ orig = unsmob_duration (note_reqs_[0]->get_mus_property ("duration"));
note_dur = *orig;
}
if (orig && note_dur.length_mom() != orig->length_mom())
{
if (!scratch_note_reqs_.size ())
- for (int i = 0; i < note_req_l_arr_.size (); i++)
+ for (int i = 0; i < note_reqs_.size (); i++)
{
- Music * m = note_req_l_arr_[i]->clone ();
+ Music * m = note_reqs_[i]->clone ();
scratch_note_reqs_.push (m);
}
}
for (int i = 0;
- left_to_do_ && i < note_req_l_arr_.size (); i++)
+ left_to_do_ && i < note_reqs_.size (); i++)
{
- Item *note_p = new Item (get_property ("NoteHead"));
+ Item *note = new Item (get_property ("NoteHead"));
- Music * req = note_req_l_arr_[i];
+ Music * req = note_reqs_[i];
if (scratch_note_reqs_.size())
{
req = scratch_note_reqs_[i];
- SCM pits = note_req_l_arr_[i]->get_mus_property ("pitch");
+ SCM pits = note_reqs_[i]->get_mus_property ("pitch");
req->set_mus_property ("pitch",pits);
}
req->set_mus_property ("duration", note_dur.smobbed_copy ());
- note_p->set_grob_property ("duration-log",
+ note->set_grob_property ("duration-log",
gh_int2scm (note_dur.duration_log ()));
int dots= note_dur.dot_count ();
if (dots)
{
Item * d = new Item (get_property ("Dots"));
- Rhythmic_head::set_dots (note_p, d);
+ Rhythmic_head::set_dots (note, d);
/*
measly attempt to save an eeny-weenie bit of memory.
if (dots != gh_scm2int (d->get_grob_property ("dot-count")))
d->set_grob_property ("dot-count", gh_int2scm (dots));
- d->set_parent (note_p, Y_AXIS);
+ d->set_parent (note, Y_AXIS);
announce_grob (d, SCM_EOL);
- dot_p_arr_.push (d);
+ dots_.push (d);
}
Pitch *pit =unsmob_pitch (req->get_mus_property ("pitch"));
if (gh_number_p (c0))
pos += gh_scm2int (c0);
- note_p->set_grob_property ("staff-position", gh_int2scm (pos));
- announce_grob (note_p,req->self_scm ());
- note_p_arr_.push (note_p);
+ note->set_grob_property ("staff-position", gh_int2scm (pos));
+ announce_grob (note,req->self_scm ());
+ notes_.push (note);
}
left_to_do_ -= note_dur.length_mom ();
void
Completion_heads_engraver::stop_translation_timestep ()
{
- for (int i=0; i < note_p_arr_.size (); i++)
+ for (int i=0; i < notes_.size (); i++)
{
- typeset_grob (note_p_arr_[i]);
+ typeset_grob (notes_[i]);
}
- note_p_arr_.clear ();
+ notes_.clear ();
- for (int i=0; i < dot_p_arr_.size (); i++)
+ for (int i=0; i < dots_.size (); i++)
{
- typeset_grob (dot_p_arr_[i]);
+ typeset_grob (dots_[i]);
}
- dot_p_arr_.clear ();
+ dots_.clear ();
for (int i = scratch_note_reqs_.size(); i--;)
{
Moment now = now_mom ();
if (note_end_mom_.main_part_ <= now.main_part_)
{
- note_req_l_arr_.clear ();
+ note_reqs_.clear ();
}
if (left_to_do_)
if (!tie_req)
tie_req = new Tie_req;
- bool succ = daddy_trans_l_->try_music (tie_req);
+ bool succ = daddy_trans_->try_music (tie_req);
if (!succ)
{
programming_error ("Completion_heads_engraver: no-one to make tie.");
private:
Item * create_custos ();
bool custos_permitted;
- Link_array<Grob> custos_arr_;
+ Link_array<Grob> custodes_;
Array<Pitch> pitches_;
};
void
Custos_engraver::start_translation_timestep ()
{
- for (int i = custos_arr_.size (); i--;)
+ for (int i = custodes_.size (); i--;)
{
- typeset_grob (custos_arr_[i]);
+ typeset_grob (custodes_[i]);
}
- custos_arr_.clear ();
+ custodes_.clear ();
pitches_.clear ();
custos_permitted = false;
void
Custos_engraver::acknowledge_grob (Grob_info info)
{
- Item *item = dynamic_cast <Item *> (info.grob_l_);
+ Item *item = dynamic_cast <Item *> (info.grob_);
if (item)
{
- if (Bar_line::has_interface (info.grob_l_))
+ if (Bar_line::has_interface (info.grob_))
custos_permitted = true;
- else if (Note_head::has_interface (info.grob_l_))
+ else if (Note_head::has_interface (info.grob_))
{
/*
Item* custos = new Item (basicProperties);
announce_grob(custos, SCM_EOL);
- custos_arr_.push (custos);
+ custodes_.push (custos);
return custos;
}
void
Custos_engraver::finalize ()
{
- for (int i = custos_arr_.size (); i--;)
+ for (int i = custodes_.size (); i--;)
{
- custos_arr_[i]->suicide ();
- typeset_grob (custos_arr_[i]);
+ custodes_[i]->suicide ();
+ typeset_grob (custodes_[i]);
}
- custos_arr_.clear ();
+ custodes_.clear ();
}
Direction neutral_direction =
to_dir (me->get_grob_property ("neutral-direction"));
- int pos = (int)rint (Staff_symbol_referencer::position_f (me));
+ int pos = (int)rint (Staff_symbol_referencer::get_position (me));
int sz = Staff_symbol_referencer::line_count (me)-1;
if (pos < neutral_pos)
if (molecule.empty_b ())
{
String message = "no such custos: `" + idx + "'";
- warning (_ (message.ch_C ()));
+ warning (_ (message.to_str0 ()));
return SCM_EOL;
}
else
{
// add ledger lines
- int pos = (int)rint (Staff_symbol_referencer::position_f (me));
+ int pos = (int)rint (Staff_symbol_referencer::get_position (me));
int interspaces = Staff_symbol_referencer::line_count (me)-1;
if (abs (pos) - interspaces > 1)
{
return 0;
}
-LY_DEFINE(cxx_function_type_p, "c++-function?", 1, 0, 0, (SCM x),
+LY_DEFINE(cxx_function_type, "c++-function?", 1, 0, 0, (SCM x),
"Is this an encapsulated C++ function ?")
{
return (SCM_CELL_TYPE (x)) == callback_tag ? SCM_BOOL_T : SCM_BOOL_F;
offset_ = d.offset_;
offset_callbacks_ = d.offset_callbacks_;
offsets_left_ = d.offsets_left_;
- parent_l_ = d.parent_l_;
+ parent_ = d.parent_;
}
Dimension_cache::Dimension_cache ()
offset_callbacks_ = SCM_EOL;
offset_ =0.0;
- parent_l_ =0;
+ parent_ =0;
}
String
print_dimen (Real r)
{
- String s = to_str (r, "%.3f");
- if (s.index_i ("NaN") != -1)
+ String s = to_string (r, "%.3f");
+ if (s.index ("NaN") != -1)
{
warning (_ ("NaN"));
s = "0.0";
{
Grob *dotcol_ ;
Grob * stem_;
- Link_array<Item> head_l_arr_;
+ Link_array<Item> heads_;
public:
TRANSLATOR_DECLARATIONS(
Dot_column_engraver );
typeset_grob (dotcol_);
dotcol_ =0;
}
- head_l_arr_.clear ();
+ heads_.clear ();
stem_ =0;
}
void
Dot_column_engraver::acknowledge_grob (Grob_info info)
{
- Grob *d = unsmob_grob (info.grob_l_->get_grob_property ("dot"));
+ Grob *d = unsmob_grob (info.grob_->get_grob_property ("dot"));
if (d)
{
if (!dotcol_)
announce_grob(dotcol_, SCM_EOL);
}
- Dot_column::add_head (dotcol_, info.grob_l_);
+ Dot_column::add_head (dotcol_, info.grob_);
}
- else if (Stem::has_interface (info.grob_l_))
+ else if (Stem::has_interface (info.grob_))
{
- stem_ = info.grob_l_;
+ stem_ = info.grob_;
}
}
Grob * stem = unsmob_grob (me->get_grob_property ("stem"));
if (stem
- && !Stem::beam_l (stem)
+ && !Stem::get_beam (stem)
&& Stem::duration_log (stem) > 2
&& !Stem::invisible_b (stem)
)
int conflicts = 0;
for (int i=0; i < dots.size (); i++)
{
- Real p = Staff_symbol_referencer::position_f (dots[i]);
+ Real p = Staff_symbol_referencer::get_position (dots[i]);
for (int j=0; j < taken_posns.size (); j++)
{
if (taken_posns[j] == (int) p)
Duration::Duration ()
{
- durlog_i_ = 0;
- dots_i_ = 0;
+ durlog_ = 0;
+ dots_ = 0;
factor_ = Rational (1,1);
}
Duration::Duration (int l, int d)
{
- durlog_i_ = l;
- dots_i_ = d;
+ durlog_ = l;
+ dots_ = d;
factor_ = Rational (1,1);
}
Rational
Duration::length_mom () const
{
- Rational mom (1 << abs (durlog_i_));
+ Rational mom (1 << abs (durlog_));
- if (durlog_i_> 0)
+ if (durlog_> 0)
mom = Rational (1)/mom;
Rational delta = mom;
- for (int d = dots_i_; d; d--)
+ for (int d = dots_; d; d--)
{
delta /= Rational (2);
mom += delta;
String
-Duration::str () const
+Duration::string () const
{
String s;
- if (durlog_i_ < 0 )
- s = "log = " + to_str (durlog_i_);
+ if (durlog_ < 0 )
+ s = "log = " + to_string (durlog_);
else
- s = to_str (1 << durlog_i_);
+ s = to_string (1 << durlog_);
- s += to_str ('.', dots_i_);
+ s += to_string ('.', dots_);
if (factor_ != Moment (Rational (1,1)))
{
- s += "*" + factor_.str ();
+ s += "*" + factor_.string ();
}
return s;
}
Duration *r = (Duration *) ly_cdr (s);
scm_puts ("#<Duration ", port);
- scm_display (ly_str02scm (r->str ().ch_C ()), port);
+ scm_display (ly_str02scm (r->string ().to_str0 ()), port);
scm_puts (" >", port);
return 1;
Duration *p = (Duration *) ly_cdr (a);
Duration *q = (Duration *) ly_cdr (b);
- bool eq = p->dots_i_ == q->dots_i_
- && p->durlog_i_ == q->durlog_i_
+ bool eq = p->dots_ == q->dots_
+ && p->durlog_ == q->durlog_
&& p->factor_ == q->factor_;
return eq ? SCM_BOOL_T : SCM_BOOL_F;
")
{
- SCM_ASSERT_TYPE(gh_number_p(length), length, SCM_ARG1, __FUNCTION__, "integer");
- SCM_ASSERT_TYPE(gh_number_p(dotcount), dotcount, SCM_ARG2, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE(gh_number_p (length), length, SCM_ARG1, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE(gh_number_p (dotcount), dotcount, SCM_ARG2, __FUNCTION__, "integer");
bool compress = false;
if (num != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE(gh_number_p(num), length, SCM_ARG3, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE(gh_number_p (num), length, SCM_ARG3, __FUNCTION__, "integer");
compress = true;
}
else
num = gh_int2scm (1);
if (den != SCM_UNDEFINED)
- SCM_ASSERT_TYPE(gh_number_p(den), length, SCM_ARG4, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE(gh_number_p (den), length, SCM_ARG4, __FUNCTION__, "integer");
else
den = gh_int2scm (1);
int
Duration::duration_log () const
{
- return durlog_i_;
+ return durlog_;
}
int
Duration::dot_count () const
{
- return dots_i_;
+ return dots_;
}
*/
class Dynamic_engraver : public Engraver
{
- Item * script_p_;
- Spanner * finished_cresc_p_;
- Spanner * cresc_p_;
+ Item * script_;
+ Spanner * finished_cresc_;
+ Spanner * cresc_;
- Text_script_req* script_req_l_;
+ Text_script_req* script_req_;
Span_req * current_cresc_req_;
Drul_array<Span_req*> accepted_spanreqs_drul_;
Spanner* line_spanner_;
Spanner* finished_line_spanner_;
- Link_array<Note_column> pending_column_arr_;
- Link_array<Grob> pending_element_arr_;
+ Link_array<Note_column> pending_columns_;
+ Link_array<Grob> pending_elements_;
void typeset_all ();
protected:
virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
- virtual bool try_music (Music *req_l);
+ virtual bool try_music (Music *req);
virtual void stop_translation_timestep ();
virtual void process_music ();
virtual void start_translation_timestep ();
Dynamic_engraver::Dynamic_engraver ()
{
- script_p_ = 0;
- finished_cresc_p_ = 0;
+ script_ = 0;
+ finished_cresc_ = 0;
line_spanner_ = 0;
finished_line_spanner_ = 0;
current_cresc_req_ = 0;
- cresc_p_ =0;
+ cresc_ =0;
- script_req_l_ = 0;
+ script_req_ = 0;
accepted_spanreqs_drul_[START] = 0;
accepted_spanreqs_drul_[STOP] = 0;
}
void
Dynamic_engraver::start_translation_timestep ()
{
- script_req_l_ = 0;
+ script_req_ = 0;
accepted_spanreqs_drul_[START] = 0;
accepted_spanreqs_drul_[STOP] = 0;
}
if (dynamic_cast <Text_script_req*> (m)
&& m->get_mus_property ("text-type") == ly_symbol2scm ("dynamic"))
{
- script_req_l_ = dynamic_cast<Text_script_req*> (m);
+ script_req_ = dynamic_cast<Text_script_req*> (m);
return true;
}
else if (Span_req* s = dynamic_cast <Span_req*> (m))
It will disappear by itself when stop_translation_timestep
() finds that there is nothing to support anymore. */
- if (cresc_p_)
- cresc_p_->suicide ();
- cresc_p_ = 0;
+ if (cresc_)
+ cresc_->suicide ();
+ cresc_ = 0;
}
else if (t == "crescendo"
|| t == "decrescendo")
void
Dynamic_engraver::process_music ()
{
- if (accepted_spanreqs_drul_[START] || accepted_spanreqs_drul_[STOP] || script_req_l_)
+ if (accepted_spanreqs_drul_[START] || accepted_spanreqs_drul_[STOP] || script_req_)
{
if (!line_spanner_)
{
line_spanner_ = new Spanner (get_property ("DynamicLineSpanner"));
Music * rq = accepted_spanreqs_drul_[START];
- if (script_req_l_)
- rq = script_req_l_ ;
+ if (script_req_)
+ rq = script_req_ ;
announce_grob(line_spanner_, rq ? rq->self_scm(): SCM_EOL);
}
}
maybe we should leave dynamic texts to the text-engraver and
simply acknowledge them?
*/
- if (script_req_l_)
+ if (script_req_)
{
- script_p_ = new Item (get_property ("DynamicText"));
- script_p_->set_grob_property ("text",
- script_req_l_->get_mus_property ("text"));
+ script_ = new Item (get_property ("DynamicText"));
+ script_->set_grob_property ("text",
+ script_req_->get_mus_property ("text"));
- if (Direction d = script_req_l_->get_direction ())
+ if (Direction d = script_req_->get_direction ())
Directional_element_interface::set (line_spanner_, d);
- Axis_group_interface::add_element (line_spanner_, script_p_);
+ Axis_group_interface::add_element (line_spanner_, script_);
- announce_grob(script_p_, script_req_l_->self_scm());
+ announce_grob(script_, script_req_->self_scm());
}
if (accepted_spanreqs_drul_[STOP])
there are no new dynamics.
*/
- if (!cresc_p_)
+ if (!cresc_)
{
accepted_spanreqs_drul_[STOP]->origin ()->warning
(_ ("can't find start of (de)crescendo"));
}
else
{
- assert (!finished_cresc_p_ && cresc_p_);
+ assert (!finished_cresc_ && cresc_);
- cresc_p_->set_bound (RIGHT, script_p_
- ? script_p_
+ cresc_->set_bound (RIGHT, script_
+ ? script_
: unsmob_grob (get_property ("currentMusicalColumn")));
- add_bound_item (line_spanner_, cresc_p_->get_bound (RIGHT));
+ add_bound_item (line_spanner_, cresc_->get_bound (RIGHT));
- finished_cresc_p_ = cresc_p_;
- cresc_p_ = 0;
+ finished_cresc_ = cresc_;
+ cresc_ = 0;
current_cresc_req_ = 0;
}
}
/*
ugh. Use push/pop?
*/
- SCM s = get_property ((start_type + "Spanner").ch_C ());
+ SCM s = get_property ((start_type + "Spanner").to_str0 ());
if (!gh_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
{
- cresc_p_ = new Spanner (get_property ("Hairpin"));
- cresc_p_->set_grob_property ("grow-direction",
+ cresc_ = new Spanner (get_property ("Hairpin"));
+ cresc_->set_grob_property ("grow-direction",
gh_int2scm ((start_type == "crescendo")
? BIGGER : SMALLER));
*/
else
{
- cresc_p_ = new Spanner (get_property ("TextSpanner"));
- cresc_p_->set_grob_property ("type", s);
- daddy_trans_l_->set_property ((start_type
- + "Spanner").ch_C(), SCM_UNDEFINED);
- s = get_property ((start_type + "Text").ch_C ());
+ cresc_ = new Spanner (get_property ("TextSpanner"));
+ cresc_->set_grob_property ("type", s);
+ daddy_trans_->set_property ((start_type
+ + "Spanner").to_str0 (), SCM_UNDEFINED);
+ s = get_property ((start_type + "Text").to_str0 ());
/*
- FIXME: use markup_p () to check type.
+ FIXME: use get_markup () to check type.
*/
if (gh_string_p (s) || gh_pair_p (s))
{
- cresc_p_->set_grob_property ("edge-text",
+ cresc_->set_grob_property ("edge-text",
gh_cons (s, ly_str02scm ("")));
- daddy_trans_l_->set_property ((start_type + "Text").ch_C(),
+ daddy_trans_->set_property ((start_type + "Text").to_str0 (),
SCM_EOL);
}
}
- cresc_p_->set_bound (LEFT, script_p_
- ? script_p_
+ cresc_->set_bound (LEFT, script_
+ ? script_
: unsmob_grob (get_property ("currentMusicalColumn")));
- Axis_group_interface::add_element (line_spanner_, cresc_p_);
+ Axis_group_interface::add_element (line_spanner_, cresc_);
- add_bound_item (line_spanner_, cresc_p_->get_bound (LEFT));
+ add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
- announce_grob(cresc_p_, accepted_spanreqs_drul_[START]->self_scm());
+ announce_grob(cresc_, accepted_spanreqs_drul_[START]->self_scm());
}
}
}
typeset_all ();
}
- if (cresc_p_
- && !cresc_p_->live())
- cresc_p_ = 0;
- if (cresc_p_)
+ if (cresc_
+ && !cresc_->live())
+ cresc_ = 0;
+ if (cresc_)
{
current_cresc_req_->origin ()->warning (_ ("unterminated (de)crescendo"));
- cresc_p_->suicide ();
- cresc_p_ = 0;
+ cresc_->suicide ();
+ cresc_ = 0;
}
}
Hmm, how to do this, cleanly?
Maybe just check at typeset_grob ()?
*/
- if (finished_cresc_p_
- && !finished_cresc_p_->live())
- finished_cresc_p_ = 0;
+ if (finished_cresc_
+ && !finished_cresc_->live())
+ finished_cresc_ = 0;
if (finished_line_spanner_
&& !finished_line_spanner_->live())
finished_line_spanner_ = 0;
- if (finished_cresc_p_)
+ if (finished_cresc_)
{
- if (!finished_cresc_p_->get_bound (RIGHT))
+ if (!finished_cresc_->get_bound (RIGHT))
{
- finished_cresc_p_->set_bound (RIGHT, script_p_
- ? script_p_
+ finished_cresc_->set_bound (RIGHT, script_
+ ? script_
: unsmob_grob (get_property ("currentMusicalColumn")));
if (finished_line_spanner_)
add_bound_item (finished_line_spanner_,
- finished_cresc_p_->get_bound (RIGHT));
+ finished_cresc_->get_bound (RIGHT));
}
- typeset_grob (finished_cresc_p_);
- finished_cresc_p_ =0;
+ typeset_grob (finished_cresc_);
+ finished_cresc_ =0;
}
- if (script_p_)
+ if (script_)
{
- typeset_grob (script_p_);
- script_p_ = 0;
+ typeset_grob (script_);
+ script_ = 0;
}
if (finished_line_spanner_)
{
if (!line_spanner_)
return ;
- if (Note_column::has_interface (i.grob_l_))
+ if (Note_column::has_interface (i.grob_))
{
if (line_spanner_
/* Don't refill killed spanner */
&& line_spanner_->live())
{
- Side_position_interface::add_support (line_spanner_,i.grob_l_);
- add_bound_item (line_spanner_,dynamic_cast<Item*> (i.grob_l_));
+ Side_position_interface::add_support (line_spanner_,i.grob_);
+ add_bound_item (line_spanner_,dynamic_cast<Item*> (i.grob_));
}
- if (script_p_ && !script_p_->get_parent (X_AXIS))
+ if (script_ && !script_->get_parent (X_AXIS))
{
- script_p_->set_parent (i.grob_l_, X_AXIS);
+ script_->set_parent (i.grob_, X_AXIS);
}
}
- else if (Script_interface::has_interface (i.grob_l_) && script_p_)
+ else if (Script_interface::has_interface (i.grob_) && script_)
{
- SCM p = i.grob_l_->get_grob_property ("script-priority");
+ SCM p = i.grob_->get_grob_property ("script-priority");
if (gh_number_p (p)
- && gh_scm2int (p) < gh_scm2int (script_p_->get_grob_property ("script-priority")))
+ && gh_scm2int (p) < gh_scm2int (script_->get_grob_property ("script-priority")))
{
- Side_position_interface::add_support (line_spanner_, i.grob_l_);
+ Side_position_interface::add_support (line_spanner_, i.grob_);
}
}
public:
TRANSLATOR_DECLARATIONS(Dynamic_performer);
protected:
- virtual bool try_music (Music* req_l);
+ virtual bool try_music (Music* req);
virtual void stop_translation_timestep ();
virtual void create_audio_elements ();
private:
- Music* script_req_l_;
- Audio_dynamic* audio_p_;
+ Music* script_req_;
+ Audio_dynamic* audio_;
};
Dynamic_performer::Dynamic_performer ()
{
- script_req_l_ = 0;
- audio_p_ = 0;
+ script_req_ = 0;
+ audio_ = 0;
}
void
Dynamic_performer::create_audio_elements ()
{
- if (script_req_l_)
+ if (script_req_)
{
SCM proc = get_property ("dynamicAbsoluteVolumeFunction");
if (gh_procedure_p (proc))
{
// urg
- svolume = gh_call1 (proc, script_req_l_->get_mus_property ("text"));
+ svolume = gh_call1 (proc, script_req_->get_mus_property ("text"));
}
Real volume = 0.5;
}
}
- audio_p_ = new Audio_dynamic (volume);
- Audio_element_info info (audio_p_, script_req_l_);
+ audio_ = new Audio_dynamic (volume);
+ Audio_element_info info (audio_, script_req_);
announce_element (info);
- script_req_l_ = 0;
+ script_req_ = 0;
}
}
void
Dynamic_performer::stop_translation_timestep ()
{
- if (audio_p_)
+ if (audio_)
{
- play_element (audio_p_);
- audio_p_ = 0;
+ play_element (audio_);
+ audio_ = 0;
}
}
bool
Dynamic_performer::try_music (Music* r)
{
- if (!script_req_l_)
+ if (!script_req_)
{
if (dynamic_cast <Text_script_req*> (r)
&& r->get_mus_property ("text-type") == ly_symbol2scm ("dynamic"))
{
- script_req_l_ = r;
+ script_req_ = r;
return true;
}
}
void
Engraver_group_engraver::announce_grob (Grob_info info)
{
- announce_info_arr_.push (info);
+ announce_infos_.push (info);
Engraver::announce_grob (info);
}
void
Engraver_group_engraver::acknowledge_grobs ()
{
- if (!announce_info_arr_.size ())
+ if (!announce_infos_.size ())
return ;
SCM tab = get_property ("acknowledgeHashTable");
SCM meta_sym = ly_symbol2scm ("meta");
- for (int j =0; j < announce_info_arr_.size (); j++)
+ for (int j =0; j < announce_infos_.size (); j++)
{
- Grob_info info = announce_info_arr_[j];
+ Grob_info info = announce_infos_[j];
- SCM meta = info.grob_l_->internal_get_grob_property (meta_sym);
+ SCM meta = info.grob_->internal_get_grob_property (meta_sym);
SCM nm = scm_assoc (name_sym, meta);
if (gh_pair_p (nm))
nm = ly_cdr (nm);
{
Translator * t = unsmob_translator (ly_car (p));
Engraver * eng = dynamic_cast<Engraver*> (t);
- if (eng && eng!= info.origin_trans_l_)
+ if (eng && eng!= info.origin_trans_)
eng->acknowledge_grob (info);
}
}
do
{
acknowledge_grobs ();
- announce_info_arr_.clear ();
+ announce_infos_.clear ();
process_acknowledged_grobs_in_simple_children ();
}
- while (announce_info_arr_.size ());
+ while (announce_infos_.size ());
}
void
Engraver::announce_grob (Grob_info inf)
{
- daddy_grav_l ()->announce_grob (inf);
+ get_daddy_grav ()->announce_grob (inf);
}
void
e->set_grob_property ("cause", cause);
Grob_info i (e);
- if (!i.origin_trans_l_)
- i.origin_trans_l_ = this;
- daddy_grav_l ()->announce_grob (i);
+ if (!i.origin_trans_)
+ i.origin_trans_ = this;
+ get_daddy_grav ()->announce_grob (i);
}
void
Engraver::typeset_grob (Grob*p)
{
- daddy_grav_l ()->typeset_grob (p);
+ get_daddy_grav ()->typeset_grob (p);
}
Engraver_group_engraver*
-Engraver::daddy_grav_l () const
+Engraver::get_daddy_grav () const
{
- return (daddy_trans_l_)
- ? dynamic_cast<Engraver_group_engraver *> (daddy_trans_l_)
+ return (daddy_trans_)
+ ? dynamic_cast<Engraver_group_engraver *> (daddy_trans_)
: 0;
}
if (dynamic_cast<Score_engraver*>((Engraver*)this))
return dynamic_cast<Score_engraver*> ((Engraver*)this);
- if (daddy_trans_l_)
- return dynamic_cast<Engraver*> (daddy_trans_l_)->top_engraver ();
+ if (daddy_trans_)
+ return dynamic_cast<Engraver*> (daddy_trans_)->top_engraver ();
programming_error ("No score engraver!");
return 0;
then. */
class Extender_engraver : public Engraver
{
- Grob *last_lyric_l_;
- Grob *current_lyric_l_;
- Extender_req* req_l_;
- Spanner* extender_p_;
+ Grob *last_lyric_;
+ Grob *current_lyric_;
+ Extender_req* req_;
+ Spanner* extender_;
public:
TRANSLATOR_DECLARATIONS(Extender_engraver);
Extender_engraver::Extender_engraver ()
{
- current_lyric_l_ = 0;
- last_lyric_l_ = 0;
- extender_p_ = 0;
- req_l_ = 0;
+ current_lyric_ = 0;
+ last_lyric_ = 0;
+ extender_ = 0;
+ req_ = 0;
}
void
Extender_engraver::acknowledge_grob (Grob_info i)
{
// -> text_item
- if (i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+ if (i.grob_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
{
- current_lyric_l_ = i.grob_l_;
- if (extender_p_
- && !extender_p_->get_bound (RIGHT)
+ current_lyric_ = i.grob_;
+ if (extender_
+ && !extender_->get_bound (RIGHT)
)
{
- Lyric_extender::set_textitem (extender_p_, RIGHT, dynamic_cast<Item*> (i.grob_l_));
+ Lyric_extender::set_textitem (extender_, RIGHT, dynamic_cast<Item*> (i.grob_));
}
}
}
{
if (Extender_req* p = dynamic_cast <Extender_req *> (r))
{
- if (req_l_)
+ if (req_)
return false;
- req_l_ = p;
+ req_ = p;
return true;
}
return false;
void
Extender_engraver::finalize ()
{
- if (extender_p_)
+ if (extender_)
{
- req_l_->origin ()->warning (_ ("unterminated extender"));
- extender_p_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
+ req_->origin ()->warning (_ ("unterminated extender"));
+ extender_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
}
}
void
Extender_engraver::process_music ()
{
- if (req_l_ && ! extender_p_)
+ if (req_ && ! extender_)
{
- if (!last_lyric_l_)
+ if (!last_lyric_)
{
- req_l_->origin ()->warning (_ ("Nothing to connect extender to on the left. Ignoring extender request."));
+ req_->origin ()->warning (_ ("Nothing to connect extender to on the left. Ignoring extender request."));
return;
}
- extender_p_ = new Spanner (get_property ("LyricExtender"));
+ extender_ = new Spanner (get_property ("LyricExtender"));
- Lyric_extender::set_textitem (extender_p_, LEFT, last_lyric_l_);
- announce_grob(extender_p_, req_l_->self_scm());
+ Lyric_extender::set_textitem (extender_, LEFT, last_lyric_);
+ announce_grob(extender_, req_->self_scm());
}
}
void
Extender_engraver::stop_translation_timestep ()
{
- if (extender_p_)
+ if (extender_)
{
- typeset_grob (extender_p_);
- extender_p_ = 0;
+ typeset_grob (extender_);
+ extender_ = 0;
}
- if (current_lyric_l_)
+ if (current_lyric_)
{
- last_lyric_l_ = current_lyric_l_;
- current_lyric_l_ =0;
+ last_lyric_ = current_lyric_;
+ current_lyric_ =0;
}
}
void
Extender_engraver::start_translation_timestep ()
{
- req_l_ = 0;
+ req_ = 0;
}
Fingering_engraver::acknowledge_grob (Grob_info inf)
{
- if (Stem::has_interface (inf.grob_l_))
+ if (Stem::has_interface (inf.grob_))
{
for (int i=0; i < fingerings_.size (); i++)
{
- Side_position_interface::add_support (fingerings_[i],inf.grob_l_);
+ Side_position_interface::add_support (fingerings_[i],inf.grob_);
}
}
- else if (Rhythmic_head::has_interface (inf.grob_l_))
+ else if (Rhythmic_head::has_interface (inf.grob_))
{
Music * mc =inf.music_cause ();
Pitch * mp = mc? unsmob_pitch (mc->get_mus_property ("pitch")) :0;
for (int i=0; i < fingerings_.size (); i++)
{
Grob*t = fingerings_[i];
- Side_position_interface::add_support (t,inf.grob_l_);
+ Side_position_interface::add_support (t,inf.grob_);
Pitch *fp = unsmob_pitch (t->get_grob_property ("pitch"));
if (fp)
{
if (*fp == *mp)
{
Axis other = other_axis (Side_position_interface::get_axis (t));
- t->set_parent (inf.grob_l_, other);
+ t->set_parent (inf.grob_, other);
}
}
else
{
if (!t->get_parent (X_AXIS))
- t->set_parent (inf.grob_l_, X_AXIS);
+ t->set_parent (inf.grob_, X_AXIS);
}
}
}
Folded_repeat_iterator::Folded_repeat_iterator ()
{
- main_iter_p_ = 0;
- alternative_iter_p_ = 0;
+ main_iter_ = 0;
+ alternative_iter_ = 0;
}
bool
Folded_repeat_iterator::ok () const
{
- return main_iter_p_ || alternative_iter_p_;
+ return main_iter_ || alternative_iter_;
}
Folded_repeat_iterator::~Folded_repeat_iterator ()
{
- delete main_iter_p_;
- delete alternative_iter_p_;
+ delete main_iter_;
+ delete alternative_iter_;
}
Folded_repeat_iterator::Folded_repeat_iterator (Folded_repeat_iterator const &src)
: Music_iterator (src)
{
- main_iter_p_ = src.main_iter_p_ ? src.main_iter_p_->clone () : 0;
- alternative_iter_p_ = src.alternative_iter_p_ ? src.alternative_iter_p_->clone () : 0;
+ main_iter_ = src.main_iter_ ? src.main_iter_->clone () : 0;
+ alternative_iter_ = src.alternative_iter_ ? src.alternative_iter_->clone () : 0;
main_length_mom_ = src.main_length_mom_;
}
Moment
Folded_repeat_iterator::pending_moment () const
{
- if (main_iter_p_)
+ if (main_iter_)
{
- return main_iter_p_->pending_moment ();
+ return main_iter_->pending_moment ();
}
else
- return main_length_mom_ + alternative_iter_p_->pending_moment ();
+ return main_length_mom_ + alternative_iter_->pending_moment ();
}
void
Folded_repeat_iterator::construct_children ()
{
- Repeated_music * mus = dynamic_cast<Repeated_music*> (music_l ());
- main_iter_p_ = get_iterator_p (mus->body ());
- if (!main_iter_p_->ok ())
+ Repeated_music * mus = dynamic_cast<Repeated_music*> (get_music ());
+ main_iter_ = get_iterator (mus->body ());
+ if (!main_iter_->ok ())
{
leave_body ();
enter_alternative ();
{
if (!m.to_bool () )
{
- bool success = try_music (music_l ());
+ bool success = try_music (get_music ());
if (!success)
- music_l ()->origin ()->warning (_ ("no one to print a repeat brace"));
+ get_music ()->origin ()->warning (_ ("no one to print a repeat brace"));
}
- if (main_iter_p_)
+ if (main_iter_)
{
- main_iter_p_->process (m);
- if (!main_iter_p_->ok ())
+ main_iter_->process (m);
+ if (!main_iter_->ok ())
leave_body ();
}
- if (!main_iter_p_ && !alternative_iter_p_)
+ if (!main_iter_ && !alternative_iter_)
{
enter_alternative ();
}
- if (alternative_iter_p_)
+ if (alternative_iter_)
{
- alternative_iter_p_->process (m - main_length_mom_);
- if (!alternative_iter_p_->ok ())
+ alternative_iter_->process (m - main_length_mom_);
+ if (!alternative_iter_->ok ())
{
- delete alternative_iter_p_;
- alternative_iter_p_ =0;
+ delete alternative_iter_;
+ alternative_iter_ =0;
}
}
}
void
Folded_repeat_iterator::leave_body ()
{
- Repeated_music * mus = dynamic_cast<Repeated_music *> (music_l ());
- delete main_iter_p_;
- main_iter_p_ = 0;
+ Repeated_music * mus = dynamic_cast<Repeated_music *> (get_music ());
+ delete main_iter_;
+ main_iter_ = 0;
main_length_mom_ += mus->body ()->length_mom ();
}
void
Folded_repeat_iterator::enter_alternative ()
{
- Repeated_music * mus = dynamic_cast<Repeated_music *> (music_l ());
+ Repeated_music * mus = dynamic_cast<Repeated_music *> (get_music ());
if (mus->alternatives ())
{
Simultaneous_music_iterator * s = new Simultaneous_music_iterator;
s->separate_contexts_b_ = true;
- s->init_translator (mus, report_to_l ());
+ s->init_translator (mus, report_to ());
- alternative_iter_p_ = s;
- alternative_iter_p_->construct_children ();
+ alternative_iter_ = s;
+ alternative_iter_->construct_children ();
}
}
Music_iterator*
Folded_repeat_iterator::try_music_in_children (Music * m) const
{
- if (main_iter_p_)
+ if (main_iter_)
{
- return main_iter_p_->try_music (m);
+ return main_iter_->try_music (m);
}
- if (alternative_iter_p_)
- return alternative_iter_p_->try_music (m);
+ if (alternative_iter_)
+ return alternative_iter_->try_music (m);
return 0;
}
Ugh: why the defaults?
*/
SCM defaults = ly_cdr (scm_assoc (ly_symbol2scm ("font-defaults"),
- me->paper_l ()->style_sheet_));
+ me->get_paper ()->style_sheet_));
SCM ch = me->get_property_alist_chain (defaults);
if (!gh_string_p (name))
{
- SCM ss = me->paper_l ()->style_sheet_;
+ SCM ss = me->get_paper ()->style_sheet_;
SCM proc = ly_cdr (scm_assoc (ly_symbol2scm ("properties-to-font"),
ss));
SCM mag = me->get_grob_property ("font-magnification");
Real rmag = gh_number_p (mag) ? gh_scm2double (mag) : 1.0;
- Font_metric *fm = me->paper_l ()->find_font (name, rmag);
+ Font_metric *fm = me->get_paper ()->find_font (name, rmag);
return fm;
}
{
assert (gh_symbol_p (style));
- SCM sheet = me->paper_l ()->style_sheet_;
+ SCM sheet = me->get_paper ()->style_sheet_;
SCM style_alist = ly_cdr (scm_assoc (ly_symbol2scm ("style-alist"), sheet));
SCM entry = scm_assoc (style, style_alist);
*/
-static SCM shape_sym, family_sym, series_sym, rel_sz_sym, design_sz_sym, wild_sym;
+static SCM shape_sym, family_sym, series_sym, rel_str0_sym, design_str0_sym, wild_sym;
static void
shape_sym = scm_permanent_object (ly_symbol2scm ("font-shape"));
family_sym = scm_permanent_object (ly_symbol2scm ("font-family"));
series_sym = scm_permanent_object (ly_symbol2scm ("font-series"));
- rel_sz_sym = scm_permanent_object (ly_symbol2scm ("font-relative-size"));
- design_sz_sym = scm_permanent_object (ly_symbol2scm ("font-design-size"));
+ rel_str0_sym = scm_permanent_object (ly_symbol2scm ("font-relative-size"));
+ design_str0_sym = scm_permanent_object (ly_symbol2scm ("font-design-size"));
wild_sym = scm_permanent_object (ly_symbol2scm ("*"));
}
SCM series = SCM_BOOL_F;
- SCM point_sz = ly_assoc_chain (design_sz_sym, alist_chain);
- SCM rel_sz = SCM_BOOL_F;
+ SCM point_str0 = ly_assoc_chain (design_str0_sym, alist_chain);
+ SCM rel_str0 = SCM_BOOL_F;
shape = ly_assoc_chain (shape_sym, alist_chain);
family = ly_assoc_chain (family_sym, alist_chain);
series = ly_cdr (series);
- if (gh_pair_p (point_sz))
- point_sz = ly_cdr (point_sz);
+ if (gh_pair_p (point_str0))
+ point_str0 = ly_cdr (point_str0);
else
{
- rel_sz = ly_assoc_chain (rel_sz_sym, alist_chain);
- if (gh_pair_p (rel_sz))
- rel_sz = ly_cdr (rel_sz);
+ rel_str0 = ly_assoc_chain (rel_str0_sym, alist_chain);
+ if (gh_pair_p (rel_str0))
+ rel_str0 = ly_cdr (rel_str0);
}
for (SCM s = fonts ; gh_pair_p (s); s = ly_cdr (s))
if (!wild_compare (scm_list_ref (qlist, gh_int2scm (3)), family))
continue;
- if (point_sz == SCM_BOOL_F && !wild_compare (ly_car (qlist), rel_sz))
+ if (point_str0 == SCM_BOOL_F && !wild_compare (ly_car (qlist), rel_str0))
continue;
SCM qname = ly_cdar (s);
}
warning (_ ("couldn't find any font satisfying "));
- scm_write (scm_list_n (point_sz, shape, series , family, rel_sz, SCM_UNDEFINED), scm_current_error_port ());
+ scm_write (scm_list_n (point_str0, shape, series , family, rel_str0, SCM_UNDEFINED), scm_current_error_port ());
scm_flush (scm_current_error_port ());
return ly_str02scm ("cmr10");
Interval ydims;
Real w=0.0;
- for (int i = 0; i < text.length_i (); i++)
+ for (int i = 0; i < text.length (); i++)
{
switch (text[i])
{
case '\\':
// accent marks use width of base letter
- if (i +1 < text.length_i ())
+ if (i +1 < text.length ())
{
if (text[i+1]=='\'' || text[i+1]=='`' || text[i+1]=='"' ||
text[i+1]=='^')
}
}
- for (i++; (i < text.length_i ()) && !isspace (text[i])
+ for (i++; (i < text.length ()) && !isspace (text[i])
&& text[i]!='{' && text[i]!='}'; i++)
;
// ugh.
if (gh_number_p (sz)
&& gh_scm2int (sz)
- && !gh_number_p (gi.grob_l_->get_grob_property ("font-relative-size")))
+ && !gh_number_p (gi.grob_->get_grob_property ("font-relative-size")))
{
- gi.grob_l_->set_grob_property ("font-relative-size", sz);
+ gi.grob_->set_grob_property ("font-relative-size", sz);
}
}
#include "global-ctor.hh"
#include "array.hh"
-static Array<Global_ctor> *ctor_global_static_arr_p_;
+static Array<Global_ctor> *ctor_global_statics_;
void
add_constructor (Global_ctor c)
{
- if (!ctor_global_static_arr_p_)
- ctor_global_static_arr_p_ = new Array<Global_ctor>;
- ctor_global_static_arr_p_->push (c);
+ if (!ctor_global_statics_)
+ ctor_global_statics_ = new Array<Global_ctor>;
+ ctor_global_statics_->push (c);
}
void
call_constructors ()
{
- for (int i=0; i < ctor_global_static_arr_p_->size (); i++)
- (ctor_global_static_arr_p_->elem (i)) ();
+ for (int i=0; i < ctor_global_statics_->size (); i++)
+ (ctor_global_statics_->elem (i)) ();
}
}
int
-Global_translator::moments_left_i () const
+Global_translator::get_moments_left () const
{
return extra_mom_pq_.size ();
}
Music_output*
-Global_translator::get_output_p ()
+Global_translator::get_output ()
{
return 0;
}
prev_mom_ = now_mom_ = iter->pending_moment ();
bool first = true;
- while (iter->ok () || moments_left_i ())
+ while (iter->ok () || get_moments_left ())
{
Moment w;
w.set_infinite (1);
w = sneaky_insert_extra_moment (w);
- // printf ("proccing %s\n ", w.str().ch_C());
+ // printf ("proccing %s\n ", w.string ().to_str0 ());
considered: this path has infinite energy
*/
- int prev_break_i_;
+ int prev_break_;
/**
Which system number so far?
*/
- int line_i_;
+ int line_;
- Real demerits_f_;
+ Real demerits_;
Column_x_positions line_config_;
Break_node ()
{
- prev_break_i_ = -1;
- line_i_ = 0;
- demerits_f_ = 0;
+ prev_break_ = -1;
+ line_ = 0;
+ demerits_ = 0;
}
};
{
Array<Break_node> optimal_paths;
Link_array<Grob> all =
- pscore_l_->system_->column_l_arr ();
+ pscore_->system_->columns ();
Array<int> breaks = find_break_indices ();
Real minimal_demerits = infinity_f;
- bool ragged = to_boolean (pscore_l_->paper_l_->get_scmvar ("raggedright"));
+ bool ragged = to_boolean (pscore_->paper_->get_scmvar ("raggedright"));
for (int start_idx = break_idx; start_idx--;)
{
cp.cols_ = line;
Interval line_dims
- = pscore_l_->paper_l_->line_dimensions_int (optimal_paths[start_idx].line_i_);
+ = pscore_->paper_->line_dimensions_int (optimal_paths[start_idx].line_);
Simple_spacer * sp = generate_spacing_problem (line, line_dims);
sp->solve (&cp, ragged);
delete sp;
- if (fabs (cp.force_f_) > worst_force)
- worst_force = fabs (cp.force_f_);
+ if (fabs (cp.force_) > worst_force)
+ worst_force = fabs (cp.force_);
/*
We remember this solution as a "should always work
Real this_demerits;
- if (optimal_paths[start_idx].demerits_f_ >= infinity_f)
+ if (optimal_paths[start_idx].demerits_ >= infinity_f)
this_demerits = infinity_f;
else
this_demerits = combine_demerits (optimal_paths[start_idx].line_config_, cp)
- + optimal_paths[start_idx].demerits_f_;
+ + optimal_paths[start_idx].demerits_;
if (this_demerits < minimal_demerits)
{
Break_node bnod;
if (minimal_start_idx < 0)
{
- bnod.demerits_f_ = infinity_f;
+ bnod.demerits_ = infinity_f;
bnod.line_config_ = backup_sol;
- bnod.prev_break_i_ = break_idx - 1;
+ bnod.prev_break_ = break_idx - 1;
}
else
{
- bnod.prev_break_i_ = minimal_start_idx;
- bnod.demerits_f_ = minimal_demerits;
+ bnod.prev_break_ = minimal_start_idx;
+ bnod.demerits_ = minimal_demerits;
bnod.line_config_ = minimal_sol;
}
- bnod.line_i_ = optimal_paths[bnod.prev_break_i_].line_i_ + 1;
+ bnod.line_ = optimal_paths[bnod.prev_break_].line_ + 1;
optimal_paths.push (bnod);
if (! (break_idx % HAPPY_DOTS_I))
- progress_indication (String ("[") + to_str (break_idx) + "]");
+ progress_indication (String ("[") + to_string (break_idx) + "]");
}
/* do the last one */
if (breaks.size () % HAPPY_DOTS_I)
- progress_indication (String ("[") + to_str (breaks.size()) + "]");
+ progress_indication (String ("[") + to_string (breaks.size()) + "]");
progress_indication ("\n");
for (int i = optimal_paths.size ()-1; i> 0;)
{
final_breaks.push (i);
- int prev = optimal_paths[i].prev_break_i_;
+ int prev = optimal_paths[i].prev_break_;
assert (i > prev);
i = prev;
}
if (verbose_global_b)
- printf ("Optimal demerits: %f\n", optimal_paths.top ().demerits_f_);
+ printf ("Optimal demerits: %f\n", optimal_paths.top ().demerits_);
- if (optimal_paths.top ().demerits_f_ >= infinity_f)
+ if (optimal_paths.top ().demerits_ >= infinity_f)
warning (_ ("No feasible line breaking found"));
for (int i= final_breaks.size (); i--;)
{
Real break_penalties = 0.0;
Grob * pc = this_one.cols_.top ();
- if (pc->original_l_)
+ if (pc->original_)
{
SCM pen = pc->get_grob_property ("penalty");
if (gh_number_p (pen) && fabs (gh_scm2double (pen)) < 10000)
/*
Q: do want globally non-cramped lines, or locally equally cramped lines.
*/
- Real demerit = abs (this_one.force_f_) + 0.1 *abs (prev.force_f_ - this_one.force_f_)
+ Real demerit = abs (this_one.force_) + 0.1 *abs (prev.force_ - this_one.force_)
+ break_penalties;
#else
- Real demerit = abs (this_one.force_f_) + break_penalties;
+ Real demerit = abs (this_one.force_) + break_penalties;
#endif
if (!this_one.satisfies_constraints_b_)
Grace_iterator::~Grace_iterator ()
{
- // child_iter_p_ = 0;
+ // child_iter_ = 0;
}
#include "music.hh"
#include "translator-group.hh"
-Grob_info::Grob_info (Grob*s_l)
+Grob_info::Grob_info (Grob*s)
{
- grob_l_ = s_l;
- origin_trans_l_ = 0;
+ grob_ = s;
+ origin_trans_ = 0;
}
Grob_info::Grob_info ()
{
- grob_l_ = 0;
- origin_trans_l_ = 0;
+ grob_ = 0;
+ origin_trans_ = 0;
}
Music*
Grob_info::music_cause ()
{
- SCM cause = grob_l_->get_grob_property ("cause");
+ SCM cause = grob_->get_grob_property ("cause");
return unsmob_music (cause);
}
Link_array<Translator>
-Grob_info::origin_trans_l_arr (Translator* end) const
+Grob_info::origin_transes (Translator* end) const
{
- Translator * t = origin_trans_l_;
+ Translator * t = origin_trans_;
Link_array<Translator> r;
do {
r.push (t);
- t = t->daddy_trans_l_;
- } while (t && t != end->daddy_trans_l_);
+ t = t->daddy_trans_;
+ } while (t && t != end->daddy_trans_);
return r;
}
LY_DEFINE(ly_add_interface, "ly-add-interface", 3,0,0, (SCM a, SCM b, SCM c),
"Add an interface description.")
{
- SCM_ASSERT_TYPE (gh_symbol_p(a), a, SCM_ARG1, __FUNCTION__, "symbol");
- SCM_ASSERT_TYPE (gh_string_p(b), b, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (gh_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_string_p (b), b, SCM_ARG2, __FUNCTION__, "string");
SCM_ASSERT_TYPE (gh_list_p(c), c, SCM_ARG3, __FUNCTION__, "list of syms");
if (!gh_vector_p (all_ifaces))
{
SCM iface = scm_hashq_ref (all_ifaces , gh_car (ifs), SCM_BOOL_F);
if (iface == SCM_BOOL_F)
{
- String msg = to_str ("Unknown interface `%s'",
- ly_scm2string (scm_symbol_to_string (gh_car(ifs))).ch_C());
+ String msg = to_string ("Unknown interface `%s'",
+ ly_scm2string (scm_symbol_to_string (gh_car(ifs))).to_str0 ());
programming_error (msg);
continue;
}
if (!found)
{
- String str = to_str("Grob %s has no interface for property %s",
- me->name ().ch_C(),
- ly_symbol2string(sym).ch_C());
+ String str = to_string ("Grob %s has no interface for property %s",
+ me->name ().to_str0 (),
+ ly_symbol2string(sym).to_str0 ());
programming_error (str);
}
}
Grob_pitch_tuple::Grob_pitch_tuple ()
{
- head_l_ =0;
+ head_ =0;
end_ = 0;
}
Grob_pitch_tuple::Grob_pitch_tuple (Grob *h, Melodic_req*m, Moment mom)
{
- head_l_ = h;
+ head_ = h;
pitch_ = *unsmob_pitch (m->get_mus_property ("pitch"));
end_ = mom;
}
void
Grob_pq_engraver::initialize ()
{
- daddy_trans_l_->set_property ("busyGrobs", SCM_EOL);
+ daddy_trans_->set_property ("busyGrobs", SCM_EOL);
}
void
l.main_part_ = 0;
}
- current_grobs_.push (Grob_mom (gi.grob_l_, n + l));
+ current_grobs_.push (Grob_mom (gi.grob_, n + l));
}
}
}
current_grobs_.clear ();
- daddy_trans_l_->set_property ("busyGrobs", start);
+ daddy_trans_->set_property ("busyGrobs", start);
}
void
}
if (start_busy != busy)
- daddy_trans_l_->set_property ("busyGrobs", busy);
+ daddy_trans_->set_property ("busyGrobs", busy);
}
{
Grob * sc = unsmob_grob (grob);
SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE(gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
if (!type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
error ("typecheck failed");
{
Grob * sc = unsmob_grob (grob);
SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE(gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
return sc->internal_get_grob_property (sym);
}
{
Grob * sc = unsmob_grob (grob);
SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE(gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
- return sc->paper_l() ->get_scmvar_scm (sym);
+ return sc->get_paper () ->get_scmvar_scm (sym);
}
SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
SCM_ASSERT_TYPE(ref, refp, SCM_ARG2, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+ SCM_ASSERT_TYPE(ly_axis_p (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
return ly_interval2scm ( sc->extent (ref, Axis (gh_scm2int (axis))));
}
{
Grob * sc = unsmob_grob (grob);
SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+ SCM_ASSERT_TYPE(ly_axis_p (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
Grob * par = sc->get_parent (Axis (gh_scm2int (axis)));
return par ? par->self_scm() : SCM_EOL;
fixme: default should be no callback.
*/
- pscore_l_=0;
- status_c_ = 0;
- original_l_ = 0;
+ pscore_=0;
+ status_ = 0;
+ original_ = 0;
immutable_property_alist_ = basicprops;
mutable_property_alist_ = SCM_EOL;
Grob::Grob (Grob const&s)
: dim_cache_ (s.dim_cache_)
{
- original_l_ = (Grob*) &s;
+ original_ = (Grob*) &s;
immutable_property_alist_ = s.immutable_property_alist_;
mutable_property_alist_ = SCM_EOL;
No properties are copied. That is the job of handle_broken_dependencies.
*/
- status_c_ = s.status_c_;
- pscore_l_ = s.pscore_l_;
+ status_ = s.status_;
+ pscore_ = s.pscore_;
smobify_self ();
Paper_def*
-Grob::paper_l () const
+Grob::get_paper () const
{
- return pscore_l_ ? pscore_l_->paper_l_ : 0;
+ return pscore_ ? pscore_->paper_ : 0;
}
void
Grob::calculate_dependencies (int final, int busy, SCM funcname)
{
- if (status_c_ >= final)
+ if (status_ >= final)
return;
- if (status_c_== busy)
+ if (status_== busy)
{
programming_error ("Element is busy, come back later");
return;
}
- status_c_= busy;
+ status_= busy;
for (SCM d = get_grob_property ("dependencies"); gh_pair_p (d);
d = ly_cdr (d))
if (gh_procedure_p (proc))
gh_call1 (proc, this->self_scm ());
- status_c_= final;
+ status_= final;
}
Molecule *
{
Grob *me = unsmob_grob (grob);
SCM_ASSERT_TYPE (me, grob, SCM_ARG1, __FUNCTION__, "grob");
- return me->original_l_ ? me->original_l_->self_scm () : me->self_scm ();
+ return me->original_ ? me->original_->self_scm () : me->self_scm ();
}
void
Grob::handle_broken_dependencies ()
{
Spanner * s= dynamic_cast<Spanner*> (this);
- if (original_l_ && s)
+ if (original_ && s)
return;
if (s)
{
- for (int i = 0; i< s->broken_into_l_arr_ .size (); i++)
+ for (int i = 0; i< s->broken_intos_ .size (); i++)
{
- Grob * sc = s->broken_into_l_arr_[i];
+ Grob * sc = s->broken_intos_[i];
System * l = sc->get_system ();
sc->substitute_mutable_properties (l ? l->self_scm () : SCM_UNDEFINED,
Don't do this in the derived method, since we want to keep access to
mutable_property_alist_ centralized.
*/
- if (original_l_)
+ if (original_)
{
Item * it = dynamic_cast<Item*> (this);
substitute_mutable_properties (gh_int2scm (it->break_status_dir ()),
- original_l_->mutable_property_alist_);
+ original_->mutable_property_alist_);
}
}
not ask for the absolute coordinate (ie. REFP == nil.)
*/
- if (refp == dim_cache_[a].parent_l_)
+ if (refp == dim_cache_[a].parent_)
return get_offset (a);
else
- return get_offset (a) + dim_cache_[a].parent_l_->relative_coordinate (refp, a);
+ return get_offset (a) + dim_cache_[a].parent_->relative_coordinate (refp, a);
}
I don't like the quadratic aspect of this code, but I see no other
way. The largest chain of parents might be 10 high or so, so
it shouldn't be a real issue. */
- for (Grob const *c = this; c; c = c->dim_cache_[a].parent_l_)
- for (Grob const * d = s; d; d = d->dim_cache_[a].parent_l_)
+ for (Grob const *c = this; c; c = c->dim_cache_[a].parent_)
+ for (Grob const * d = s; d; d = d->dim_cache_[a].parent_)
if (d == c)
return (Grob*)d;
void
Grob::set_parent (Grob *g, Axis a)
{
- dim_cache_[a].parent_l_ = g;
+ dim_cache_[a].parent_ = g;
}
MAKE_SCHEME_CALLBACK (Grob,fixup_refpoint,1);
*/
}
- if (s->original_l_)
- scm_gc_mark (s->original_l_->self_scm ());
+ if (s->original_)
+ scm_gc_mark (s->original_->self_scm ());
s->do_derived_mark ();
return s->mutable_property_alist_;
Grob *sc = (Grob *) ly_cdr (s);
scm_puts ("#<Grob ", port);
- scm_puts ((char *)sc->name ().ch_C (), port);
+ scm_puts ((char *)sc->name ().to_str0 (), port);
/*
don't try to print properties, that is too much hassle.
/** Return Array of Grobs in SCM list L */
Link_array<Grob>
-ly_scm2grob_array (SCM l)
+ly_scm2grobs (SCM l)
{
Link_array<Grob> arr;
/** Return SCM list of Grob array A */
SCM
-ly_grob_array2scm (Link_array<Grob> a)
+ly_grobs2scm (Link_array<Grob> a)
{
SCM s = SCM_EOL;
for (int i = a.size (); i; i--)
void
Group_interface::add_thing (Grob*me, String name, SCM thing)
{
- add_thing (me, ly_symbol2scm (name.ch_C()), thing);
+ add_thing (me, ly_symbol2scm (name.to_str0 ()), thing);
}
int
Group_interface::count (Grob *me, String name)
{
- return scm_ilength (me->get_grob_property (name.ch_C ()));
+ return scm_ilength (me->get_grob_property (name.to_str0 ()));
}
Grob *me= unsmob_grob (smob);
Spanner *spanner = dynamic_cast<Spanner*> (me);
- Real line = me->paper_l ()->get_var ("linethickness");
+ Real line = me->get_paper ()->get_var ("linethickness");
SCM s = me->get_grob_property ("grow-direction");
if (!ly_dir_p (s))
then. */
class Hyphen_engraver : public Engraver
{
- Grob *last_lyric_l_;
- Grob *current_lyric_l_;
- Hyphen_req* req_l_;
- Spanner* hyphen_p_;
+ Grob *last_lyric_;
+ Grob *current_lyric_;
+ Hyphen_req* req_;
+ Spanner* hyphen_;
public:
TRANSLATOR_DECLARATIONS(Hyphen_engraver);
Hyphen_engraver::Hyphen_engraver ()
{
- current_lyric_l_ = 0;
- last_lyric_l_ = 0;
- hyphen_p_ = 0;
- req_l_ = 0;
+ current_lyric_ = 0;
+ last_lyric_ = 0;
+ hyphen_ = 0;
+ req_ = 0;
}
void
Hyphen_engraver::acknowledge_grob (Grob_info i)
{
// -> text-item
- if (i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+ if (i.grob_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
{
- current_lyric_l_ = i.grob_l_;
- if (hyphen_p_
- && !hyphen_p_->get_bound (RIGHT)
+ current_lyric_ = i.grob_;
+ if (hyphen_
+ && !hyphen_->get_bound (RIGHT)
)
{
- Hyphen_spanner (hyphen_p_).set_textitem (RIGHT, i.grob_l_);
+ Hyphen_spanner (hyphen_).set_textitem (RIGHT, i.grob_);
}
}
}
{
if (Hyphen_req* p = dynamic_cast <Hyphen_req *> (r))
{
- if (req_l_)
+ if (req_)
return false;
- req_l_ = p;
+ req_ = p;
return true;
}
return false;
void
Hyphen_engraver::finalize ()
{
- if (hyphen_p_)
+ if (hyphen_)
{
- req_l_->origin ()->warning (_ ("unterminated hyphen"));
- hyphen_p_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
+ req_->origin ()->warning (_ ("unterminated hyphen"));
+ hyphen_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
}
}
void
Hyphen_engraver::process_acknowledged_grobs ()
{
- if (req_l_ &&! hyphen_p_)
+ if (req_ &&! hyphen_)
{
- if (!last_lyric_l_)
+ if (!last_lyric_)
{
- req_l_->origin ()->warning (_ ("Nothing to connect hyphen to on the left. Ignoring hyphen request."));
+ req_->origin ()->warning (_ ("Nothing to connect hyphen to on the left. Ignoring hyphen request."));
return;
}
- hyphen_p_ = new Spanner (get_property ("LyricHyphen"));
+ hyphen_ = new Spanner (get_property ("LyricHyphen"));
- Hyphen_spanner (hyphen_p_).set_textitem (LEFT, last_lyric_l_);
- announce_grob(hyphen_p_, req_l_->self_scm());
+ Hyphen_spanner (hyphen_).set_textitem (LEFT, last_lyric_);
+ announce_grob(hyphen_, req_->self_scm());
}
}
void
Hyphen_engraver::stop_translation_timestep ()
{
- if (hyphen_p_)
+ if (hyphen_)
{
- typeset_grob (hyphen_p_);
- hyphen_p_ = 0;
+ typeset_grob (hyphen_);
+ hyphen_ = 0;
}
- if (current_lyric_l_)
+ if (current_lyric_)
{
- last_lyric_l_ = current_lyric_l_;
- current_lyric_l_ =0;
+ last_lyric_ = current_lyric_;
+ current_lyric_ =0;
}
}
void
Hyphen_engraver::start_translation_timestep ()
{
- req_l_ = 0;
+ req_ = 0;
}
}
while (flip (&d) != LEFT);
- Real lt = sp->paper_l ()->get_var ("linethickness");
+ Real lt = sp->get_paper ()->get_var ("linethickness");
Real th = gh_scm2double (sp->get_grob_property ("thickness")) * lt ;
Real h = gh_scm2double (sp->get_grob_property ("height"));
the offset for stuff */
/* This test for being on the first column has been shamelessly
ripped from spanner.cc */
- Paper_column *sc = dynamic_cast<Paper_column*> (sp->get_bound (LEFT)->column_l ());
+ Paper_column *sc = dynamic_cast<Paper_column*> (sp->get_bound (LEFT)->get_column ());
if (sc != NULL &&
sc->break_status_dir () == RIGHT)
{
void
Hyphen_spanner::set_textitem (Direction d, Grob* b)
{
- elt_l_->set_bound (d, b);
- elt_l_->add_dependency (b);
+ elt_->set_bound (d, b);
+ elt_->add_dependency (b);
}
Hyphen_spanner::Hyphen_spanner (Spanner*s)
{
- elt_l_ = s;
+ elt_ = s;
}
return;
}
- Source_file * sl = global_sources->get_file_l (s);
+ Source_file * sl = global_sources->get_file (s);
if (!sl)
{
String msg = _f ("can't find file: `%s'", s);
msg += "\n";
- msg += _f ("(search path: `%s')", global_sources->path_C_->str ().ch_C ());
+ msg += _f ("(search path: `%s')", global_sources->path_C_->string ().to_str0 ());
msg += "\n";
- LexerError (msg.ch_C ());
+ LexerError (msg.to_str0 ());
return;
}
- filename_str_arr_.push (sl->name_str ());
+ filename_strings_.push (sl->name_string ());
char_count_stack_.push (0);
if (yy_current_buffer)
filelength but a BUFFERSIZE. Maybe this is why reading stdin fucks up.
*/
- yy_switch_to_buffer (yy_create_buffer (sl->istream_l (), YY_BUF_SIZE));
+ yy_switch_to_buffer (yy_create_buffer (sl->get_istream (), YY_BUF_SIZE));
}
void
{
Source_file* file = new Source_file (name, data);
sources->add (file);
- filename_str_arr_.push (name);
+ filename_strings_.push (name);
char_count_stack_.push (0);
if (yy_current_buffer)
progress_indication (String ("[") + name);
include_stack_.push (file);
- yy_switch_to_buffer (yy_create_buffer (file->istream_l (), YY_BUF_SIZE));
+ yy_switch_to_buffer (yy_create_buffer (file->get_istream (), YY_BUF_SIZE));
}
/** pop the inputstack. conceptually this is a destructor, but it
}
char const*
-Includable_lexer::here_ch_C () const
+Includable_lexer::here_str0 () const
{
if (include_stack_.empty ())
return 0;
- return include_stack_.top ()->ch_C () + char_count_stack_.top ();
+ return include_stack_.top ()->to_str0 () + char_count_stack_.top ();
}
Includable_lexer::~Includable_lexer ()
}
Source_file*
-Includable_lexer::source_file_l () const
+Includable_lexer::get_source_file () const
{
if (include_stack_.empty ())
return 0;
AFM_CharMetricInfo const *find_char_metric (String name, bool warn=true) const;
AFM_CharMetricInfo const *find_ascii_metric (int, bool warn=true) const;
- String str () const;
+ String string () const;
~Adobe_font_metric ();
static SCM make_afm (AFM_Font_info*, unsigned);
public:
Audio_column (Moment at_mom);
- void add_audio_item (Audio_item* i_l);
+ void add_audio_item (Audio_item* i);
Moment at_mom () const;
void print () const;
- Link_array<Audio_item> audio_item_l_arr_;
- Performance * performance_l_;
+ Link_array<Audio_item> audio_items_;
+ Performance * performance_;
private:
Audio_column (Audio_column const&);
Data container for broadcasts
*/
struct Audio_element_info {
- Audio_element * elem_l_;
- Music *req_l_;
- Translator * origin_trans_l_;
- Link_array<Translator> origin_trans_l_arr (Translator*) const;
+ Audio_element * elem_;
+ Music *req_;
+ Translator * origin_trans_;
+ Link_array<Translator> origin_transes (Translator*) const;
Audio_element_info (Audio_element*, Music*);
Audio_element_info ();
public:
Audio_item ();
- Audio_column* audio_column_l_;
+ Audio_column* audio_column_;
private:
class Audio_instrument : public Audio_item
{
public:
- Audio_instrument (String instrument_str);
+ Audio_instrument (String instrument_string);
String str_;
};
Moment length_mom_;
Moment delayed_mom_;
Moment delayed_until_mom_;
- int transposing_i_;
+ int transposing_;
Audio_note* tied_;
};
class Audio_piano_pedal : public Audio_item
{
public:
- String type_str_;
+ String type_string_;
Direction dir_;
};
MARKER, CUE_POINT
};
- Audio_text (Audio_text::Type type, String text_str);
+ Audio_text (Audio_text::Type type, String text_string);
Type type_;
- String text_str_;
+ String text_string_;
};
class Audio_tempo : public Audio_item
public:
Audio_tempo (int per_minute_4_i);
- int per_minute_4_i_;
+ int per_minute_4_;
};
class Audio_tie : public Audio_item
public:
Audio_time_signature (int beats, int one_beat);
- int beats_i_;
- int one_beat_i_;
+ int beats_;
+ int one_beat_;
};
#endif // AUDIO_ITEM_HH
void add_audio_item (Audio_item* l);
void output (Midi_stream& midi_stream_r, int track_i);
- Link_array<Audio_item> audio_item_l_arr_;
- int channel_i_;
+ Link_array<Audio_item> audio_items_;
+ int channel_;
};
#endif // AUDIO_STAFF_HH
Offset control_[4];
};
-void scale (Array<Offset>* arr_p, Real xscale, Real yscale);
-void rotate (Array<Offset>* arr_p, Real phi);
-void translate (Array<Offset>* arr_p, Offset o);
+void scale (Array<Offset>* array, Real xscale, Real yscale);
+void rotate (Array<Offset>* array, Real phi);
+void translate (Array<Offset>* array, Offset o);
#endif // BEZIER_HH
*/
class Break_algorithm {
protected:
- Paper_score *pscore_l_;
- Real linewidth_f_;
+ Paper_score *pscore_;
+ Real linewidth_;
/// search all pcols which are breakable.
Link_array<Grob> find_breaks () const;
private:
Moment factor_;
- Music_iterator * child_iter_p_;
+ Music_iterator * child_iter_;
};
Link_array<Grob> loose_cols_;
Array<Real> config_;
- Real force_f_;
+ Real force_;
bool satisfies_constraints_b_;
Column_x_positions ();
};
/*
- int metronome_i_;
+ int metronome_;
*/
class Tempo_req : public Request
{
static bool has_interface (Grob*);
private:
- static void add_streepjes (Grob* me, int pos, int interspaces, Molecule* custos_p_);
+ static void add_streepjes (Grob* me, int pos, int interspaces, Molecule* custos_);
static Molecule create_ledger_line (Interval x_extent, Grob *me) ;
};
SCM dimension_;
/**
- The offset wrt. to the center of #parent_l_#
+ The offset wrt. to the center of #parent_#
*/
Real offset_;
/**
What to call to find extent. Nil means empty.
*/
- Grob * parent_l_;
+ Grob * parent_;
Dimension_cache (Dimension_cache const&);
Dimension_cache ();
Duration ();
Duration (int, int);
- String str () const;
+ String string () const;
Duration compressed (Rational) const;
Rational length_mom () const ;
private:
/// Logarithm of the base duration.
- int durlog_i_;
- int dots_i_;
+ int durlog_;
+ int dots_;
Rational factor_;
};
public virtual Translator_group
{
protected:
- Array<Grob_info> announce_info_arr_;
+ Array<Grob_info> announce_infos_;
/*
Call this when you're finished with ELEM_P.
*/
- virtual void typeset_grob (Grob*elem_p);
+ virtual void typeset_grob (Grob*elem);
/*
take note of item/spanner
put item in spanner. Adjust local key; etc.
Score_engraver * top_engraver () const;
public:
- Engraver_group_engraver * daddy_grav_l () const;
+ Engraver_group_engraver * get_daddy_grav () const;
/**
override other ctor
*/
#define FILE_RESULTS_HH
#include "flower-proto.hh"
-void do_one_file (String init_str, String file_str);
-extern Scheme_hash_table *global_header_p;
-extern Array<String> target_str_global_array;
-extern Array<String> inclusion_global_array;
-extern Link_array<Score> score_global_array;
+void do_one_file (String init_string, String file_string);
+extern Scheme_hash_table *global_header;
+extern Array<String> target_string_globals;
+extern Array<String> inclusion_globals;
+extern Link_array<Score> score_globals;
void do_scores ();
void clear_scores ();
virtual Music_iterator *try_music_in_children (Music *) const;
private:
- Music_iterator * main_iter_p_;
- Music_iterator * alternative_iter_p_;
+ Music_iterator * main_iter_;
+ Music_iterator * alternative_iter_;
Moment main_length_mom_;
};
Moment now_mom_;
Global_translator ();
- int moments_left_i () const;
+ int get_moments_left () const;
Moment sneaky_insert_extra_moment (Moment);
void add_moment_to_process (Moment);
void run_iterator_on_me (Music_iterator*);
- virtual Music_output *get_output_p ();
+ virtual Music_output *get_output ();
virtual void prepare (Moment);
virtual void one_time_step ();
virtual void finish ();
Data container for broadcasts.
*/
struct Grob_info {
- Translator * origin_trans_l_;
+ Translator * origin_trans_;
friend class Engraver;
- Grob * grob_l_;
+ Grob * grob_;
public:
Music * music_cause ();
- Link_array<Translator> origin_trans_l_arr (Translator*) const;
+ Link_array<Translator> origin_transes (Translator*) const;
Grob_info (Grob*);
Grob_info ();
};
struct Grob_pitch_tuple {
Pitch pitch_;
- Grob *head_l_;
+ Grob *head_;
Moment end_;
Grob_pitch_tuple ();
void substitute_mutable_properties(SCM,SCM);
public:
- Grob *original_l_;
+ Grob *original_;
/**
Administration: Where are we?. This is mainly used by Super_element and
0 means ORPHAN,
*/
- char status_c_;
+ char status_;
/*
elements, I think it is safe to assume that we will not have
scores being formatted multithreadedly.
*/
- Paper_score *pscore_l_;
+ Paper_score *pscore_;
Dimension_cache dim_cache_[NO_AXES];
Grob (SCM basic_props);
/*
related classes.
*/
- Paper_def *paper_l () const;
+ Paper_def *get_paper () const;
/**
add a dependency. It may be the 0 pointer, in which case, it is ignored.
/**
Recursively track all dependencies of this Grob. The
- status_c_ field is used as a mark-field. It is marked with
+ status_ field is used as a mark-field. It is marked with
#busy# during execution of this function, and marked with #final#
when finished.
void set_parent (Grob* e, Axis);
- Grob *get_parent (Axis a) const { return dim_cache_[a].parent_l_; }
+ Grob *get_parent (Axis a) const { return dim_cache_[a].parent_; }
DECLARE_SCHEME_CALLBACK (fixup_refpoint, (SCM));
};
void set_break_subsititution (SCM criterion);
SCM substitute_mutable_property_alist (SCM alist);
-Link_array<Grob> ly_scm2grob_array (SCM l);
-SCM ly_grob_array2scm (Link_array<Grob> a);
+Link_array<Grob> ly_scm2grobs (SCM l);
+SCM ly_grobs2scm (Link_array<Grob> a);
#endif // STAFFELEM_HH
struct Hyphen_spanner
{
public:
- Spanner* elt_l_;
+ Spanner* elt_;
Hyphen_spanner (Spanner*);
void set_textitem (Direction, Grob*);
bool has_interface (Grob*);
~Includable_lexer ();
/// store dependencies for Makefile stuff.
- Array<String> filename_str_arr_;
+ Array<String> filename_strings_;
- Source_file* source_file_l () const;
+ Source_file* get_source_file () const;
void new_input (String s, Sources*);
void new_input (String name, String data, Sources*);
void add_lexed_char (int);
- char const * here_ch_C () const;
+ char const * here_str0 () const;
};
bool try_music (Music *);
void operator = (Interpretation_context_handle const&);
Interpretation_context_handle (Interpretation_context_handle const&);
- Translator_group * report_to_l () const;
+ Translator_group * report_to () const;
private:
- Translator_group * report_to_l_;
+ Translator_group * report_to_;
void down ();
void up (Translator_group*);
};
Grob *find_broken_piece (System *) const;
virtual System *get_system () const;
- virtual Paper_column *column_l () const;
+ virtual Paper_column *get_column () const;
virtual void handle_prebroken_dependencies ();
static bool has_interface (Grob *);
protected:
virtual void try_stop_ligature ();
virtual Spanner *create_ligature_spanner ();
- Spanner *finished_ligature_p_;
- Spanner *ligature_p_;
+ Spanner *finished_ligature_;
+ Spanner *ligature_;
SCM brew_ligature_primitive_proc;
public:
*/
#define ly_symbol2scm(x) ({ static SCM cached; \
SCM value = cached; /* We store this one locally, since G++ -O2 fucks up else */ \
- if ( __builtin_constant_p ((x)))\
+ if ( get___builtin_constant ((x)))\
{ if (!cached)\
value = cached = scm_gc_protect_object (my_gh_symbol2scm((x)));\
} else\
#endif
inline bool ly_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
inline bool ly_number_p (SCM x) { return SCM_NUMBERP (x); }
-inline bool ly_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p(x)); }
+inline bool ly_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
/*
display and print newline.
#include "string.hh"
-String version_str ();
-String gnu_lilypond_str ();
-String gnu_lilypond_version_str ();
+String version_string ();
+String gnu_lilypond_string ();
+String gnu_lilypond_version_string ();
#endif // LILY_VERSION_HH
Lilypond_version (int major, int minor, int patch);
Lilypond_version (String str);
- String str () const;
+ String string () const;
operator int () const;
- int major_i_;
- int minor_i_;
- int patch_i_;
- String extra_patch_str_;
+ int major_;
+ int minor_;
+ int patch_;
+ String extra_patch_string_;
};
extern Lilypond_version oldest_version;
class Line_group_engraver_group : public Engraver_group_engraver
{
protected:
- Spanner *staffline_p_;
+ Spanner *staffline_;
virtual void create_line_spanner ();
virtual void initialize ();
#define IMPLEMENT_TYPE_P(CL, FUNCNAME)\
-void init_type_p_ ## CL ()\
+void init_type_ ## CL ()\
{\
scm_c_define_gsubr (FUNCNAME, 1, 0, 0, (Scheme_function_unknown) CL::smob_p);\
ly_add_function_documentation (FUNCNAME, "(SCM x)", "Check if @var{x} is a " #CL " object");\
}\
-ADD_SCM_INIT_FUNC (init_type_p_ ## CL, init_type_p_ ## CL)
+ADD_SCM_INIT_FUNC (init_type_ ## CL, init_type_ ## CL)
#ifndef SCM_CELL_TYPE
#define SCM_CELL_TYPE(X) SCM_CAR (X)
private:
bool get_busy_status ()const ;
- Music_iterator * music_iter_p_;
- Music_iterator * lyric_iter_p_;
+ Music_iterator * music_iter_;
+ Music_iterator * lyric_iter_;
};
#endif /* LYRIC_COMBINE_MUSIC_ITERATOR_HH */
class Lyric_combine_music : public Music
{
public:
- Music * music_l () const;
- Music * lyrics_l () const;
+ Music * get_music () const;
+ Music * get_lyrics () const;
Lyric_combine_music ();
Lyric_combine_music (SCM);
*/
Protected_scm voice_alist_;
- Grob * any_notehead_l_;
+ Grob * any_notehead_;
};
class Syllable_group
{
bool first_in_phrase_b_;
- Grob * notehead_l_;
+ Grob * notehead_;
Link_array<Grob> lyric_list_;
- Grob * longest_lyric_l_;
- Grob * shortest_lyric_l_;
- int alignment_i_;
+ Grob * longest_lyric_;
+ Grob * shortest_lyric_;
+ int alignment_;
bool melisma_b_;
- Real group_translation_f_;
+ Real group_translation_;
public:
static SCM make_entry ();
void set_first_in_phrase (bool f);
int lyric_count () { return lyric_list_.size (); }
void clear ();
bool is_empty ();
- bool set_lyric_align (const char *punc, Grob *default_notehead_l);
+ bool set_lyric_align (const char *punc, Grob *default_notehead);
void adjust_melisma_align ();
int appropriate_alignment (const char *punc);
Real amount_to_translate ();
/* misc */
-extern All_font_metrics *all_fonts_global_p;
+extern All_font_metrics *all_fonts_global;
extern int exit_status_global;
extern File_path global_path;
extern int score_count_global;
-extern Sources* source_global_l;
+extern Sources* source_global;
#endif /* MAIN_HH */
definitions for midi output. Rather empty
*/
class Midi_def : public Music_output_def {
- static int score_count_i_;
+ static int score_count_;
public:
VIRTUAL_COPY_CONS (Music_output_def);
Midi_def ();
- int get_tempo_i (Moment moment);
+ int get_tempo (Moment moment);
void set_tempo (Moment moment, int count_per_minute_i);
virtual int get_next_score_count () const;
static void reset_score_count ();
virtual ~Midi_item ();
/// factory
- static Midi_item* midi_p (Audio_item* a);
+ static Midi_item* get_midi (Audio_item* a);
- static String i2varint_str (int i);
+ static String i2varint_string (int i);
- virtual String str () const = 0;
+ virtual String string () const = 0;
- int channel_i_;
+ int channel_;
};
/**
class Midi_event
{
public:
- Midi_event (Moment delta_mom, Midi_item* midi_l);
+ Midi_event (Moment delta_mom, Midi_item* midi);
Moment delta_mom_;
- Midi_item* midi_p_;
- String str () const;
+ Midi_item* midi_;
+ String string () const;
};
/**
class Midi_chunk : public Midi_item
{
public:
- void set (String header_str, String data_str, String footer_str);
- virtual String str () const;
- virtual String data_str () const;
+ void set (String header_string, String data_string, String footer_string);
+ virtual String string () const;
+ virtual String data_string () const;
private:
- String data_str_;
- String footer_str_;
- String header_str_;
+ String data_string_;
+ String footer_string_;
+ String header_string_;
};
class Midi_duration : public Midi_item
public:
Midi_duration (Real seconds_f);
- virtual String str () const;
- Real seconds_f_;
+ virtual String string () const;
+ Real seconds_;
};
class Midi_header : public Midi_chunk
public:
Midi_instrument (Audio_instrument*);
- virtual String str () const;
+ virtual String string () const;
- Audio_instrument* audio_l_;
+ Audio_instrument* audio_;
};
public:
Midi_key (Audio_key*);
- virtual String str () const;
+ virtual String string () const;
- Audio_key* audio_l_;
+ Audio_key* audio_;
};
class Midi_time_signature : public Midi_item
public:
Midi_time_signature (Audio_time_signature*);
- virtual String str () const;
+ virtual String string () const;
- Audio_time_signature* audio_l_;
- int clocks_per_1_i_;
+ Audio_time_signature* audio_;
+ int clocks_per_1_;
};
/**
Midi_note (Audio_note*);
Moment length_mom () const;
- int pitch_i () const;
- virtual String str () const;
+ int get_pitch () const;
+ virtual String string () const;
- Audio_note* audio_l_;
+ Audio_note* audio_;
- static int const c0_pitch_i_c_ = 60;
+ static int const c0_pitch_i_ = 60;
Byte dynamic_byte_;
};
public:
Midi_note_off (Midi_note*);
- virtual String str () const;
+ virtual String string () const;
- Midi_note* on_l_;
+ Midi_note* on_;
Byte aftertouch_byte_;
};
Midi_text (Audio_text*);
- virtual String str () const;
+ virtual String string () const;
- Audio_text* audio_l_;
+ Audio_text* audio_;
};
class Midi_dynamic : public Midi_item
public:
Midi_dynamic (Audio_dynamic*);
- virtual String str () const;
+ virtual String string () const;
- Audio_dynamic* audio_l_;
+ Audio_dynamic* audio_;
};
class Midi_piano_pedal : public Midi_item
public:
Midi_piano_pedal (Audio_piano_pedal*);
- virtual String str () const;
+ virtual String string () const;
- Audio_piano_pedal* audio_l_;
+ Audio_piano_pedal* audio_;
};
class Midi_tempo : public Midi_item
public:
Midi_tempo (Audio_tempo*);
- virtual String str () const;
+ virtual String string () const;
- Audio_tempo* audio_l_;
+ Audio_tempo* audio_;
};
class Midi_track : public Midi_chunk
{
public:
- int number_i_;
+ int number_;
/*
Compensate for starting grace notes.
Midi_track ();
- void add (Moment delta_time_mom, Midi_item* midi_l);
- virtual String data_str () const;
+ void add (Moment delta_time_mom, Midi_item* midi);
+ virtual String data_string () const;
};
#endif // MIDI_ITEM_HH
/// Midi outputfile
struct Midi_stream {
- Midi_stream (String filename_str);
+ Midi_stream (String filename_string);
~Midi_stream ();
Midi_stream& operator << ( String str);
void open ();
- std::ostream* os_p_;
- String filename_str_;
+ std::ostream* os_;
+ String filename_string_;
};
#endif // MIDI_STREAM_HH
class Midi_walker
{
public:
- Midi_walker (Audio_staff* audio_staff_l, Midi_track* midi_track_l);
+ Midi_walker (Audio_staff* audio_staff, Midi_track* midi_track);
~Midi_walker ();
void process ();
bool ok () const;
private:
- void do_start_note (Midi_note* note_p);
+ void do_start_note (Midi_note* note);
void do_stop_notes (Moment now_mom);
void output_event (Moment now_mom, Midi_item* l);
- Midi_track* track_l_;
- Audio_staff* staff_l_;
+ Midi_track* track_;
+ Audio_staff* staff_;
int index_;
- Link_array<Audio_item> * item_l_arr_l_;
+ Link_array<Audio_item> * items_;
PQueue<Midi_note_event> stop_note_queue;
Moment last_mom_;
};
Deliver a copy of THIS as a smobified SCM
*/
SCM smobbed_copy () const;
- String str () const;
+ String string () const;
static int compare (Moment const&, Moment const&);
};
/**
The translation unit that we this iterator is reporting to now.
*/
- Translator_group* report_to_l () const;
+ Translator_group* report_to () const;
void set_translator (Translator_group*);
/** Get an iterator matching the type of MUS, and use TRANS to find
an accompanying translation unit
*/
- static Music_iterator* static_get_iterator_p (Music * mus);
+ static Music_iterator* get_static_get_iterator (Music * mus);
void init_translator (Music *, Translator_group *);
virtual Moment pending_moment () const;
/**
Get an iterator for MUS, inheriting the translation unit from THIS.
*/
- Music_iterator* get_iterator_p (Music *) const;
+ Music_iterator* get_iterator (Music *) const;
virtual Music_iterator* try_music_in_children (Music *) const;
- Music * music_l () const;
+ Music * get_music () const;
private:
Interpretation_context_handle handle_;
- Music * music_l_;
+ Music * music_;
};
Music_output_def ();
virtual int get_next_score_count () const;
- Global_translator *get_global_translator_p ();
- Translator_group *get_group_translator_p (String type) const;
+ Global_translator *get_global_translator ();
+ Translator_group *get_group_translator (String type) const;
void assign_translator (SCM transdef);
- SCM find_translator_l (SCM name) const;
- String outname_str () ;
+ SCM find_translator (SCM name) const;
+ String outname_string () ;
DECLARE_SMOBS (Music_output_def,);
};
class Music_output
{
public:
- Scheme_hash_table * header_l_;
- String default_out_str_;
- String origin_str_;
- int errorlevel_i_;
+ Scheme_hash_table * header_;
+ String default_out_string_;
+ String origin_string_;
+ int errorlevel_;
virtual void process () {}
virtual ~Music_output (){}
Music_output ()
{
- errorlevel_i_ = 0;
+ errorlevel_ = 0;
}
};
virtual void process (Moment);
virtual Music_iterator *try_music_in_children (Music *) const;
- Music_iterator *child_iter_p_;
+ Music_iterator *child_iter_;
};
#endif /* MUSIC_WRAPPER_ITERATOR_HH */
class Articulation_req : public Script_req
{
public:
- String get_articulation_str ();
+ String get_articulation_string ();
protected:
virtual bool do_equal_b (Request const*) const;
class My_lily_lexer : public Includable_lexer
{
public:
- String main_input_str_;
- void * lexval_l;
+ String main_input_string_;
+ void * lexval;
Scheme_hash_table * toplevel_variable_tab_;
bool main_input_b_;
Protected_scm chordmodifier_tab_;
Protected_scm pitchname_tab_;
- Link_array<Scheme_hash_table> scope_l_arr_;
- Keyword_table * keytable_p_;
- int errorlevel_i_;
+ Link_array<Scheme_hash_table> scopes_;
+ Keyword_table * keytable_;
+ int errorlevel_;
My_lily_lexer ();
~My_lily_lexer ();
void push_lyric_state ();
void pop_state ();
void LexerError (char const *);
- void set_identifier (SCM name_str, SCM);
+ void set_identifier (SCM name_string, SCM);
bool note_state_b () const;
bool chord_state_b () const;
bool lyric_state_b () const;
class My_lily_parser
{
public:
- My_lily_parser (Sources * sources_l);
+ My_lily_parser (Sources * sources);
~My_lily_parser ();
void do_init_file ();
- void parse_file ( String init_str, String file_str);
+ void parse_file ( String init_string, String file_string);
void set_version_check (bool ignore);
public:
Duration default_duration_;
- Scheme_hash_table *default_header_p_;
+ Scheme_hash_table *default_header_;
- int fatal_error_i_;
- Sources * source_l_;
- int error_level_i_;
+ int fatal_error_;
+ Sources * source_;
+ int error_level_;
- My_lily_lexer * lexer_p_;
+ My_lily_lexer * lexer_;
bool ignore_version_b_;
SCM last_beam_start_;
DECLARE_SCHEME_CALLBACK (paper_description, ());
private:
- Array<Input> define_spot_array_;
+ Array<Input> define_spots_;
- char const* here_ch_C () const;
+ char const* here_str0 () const;
- Simultaneous_music * get_chord (Pitch tonic, Array<Pitch>* add_arr_p,
- Array<Pitch>* sub_arr_p, Pitch* inversion_p,
- Pitch* bass_p, Duration d);
+ Simultaneous_music * get_chord (Pitch tonic, Array<Pitch>* adds,
+ Array<Pitch>* subs, Pitch* inversion,
+ Pitch* bass, Duration d);
void set_chord_tremolo (int type_i);
void set_last_duration (Duration const *);
static Drul_array< Link_array <Grob> > get_clash_groups (Grob *me);
DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis));
static void do_shifts (Grob*);
- static void add_column (Grob*me,Grob*ncol_l);
+ static void add_column (Grob*me,Grob*ncol);
static bool has_interface(Grob*);
};
#endif // COLLISION_HH
static bool rest_b (Grob*me);
static bool has_interface (Grob*);
- static Item *stem_l (Grob*);
+ static Item *get_stem (Grob*);
};
#endif // NOTE_COLUMN_HH
DECLARE_SCHEME_CALLBACK (brew_ez_molecule, (SCM ));
static bool has_interface (Grob*);
static Real stem_attachment_coordinate (Grob *, Axis a);
- static int balltype_i (Grob*) ;
+ static int get_balltype (Grob*) ;
};
#endif // NOTEHEAD_HH
VIRTUAL_COPY_CONS (Grob);
static bool has_interface (Grob*);
- int rank_i_;
+ int rank_;
virtual void do_break_processing ();
- virtual Paper_column *column_l () const;
+ virtual Paper_column *get_column () const;
virtual System *get_system () const;
/// if lines are broken then this column is in #line#
System *system_;
- static int rank_i (Grob*);
+ static int get_rank (Grob*);
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM));
DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM));
public:
SCM font_descriptions ()const;
virtual ~Paper_def ();
- static int score_count_i_;
+ static int score_count_;
/*
JUNKME
virtual int get_next_score_count () const;
static void reset_score_count ();
void output_settings (Paper_outputter*) const;
- Paper_outputter* paper_outputter_p () ;
+ Paper_outputter* get_paper_outputter () ;
Font_metric * find_font (SCM name, Real mag);
{
SCM main_smob_;
public:
- Paper_def *paper_l_;
+ Paper_def *paper_;
- Paper_outputter *outputter_l_;
+ Paper_outputter *outputter_;
System *system_;
Paper_score ();
void change_to (Music_iterator*, String, String);
int get_state (Moment m);
- Music_iterator * first_iter_p_;
- Music_iterator * second_iter_p_;
+ Music_iterator * first_iter_;
+ Music_iterator * second_iter_;
Moment first_until_;
Moment second_until_;
int state_;
VIRTUAL_COPY_CONS (Music);
Part_combine_music (SCM l);
- Music * first_l () const;
- Music * second_l () const;
+ Music * get_first () const;
+ Music * get_second () const;
virtual void transpose (Pitch);
virtual Music_iterator *try_music_in_children (Music *) const;
private:
- Music_iterator * child_iter_p_;
+ Music_iterator * child_iter_;
Moment finish_mom_;
};
void print () const;
void process ();
- Link_array<Audio_staff> audio_staff_l_arr_;
+ Link_array<Audio_staff> audio_staffs_;
Cons<Audio_element> *audio_elem_p_list_;
- Midi_def * midi_l_;
+ Midi_def * midi_;
};
#endif // PERFORMANCE_HH
virtual void do_announces ();
virtual void announce_element (Audio_element_info);
protected:
- Array<Audio_element_info> announce_info_arr_;
+ Array<Audio_element_info> announce_infos_;
void create_audio_elements ();
private:
public:
VIRTUAL_COPY_CONS (Translator);
friend class Performer_group_performer;
- Performer_group_performer* daddy_perf_l () const;
+ Performer_group_performer* get_daddy_perf () const;
protected:
virtual void announce_element (Audio_element_info);
virtual void acknowledge_audio_element (Audio_element_info);
virtual void create_audio_elements ();
- virtual int get_tempo_i () const;
- virtual void play_element (Audio_element * elem_p );
+ virtual int get_tempo () const;
+ virtual void play_element (Audio_element * elem );
};
*/
/// 0 is c, 6 is b
- int notename_i_;
+ int notename_;
/// 0 natural, 1 sharp, etc
- int alteration_i_;
+ int alteration_;
/// 0 is central c
- int octave_i_;
+ int octave_;
/*
mutators, so JUNKME.
*/
public:
- int octave_i () const;
- int notename_i () const;
- int alteration_i () const;
+ int get_octave () const;
+ int get_notename () const;
+ int get_alteration () const;
void normalise ();
/*
int steps () const;
/// return pitch from central c (in halfnotes)
int semitone_pitch () const;
- String str () const;
+ String string () const;
*/
class Request_chord_iterator : public Simple_music_iterator
{
- Request_chord * elt_l () const;
+ Request_chord * get_elt () const;
/**
Find a bottom notation context to deliver requests to.
*/
- virtual Translator_group* get_req_translator_l ();
+ virtual Translator_group* get_req_translator ();
/*
*/
class Span_req : public virtual Request {
public:
- String get_span_type_str () const;
- void set_span_type_str (String);
+ String get_span_type_string () const;
+ void set_span_type_string (String);
void set_span_dir (Direction d);
Direction get_span_dir () const;
public:
static int duration_log (Grob*);
static void set_dots (Grob*,Item *);
- static Item * stem_l (Grob*) ;
- static Item * dots_l (Grob*) ;
+ static Item * get_stem (Grob*) ;
+ static Item * get_dots (Grob*) ;
static int dot_count (Grob*) ;
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM ));
static bool has_interface (Grob*);
struct Rod
{
Drul_array <Item*> item_l_drul_;
- Real distance_f_;
+ Real distance_;
/**
translate the rod so as to refer to Paper_columns
virtual int count () const;
protected:
virtual Box get_char (int)const;
- Font_metric *orig_l_;
- Real magnification_f_;
+ Font_metric *orig_;
+ Real magnification_;
Scaled_font_metric (Font_metric*,Real);
};
public Engraver_group_engraver, public Global_translator
{
System *system_;
- int breaks_i_;
+ int breaks_;
- Link_array<Grob> elem_p_arr_;
+ Link_array<Grob> elems_;
- Paper_column* command_column_l_;
- Paper_column* musical_column_l_;
+ Paper_column* command_column_;
+ Paper_column* musical_column_;
void make_columns ();
void set_columns (Paper_column*,Paper_column*);
void typeset_all ();
public:
TRANSLATOR_DECLARATIONS(Score_engraver);
- Paper_score * pscore_p_;
+ Paper_score * pscore_;
void forbid_breaks ();
- virtual Music_output *get_output_p ();
+ virtual Music_output *get_output ();
protected:
virtual void prepare (Moment);
virtual void finish ();
virtual void one_time_step ();
- virtual int depth_i () const { return Global_translator::depth_i ();}
+ virtual int get_depth () const { return Global_translator::get_depth ();}
protected:
/* Engraver_group_engraver interface */
virtual void initialize ();
virtual void finalize ();
virtual void announce_grob (Grob_info);
- virtual void typeset_grob (Grob*elem_p);
+ virtual void typeset_grob (Grob*elem);
virtual void stop_translation_timestep ();
};
public:
TRANSLATOR_DECLARATIONS(Score_performer);
~Score_performer ();
- Performance *performance_p_;
+ Performance *performance_;
protected:
virtual void finish ();
virtual void start ();
virtual void initialize ();
virtual void announce_element (Audio_element_info);
- virtual int get_tempo_i () const;
+ virtual int get_tempo () const;
virtual void play_element (Audio_element* p);
- virtual Music_output *get_output_p ();
+ virtual Music_output *get_output ();
private:
void header (Midi_stream&);
- Audio_column* audio_column_l_;
+ Audio_column* audio_column_;
};
#endif // SCORE_PERFORMER_HH
class Score: public Input {
public:
/// paper_, staves_ and commands_ form the problem definition.
- Link_array<Music_output_def> def_p_arr_;
+ Link_array<Music_output_def> defs_;
SCM music_;
- Scheme_hash_table * header_p_;
+ Scheme_hash_table * header_;
- int errorlevel_i_;
+ int errorlevel_;
/// construction
Score ();
void process ();
- void add_output (Music_output_def *def_p);
+ void add_output (Music_output_def *def);
DECLARE_SMOBS (Score,foo);
private:
void run_translator (Music_output_def*);
protected:
Moment here_mom_;
- Music_iterator * iter_p_;
+ Music_iterator * iter_;
Protected_scm list_;
SCM cursor_;
struct Spring_description
{
- Real ideal_f_;
- Real hooke_f_;
+ Real ideal_;
+ Real hooke_;
bool active_b_;
- Real block_force_f_;
+ Real block_force_;
Real length (Real force) const;
Spring_description ();
Array<Spring_description> springs_;
Link_array<Grob> spaced_cols_;
Link_array<Grob> loose_cols_;
- Real force_f_;
- Real indent_f_;
- Real line_len_f_;
- Real default_space_f_;
+ Real force_;
+ Real indent_;
+ Real line_len_;
+ Real default_space_;
int active_count_;
bool compression_penalty_b_;
/// make a new context for every child.
bool separate_contexts_b_;
- int cursor_i_;
+ int cursor_;
virtual void construct_children ();
virtual Moment pending_moment () const;
void minimise_enclosed_area (Real beauty, SCM props);
Real fit_factor () const;
void blow_fit ();
- Real enclosed_area_f () const;
+ Real get_enclosed_area () const;
private:
- Array<Real> area_x_gradients_array (Real area);
+ Array<Real> area_x_gradientses (Real area);
};
#endif /* SLUR_BEZIER_BOW_HH */
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
static void set_interface (Grob*);
static bool has_interface (Grob*);
- static Array<Offset> get_encompass_offset_arr (Grob *me);
+ static Array<Offset> get_encompass_offsets (Grob *me);
static Bezier get_curve (Grob *me);
static Direction get_default_dir (Grob *me);
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
public:
DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
- Link_array<Spanner> broken_into_l_arr_;
+ Link_array<Spanner> broken_intos_;
// todo: move to somewhere else.
Real get_broken_left_end_align () const;
struct Spring_smob
{
Grob *other_;
- Real distance_f_;
+ Real distance_;
bool expand_only_b_;
- Real strength_f_;
+ Real strength_;
DECLARE_SIMPLE_SMOBS(Spring_smob,dummy);
public:
struct Spring{
Drul_array<Item*> item_l_drul_;
- Real distance_f_;
+ Real distance_;
bool expand_only_b_;
/*
TODO: make 2 strengths: one for stretching, and one for shrinking.
*/
- Real strength_f_;
+ Real strength_;
void add_to_cols ();
void set_to_cols ();
Spring ();
*/
static Real staff_space (Grob*);
- static Grob * staff_symbol_l (Grob*);
+ static Grob * get_staff_symbol (Grob*);
static bool on_staffline (Grob*);
static bool on_staffline (Grob*,int);
static int line_count (Grob*);
- static Real position_f (Grob*);
+ static Real get_position (Grob*);
static Real staff_radius (Grob*);
};
{
public:
static Real staff_space (Grob*) ;
- static int steps_i (Grob*) ;
+ static int get_steps (Grob*) ;
static int line_count (Grob*);
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
static bool has_interface (Grob*);
static Array<int> note_head_positions (Grob*);
static int duration_log (Grob*) ;
static void set_beaming (Grob*,int, Direction d);
- static Grob * beam_l (Grob*);
+ static Grob * get_beam (Grob*);
static Grob * first_head (Grob*) ;
static Grob * last_head (Grob*) ;
static Drul_array<Grob*> extremal_heads (Grob*);
class System : public Spanner
{
public:
- int rank_i_;
+ int rank_;
void post_processing (bool);
System (SCM);
static bool has_interface (Grob*);
Link_array<Item> broken_col_range (Item const*, Item const*) const;
- Link_array<Grob> column_l_arr () const;
+ Link_array<Grob> columns () const;
void add_column (Paper_column*);
void typeset_grob (Grob*);
class Tex_font_metric_reader
{
private:
- Real get_U32_fix_f ();
- Real get_U32_fix_scaled_f ();
- String get_bcpl_str ();
+ Real get_U32_fix ();
+ Real get_U32_fix_scaled ();
+ String get_bcpl_string ();
void read_header ();
void read_params ();
void read_char_metrics ();
Tex_font_char_metric read_char_metric (Char_code code);
Tex_font_char_metric read_char ();
- void read_lig_kern_program (Array<Tfm_ligature>* ligature_arr_p, Array <Tfm_kern>* kern_arr_p);
+ void read_lig_kern_program (Array<Tfm_ligature>* ligatures, Array <Tfm_kern>* kerns);
Binary_source_file input_;
Char_code code_;
Real width_, height_, depth_, italic_correction_;
Fix width_fix_, height_fix_, depth_fix_, italic_correction_fix_;
- Array<Tfm_kern> kern_arr_;
- Array<Tfm_ligature> ligature_arr_;
+ Array<Tfm_kern> kerns_;
+ Array<Tfm_ligature> ligatures_;
- String str () const;
+ String string () const;
Tex_font_char_metric ();
Box dimensions () const;
virtual Box get_char (int) const;
Tex_font_char_metric const *find_ascii (int ascii, bool warn=true) const;
- String str () const;
+ String string () const;
class Tie
{
public:
- static void set_head (Grob*,Direction, Item*head_l);
+ static void set_head (Grob*,Direction, Item*head);
static void set_interface (Grob*);
static bool has_interface (Grob*);
static Grob * head (Grob*,Direction) ;
- static Real position_f (Grob*) ;
+ static Real get_position (Grob*) ;
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
static Direction get_default_dir (Grob*) ;
static SCM get_control_points (SCM);
#ifndef TRANSLATOR_CHANGE_HH
#define TRANSLATOR_CHANGE_HH
-/** Change the nesting of the current translation. Uses the type_str_
- and id_str_ differently.
+/** Change the nesting of the current translation. Uses the type_string_
+ and id_string_ differently.
*/
class Translator_change : public Music
{
void add_push_property (SCM,SCM,SCM);
void add_pop_property (SCM,SCM);
void add_property_assign (SCM, SCM);
- Link_array<Translator_def> path_to_acceptable_translator (SCM type_str, Music_output_def* odef) const;
+ Link_array<Translator_def> path_to_acceptable_translator (SCM type_string, Music_output_def* odef) const;
Translator_group * instantiate (Music_output_def*);
SCM to_alist () const;
void internal_set_property (SCM var_sym, SCM value);
Translator_group *where_defined (SCM name_sym) const;
- String id_str_;
+ String id_string_;
VIRTUAL_COPY_CONS (Translator);
Translator_group (Translator_group const &);
Translator_group ();
- void add_fresh_group_translator (Translator *trans_p);
- void add_used_group_translator (Translator *trans_p);
+ void add_fresh_group_translator (Translator *trans);
+ void add_used_group_translator (Translator *trans);
/// Score_register = 0, Staff_registers = 1, etc)
- Translator_group* ancestor_l (int l=1);
- int depth_i () const;
+ Translator_group* get_ancestor (int l=1);
+ int get_depth () const;
bool is_bottom_translator_b () const;
bool removable_b () const;
- void terminate_translator (Translator*r_l);
- Translator *remove_translator_p (Translator*trans_l);
+ void terminate_translator (Translator*r);
+ Translator *remove_translator (Translator*trans);
void check_removal ();
// Translator *get_simple_translator (String) const;
- Translator_group *find_existing_translator_l (String n, String id);
- Translator_group *find_create_translator_l (String n, String id);
+ Translator_group *find_existing_translator (String n, String id);
+ Translator_group *find_create_translator (String n, String id);
Link_array<Translator_group> path_to_acceptable_translator (String alias, Music_output_def*) const;
Translator_group*get_default_interpreter ();
bool try_music_on_nongroup_children (Music *m);
virtual void do_announces ();
- virtual bool try_music (Music* req_l);
+ virtual bool try_music (Music* req);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
virtual void initialize ();
{
void init ();
public:
- Music_output_def * output_def_l_;
- String type_str_;
+ Music_output_def * output_def_;
+ String type_string_;
bool is_alias_b (String) const;
Translator (Translator const &);
- Translator_group * daddy_trans_l_ ;
+ Translator_group * daddy_trans_ ;
void removal_processing ();
/**
ask daddy for a feature
*/
- Music_output_def *output_def_l () const;
+ Music_output_def *get_output_def () const;
SCM internal_get_property (SCM symbol) const;
true: request swallowed. Don't try to put the request elsewhere.
*/
- virtual bool try_music (Music *req_l);
+ virtual bool try_music (Music *req);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
virtual void do_announces () ;
T *t = new T;\
T::static_description_ = t->static_translator_description ();\
scm_permanent_object (T::static_description_);\
- t->type_str_ = classname (t);\
+ t->type_string_ = classname (t);\
add_translator (t);\
}\
SCM T::translator_description() const\
-extern Dictionary<Translator*> *global_translator_dict_p;
-void add_translator (Translator*trans_p);
+extern Dictionary<Translator*> *global_translator_dict;
+void add_translator (Translator*trans);
-Translator*get_translator_l (String s);
+Translator*get_translator (String s);
DECLARE_UNSMOB(Translator,translator);
#endif // TRANSLATOR_HH
class Type_swallow_translator : public virtual Translator
{
protected:
- String swallow_str_;
+ String swallow_string_;
bool try_music (Music*);
public:
VIRTUAL_COPY_CONS (Translator);
TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator); \
}; \
TYPE ## _swallow_translator :: TYPE ## _swallow_translator() {\
- swallow_str_ = #TYPE; \
+ swallow_string_ = #TYPE; \
} \
ENTER_DESCRIPTION(TYPE ## _swallow_translator, \
"Swallow requests of " #TYPE " type.", \
static int
print_smob (SCM s, SCM port, scm_print_state *)
{
- String str = "#<location " + unsmob_input (s)->location_str () + ">";
- scm_puts (str.ch_C (), port);
+ String str = "#<location " + unsmob_input (s)->location_string () + ">";
+ scm_puts (str.to_str0 (), port);
return 1;
}
We don't use IMPLEMENT_TYPE_P, since the smobification part is
implemented separately from the class.
*/
-LY_DEFINE(ly_input_p, "ly-input-location?", 1, 0, 0,
+LY_DEFINE(ly_input, "ly-input-location?", 1, 0, 0,
(SCM x),
"Return whether @var{x} is an input location")
{
Input *ip = unsmob_input(sip);
SCM_ASSERT_TYPE(ip, sip, SCM_ARG1, __FUNCTION__, "input location");
- SCM_ASSERT_TYPE(gh_string_p(msg), msg, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE(gh_string_p (msg), msg, SCM_ARG2, __FUNCTION__, "string");
String m = ly_scm2string (msg);
void
Instrument_name_engraver::initialize ()
{
- daddy_trans_l_->set_property ("instrumentSupport", SCM_EOL);
+ daddy_trans_->set_property ("instrumentSupport", SCM_EOL);
}
void
void
Instrument_name_engraver::acknowledge_grob (Grob_info i)
{
- if (Bar_line::has_interface (i.grob_l_))
+ if (Bar_line::has_interface (i.grob_))
{
SCM s = get_property ("instrument");
s = get_property ("instr");
/*
- FIXME: use markup_p () to check type.
+ FIXME: use get_markup () to check type.
*/
if (gh_string_p (s) || gh_pair_p (s))
create_text (s);
}
- if (dynamic_cast<Spanner*> (i.grob_l_)
- && i.grob_l_->internal_has_interface (ly_symbol2scm ("dynamic-interface")))
+ if (dynamic_cast<Spanner*> (i.grob_)
+ && i.grob_->internal_has_interface (ly_symbol2scm ("dynamic-interface")))
return;
/*
without staffs as well.
*/
- if (dynamic_cast<Spanner*> (i.grob_l_)
- && ((Axis_group_interface::has_interface (i.grob_l_)
- && Axis_group_interface::axis_b (i.grob_l_, Y_AXIS)))
- && !Align_interface::has_interface (i.grob_l_))
+ if (dynamic_cast<Spanner*> (i.grob_)
+ && ((Axis_group_interface::has_interface (i.grob_)
+ && Axis_group_interface::axis_b (i.grob_, Y_AXIS)))
+ && !Align_interface::has_interface (i.grob_))
{
- SCM nl = gh_cons (i.grob_l_->self_scm (),
+ SCM nl = gh_cons (i.grob_->self_scm (),
get_property ("instrumentSupport"));
- daddy_trans_l_->set_property ("instrumentSupport", nl);
+ daddy_trans_->set_property ("instrumentSupport", nl);
}
}
Interpretation_context_handle::Interpretation_context_handle ()
{
- report_to_l_ =0;
+ report_to_ =0;
}
Interpretation_context_handle::Interpretation_context_handle (Interpretation_context_handle const&s)
{
- report_to_l_ =0;
- if (s.report_to_l_)
- up (s.report_to_l_);
+ report_to_ =0;
+ if (s.report_to_)
+ up (s.report_to_);
}
Interpretation_context_handle*
Interpretation_context_handle::clone () const
{
Interpretation_context_handle* handle = new Interpretation_context_handle;
- handle->report_to_l_ = this->report_to_l_;
+ handle->report_to_ = this->report_to_;
return handle;
}
Interpretation_context_handle::~Interpretation_context_handle ()
{
- if (report_to_l_)
+ if (report_to_)
down ();
}
void
Interpretation_context_handle::up (Translator_group*t)
{
- report_to_l_ = t;
+ report_to_ = t;
t->iterator_count_ ++;
}
void
Interpretation_context_handle::down ()
{
- report_to_l_->iterator_count_ --;
- report_to_l_ = 0;
+ report_to_->iterator_count_ --;
+ report_to_ = 0;
}
bool
Interpretation_context_handle::try_music (Music *m)
{
- return report_to_l_->try_music (m);
+ return report_to_->try_music (m);
}
void
Interpretation_context_handle::operator = (Interpretation_context_handle const &s)
{
- set_translator (s.report_to_l_);
+ set_translator (s.report_to_);
}
void
Interpretation_context_handle::set_translator (Translator_group*trans)
{
- if (report_to_l_ ==trans)
+ if (report_to_ ==trans)
return;
- if (report_to_l_)
+ if (report_to_)
down ();
if (trans)
up (trans);
}
Translator_group*
-Interpretation_context_handle::report_to_l ()const
+Interpretation_context_handle::report_to ()const
{
- return report_to_l_;
+ return report_to_;
}
bool
Item::breakable_b (Grob*me)
{
- if (me->original_l_)
+ if (me->original_)
return false;
if (!dynamic_cast<Item*> (me))
}
Paper_column *
-Item::column_l () const
+Item::get_column () const
{
Item *parent = dynamic_cast<Item*> (get_parent (X_AXIS));
- return parent ? parent->column_l () : 0;
+ return parent ? parent->get_column () : 0;
}
System *
do
{
Grob * dolly = clone ();
- Item * item_p = dynamic_cast<Item*> (dolly);
- pscore_l_->system_->typeset_grob (item_p);
- new_copies[i] =item_p;
+ Item * item = dynamic_cast<Item*> (dolly);
+ pscore_->system_->typeset_grob (item);
+ new_copies[i] =item;
}
while (flip (&i) != LEFT);
broken_to_drul_= new_copies;
Direction
Item::break_status_dir () const
{
- if (original_l_)
+ if (original_)
{
- Item * i = dynamic_cast<Item*> (original_l_);
+ Item * i = dynamic_cast<Item*> (original_);
return (i->broken_to_drul_[LEFT] == this) ? LEFT : RIGHT;
}
{
void create_key (bool);
void read_req (Key_change_req const * r);
- Key_change_req * keyreq_l_;
- Item * item_p_;
+ Key_change_req * keyreq_;
+ Item * item_;
public:
TRANSLATOR_DECLARATIONS(Key_engraver);
protected:
virtual void initialize ();
virtual void finalize ();
- virtual bool try_music (Music *req_l);
+ virtual bool try_music (Music *req);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
virtual void process_music ();
Key_engraver::Key_engraver ()
{
- keyreq_l_ = 0;
- item_p_ = 0;
+ keyreq_ = 0;
+ item_ = 0;
}
void
Key_engraver::create_key (bool def)
{
- if (!item_p_)
+ if (!item_)
{
- item_p_ = new Item (get_property ("KeySignature"));
+ item_ = new Item (get_property ("KeySignature"));
- item_p_->set_grob_property ("c0-position",
+ item_->set_grob_property ("c0-position",
get_property ("centralCPosition"));
// todo: put this in basic props.
- item_p_->set_grob_property ("old-accidentals", get_property ("lastKeySignature"));
- item_p_->set_grob_property ("new-accidentals", get_property ("keySignature"));
+ item_->set_grob_property ("old-accidentals", get_property ("lastKeySignature"));
+ item_->set_grob_property ("new-accidentals", get_property ("keySignature"));
- announce_grob(item_p_, keyreq_l_ ? keyreq_l_->self_scm() : SCM_EOL);
+ announce_grob(item_, keyreq_ ? keyreq_->self_scm() : SCM_EOL);
}
if (!def)
{
SCM vis = get_property ("explicitKeySignatureVisibility");
if (gh_procedure_p (vis))
- item_p_->set_grob_property ("break-visibility",vis);
+ item_->set_grob_property ("break-visibility",vis);
}
}
bool
-Key_engraver::try_music (Music * req_l)
+Key_engraver::try_music (Music * req)
{
- if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l))
+ if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req))
{
- if (keyreq_l_ && !keyreq_l_->equal_b (kc))
+ if (keyreq_ && !keyreq_->equal_b (kc))
{
kc->origin ()->warning (_ ("Conflicting key signatures found."));
- keyreq_l_->origin ()->warning (_ ("This was the other key definition."));
+ keyreq_->origin ()->warning (_ ("This was the other key definition."));
return false;
}
- if (!keyreq_l_)
+ if (!keyreq_)
{
/*
do this only once, just to be on the safe side.
*/
- keyreq_l_ = kc;
- read_req (keyreq_l_);
+ keyreq_ = kc;
+ read_req (keyreq_);
}
return true;
void
Key_engraver::acknowledge_grob (Grob_info info)
{
- if (Clef::has_interface (info.grob_l_))
+ if (Clef::has_interface (info.grob_))
{
SCM c = get_property ("createKeyOnClefChange");
if (to_boolean (c))
create_key (false);
}
}
- else if (Bar_line::has_interface (info.grob_l_)
+ else if (Bar_line::has_interface (info.grob_)
&& gh_pair_p (get_property ("keySignature")))
{
create_key (true);
void
Key_engraver::process_music ()
{
- if (keyreq_l_ ||
+ if (keyreq_ ||
get_property ("lastKeySignature") != get_property ("keySignature"))
create_key (false);
}
void
Key_engraver::stop_translation_timestep ()
{
- if (item_p_)
+ if (item_)
{
- typeset_grob (item_p_);
- item_p_ = 0;
+ typeset_grob (item_);
+ item_ = 0;
}
}
accs = gh_cons (ly_car (s), accs);
#if 0
- daddy_trans_l_->set_property ("lastKeySignature",
+ daddy_trans_->set_property ("lastKeySignature",
get_property ("keySignature"));
#endif
- daddy_trans_l_->set_property ("keySignature", accs);
+ daddy_trans_->set_property ("keySignature", accs);
}
void
Key_engraver::start_translation_timestep ()
{
- keyreq_l_ = 0;
- daddy_trans_l_->set_property ("lastKeySignature", get_property ("keySignature"));
+ keyreq_ = 0;
+ daddy_trans_->set_property ("lastKeySignature", get_property ("keySignature"));
}
void
Key_engraver::initialize ()
{
- daddy_trans_l_->set_property ("keySignature", SCM_EOL);
- daddy_trans_l_->set_property ("lastKeySignature", SCM_EOL);
+ daddy_trans_->set_property ("keySignature", SCM_EOL);
+ daddy_trans_->set_property ("lastKeySignature", SCM_EOL);
}
~Key_performer ();
protected:
- virtual bool try_music (Music* req_l);
+ virtual bool try_music (Music* req);
virtual void create_audio_elements ();
virtual void stop_translation_timestep ();
private:
- Key_change_req* key_req_l_;
- Audio_key* audio_p_;
+ Key_change_req* key_req_;
+ Audio_key* audio_;
};
Key_performer::Key_performer ()
{
- key_req_l_ = 0;
- audio_p_ = 0;
+ key_req_ = 0;
+ audio_ = 0;
}
Key_performer::~Key_performer ()
void
Key_performer::create_audio_elements ()
{
- if (key_req_l_)
+ if (key_req_)
{
- SCM pitchlist = key_req_l_->get_mus_property ("pitch-alist");
+ SCM pitchlist = key_req_->get_mus_property ("pitch-alist");
SCM proc = scm_primitive_eval (ly_symbol2scm ("accidentals-in-key"));
SCM acc = gh_call1 (proc, pitchlist);
proc = scm_primitive_eval (ly_symbol2scm ("major-key"));
-gh_scm2int (ly_cdar (pitchlist)));
my_do.transpose (to_c);
- to_c.alteration_i_ -= my_do.alteration_i_;
+ to_c.alteration_ -= my_do.alteration_;
Key_change_req *key = new Key_change_req;
key->set_mus_property ("pitch-alist", scm_list_copy (pitchlist));
SCM c_pitchlist = key->get_mus_property ("pitch-alist");
SCM major = gh_call1 (proc, c_pitchlist);
- audio_p_ = new Audio_key (gh_scm2int (acc), major == SCM_BOOL_T);
- Audio_element_info info (audio_p_, key_req_l_);
+ audio_ = new Audio_key (gh_scm2int (acc), major == SCM_BOOL_T);
+ Audio_element_info info (audio_, key_req_);
announce_element (info);
- key_req_l_ = 0;
+ key_req_ = 0;
}
}
void
Key_performer::stop_translation_timestep ()
{
- if (audio_p_)
+ if (audio_)
{
- play_element (audio_p_);
- audio_p_ = 0;
+ play_element (audio_);
+ audio_ = 0;
}
}
bool
-Key_performer::try_music (Music* req_l)
+Key_performer::try_music (Music* req)
{
- if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l))
+ if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req))
{
- if (key_req_l_)
+ if (key_req_)
warning (_ ("FIXME: key change merge"));
- key_req_l_ = kc;
+ key_req_ = kc;
return true;
}
int pos = alteration_pos (what, alter, c0p);
Molecule m = Font_interface::get_default_font (me)->
- find_by_name (String ("accidentals-") + style + to_str (alter));
+ find_by_name (String ("accidentals-") + style + to_string (alter));
m.translate_axis (pos * inter, Y_AXIS);
mol.add_at_edge (X_AXIS, LEFT, m, 0);
}
{
String p = global_path.find (String (name) + ".tfm");
- if (p.length_i ())
+ if (p.length ())
return p;
#if (KPATHSEA && HAVE_KPSE_FIND_FILE)
yylval.string = new String
#define yylval \
- (*(YYSTYPE*)lexval_l)
+ (*(YYSTYPE*)lexval)
#define YY_USER_ACTION add_lexed_char (YYLeng ());
/*
}
<version>\"[^"]*\" { /* got the version number */
String s (YYText ()+1);
- s = s.left_str (s.index_last_i ('"'));
+ s = s.left_string (s.index_last ('"'));
yy_pop_state ();
if (!valid_version_b (s))
yy_pop_state ();
}
<<EOF>> {
- LexerError (_ ("EOF found inside a comment").ch_C ());
+ LexerError (_ ("EOF found inside a comment").to_str0 ());
if (! close_input ())
yyterminate (); // can't move this, since it actually rets a YY_NULL
}
}
<incl>\"[^"]*\";? { /* got the include file name */
String s (YYText ()+1);
- s = s.left_str (s.index_last_i ('"'));
+ s = s.left_string (s.index_last ('"'));
- new_input (s,source_global_l);
+ new_input (s,source_global);
yy_pop_state ();
}
<incl>\\{BLACK}*;?{WHITE} { /* got the include identifier */
String s = YYText () + 1;
strip_trailing_white (s);
- if (s.length_i () && (s[s.length_i () - 1] == ';'))
- s = s.left_str (s.length_i () - 1);
+ if (s.length () && (s[s.length () - 1] == ';'))
+ s = s.left_string (s.length () - 1);
SCM sid = lookup_identifier (s);
if (gh_string_p (sid)) {
- new_input (ly_scm2string (sid), source_global_l);
+ new_input (ly_scm2string (sid), source_global);
yy_pop_state ();
} else {
String msg (_f ("wrong or undefined identifier: `%s'", s ));
- LexerError (msg.ch_C ());
+ LexerError (msg.to_str0 ());
SCM err = scm_current_error_port ();
scm_puts ("This value was found in the table: ", err);
scm_display (sid, err);
}
<INITIAL,chords,lyrics,notes,figures>\\\${BLACK}*{WHITE} {
String s=YYText () + 2;
- s=s.left_str (s.length_i () - 1);
+ s=s.left_string (s.length () - 1);
return scan_escaped_word (s);
}
<INITIAL,chords,lyrics,notes,figures>\${BLACK}*{WHITE} {
String s=YYText () + 1;
- s=s.left_str (s.length_i () - 1);
+ s=s.left_string (s.length () - 1);
return scan_bare_word (s);
}
<INITIAL,chords,lyrics,notes,figures>\\\${BLACK}* { // backup rule
<INITIAL,chords,lyrics,notes,figures># { //embedded scm
//char const* s = YYText () + 1;
- char const* s = here_ch_C ();
+ char const* s = here_str0 ();
int n = 0;
if (main_input_b_ && safe_global_b) {
error (_ ("Can't evaluate Scheme in safe mode"));
}
{DIGIT} {
- yylval.i = String_convert::dec2_i (String (YYText ()));
+ yylval.i = String_convert::dec2int (String (YYText ()));
return DIGIT;
}
{UNSIGNED} {
- yylval.i = String_convert::dec2_i (String (YYText ()));
+ yylval.i = String_convert::dec2int (String (YYText ()));
return UNSIGNED;
}
}
<quote>{
\\{ESCAPED} {
- *yylval.string += to_str (escaped_char (YYText ()[1]));
+ *yylval.string += to_string (escaped_char (YYText ()[1]));
}
[^\\"]+ {
*yylval.string += YYText ();
/* yylval is union. Must remember STRING before setting SCM*/
String *sp = yylval.string;
- yylval.scm = ly_str02scm (sp->ch_C ());
+ yylval.scm = ly_str02scm (sp->to_str0 ());
delete sp;
return STRING;
}
return FRACTION;
}
{UNSIGNED} {
- yylval.i = String_convert::dec2_i (String (YYText ()));
+ yylval.i = String_convert::dec2int (String (YYText ()));
return UNSIGNED;
}
{NOTECOMMAND} {
return yylval.i = HYPHEN;
s = lyric_fudge (s);
- char c = s[s.length_i () - 1];
+ char c = s[s.length () - 1];
if (c == '{' || c == '}') // brace open is for not confusing dumb tools.
here_input ().warning (
_ ("Brace found at end of lyric. Did you forget a space?"));
- yylval.scm = ly_str02scm (s.ch_C ());
+ yylval.scm = ly_str02scm (s.to_str0 ());
return STRING;
return FRACTION;
}
{UNSIGNED} {
- yylval.i = String_convert::dec2_i (String (YYText ()));
+ yylval.i = String_convert::dec2int (String (YYText ()));
return UNSIGNED;
}
\" {
}
{UNSIGNED} {
- yylval.i = String_convert::dec2_i (String (YYText ()));
+ yylval.i = String_convert::dec2int (String (YYText ()));
return UNSIGNED;
}
<*>. {
String msg = _f ("invalid character: `%c'", YYText ()[0]);
- LexerError (msg.ch_C ());
+ LexerError (msg.to_str0 ());
return YYText ()[0];
}
{
// use more SCM for this.
- SCM sym = ly_symbol2scm (str.ch_C ());
+ SCM sym = ly_symbol2scm (str.to_str0 ());
int l = lookup_keyword (str);
if (l != -1) {
}
}
String msg (_f ("unknown escaped string: `\\%s'", str));
- LexerError (msg.ch_C ());
+ LexerError (msg.to_str0 ());
- yylval.scm = ly_str02scm (str.ch_C ());
+ yylval.scm = ly_str02scm (str.to_str0 ());
return STRING;
}
int
My_lily_lexer::scan_bare_word (String str)
{
- SCM sym = ly_symbol2scm (str.ch_C ());
+ SCM sym = ly_symbol2scm (str.to_str0 ());
if ((YYSTATE == notes) || (YYSTATE == chords)) {
SCM pitch = scm_hashq_get_handle (pitchname_tab_, sym);
if (gh_pair_p (pitch)) {
}
}
- yylval.scm = ly_str02scm (str.ch_C ());
+ yylval.scm = ly_str02scm (str.to_str0 ());
return STRING;
}
strip_leading_white (String&s)
{
int i=0;
- for (; i < s.length_i (); i++)
+ for (; i < s.length (); i++)
if (!isspace (s[i]))
break;
- s = s.nomid_str (0, i);
+ s = s.nomid_string (0, i);
}
void
strip_trailing_white (String&s)
{
- int i=s.length_i ();
+ int i=s.length ();
while (i--)
if (!isspace (s[i]))
break;
- s = s.left_str (i+1);
+ s = s.left_string (i+1);
}
Lilypond_version ver (s);
if (! ((ver >= oldest_version) && (ver <= current)))
{
- non_fatal_error (_f ("incorrect lilypond version: %s (%s, %s)", ver.str (), oldest_version.str (), current.str ()));
+ non_fatal_error (_f ("incorrect lilypond version: %s (%s, %s)", ver.string (), oldest_version.string (), current.string ()));
non_fatal_error (_ ("Consider converting the input with the convert-ly script"));
return false;
}
String
lyric_fudge (String s)
{
- char * chars =s.copy_ch_p ();
+ char * chars =s.get_copy_str0 ();
for (char * p = chars; *p ; p++)
{
delete[] chars;
int i =0;
- if ((i=s.index_i ("\\,")) != -1) // change "\," to TeX's "\c "
+ if ((i=s.index ("\\,")) != -1) // change "\," to TeX's "\c "
{
- * (s.ch_l () + i + 1) = 'c';
- s = s.left_str (i+2) + " " + s.right_str (s.length_i ()-i-2);
+ * (s.get_str0 () + i + 1) = 'c';
+ s = s.left_string (i+2) + " " + s.right_string (s.length ()-i-2);
}
return s;
SCM
scan_fraction (String frac)
{
- int i = frac.index_i ('/');
- int l = frac.length_i ();
- String left = frac.left_str (i);
- String right = frac.right_str (l - i - 1);
+ int i = frac.index ('/');
+ int l = frac.length ();
+ String left = frac.left_string (i);
+ String right = frac.right_string (l - i - 1);
- int n = String_convert::dec2_i (left);
- int d = String_convert::dec2_i (right);
+ int n = String_convert::dec2int (left);
+ int d = String_convert::dec2int (right);
return gh_cons (gh_int2scm (n), gh_int2scm (d));
}
{
Grob *me = unsmob_grob (smob);
Spanner *spanner = dynamic_cast<Spanner*> (me);
- Real blotdiameter = me->paper_l ()->get_var ("blotdiameter");
+ Real blotdiameter = me->get_paper ()->get_var ("blotdiameter");
Real staff_space = Staff_symbol_referencer::staff_space (me);
- Real thickness = me->paper_l ()->get_var ("linethickness");
+ Real thickness = me->get_paper ()->get_var ("linethickness");
SCM grob_thickness = me->get_grob_property ("thickness");
if (gh_number_p (grob_thickness))
thickness *= gh_scm2double (grob_thickness);
{
Molecule right_edge =
brew_edge (RIGHT, thickness, edge_width, edge_height, blotdiameter);
- Grob *staff_symbol = Staff_symbol_referencer::staff_symbol_l (me);
+ Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (me);
Grob *right_common_bound_x =
right_bound->common_refpoint (staff_symbol, X_AXIS);
*/
Ligature_engraver::Ligature_engraver ()
{
- ligature_p_ = 0;
- finished_ligature_p_ = 0;
+ ligature_ = 0;
+ finished_ligature_ = 0;
reqs_drul_[LEFT] = reqs_drul_[RIGHT] = 0;
prev_start_req_ = 0;
last_bound = 0;
{
reqs_drul_[START] = 0;
reqs_drul_[STOP] = 0;
- if (ligature_p_)
- ligature_p_->suicide ();
- ligature_p_ = 0;
+ if (ligature_)
+ ligature_->suicide ();
+ ligature_ = 0;
}
else if (scm_equal_p (req_->get_mus_property ("span-type"),
ly_str02scm ("ligature")) == SCM_BOOL_T)
{
if (reqs_drul_[STOP])
{
- if (!ligature_p_)
+ if (!ligature_)
reqs_drul_[STOP]->origin ()->warning (_ ("can't find start of ligature"));
else
{
}
else
{
- ligature_p_->set_bound (RIGHT, last_bound);
+ ligature_->set_bound (RIGHT, last_bound);
}
}
prev_start_req_ = 0;
- finished_ligature_p_ = ligature_p_;
- ligature_p_ = 0;
+ finished_ligature_ = ligature_;
+ ligature_ = 0;
}
last_bound = unsmob_grob (get_property ("currentMusicalColumn"));
- if (ligature_p_)
+ if (ligature_)
{
// TODO: maybe forbid breaks only if not transcribing
top_engraver ()->forbid_breaks ();
}
if (reqs_drul_[START])
{
- if (ligature_p_)
+ if (ligature_)
{
reqs_drul_[START]->origin ()->warning (_ ("already have a ligature"));
return;
}
prev_start_req_ = reqs_drul_[START];
- ligature_p_ = create_ligature_spanner ();
+ ligature_ = create_ligature_spanner ();
brew_ligature_primitive_proc =
- ligature_p_->get_grob_property ("ligature-primitive-callback");
+ ligature_->get_grob_property ("ligature-primitive-callback");
if (brew_ligature_primitive_proc == SCM_EOL)
{
warning ("Ligature_engraver: ligature-primitive-callback undefined");
}
else
{
- ligature_p_->set_bound (LEFT, bound);
+ ligature_->set_bound (LEFT, bound);
}
ligature_start_mom_ = now_mom ();
- announce_grob(ligature_p_, reqs_drul_[START]->self_scm());
+ announce_grob(ligature_, reqs_drul_[START]->self_scm());
}
}
void
Ligature_engraver::try_stop_ligature ()
{
- if (finished_ligature_p_)
+ if (finished_ligature_)
{
- typeset_grob (finished_ligature_p_);
- finished_ligature_p_ = 0;
+ typeset_grob (finished_ligature_);
+ finished_ligature_ = 0;
}
}
Ligature_engraver::finalize ()
{
try_stop_ligature ();
- if (ligature_p_)
+ if (ligature_)
{
prev_start_req_->origin ()->warning (_ ("unterminated ligature"));
- ligature_p_->suicide ();
+ ligature_->suicide ();
}
}
void
Ligature_engraver::acknowledge_grob (Grob_info info)
{
- if (ligature_p_)
+ if (ligature_)
{
- if (Ligature_head::has_interface (info.grob_l_))
+ if (Ligature_head::has_interface (info.grob_))
{
- info.grob_l_->set_grob_property ("ligature-primitive-callback",
+ info.grob_->set_grob_property ("ligature-primitive-callback",
brew_ligature_primitive_proc);
}
- else if (Rest::has_interface (info.grob_l_))
+ else if (Rest::has_interface (info.grob_))
{
info.music_cause ()->origin ()->warning (_ ("ligature may not contain rest; ignoring rest"));
prev_start_req_->origin ()->warning (_ ("ligature was started here"));
{
String e = _f ("can't find file: `%s'", fn);
e += " ";
- e += _f ("(load path: `%s')", global_path.str ());
+ e += _f ("(load path: `%s')", global_path.string ());
error (e);
}
else if (verbose_global_b)
Simple_file_storage f (s);
- String result (f.ch_C ());
+ String result (f.to_str0 ());
if (verbose_global_b)
progress_indication ("]");
return result;
")
{
- return ly_str02scm (gulp_file_to_string (ly_scm2string (name)).ch_C ());
+ return ly_str02scm (gulp_file_to_string (ly_scm2string (name)).to_str0 ());
}
void
read_lily_scm_file (String fn)
{
- gh_eval_str ((char *) gulp_file_to_string (fn).ch_C ());
+ gh_eval_str ((char *) gulp_file_to_string (fn).to_str0 ());
}
extern "C" {
return SCM_BOOL_T;
}
-LY_DEFINE(ly_isdir_p, "dir?", 1,0, 0, (SCM s),
+LY_DEFINE(ly_isdir, "dir?", 1,0, 0, (SCM s),
"type predicate. A direction is a -1, 0 or 1, where -1 represents left or
down and 1 represents right or up.
")
print_scm_val (SCM val)
{
String realval = ly_scm2string (ly_write2scm (val));
- if (realval.length_i () > 200)
- realval = realval.left_str (100) + "\n :\n :\n" + realval.right_str (100);
+ if (realval.length () > 200)
+ realval = realval.left_string (100) + "\n :\n :\n" + realval.right_string (100);
return realval;
}
return ok;
- SCM type_p = SCM_EOL;
+ SCM type = SCM_EOL;
if (gh_symbol_p (sym))
- type_p = scm_object_property (sym, type_symbol);
+ type = scm_object_property (sym, type_symbol);
- if (type_p != SCM_EOL && !gh_procedure_p (type_p))
+ if (type != SCM_EOL && !gh_procedure_p (type))
{
warning (_f ("Can't find property type-check for `%s' (%s). Perhaps you made a typing error? Doing assignment anyway.",
- ly_symbol2string (sym).ch_C (),
- ly_symbol2string (type_symbol).ch_C ()
+ ly_symbol2string (sym).to_str0 (),
+ ly_symbol2string (type_symbol).to_str0 ()
));
}
else
{
if (val != SCM_EOL
- && gh_procedure_p (type_p)
- && gh_call1 (type_p, val) == SCM_BOOL_F)
+ && gh_procedure_p (type)
+ && gh_call1 (type, val) == SCM_BOOL_F)
{
SCM errport = scm_current_error_port ();
ok = false;
SCM typefunc = scm_primitive_eval (ly_symbol2scm ("type-name"));
- SCM type_name = gh_call1 (typefunc, type_p);
+ SCM type_name = gh_call1 (typefunc, type);
scm_puts (_f ("Type check for `%s' failed; value `%s' must be of type `%s'",
- ly_symbol2string (sym).ch_C (),
+ ly_symbol2string (sym).to_str0 (),
print_scm_val (val),
- ly_scm2string (type_name).ch_C ()).ch_C (),
+ ly_scm2string (type_name).to_str0 ()).to_str0 (),
errport);
scm_puts ("\n", errport);
}
#include "lily-version.hh"
String
-version_str ()
+version_string ()
{
String str = MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL;
String mpl ("." MY_PATCH_LEVEL);
}
String
-gnu_lilypond_str ()
+gnu_lilypond_string ()
{
String str = "GNU LilyPond";
return str;
}
String
-gnu_lilypond_version_str ()
+gnu_lilypond_version_string ()
{
- String str = gnu_lilypond_str () + " " + version_str ();
+ String str = gnu_lilypond_string () + " " + version_string ();
return str;
}
Lilypond_version::Lilypond_version (int major, int minor, int patch)
{
- major_i_ = major;
- minor_i_ = minor;
- patch_i_ = patch;
+ major_ = major;
+ minor_ = minor;
+ patch_ = patch;
}
Lilypond_version::Lilypond_version (String str)
{
Array<String> version;
- version = String_convert::split_arr (str, '.');
+ version = String_convert::split (str, '.');
- major_i_ = version[0].value_i ();
- minor_i_ = version[1].value_i ();
- patch_i_ = 0;
+ major_ = version[0].to_int ();
+ minor_ = version[1].to_int ();
+ patch_ = 0;
if (version.size () >= 3)
- patch_i_ = version[2].value_i ();
+ patch_ = version[2].to_int ();
if (version.size () >= 4)
- extra_patch_str_ = version[3];
+ extra_patch_string_ = version[3];
}
String
-Lilypond_version::str () const
+Lilypond_version::string () const
{
- return to_str (major_i_) + "." + to_str (minor_i_) + "." + to_str (patch_i_);
+ return to_string (major_) + "." + to_string (minor_) + "." + to_string (patch_);
}
Lilypond_version::operator int () const
{
// ugh
- return 100000 * major_i_ + 1000 * minor_i_ + patch_i_;
+ return 100000 * major_ + 1000 * minor_ + patch_;
}
if (!bound->break_status_dir ())
{
Grob *common[] = {
- bound->common_refpoint (Staff_symbol_referencer::staff_symbol_l (me),
+ bound->common_refpoint (Staff_symbol_referencer::get_staff_symbol (me),
X_AXIS),
- bound->common_refpoint (Staff_symbol_referencer::staff_symbol_l (me),
+ bound->common_refpoint (Staff_symbol_referencer::get_staff_symbol (me),
Y_AXIS)
};
the unbroken line-spanner would have had.
From slur */
Offset o;
- if (Spanner *mother = dynamic_cast<Spanner*> (me->original_l_))
+ if (Spanner *mother = dynamic_cast<Spanner*> (me->original_))
{
- for (int i = dir == LEFT ? 0 : mother->broken_into_l_arr_.size () - 1;
- dir == LEFT ? i < mother->broken_into_l_arr_.size () : i > 0;
+ for (int i = dir == LEFT ? 0 : mother->broken_intos_.size () - 1;
+ dir == LEFT ? i < mother->broken_intos_.size () : i > 0;
dir == LEFT ? i++ : i--)
{
- if (mother->broken_into_l_arr_[i - dir] == me)
+ if (mother->broken_intos_[i - dir] == me)
{
- Grob *neighbour = mother->broken_into_l_arr_[i];
+ Grob *neighbour = mother->broken_intos_[i];
Offset neighbour_o = get_broken_offset (neighbour, dir);
Offset me_o = get_broken_offset (me, -dir);
// Hmm, why not return me_o[X], but recalc in brew_mol?
}
- Real thick = me->paper_l ()->get_var ("linethickness");
+ Real thick = me->get_paper ()->get_var ("linethickness");
SCM s = me->get_grob_property ("thickness");
if (gh_number_p (s))
{
Molecule r = fm->find_by_name ("accordion-accDiscant");
m.add_molecule (r);
- if (reg.left_str (1) == "F")
+ if (reg.left_string (1) == "F")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
int eflag = 0x00;
- if (reg.left_str (3) == "EEE")
+ if (reg.left_string (3) == "EEE")
{
eflag = 0x07;
- reg = reg.right_str (reg.length_i ()-3);
+ reg = reg.right_string (reg.length ()-3);
}
- else if (reg.left_str (2) == "EE")
+ else if (reg.left_string (2) == "EE")
{
eflag = 0x05;
- reg = reg.right_str (reg.length_i ()-2);
+ reg = reg.right_string (reg.length ()-2);
}
- else if (reg.left_str (2) == "Eh")
+ else if (reg.left_string (2) == "Eh")
{
eflag = 0x04;
- reg = reg.right_str (reg.length_i ()-2);
+ reg = reg.right_string (reg.length ()-2);
}
- else if (reg.left_str (1) == "E")
+ else if (reg.left_string (1) == "E")
{
eflag = 0x02;
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
if (eflag & 0x02)
{
d.translate_axis (-0.8 * staff_space PT, X_AXIS);
m.add_molecule (d);
}
- if (reg.left_str (2) == "SS")
+ if (reg.left_string (2) == "SS")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (0.5 * staff_space PT, Y_AXIS);
m.add_molecule (d);
d.translate_axis (-0.8 * staff_space PT, X_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-2);
+ reg = reg.right_string (reg.length ()-2);
}
- if (reg.left_str (1) == "S")
+ if (reg.left_string (1) == "S")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (0.5 * staff_space PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
}
else if (sym == "Freebase")
{
Molecule r = fm->find_by_name ("accordion-accFreebase");
m.add_molecule (r);
- if (reg.left_str (1) == "F")
+ if (reg.left_string (1) == "F")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
if (reg == "E")
{
{
Molecule r = fm->find_by_name ("accordion-accBayanbase");
m.add_molecule (r);
- if (reg.left_str (1) == "T")
+ if (reg.left_string (1) == "T")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
/* include 4' reed just for completeness. You don't want to use this. */
- if (reg.left_str (1) == "F")
+ if (reg.left_string (1) == "F")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
- if (reg.left_str (2) == "EE")
+ if (reg.left_string (2) == "EE")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
m.add_molecule (d);
d.translate_axis (-0.8 * staff_space PT, X_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-2);
+ reg = reg.right_string (reg.length ()-2);
}
- if (reg.left_str (1) == "E")
+ if (reg.left_string (1) == "E")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
}
else if (sym == "Stdbase")
{
Molecule r = fm->find_by_name ("accordion-accStdbase");
m.add_molecule (r);
- if (reg.left_str (1) == "T")
+ if (reg.left_string (1) == "T")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 3.5 PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
- if (reg.left_str (1) == "F")
+ if (reg.left_string (1) == "F")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
- if (reg.left_str (1) == "M")
+ if (reg.left_string (1) == "M")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 2 PT, Y_AXIS);
d.translate_axis (staff_space PT, X_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
- if (reg.left_str (1) == "E")
+ if (reg.left_string (1) == "E")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
- if (reg.left_str (1) == "S")
+ if (reg.left_string (1) == "S")
{
Molecule d = fm->find_by_name ("accordion-accDot");
d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
m.add_molecule (d);
- reg = reg.right_str (reg.length_i ()-1);
+ reg = reg.right_string (reg.length ()-1);
}
}
/* ugh maybe try to use regular font for S.B. and B.B and only use one font
SCM_ASSERT_TYPE(ly_axis_p (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
SCM_ASSERT_TYPE(ly_number_pair_p (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ;
SCM_ASSERT_TYPE(gh_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
- SCM_ASSERT_TYPE(gh_number_p(p), a, SCM_ARG4, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE(gh_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
return Lookup::bracket ((Axis)gh_scm2int (a), ly_scm2interval (iv),
melisma_start_req->set_span_dir (START);
melisma_stop_req->set_span_dir (STOP);
- music_iter_p_ =0;
- lyric_iter_p_ =0;
+ music_iter_ =0;
+ lyric_iter_ =0;
}
Moment
Lyric_combine_music_iterator::pending_moment () const
{
- Moment musnext = music_iter_p_->pending_moment ();
+ Moment musnext = music_iter_->pending_moment ();
return musnext;
}
bool
Lyric_combine_music_iterator::ok () const
{
- return music_iter_p_->ok ();
+ return music_iter_->ok ();
}
void
Lyric_combine_music_iterator::construct_children ()
{
- Lyric_combine_music const * m = dynamic_cast<Lyric_combine_music const*> (music_l ());
+ Lyric_combine_music const * m = dynamic_cast<Lyric_combine_music const*> (get_music ());
- music_iter_p_ = get_iterator_p (m->music_l ());
- lyric_iter_p_ = get_iterator_p (m->lyrics_l ());
+ music_iter_ = get_iterator (m->get_music ());
+ lyric_iter_ = get_iterator (m->get_lyrics ());
}
bool
if (try_music (busy_req))
return true;
- Translator_group * tr = music_iter_p_->report_to_l ();
+ Translator_group * tr = music_iter_->report_to ();
SCM grobs = tr->get_property ("busyGrobs");
Moment now = tr->now_mom();
void
Lyric_combine_music_iterator::process (Moment m)
{
- Moment my_next = music_iter_p_->pending_moment ();
+ Moment my_next = music_iter_->pending_moment ();
if (my_next > m)
return;
- music_iter_p_->process (m);
+ music_iter_->process (m);
if ( get_busy_status ())
{
bool melisma_b = try_music (melisma_playing_req);
if (!melisma_b)
{
- if (lyric_iter_p_->ok ())
+ if (lyric_iter_->ok ())
{
// FIXME
#if 0 // devise a new way for this
if (melisma_b && !melisma_started_b_)
- lyric_iter_p_->try_music (melisma_start_req);
+ lyric_iter_->try_music (melisma_start_req);
else if (melisma_started_b_)
- lyric_iter_p_->try_music (melisma_stop_req);
+ lyric_iter_->try_music (melisma_stop_req);
#endif
- Moment m= lyric_iter_p_->pending_moment ();
- lyric_iter_p_->process (m);
+ Moment m= lyric_iter_->pending_moment ();
+ lyric_iter_->process (m);
}
}
}
Lyric_combine_music_iterator::~Lyric_combine_music_iterator ()
{
- delete lyric_iter_p_;
- delete music_iter_p_;
+ delete lyric_iter_;
+ delete music_iter_;
}
Lyric_combine_music_iterator::Lyric_combine_music_iterator (Lyric_combine_music_iterator const & src)
: Music_iterator (src)
{
- lyric_iter_p_ = src.lyric_iter_p_ ? src.lyric_iter_p_->clone () : 0;
- music_iter_p_ = src.music_iter_p_ ? src.music_iter_p_->clone () : 0;
+ lyric_iter_ = src.lyric_iter_ ? src.lyric_iter_->clone () : 0;
+ music_iter_ = src.music_iter_ ? src.music_iter_->clone () : 0;
}
Music_iterator*
Lyric_combine_music_iterator::try_music_in_children (Music *m) const
{
- Music_iterator * i = music_iter_p_->try_music (m);
+ Music_iterator * i = music_iter_->try_music (m);
if (i)
return i;
else
- return lyric_iter_p_->try_music (m);
+ return lyric_iter_->try_music (m);
}
void
Lyric_combine_music::transpose (Pitch p)
{
- music_l ()->transpose (p);
- lyrics_l () ->transpose (p);
+ get_music ()->transpose (p);
+ get_lyrics () ->transpose (p);
}
Moment
Lyric_combine_music::length_mom () const
{
- return music_l ()->length_mom ();
+ return get_music ()->length_mom ();
}
Pitch
Lyric_combine_music::to_relative_octave (Pitch p)
{
- p = music_l ()->to_relative_octave (p);
- return lyrics_l () ->to_relative_octave (p);
+ p = get_music ()->to_relative_octave (p);
+ return get_lyrics () ->to_relative_octave (p);
}
void
Lyric_combine_music::compress (Moment m)
{
- music_l ()->compress (m);
+ get_music ()->compress (m);
}
Music*
-Lyric_combine_music::music_l () const
+Lyric_combine_music::get_music () const
{
SCM l = get_mus_property ("elements");
if (!gh_pair_p (l))
Music*
-Lyric_combine_music::lyrics_l () const
+Lyric_combine_music::get_lyrics () const
{
SCM l = get_mus_property ("elements");
if (!gh_pair_p (l))
public:
TRANSLATOR_DECLARATIONS(Lyric_engraver);
private:
- Lyric_req * req_l_;
- Item* text_p_;
+ Lyric_req * req_;
+ Item* text_;
};
Lyric_engraver::Lyric_engraver ()
{
- text_p_ =0;
- req_l_ =0;
+ text_ =0;
+ req_ =0;
}
bool
{
if (Lyric_req* l = dynamic_cast <Lyric_req *> (r))
{
- if (req_l_)
+ if (req_)
return false;
- req_l_ =l;
+ req_ =l;
return true;
}
return false;
void
Lyric_engraver::process_acknowledged_grobs ()
{
- if (req_l_)
+ if (req_)
{
- text_p_= new Item (get_property ("LyricText"));
+ text_= new Item (get_property ("LyricText"));
- text_p_->set_grob_property ("text", req_l_->get_mus_property ("text"));
+ text_->set_grob_property ("text", req_->get_mus_property ("text"));
/*
We can't reach the notehead where we're centered from here. So
(UGH UGH, pulled amount of space out of thin air)
*/
- text_p_->translate_axis (0.66, X_AXIS);
+ text_->translate_axis (0.66, X_AXIS);
- announce_grob(text_p_, req_l_->self_scm());
- req_l_ = 0;
+ announce_grob(text_, req_->self_scm());
+ req_ = 0;
}
}
void
Lyric_engraver::stop_translation_timestep ()
{
- if (text_p_)
+ if (text_)
{
- typeset_grob (text_p_);
- text_p_ =0;
+ typeset_grob (text_);
+ text_ =0;
}
}
void
Lyric_engraver::start_translation_timestep ()
{
- req_l_ =0;
+ req_ =0;
}
Real leftext = l->extent (l, X_AXIS).length ();
- Real sl = sp->paper_l ()->get_var ("linethickness");
+ Real sl = sp->get_paper ()->get_var ("linethickness");
Real righttrim = 0.5; // default to half a space gap on the right
TRANSLATOR_DECLARATIONS(Lyric_performer);
protected:
- virtual bool try_music (Music* req_l);
+ virtual bool try_music (Music* req);
virtual void stop_translation_timestep ();
virtual void create_audio_elements ();
private:
- Link_array<Lyric_req> lreq_arr_;
- Audio_text* audio_p_;
+ Link_array<Lyric_req> lreqs_;
+ Audio_text* audio_;
};
Lyric_performer::Lyric_performer ()
{
- audio_p_ = 0;
+ audio_ = 0;
}
Lyric_performer::create_audio_elements ()
{
// FIXME: won't work with fancy lyrics
- if (lreq_arr_.size ()
- && gh_string_p (lreq_arr_[0]->get_mus_property ("text"))
- && ly_scm2string (lreq_arr_[0]->get_mus_property ("text")).length_i ())
+ if (lreqs_.size ()
+ && gh_string_p (lreqs_[0]->get_mus_property ("text"))
+ && ly_scm2string (lreqs_[0]->get_mus_property ("text")).length ())
{
- audio_p_ = new Audio_text (Audio_text::LYRIC,
- ly_scm2string (lreq_arr_[0]->get_mus_property ("text")));
- Audio_element_info info (audio_p_, lreq_arr_[0]);
+ audio_ = new Audio_text (Audio_text::LYRIC,
+ ly_scm2string (lreqs_[0]->get_mus_property ("text")));
+ Audio_element_info info (audio_, lreqs_[0]);
announce_element (info);
}
- lreq_arr_.clear ();
+ lreqs_.clear ();
}
void
Lyric_performer::stop_translation_timestep ()
{
- if (audio_p_)
+ if (audio_)
{
- play_element (audio_p_);
- audio_p_ = 0;
+ play_element (audio_);
+ audio_ = 0;
}
- lreq_arr_.clear ();
+ lreqs_.clear ();
}
bool
-Lyric_performer::try_music (Music* req_l)
+Lyric_performer::try_music (Music* req)
{
- if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req_l))
+ if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req))
{
- lreq_arr_.push (lr);
+ lreqs_.push (lr);
return true;
}
return false;
Lyric_phrasing_engraver::Lyric_phrasing_engraver ()
{
voice_alist_ = SCM_EOL;
- any_notehead_l_ = 0;
+ any_notehead_ = 0;
}
Lyric_phrasing_engraver::~Lyric_phrasing_engraver ()
Syllable_group *
Lyric_phrasing_engraver::lookup_context_id (const String &context_id)
{
- SCM key = ly_str02scm (context_id.ch_C ());
+ SCM key = ly_str02scm (context_id.to_str0 ());
if (! gh_null_p (voice_alist_))
{
SCM s = scm_assoc (key, voice_alist_);
{
Syllable_group * v = lookup_context_id (context_id);
v->set_notehead (notehead);
- if (!any_notehead_l_)
- any_notehead_l_ = notehead;
+ if (!any_notehead_)
+ any_notehead_ = notehead;
}
void
void
Lyric_phrasing_engraver::record_extender (const String &context_id, Grob * extender)
{
- SCM key = ly_str02scm (context_id.ch_C ());
+ SCM key = ly_str02scm (context_id.to_str0 ());
if (! gh_null_p (voice_alist_))
{
SCM s = scm_assoc (key, voice_alist_);
return;
- Grob *h = i.grob_l_;
+ Grob *h = i.grob_;
if (Note_head::has_interface (h))
{
/* caught a note head ... do something with it */
/* what's its Voice context name? */
- String voice_context_id = get_context_id (i.origin_trans_l_->daddy_trans_l_, "Voice");
+ String voice_context_id = get_context_id (i.origin_trans_->daddy_trans_, "Voice");
record_notehead (voice_context_id, h);
/* is it in a melisma ? */
- if (to_boolean (i.origin_trans_l_->get_property ("melismaEngraverBusy")))
+ if (to_boolean (i.origin_trans_->get_property ("melismaEngraverBusy")))
{
record_melisma (voice_context_id);
}
/* what's its LyricsVoice context name? */
String voice_context_id;
- SCM voice_context_scm = i.origin_trans_l_->get_property ("associatedVoice");
+ SCM voice_context_scm = i.origin_trans_->get_property ("associatedVoice");
if (gh_string_p (voice_context_scm))
{
voice_context_id = ly_scm2string (voice_context_scm);
}
else {
- voice_context_id = get_context_id (i.origin_trans_l_->daddy_trans_l_, "LyricsVoice");
+ voice_context_id = get_context_id (i.origin_trans_->daddy_trans_, "LyricsVoice");
voice_context_id = trim_suffix (voice_context_id);
}
record_lyric (voice_context_id, h);
*/
if (h->internal_has_interface (ly_symbol2scm ("lyric-extender-interface")))
{
- String voice_context_id = get_context_id (i.origin_trans_l_->daddy_trans_l_, "LyricsVoice");
+ String voice_context_id = get_context_id (i.origin_trans_->daddy_trans_, "LyricsVoice");
record_extender (trim_suffix (voice_context_id), h);
return;
}
String
get_context_id (Translator_group * ancestor, const char *type)
{
- while (ancestor != 0 && ancestor->type_str_ != type)
+ while (ancestor != 0 && ancestor->type_string_ != type)
{
- ancestor = ancestor->daddy_trans_l_;
+ ancestor = ancestor->daddy_trans_;
}
if (ancestor != 0)
{
- return ancestor->id_str_;
+ return ancestor->id_string_;
}
return "";
String
trim_suffix (String &id)
{
- int index = id.index_i ('-');
+ int index = id.index ('-');
if (index >= 0)
{
- return id.left_str (index);
+ return id.left_string (index);
}
return id;
}
/*
TODO: give context for warning.
*/
- if (! entry->set_lyric_align (punc.ch_C (), any_notehead_l_))
+ if (! entry->set_lyric_align (punc.to_str0 (), any_notehead_))
warning (_ ("lyrics found without any matching notehead"));
// is this note melismatic? If so adjust alignment of previous one.
}
entry->next_lyric ();
}
- any_notehead_l_ = 0;
+ any_notehead_ = 0;
}
*/
-All_font_metrics *all_fonts_global_p;
+All_font_metrics *all_fonts_global;
int exit_status_global;
File_path global_path;
void
identify (FILE *out)
{
- fputs (gnu_lilypond_version_str ().ch_C (), out);
+ fputs (gnu_lilypond_version_string ().to_str0 (), out);
}
void
{
std::cout << "\n";
/* No version number or newline here. It confuses help2man. */
- std::cout << _f ("Usage: %s [OPTION]... FILE...", "lilypond").ch_C ();
+ std::cout << _f ("Usage: %s [OPTION]... FILE...", "lilypond").to_str0 ();
std::cout << "\n\n";
- std::cout << _ ("Typeset music and or play MIDI from FILE").ch_C ();
+ std::cout << _ ("Typeset music and or play MIDI from FILE").to_str0 ();
std::cout << "\n\n";
std::cout <<
_ (
"LilyPond is a music typesetter. It produces beautiful sheet music\n"
"using a high level description file as input. LilyPond is part of \n"
"the GNU Project.\n"
-).ch_C ();
+).to_str0 ();
std::cout << '\n';
- std::cout << _ ("Options:").ch_C ();
+ std::cout << _ ("Options:").to_str0 ();
std::cout << '\n';
- std::cout << Long_option_init::table_str (options_static).ch_C ();
+ std::cout << Long_option_init::table_string (options_static).to_str0 ();
std::cout << '\n';
std::cout << std::endl;
- std::cout << _f ("Report bugs to %s", "bug-lilypond@gnu.org").ch_C () << std::endl;
+ std::cout << _f ("Report bugs to %s", "bug-lilypond@gnu.org").to_str0 () << std::endl;
}
void
"This is free software. It is covered by the GNU General Public License,\n"
"and you are welcome to change it and/or distribute copies of it under\n"
"certain conditions. Invoke as `%s --warranty' for more information.\n",
- "lilypond").ch_C ();
+ "lilypond").to_str0 ();
std::cout << std::endl;
- std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C ();
+ std::cout << _f ("Copyright (c) %s by", "1996--2002").to_str0 ();
std::cout << '\n';
std::cout << " Han-Wen Nienhuys <hanwen@cs.uu.nl>\n";
std::cout << " Jan Nieuwenhuizen <janneke@gnu.org>\n";
notice ()
{
std::cout << '\n';
- std::cout << _ ("GNU LilyPond -- The music typesetter").ch_C ();
+ std::cout << _ ("GNU LilyPond -- The music typesetter").to_str0 ();
std::cout << '\n';
- std::cout << _f ("Copyright (c) %s by", "1996--2002").ch_C ();
+ std::cout << _f ("Copyright (c) %s by", "1996--2002").to_str0 ();
std::cout << '\n';
std::cout << " Han-Wen Nienhuys <hanwen@cs.uu.nl>\n";
std::cout << " Jan Nieuwenhuizen <janneke@gnu.org>\n";
" You should have received a copy (refer to the file COPYING) of the\n"
"GNU General Public License along with this program; if not, write to\n"
"the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,\n"
- "USA.\n").ch_C ();
+ "USA.\n").to_str0 ();
}
if (!String (prefix_directory[0]).empty_b ())
{
lily_locale_dir = String (prefix_directory[0]) + "/share/locale";
- bindtextdomain (name.ch_C (), lily_locale_dir.ch_C ());
+ bindtextdomain (name.to_str0 (), lily_locale_dir.to_str0 ());
}
else
- bindtextdomain (name.ch_C (), LOCALEDIR);
- textdomain (name.ch_C ());
+ bindtextdomain (name.to_str0 (), LOCALEDIR);
+ textdomain (name.to_str0 ());
#endif
global_path.add ("");
/ sizeof (*prefix_directory); i++)
for (char **s = suffixes; *s; s++)
{
- String p = prefix_directory[i] + to_str ('/') + String (*s);
+ String p = prefix_directory[i] + to_string ('/') + String (*s);
global_path.add (p);
#if !KPATHSEA
/* Urg: GNU make's $ (word) index starts at 1 */
int i = 1;
- while (global_path.try_add (p + to_str (".") + to_str (i)))
+ while (global_path.try_add (p + to_string (".") + to_string (i)))
i++;
#endif
}
if (*extensions[i] && !p.ext.empty_b ())
p.ext += ".";
p.ext += extensions[i];
- if (!global_path.find (p.str ()).empty_b ())
+ if (!global_path.find (p.string ()).empty_b ())
break;
}
/* Reshuffle extension */
- p = split_path (p.str ());
+ p = split_path (p.string ());
}
return p;
}
String s = "(set! %load-path (cons \""
+ dir
+ "\" %load-path))";
- scm_c_eval_string (s.ch_C ());
+ scm_c_eval_string (s.to_str0 ());
}
void
std::cout << std::endl;
call_constructors ();
- all_fonts_global_p = new All_font_metrics (global_path.str ());
+ all_fonts_global = new All_font_metrics (global_path.string ());
init_scheme_code_string += ")";
- gh_eval_str ((char *)init_scheme_code_string.ch_C ());
+ gh_eval_str ((char *)init_scheme_code_string.to_str0 ());
int p=0;
const char *arg = oparser_p_static->get_next_arg ();
/* By default, use base name of input file for output file name */
Path outpath = inpath;
- if (inpath.str () != "-")
+ if (inpath.string () != "-")
outpath.ext = format_to_ext (output_format_global);
/* By default, write output to cwd; do not copy directory part
/* Burp: output name communication goes through _global */
String save_output_name_global = output_name_global;
- output_name_global = outpath.str ();
- do_one_file (init, inpath.str ());
+ output_name_global = outpath.string ();
+ do_one_file (init, inpath.string ());
output_name_global = save_output_name_global;
p++;
sane_putenv (char const* key, char const* value, bool overwrite)
{
if (overwrite || !getenv (key))
- return putenv ((char*)((String (key) + "=" + value).ch_C ()));
+ return putenv ((char*)((String (key) + "=" + value).to_str0 ()));
return -1;
}
oparser_p_static = new Getopt_long (argc, argv, options_static);
while (Long_option_init const * opt = (*oparser_p_static) ())
{
- switch (opt->shortname_ch_)
+ switch (opt->shortname_char_)
{
case 'v':
version ();
break;
case 'o':
{
- String s = oparser_p_static->optional_argument_ch_C_;
+ String s = oparser_p_static->optional_argument_str0_;
Path p = split_path (s);
if (s != "-" && p.ext.empty_b ())
p.ext = format_to_ext (output_format_global);
- output_name_global = p.str ();
+ output_name_global = p.string ();
}
break;
case 'e':
init_scheme_code_string +=
- oparser_p_static->optional_argument_ch_C_;
+ oparser_p_static->optional_argument_str0_;
break;
case 'w':
notice ();
"This option is for developers only.\n";
exit (0);
}
- output_format_global = oparser_p_static->optional_argument_ch_C_;
+ output_format_global = oparser_p_static->optional_argument_str0_;
break;
case 'P':
- dependency_prefix_global = oparser_p_static->optional_argument_ch_C_;
+ dependency_prefix_global = oparser_p_static->optional_argument_str0_;
break;
case 'H':
- dump_header_fieldnames_global.push (oparser_p_static->optional_argument_ch_C_);
+ dump_header_fieldnames_global.push (oparser_p_static->optional_argument_str0_);
break;
case 'I':
- global_path.push (oparser_p_static->optional_argument_ch_C_);
+ global_path.push (oparser_p_static->optional_argument_str0_);
break;
case 'i':
- init_name_global = oparser_p_static->optional_argument_ch_C_;
+ init_name_global = oparser_p_static->optional_argument_str0_;
break;
case 'h':
help_b = true;
public:
TRANSLATOR_DECLARATIONS(Mark_engraver);
protected:
- Item* text_p_;
+ Item* text_;
protected:
virtual void stop_translation_timestep ();
virtual void acknowledge_grob (Grob_info);
void create_items (Request*);
- virtual bool try_music (Music *req_l);
+ virtual bool try_music (Music *req);
virtual void start_translation_timestep ();
virtual void process_music ();
private:
- Mark_req * mark_req_l_;
+ Mark_req * mark_req_;
};
Mark_engraver::Mark_engraver ()
{
- text_p_ =0;
- mark_req_l_ = 0;
+ text_ =0;
+ mark_req_ = 0;
}
void
Mark_engraver::acknowledge_grob (Grob_info inf)
{
- Grob * s = inf.grob_l_;
- if (text_p_ && Bar_line::has_interface (s))
+ Grob * s = inf.grob_;
+ if (text_ && Bar_line::has_interface (s))
{
/*
Ugh. Figure out how to do this right at beginning of line, (without
creating class Bar_script : public Item).
*/
- text_p_->set_parent (s, X_AXIS);
+ text_->set_parent (s, X_AXIS);
}
}
void
Mark_engraver::stop_translation_timestep ()
{
- if (text_p_)
+ if (text_)
{
- text_p_->set_grob_property ("side-support-elements" , get_property ("stavesFound"));
- typeset_grob (text_p_);
- text_p_ =0;
+ text_->set_grob_property ("side-support-elements" , get_property ("stavesFound"));
+ typeset_grob (text_);
+ text_ =0;
}
}
void
Mark_engraver::create_items (Request *rq)
{
- if (text_p_)
+ if (text_)
return;
SCM s = get_property ("RehearsalMark");
- text_p_ = new Item (s);
+ text_ = new Item (s);
- announce_grob(text_p_, rq->self_scm());
+ announce_grob(text_, rq->self_scm());
}
void
Mark_engraver::start_translation_timestep ()
{
- mark_req_l_ = 0;
+ mark_req_ = 0;
}
bool
-Mark_engraver::try_music (Music* r_l)
+Mark_engraver::try_music (Music* r)
{
- if (Mark_req *mr = dynamic_cast <Mark_req *> (r_l))
+ if (Mark_req *mr = dynamic_cast <Mark_req *> (r))
{
- if (mark_req_l_ && mr->equal_b (mark_req_l_))
+ if (mark_req_ && mr->equal_b (mark_req_))
return true;
- if (mark_req_l_)
+ if (mark_req_)
return false;
- mark_req_l_ = mr;
+ mark_req_ = mr;
return true;
}
return false;
void
Mark_engraver::process_music ()
{
- if (mark_req_l_)
+ if (mark_req_)
{
- create_items (mark_req_l_);
+ create_items (mark_req_);
String t;
automatic marks.
*/
- SCM m = mark_req_l_->get_mus_property ("label");
+ SCM m = mark_req_->get_mus_property ("label");
if (gh_pair_p (m)) // markup text
- text_p_->set_grob_property ("text",m);
+ text_->set_grob_property ("text",m);
else
{
if (!gh_string_p (m) && !gh_number_p (m))
if (gh_number_p (m))
{
int mark_count = gh_scm2int (m);
- t = to_str (mark_count);
+ t = to_string (mark_count);
mark_count ++;
m = gh_int2scm (mark_count);
}
{
t = ly_scm2string (m);
String next;
- if (t.length_i ())
+ if (t.length ())
{
char c = t[0];
c++;
- next = to_str (c);
+ next = to_string (c);
}
- m = ly_str02scm (next.ch_C ());
+ m = ly_str02scm (next.to_str0 ());
}
else
{
m = gh_int2scm (1);
}
- daddy_trans_l_->set_property ("rehearsalMark", m);
+ daddy_trans_->set_property ("rehearsalMark", m);
- text_p_->set_grob_property ("text",
- ly_str02scm (t.ch_C ()));
+ text_->set_grob_property ("text",
+ ly_str02scm (t.to_str0 ()));
String style = "mark-number";
- for (int i=0; i < t.length_i (); i++)
+ for (int i=0; i < t.length (); i++)
{
if (!isdigit (t[i]))
{
break;
}
}
- SCM st = ly_symbol2scm (style.ch_C ());
- text_p_->set_grob_property ("font-style", st);
+ SCM st = ly_symbol2scm (style.to_str0 ());
+ text_->set_grob_property ("font-style", st);
}
}
|| (to_boolean (tie))
|| (to_boolean (beam))) {
- daddy_trans_l_->set_property ("melismaEngraverBusy",SCM_BOOL_T);
+ daddy_trans_->set_property ("melismaEngraverBusy",SCM_BOOL_T);
return true;
}
}
- daddy_trans_l_->set_property ("melismaEngraverBusy",SCM_BOOL_F);
+ daddy_trans_->set_property ("melismaEngraverBusy",SCM_BOOL_F);
return false;
}
Melisma_engraver::Melisma_engraver()
* implemented, such as a Vaticana_ligature_engraver. There will be
* redundant code between these engravers and the
* Mensural_ligature_engraver. In particular these are functions
- * set_column_l_, fold_up_primitives, join_primitives, and
+ * set_column_, fold_up_primitives, join_primitives, and
* ackowledge_grob; further the code for handling accidentals. It is
* not appropriate to put these things into Ligature_engraver, since,
* for example, Ligature_bracket_engraver does not share any of this
*/
class Mensural_ligature_engraver : public Ligature_engraver
{
- Real distance_f_;
- Array<Grob_info> primitives_arr_;
+ Real distance_;
+ Array<Grob_info> primitives_;
protected:
virtual void acknowledge_grob (Grob_info);
void propagate_properties ();
void fold_up_primitives ();
void join_primitives ();
- void set_column_l (Item *item, Paper_column *new_col);
+ void get_set_column (Item *item, Paper_column *new_col);
};
Mensural_ligature_engraver::Mensural_ligature_engraver ()
{
- distance_f_ = 0;
+ distance_ = 0;
}
Spanner *
Mensural_ligature_engraver::create_ligature_spanner ()
{
- distance_f_ = 0;
+ distance_ = 0;
return new Spanner (get_property ("MensuralLigature"));
}
* TODO: move this function to class Item?
*/
void
-Mensural_ligature_engraver::set_column_l (Item *item, Paper_column *column)
+Mensural_ligature_engraver::get_set_column (Item *item, Paper_column *column)
{
Item *parent = dynamic_cast<Item*> (item->get_parent (X_AXIS));
if (!parent)
}
String name = parent->name ();
- if (!String::compare_i (name, "PaperColumn"))
+ if (!String::compare (name, "PaperColumn"))
{
// Change column not only for targeted item (NoteColumn), but
// also for all associated grobs (NoteSpacing, SeparationItem).
- Grob *sl = Staff_symbol_referencer::staff_symbol_l (item);
+ Grob *sl = Staff_symbol_referencer::get_staff_symbol (item);
for (SCM tail = parent->get_grob_property ("elements");
gh_pair_p (tail);
tail = ly_cdr (tail))
{
Item *sibling = unsmob_item (ly_car (tail));
if ((sibling) &&
- (Staff_symbol_referencer::staff_symbol_l (sibling) == sl))
+ (Staff_symbol_referencer::get_staff_symbol (sibling) == sl))
{
sibling->set_parent (column, X_AXIS);
}
}
else
{
- set_column_l (parent, column);
+ get_set_column (parent, column);
}
}
{
int output = transition_output[state][input];
Item *last_last_primitive = (i > 1) ?
- dynamic_cast<Item*> (primitives_arr_[i-2].grob_l_) : 0;
+ dynamic_cast<Item*> (primitives_[i-2].grob_) : 0;
Item *last_primitive = (i > 0) ?
- dynamic_cast<Item*> (primitives_arr_[i-1].grob_l_) : 0;
- Item *primitive = (i < primitives_arr_.size ()) ?
- dynamic_cast<Item*> (primitives_arr_[i].grob_l_) : 0;
+ dynamic_cast<Item*> (primitives_[i-1].grob_) : 0;
+ Item *primitive = (i < primitives_.size ()) ?
+ dynamic_cast<Item*> (primitives_[i].grob_) : 0;
switch (output)
{
case MLP_NONE:
void
Mensural_ligature_engraver::transform_heads ()
{
- if (primitives_arr_.size () < 2)
+ if (primitives_.size () < 2)
{
warning (_f ("ligature with less than 2 heads -> skipping"));
return;
int state = STATE_START;
Pitch last_pitch, pitch;
bool have_last_pitch = 0, have_pitch = 0;
- for (int i = 0; i < primitives_arr_.size (); i++) {
+ for (int i = 0; i < primitives_.size (); i++) {
last_pitch = pitch;
have_last_pitch = have_pitch;
- Grob_info info = primitives_arr_[i];
+ Grob_info info = primitives_[i];
int duration_log =
- Note_head::balltype_i (dynamic_cast<Item*> (info.grob_l_));
+ Note_head::get_balltype (dynamic_cast<Item*> (info.grob_));
Note_req *nr = dynamic_cast<Note_req*> (info.music_cause ());
if (!nr)
{
// TODO: if (state == STATE_ERROR) { ... }
}
- state = apply_transition (state, INPUT_AE, primitives_arr_.size ());
+ state = apply_transition (state, INPUT_AE, primitives_.size ());
// TODO: if (state == STATE_ERROR) { ... }
}
Mensural_ligature_engraver::propagate_properties ()
{
SCM thickness_scm =
- finished_ligature_p_->get_grob_property ("thickness");
+ finished_ligature_->get_grob_property ("thickness");
Real thickness = (thickness_scm != SCM_EOL) ?
gh_scm2double (thickness_scm) : 1.4;
- thickness *= finished_ligature_p_->paper_l ()->get_var ("linethickness");
+ thickness *= finished_ligature_->get_paper ()->get_var ("linethickness");
/*
* FIXME: Since character "noteheads--1mensural" is defined in
* parmesan font only, the right-hand expression in the
* following assignment evaluates to a width of 0.0, in case
- * font-family of finished_ligature_p_ is _not_ set to "ancient"
+ * font-family of finished_ligature_ is _not_ set to "ancient"
* (by default, it is; see grob properties of MensuralLigature
* in scm/grob-description.scm). This may arise severe problems
* in the future when switching between fonts (e.g. mensural
* versus neo-mensural).
*/
Real head_width =
- Font_interface::get_default_font (finished_ligature_p_)->
+ Font_interface::get_default_font (finished_ligature_)->
find_by_name ("noteheads--1mensural").extent (X_AXIS).length ();
if (head_width == 0.0)
{
}
SCM flexa_width_scm =
- finished_ligature_p_->get_grob_property ("flexa-width");
+ finished_ligature_->get_grob_property ("flexa-width");
Real flexa_width = (flexa_width_scm != SCM_EOL) ?
gh_scm2double (flexa_width_scm) : 2.0;
- flexa_width *= Staff_symbol_referencer::staff_space (finished_ligature_p_);
+ flexa_width *= Staff_symbol_referencer::staff_space (finished_ligature_);
Real half_flexa_width = 0.5 * (flexa_width + thickness);
- for (int i = 0; i < primitives_arr_.size (); i++)
+ for (int i = 0; i < primitives_.size (); i++)
{
- Item *primitive = dynamic_cast<Item*> (primitives_arr_[i].grob_l_);
+ Item *primitive = dynamic_cast<Item*> (primitives_[i].grob_);
int output = gh_scm2int (primitive->get_grob_property ("primitive"));
primitive->set_grob_property ("thickness",
gh_double2scm (thickness));
primitive->set_grob_property ("flexa-width",
gh_double2scm (flexa_width));
set_delta_pitch (primitive,
- primitives_arr_[i], primitives_arr_[i+1]);
+ primitives_[i], primitives_[i+1]);
break;
default:
programming_error (_f ("unexpected case fall-through"));
Mensural_ligature_engraver::fold_up_primitives ()
{
Item *first = 0;
- for (int i = 0; i < primitives_arr_.size (); i++)
+ for (int i = 0; i < primitives_.size (); i++)
{
- Item *current = dynamic_cast<Item*> (primitives_arr_[i].grob_l_);
+ Item *current = dynamic_cast<Item*> (primitives_[i].grob_);
if (i == 0)
{
first = current;
}
- set_column_l (current, first->column_l ());
+ get_set_column (current, first->get_column ());
if (i > 0)
{
#if 0
Rod r;
- r.distance_f_ = distance_f_;
+ r.distance_ = distance_;
r.item_l_drul_[LEFT] = first;
r.item_l_drul_[RIGHT] = current;
r.add_to_cols ();
#endif
- current->translate_axis (distance_f_, X_AXIS);
+ current->translate_axis (distance_, X_AXIS);
}
- distance_f_ +=
+ distance_ +=
gh_scm2double (current->get_grob_property ("head-width")) -
gh_scm2double (current->get_grob_property ("thickness"));
}
Mensural_ligature_engraver::join_primitives ()
{
Pitch last_pitch;
- for (int i = 0; i < primitives_arr_.size (); i++)
+ for (int i = 0; i < primitives_.size (); i++)
{
- Grob_info info = primitives_arr_[i];
+ Grob_info info = primitives_[i];
Note_req *nr = dynamic_cast<Note_req*> (info.music_cause ());
Pitch pitch = *unsmob_pitch (nr->get_mus_property ("pitch"));
if (i > 0)
{
- Item *primitive = dynamic_cast<Item*> (info.grob_l_);
+ Item *primitive = dynamic_cast<Item*> (info.grob_);
int output = gh_scm2int (primitive->get_grob_property ("primitive"));
if (output & MLP_ANY)
{
void
Mensural_ligature_engraver::try_stop_ligature ()
{
- if (finished_ligature_p_)
+ if (finished_ligature_)
{
transform_heads ();
propagate_properties ();
fold_up_primitives ();
join_primitives ();
- for (int i = 0; i < primitives_arr_.size (); i++)
+ for (int i = 0; i < primitives_.size (); i++)
{
- typeset_grob (primitives_arr_[i].grob_l_);
+ typeset_grob (primitives_[i].grob_);
}
- primitives_arr_.clear ();
- finished_ligature_p_ = 0;
+ primitives_.clear ();
+ finished_ligature_ = 0;
}
}
Mensural_ligature_engraver::acknowledge_grob (Grob_info info)
{
Ligature_engraver::acknowledge_grob (info);
- if (ligature_p_)
+ if (ligature_)
{
- if (Note_head::has_interface (info.grob_l_))
+ if (Note_head::has_interface (info.grob_))
{
- primitives_arr_.push (info);
+ primitives_.push (info);
}
}
}
else
{
programming_error (_f ("Mensural_ligature: thickness undefined on flexa %d; assuming 1.4", primitive));
- thickness = 1.4 * me->paper_l ()->get_var ("linethickness");
+ thickness = 1.4 * me->get_paper ()->get_var ("linethickness");
}
}
int join_left = gh_scm2int (join_left_scm);
if (!join_left)
programming_error (_f ("Menusral_ligature: (join_left == 0)"));
- Real blotdiameter = (me->paper_l ()->get_var ("blotdiameter"));
+ Real blotdiameter = (me->get_paper ()->get_var ("blotdiameter"));
Interval x_extent = Interval (0, thickness);
Interval y_extent = (join_left > 0) ?
Interval (-join_left * 0.5 * staff_space, 0) :
out.add_molecule (stem);
}
- int pos = (int)rint (Staff_symbol_referencer::position_f (me));
+ int pos = (int)rint (Staff_symbol_referencer::get_position (me));
add_ledger_lines(me, &out, pos, 0, ledger_take_space);
if (primitive & MLP_FLEXA)
{
}
int
-Midi_def::get_tempo_i (Moment one_beat_mom)
+Midi_def::get_tempo (Moment one_beat_mom)
{
SCM wis = ly_symbol2scm ("whole-in-seconds");
Moment *w = unsmob_moment (variable_tab_->get (wis));
}
-int Midi_def::score_count_i_=0;
+int Midi_def::score_count_=0;
int
Midi_def::get_next_score_count () const
{
- return score_count_i_++;
+ return score_count_++;
}
void
Midi_def::reset_score_count ()
{
- score_count_i_ = 0;
+ score_count_ = 0;
}
#include "killing-cons.tcc"
Midi_item*
-Midi_item::midi_p (Audio_item* a)
+Midi_item::get_midi (Audio_item* a)
{
if (Audio_key* i = dynamic_cast<Audio_key*> (a))
return new Midi_key (i);
else if (Audio_instrument* i = dynamic_cast<Audio_instrument*> (a))
- return i->str_.length_i () ? new Midi_instrument (i) : 0;
+ return i->str_.length () ? new Midi_instrument (i) : 0;
else if (Audio_note* i = dynamic_cast<Audio_note*> (a))
return new Midi_note (i);
else if (Audio_dynamic* i = dynamic_cast<Audio_dynamic*> (a))
else if (Audio_time_signature* i = dynamic_cast<Audio_time_signature*> (a))
return new Midi_time_signature (i);
else if (Audio_text* i = dynamic_cast<Audio_text*> (a))
- //return i->text_str_.length_i () ? new Midi_text (i) : 0;
+ //return i->text_string_.length () ? new Midi_text (i) : 0;
return new Midi_text (i);
else
assert (0);
}
void
-Midi_chunk::set (String header_str, String data_str, String footer_str)
+Midi_chunk::set (String header_string, String data_string, String footer_string)
{
- data_str_ = data_str;
- footer_str_ = footer_str;
- header_str_ = header_str;
+ data_string_ = data_string;
+ footer_string_ = footer_string;
+ header_string_ = header_string;
}
String
-Midi_chunk::data_str () const
+Midi_chunk::data_string () const
{
- return data_str_;
+ return data_string_;
}
String
-Midi_chunk::str () const
-{
- String str = header_str_;
- String dat = data_str ();
- String length_str = String_convert::i2hex_str (dat.length_i ()
- + footer_str_.length_i (), 8, '0');
- length_str = String_convert::hex2bin_str (length_str);
- str += length_str;
+Midi_chunk::string () const
+{
+ String str = header_string_;
+ String dat = data_string ();
+ String length_string = String_convert::int2hex (dat.length ()
+ + footer_string_.length (), 8, '0');
+ length_string = String_convert::hex2bin (length_string);
+ str += length_string;
str += dat;
- str += footer_str_;
+ str += footer_string_;
return str;
}
Midi_duration::Midi_duration (Real seconds_f)
{
- seconds_f_ = seconds_f;
+ seconds_ = seconds_f;
}
String
-Midi_duration::str () const
+Midi_duration::string () const
{
- return String ("<duration: ") + to_str (seconds_f_) + ">";
+ return String ("<duration: ") + to_string (seconds_) + ">";
}
-Midi_event::Midi_event (Moment delta_mom, Midi_item* midi_p)
+Midi_event::Midi_event (Moment delta_mom, Midi_item* midi)
{
delta_mom_ = delta_mom;
- midi_p_ = midi_p;
+ midi_ = midi;
}
/*
ugh. midi output badly broken since grace note hackage.
*/
String
-Midi_event::str () const
+Midi_event::string () const
{
Rational rat_dt = (delta_mom_.main_part_ * Rational (384) +
delta_mom_.grace_part_ * Rational (100))*Rational (4);
int delta_i = int (rat_dt);
- String delta_str = Midi_item::i2varint_str (delta_i);
- String midi_str = midi_p_->str ();
- assert (midi_str.length_i ());
- return delta_str + midi_str;
+ String delta_string = Midi_item::i2varint_string (delta_i);
+ String midi_string = midi_->string ();
+ assert (midi_string.length ());
+ return delta_string + midi_string;
}
{
String str;
- String format_str = String_convert::i2hex_str (format_i, 4, '0');
- str += String_convert::hex2bin_str (format_str);
+ String format_string = String_convert::int2hex (format_i, 4, '0');
+ str += String_convert::hex2bin (format_string);
- String tracks_str = String_convert::i2hex_str (tracks_i, 4, '0');
- str += String_convert::hex2bin_str (tracks_str);
+ String tracks_string = String_convert::int2hex (tracks_i, 4, '0');
+ str += String_convert::hex2bin (tracks_string);
- String tempo_str = String_convert::i2hex_str (clocks_per_4_i, 4, '0');
- str += String_convert::hex2bin_str (tempo_str);
+ String tempo_string = String_convert::int2hex (clocks_per_4_i, 4, '0');
+ str += String_convert::hex2bin (tempo_string);
set ("MThd", str, "");
}
Midi_instrument::Midi_instrument (Audio_instrument* a)
{
- audio_l_ = a;
- audio_l_->str_.to_lower ();
+ audio_ = a;
+ audio_->str_.to_lower ();
}
String
-Midi_instrument::str() const
+Midi_instrument::string () const
{
Byte program_byte = 0;
bool found = false;
SCM proc = scm_primitive_eval (ly_symbol2scm ("midi-program"));
- SCM program = gh_call1 (proc, ly_symbol2scm (audio_l_->str_.ch_C()));
+ SCM program = gh_call1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
found = (program != SCM_BOOL_F);
if (found)
program_byte = gh_scm2int(program);
else
- warning (_f ("no such instrument: `%s'", audio_l_->str_.ch_C ()));
+ warning (_f ("no such instrument: `%s'", audio_->str_.to_str0 ()));
- String str = to_str ((char) (0xc0 + channel_i_)); //YIKES! FIXME: Should be track. -rz
- str += to_str ((char)program_byte);
+ String str = to_string ((char) (0xc0 + channel_)); //YIKES! FIXME: Should be track. -rz
+ str += to_string ((char)program_byte);
return str;
}
Midi_item::Midi_item ()
{
- channel_i_ = 0;
+ channel_ = 0;
}
Midi_item::~Midi_item ()
}
String
-Midi_item::i2varint_str (int i)
+Midi_item::i2varint_string (int i)
{
int buffer_i = i & 0x7f;
while ((i >>= 7) > 0)
String str;
while (1)
{
- str += to_str ((char)buffer_i);
+ str += to_string ((char)buffer_i);
if (buffer_i & 0x80)
buffer_i >>= 8;
else
Midi_key::Midi_key (Audio_key*a)
{
- audio_l_ = a;
+ audio_ = a;
}
String
-Midi_key::str () const
+Midi_key::string () const
{
String str = "ff5902";
- str += String_convert::i2hex_str (audio_l_->accidentals_, 2, '0');
- if (audio_l_->major_)
- str += String_convert::i2hex_str (0, 2, '0');
+ str += String_convert::int2hex (audio_->accidentals_, 2, '0');
+ if (audio_->major_)
+ str += String_convert::int2hex (0, 2, '0');
else
- str += String_convert::i2hex_str (1, 2, '0');
- return String_convert::hex2bin_str (str);
+ str += String_convert::int2hex (1, 2, '0');
+ return String_convert::hex2bin (str);
}
Midi_time_signature::Midi_time_signature (Audio_time_signature* a)
{
- audio_l_ = a;
- clocks_per_1_i_ = 18;
+ audio_ = a;
+ clocks_per_1_ = 18;
}
String
-Midi_time_signature::str () const
+Midi_time_signature::string () const
{
- int num = audio_l_->beats_i_;
- int den = audio_l_->one_beat_i_;
+ int num = audio_->beats_;
+ int den = audio_->one_beat_;
String str = "ff5804";
- str += String_convert::i2hex_str (num, 2, '0');
- str += String_convert::i2hex_str (intlog2 (den) , 2, '0');
- str += String_convert::i2hex_str (clocks_per_1_i_, 2, '0');
- str += String_convert::i2hex_str (8, 2, '0');
- return String_convert::hex2bin_str (str);
+ str += String_convert::int2hex (num, 2, '0');
+ str += String_convert::int2hex (intlog2 (den) , 2, '0');
+ str += String_convert::int2hex (clocks_per_1_, 2, '0');
+ str += String_convert::int2hex (8, 2, '0');
+ return String_convert::hex2bin (str);
}
Midi_note::Midi_note (Audio_note* a)
{
- audio_l_ = a;
+ audio_ = a;
dynamic_byte_ = 0x7f;
}
Moment
Midi_note::length_mom () const
{
- Moment m = audio_l_->length_mom_;
+ Moment m = audio_->length_mom_;
#if 0
//junkme?
if (m < Moment (Rational (1, 1000)))
}
int
-Midi_note::pitch_i () const
+Midi_note::get_pitch () const
{
- int p = audio_l_->pitch_.semitone_pitch () + audio_l_->transposing_i_;
+ int p = audio_->pitch_.semitone_pitch () + audio_->transposing_;
if (p == INT_MAX)
{
warning (_ ("silly pitch"));
}
String
-Midi_note::str () const
+Midi_note::string () const
{
- Byte status_byte = (char) (0x90 + channel_i_);
+ Byte status_byte = (char) (0x90 + channel_);
- String str = to_str ((char)status_byte);
- str += to_str ((char) (pitch_i () + c0_pitch_i_c_));
+ String str = to_string ((char)status_byte);
+ str += to_string ((char) (get_pitch () + c0_pitch_i_));
- str += to_str ((char)dynamic_byte_);
+ str += to_string ((char)dynamic_byte_);
return str;
}
Midi_note_off::Midi_note_off (Midi_note* n)
- : Midi_note (n->audio_l_)
+ : Midi_note (n->audio_)
{
- on_l_ = n;
- channel_i_ = n->channel_i_;
+ on_ = n;
+ channel_ = n->channel_;
// Anybody who hears any difference, or knows how this works?
// 0 should definitely be avoided, notes stick on some sound cards.
}
String
-Midi_note_off::str () const
+Midi_note_off::string () const
{
- Byte status_byte = (char) (0x80 + channel_i_);
+ Byte status_byte = (char) (0x80 + channel_);
- String str = to_str ((char)status_byte);
- str += to_str ((char) (pitch_i () + Midi_note::c0_pitch_i_c_));
- str += to_str ((char)aftertouch_byte_);
+ String str = to_string ((char)status_byte);
+ str += to_string ((char) (get_pitch () + Midi_note::c0_pitch_i_));
+ str += to_string ((char)aftertouch_byte_);
return str;
}
Midi_dynamic::Midi_dynamic (Audio_dynamic* a)
{
- audio_l_ = a;
+ audio_ = a;
}
String
-Midi_dynamic::str () const
+Midi_dynamic::string () const
{
- Byte status_byte = (char) (0xB0 + channel_i_);
- String str = to_str ((char)status_byte);
+ Byte status_byte = (char) (0xB0 + channel_);
+ String str = to_string ((char)status_byte);
/*
Main volume controller (per channel):
*/
static Real const full_scale = 127;
- int volume = (int) (audio_l_->volume_*full_scale);
+ int volume = (int) (audio_->volume_*full_scale);
if (volume <= 0)
volume = 1;
if (volume > full_scale)
volume = (int)full_scale;
- str += to_str ((char)0x07);
- str += to_str ((char)volume);
+ str += to_string ((char)0x07);
+ str += to_string ((char)volume);
return str;
}
Midi_piano_pedal::Midi_piano_pedal (Audio_piano_pedal* a)
{
- audio_l_ = a;
+ audio_ = a;
}
String
-Midi_piano_pedal::str () const
+Midi_piano_pedal::string () const
{
- Byte status_byte = (char) (0xB0 + channel_i_);
- String str = to_str ((char)status_byte);
+ Byte status_byte = (char) (0xB0 + channel_);
+ String str = to_string ((char)status_byte);
- if (audio_l_->type_str_ == "Sostenuto")
- str += to_str ((char)0x42);
- else if (audio_l_->type_str_ == "Sustain")
- str += to_str ((char)0x40);
- else if (audio_l_->type_str_ == "UnaCorda")
- str += to_str ((char)0x43);
+ if (audio_->type_string_ == "Sostenuto")
+ str += to_string ((char)0x42);
+ else if (audio_->type_string_ == "Sustain")
+ str += to_string ((char)0x40);
+ else if (audio_->type_string_ == "UnaCorda")
+ str += to_string ((char)0x43);
- int pedal = ((1 - audio_l_->dir_) / 2) * 0x7f;
- str += to_str ((char)pedal);
+ int pedal = ((1 - audio_->dir_) / 2) * 0x7f;
+ str += to_string ((char)pedal);
return str;
}
Midi_tempo::Midi_tempo (Audio_tempo* a)
{
- audio_l_ = a;
+ audio_ = a;
}
String
-Midi_tempo::str () const
+Midi_tempo::string () const
{
- int useconds_per_4_i = 60 * (int)1e6 / audio_l_->per_minute_4_i_;
+ int useconds_per_4_i = 60 * (int)1e6 / audio_->per_minute_4_;
String str = "ff5103";
- str += String_convert::i2hex_str (useconds_per_4_i, 6, '0');
- return String_convert::hex2bin_str (str);
+ str += String_convert::int2hex (useconds_per_4_i, 6, '0');
+ return String_convert::hex2bin (str);
}
Midi_text::Midi_text (Audio_text* a)
{
- audio_l_ = a;
+ audio_ = a;
}
String
-Midi_text::str () const
+Midi_text::string () const
{
- String str = "ff" + String_convert::i2hex_str (audio_l_->type_, 2, '0');
- str = String_convert::hex2bin_str (str);
- str += i2varint_str (audio_l_->text_str_.length_i ());
- str += audio_l_->text_str_;
+ String str = "ff" + String_convert::int2hex (audio_->type_, 2, '0');
+ str = String_convert::hex2bin (str);
+ str += i2varint_string (audio_->text_string_.length ());
+ str += audio_->text_string_;
return str;
}
// mi = 0: major key
// mi = 1: minor key
- number_i_ = 0;
+ number_ = 0;
- char const* data_ch_C = ""
+ char const* data_str0 = ""
// "00" "ff58" "0404" "0218" "08"
// "00" "ff51" "0307" "a120"
// why a key at all, in midi?
// "00" "ff59" "02" "ff" "00"
;
- String data_str;
+ String data_string;
// only for format 0 (currently using format 1)?
- data_str += String_convert::hex2bin_str (data_ch_C);
+ data_string += String_convert::hex2bin (data_str0);
- char const* footer_ch_C = "00" "ff2f" "00";
- String footer_str = String_convert::hex2bin_str (footer_ch_C);
+ char const* footer_str0 = "00" "ff2f" "00";
+ String footer_string = String_convert::hex2bin (footer_str0);
- set ("MTrk", data_str, footer_str);
+ set ("MTrk", data_string, footer_string);
}
void
-Midi_track::add (Moment delta_time_mom, Midi_item* midi_p)
+Midi_track::add (Moment delta_time_mom, Midi_item* midi)
{
assert (delta_time_mom >= Moment (0));
- Midi_event * e = new Midi_event (delta_time_mom, midi_p);
+ Midi_event * e = new Midi_event (delta_time_mom, midi);
event_p_list_.append (new Killing_cons<Midi_event> (e, 0));
}
String
-Midi_track::data_str () const
+Midi_track::data_string () const
{
- String str = Midi_chunk::data_str ();
+ String str = Midi_chunk::data_string ();
if (midi_debug_global_b)
str += "\n";
for (Cons<Midi_event> *i=event_p_list_.head_; i; i = i->next_)
{
- str += i->car_->str ();
+ str += i->car_->string ();
if (midi_debug_global_b)
str += "\n";
}
Midi_stream::Midi_stream (String filename)
{
- filename_str_ = filename;
- os_p_ = open_file_stream (filename, std::ios::out|std::ios::binary);
+ filename_string_ = filename;
+ os_ = open_file_stream (filename, std::ios::out|std::ios::binary);
}
Midi_stream::~Midi_stream ()
{
- close_file_stream (os_p_);
+ close_file_stream (os_);
}
Midi_stream&
Midi_stream::operator << (String str)
{
- Byte * b = str.byte_l();
- for (int sz = str.length_i (); sz--;)
- *os_p_ << *b ++;
+ Byte * b = str.get_bytes ();
+ for (int sz = str.length (); sz--;)
+ *os_ << *b ++;
return *this;
}
Midi_stream&
Midi_stream::operator << (Midi_item const& midi_c_r)
{
- String str = midi_c_r.str ();
+ String str = midi_c_r.string ();
if (midi_debug_global_b)
{
- str = String_convert::bin2hex_str (str) + "\n";
+ str = String_convert::bin2hex (str) + "\n";
// ugh, should have separate debugging output with Midi*::print routines
- int i = str.index_i ("0a");
+ int i = str.index ("0a");
while (i >= 0)
{
str[i] = '\n';
str[i + 1] = '\t';
- i = str.index_i ("0a");
+ i = str.index ("0a");
}
}
else
{
- Byte * b = str.byte_l();
- for (int sz = str.length_i (); sz--;)
- *os_p_ << *b++;
+ Byte * b = str.get_bytes ();
+ for (int sz = str.length (); sz--;)
+ *os_ << *b++;
}
return *this;
Midi_stream::operator << (int i)
{
// output binary string ourselves
- *this << Midi_item::i2varint_str (i);
+ *this << Midi_item::i2varint_string (i);
return *this;
}
return 0;
}
-Midi_walker::Midi_walker (Audio_staff* audio_staff_l, Midi_track* track_l)
+Midi_walker::Midi_walker (Audio_staff* audio_staff, Midi_track* track)
{
- track_l_ = track_l;
+ track_ = track;
index_= 0;
- item_l_arr_l_ = &audio_staff_l->audio_item_l_arr_;
+ items_ = &audio_staff->audio_items_;
last_mom_ = 0;
}
Find out if start_note event is needed, and do it if needed.
*/
void
-Midi_walker::do_start_note (Midi_note* note_p)
+Midi_walker::do_start_note (Midi_note* note)
{
- Audio_item* ptr = (*item_l_arr_l_)[index_];
- Moment stop_mom = note_p->length_mom () + ptr->audio_column_l_->at_mom ();
+ Audio_item* ptr = (*items_)[index_];
+ Moment stop_mom = note->length_mom () + ptr->audio_column_->at_mom ();
bool play_start = true;
for (int i=0; i < stop_note_queue.size (); i++)
{
/* if this pith already in queue */
- if (stop_note_queue[i].val->pitch_i () == note_p->pitch_i ())
+ if (stop_note_queue[i].val->get_pitch () == note->get_pitch ())
{
if (stop_note_queue[i].key < stop_mom)
{
{
/* skip this stopnote,
don't play the start note */
- delete note_p;
- note_p = 0;
+ delete note;
+ note = 0;
break;
}
}
}
- if (note_p)
+ if (note)
{
Midi_note_event e;
- e.val = new Midi_note_off (note_p);
+ e.val = new Midi_note_off (note);
e.key = stop_mom;
stop_note_queue.insert (e);
if (play_start)
- output_event (ptr->audio_column_l_->at_mom (), note_p);
+ output_event (ptr->audio_column_->at_mom (), note);
}
}
}
Moment stop_mom = e.key;
- Midi_note* note_p = e.val;
+ Midi_note* note = e.val;
- output_event (stop_mom, note_p);
+ output_event (stop_mom, note);
}
}
}
- track_l_->add (delta_t, l);
+ track_->add (delta_t, l);
}
void
Midi_walker::process ()
{
- Audio_item* audio_p = (*item_l_arr_l_)[index_];
- do_stop_notes (audio_p->audio_column_l_->at_mom ());
+ Audio_item* audio = (*items_)[index_];
+ do_stop_notes (audio->audio_column_->at_mom ());
- if (Midi_item* midi_p = Midi_item::midi_p (audio_p))
+ if (Midi_item* midi = Midi_item::get_midi (audio))
{
- midi_p->channel_i_ = track_l_->channel_i_;
- //midi_p->channel_i_ = track_l_->number_i_;
- if (Midi_note* note_p = dynamic_cast<Midi_note*> (midi_p))
+ midi->channel_ = track_->channel_;
+ //midi->channel_ = track_->number_;
+ if (Midi_note* note = dynamic_cast<Midi_note*> (midi))
{
- if (note_p->length_mom ().to_bool ())
- do_start_note (note_p);
+ if (note->length_mom ().to_bool ())
+ do_start_note (note);
}
else
- output_event (audio_p->audio_column_l_->at_mom (), midi_p);
+ output_event (audio->audio_column_->at_mom (), midi);
}
}
bool
Midi_walker::ok () const
{
- return index_ <item_l_arr_l_->size ();
+ return index_ <items_->size ();
}
void
{
Molecule* m = unsmob_molecule (mol);
SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "molecule");
- SCM_ASSERT_TYPE (ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+ SCM_ASSERT_TYPE (ly_axis_p (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
SCM_ASSERT_TYPE (ly_number_pair_p (np), np, SCM_ARG3, __FUNCTION__, "number pair");
Interval iv = ly_scm2interval (np);
{
Molecule *m = unsmob_molecule (mol);
SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "molecule");
- SCM_ASSERT_TYPE (ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+ SCM_ASSERT_TYPE (ly_axis_p (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
return ly_interval2scm (m->extent (Axis (gh_scm2int (axis))));
}
Molecule result;
- SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+ SCM_ASSERT_TYPE(ly_axis_p (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
SCM_ASSERT_TYPE(ly_dir_p (direction), direction, SCM_ARG3, __FUNCTION__, "dir");
- SCM_ASSERT_TYPE(gh_number_p(padding), padding, SCM_ARG4, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE(gh_number_p (padding), padding, SCM_ARG4, __FUNCTION__, "number");
if (m1)
result = *m1;
"Align @var{mol} using its own extents.")
{
SCM_ASSERT_TYPE(unsmob_molecule (mol), mol, SCM_ARG1, __FUNCTION__, "molecule");
- SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+ SCM_ASSERT_TYPE(ly_axis_p (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
SCM_ASSERT_TYPE(ly_dir_p (dir), dir, SCM_ARG3, __FUNCTION__, "dir");
unsmob_molecule (mol)->align_to ((Axis)gh_scm2int (axis), Direction (gh_scm2int (dir)));
scm_puts ("#<Molecule ", port);
#if 0
Molecule *r = (Molecule *) ly_cdr (s);
- String str (r->str ());
- scm_puts ((char *)str.ch_C (), port);
+ String string (r->string ());
+ scm_puts ((char *)str.to_str0 (), port);
#endif
scm_puts (" >", port);
Moment *r = (Moment *) ly_cdr (s);
scm_puts ("#<Mom ", port);
- String str = r->str ();
- scm_puts ((char *)str.ch_C (), port);
+ String str = r->string ();
+ scm_puts ((char *)str.to_str0 (), port);
scm_puts (" >", port);
return 1;
String
-Moment::str () const
+Moment::string () const
{
- String s = main_part_.str ();
+ String s = main_part_.string ();
if (grace_part_)
{
- s += "G" + grace_part_.str ();
+ s += "G" + grace_part_.string ();
}
return s;
}
std::ostream &
operator << (std::ostream &os, Moment const &m)
{
- os << m.str ();
+ os << m.string ();
return os;
}
#endif
virtual void finalize ();
private:
- Span_req * new_req_l_;
- Span_req * busy_span_req_l_;
- Span_req * stop_req_l_;
- int start_measure_i_;
+ Span_req * new_req_;
+ Span_req * busy_span_req_;
+ Span_req * stop_req_;
+ int start_measure_;
Moment start_moment_;
- Spanner *mmrest_p_;
- Spanner *lastrest_p_;
+ Spanner *mmrest_;
+ Spanner *lastrest_;
};
Multi_measure_rest_engraver::Multi_measure_rest_engraver ()
{
- start_measure_i_ = 0;
- mmrest_p_ = lastrest_p_ =0;
- new_req_l_ = busy_span_req_l_ = stop_req_l_ =0;
+ start_measure_ = 0;
+ mmrest_ = lastrest_ =0;
+ new_req_ = busy_span_req_ = stop_req_ =0;
}
bool
-Multi_measure_rest_engraver::try_music (Music* req_l)
+Multi_measure_rest_engraver::try_music (Music* req)
{
- if (Span_req * sp = dynamic_cast<Span_req*> (req_l))
+ if (Span_req * sp = dynamic_cast<Span_req*> (req))
{
if (scm_equal_p (sp->get_mus_property ("span-type"),
{
if (sp->get_span_dir () == STOP)
{
- stop_req_l_ = sp;
+ stop_req_ = sp;
}
- else if (sp->get_span_dir () == START && !new_req_l_)
+ else if (sp->get_span_dir () == START && !new_req_)
{
- new_req_l_ = sp;
+ new_req_ = sp;
}
return true;
}
void
Multi_measure_rest_engraver::process_music ()
{
- if (new_req_l_ && stop_req_l_)
- stop_req_l_ = 0;
+ if (new_req_ && stop_req_)
+ stop_req_ = 0;
- if (new_req_l_)
+ if (new_req_)
start_moment_ = now_mom ();
- if (stop_req_l_)
+ if (stop_req_)
{
- busy_span_req_l_ =0;
- stop_req_l_ = 0;
+ busy_span_req_ =0;
+ stop_req_ = 0;
}
- if (new_req_l_)
+ if (new_req_)
{
- busy_span_req_l_ = new_req_l_;
- new_req_l_ =0;
+ busy_span_req_ = new_req_;
+ new_req_ =0;
}
- if (busy_span_req_l_ && !mmrest_p_)
+ if (busy_span_req_ && !mmrest_)
{
- mmrest_p_ = new Spanner (get_property ("MultiMeasureRest"));
+ mmrest_ = new Spanner (get_property ("MultiMeasureRest"));
- announce_grob(mmrest_p_, busy_span_req_l_->self_scm());
- start_measure_i_
+ announce_grob(mmrest_, busy_span_req_->self_scm());
+ start_measure_
= gh_scm2int (get_property ("currentBarNumber"));
}
{
Grob *cmc = unsmob_grob (get_property( "currentCommandColumn"));
Item *it = dynamic_cast<Item*> (cmc);
- if (mmrest_p_)
- add_bound_item (mmrest_p_, it);
- if (lastrest_p_)
- add_bound_item (lastrest_p_,it);
+ if (mmrest_)
+ add_bound_item (mmrest_, it);
+ if (lastrest_)
+ add_bound_item (lastrest_,it);
}
}
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
- if (mmrest_p_ && (now_mom () >= start_moment_)
+ if (mmrest_ && (now_mom () >= start_moment_)
&& !mp.to_bool ()
- && mmrest_p_->get_bound (LEFT) && mmrest_p_->get_bound (RIGHT))
+ && mmrest_->get_bound (LEFT) && mmrest_->get_bound (RIGHT))
{
- typeset_grob (mmrest_p_);
+ typeset_grob (mmrest_);
/*
- we must keep mmrest_p_ around to set measure-count, so
- no mmrest_p_ = 0 here.
+ we must keep mmrest_ around to set measure-count, so
+ no mmrest_ = 0 here.
*/
}
- if (lastrest_p_)
+ if (lastrest_)
{
/* sanity check */
- if (lastrest_p_->get_bound (LEFT) && lastrest_p_->get_bound (RIGHT)
- && lastrest_p_->get_bound (LEFT) != lastrest_p_->get_bound (RIGHT))
- typeset_grob (lastrest_p_);
- lastrest_p_ = 0;
+ if (lastrest_->get_bound (LEFT) && lastrest_->get_bound (RIGHT)
+ && lastrest_->get_bound (LEFT) != lastrest_->get_bound (RIGHT))
+ typeset_grob (lastrest_);
+ lastrest_ = 0;
}
- if (new_req_l_)
+ if (new_req_)
{
- busy_span_req_l_ = new_req_l_;
- new_req_l_ =0;
+ busy_span_req_ = new_req_;
+ new_req_ =0;
}
}
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
- if (mmrest_p_ && !mp.to_bool ())
+ if (mmrest_ && !mp.to_bool ())
{
- lastrest_p_ = mmrest_p_;
+ lastrest_ = mmrest_;
int cur = gh_scm2int (get_property ("currentBarNumber"));
- lastrest_p_->set_grob_property ("measure-count",
- gh_int2scm (cur - start_measure_i_));
- mmrest_p_ = 0;
+ lastrest_->set_grob_property ("measure-count",
+ gh_int2scm (cur - start_measure_));
+ mmrest_ = 0;
}
}
void
Multi_measure_rest_engraver::finalize ()
{
- if (mmrest_p_)
- typeset_grob (mmrest_p_);
- if (lastrest_p_)
- typeset_grob (lastrest_p_);
+ if (mmrest_)
+ typeset_grob (mmrest_);
+ if (lastrest_)
+ typeset_grob (lastrest_);
}
ENTER_DESCRIPTION(Multi_measure_rest_engraver,
Direction d = LEFT;
do
{
- Item * col = sp->get_bound (d)->column_l ();
+ Item * col = sp->get_bound (d)->get_column ();
Interval coldim = col->extent (0, X_AXIS);
Grob *common = sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
do
{
- Item * col = sp->get_bound (d)->column_l ();
+ Item * col = sp->get_bound (d)->get_column ();
Interval coldim = col->extent (common, X_AXIS);
if (measures > gh_scm2int (s))
{
Molecule s = Text_item::text2molecule (me,
- ly_str02scm (to_str (measures).ch_C ()),
+ ly_str02scm (to_string (measures).to_str0 ()),
alist_chain);
s.align_to (X_AXIS, CENTER);
/*
ugh.
*/
- if (Staff_symbol_referencer::position_f (me) == 0.0)
+ if (Staff_symbol_referencer::get_position (me) == 0.0)
s.translate_axis (staff_space, Y_AXIS);
s.translate_axis ((space - s.extent (X_AXIS).length ())/2, X_AXIS);
Real thick = gh_scm2double (me->get_grob_property ("thickness"));
Real ss = Staff_symbol_referencer::staff_space (me);
- Real slt = me->paper_l ()->get_var ("linethickness");
+ Real slt = me->get_paper ()->get_var ("linethickness");
Real y = slt * thick/2 * ss;
Box b(Interval (0, width), Interval (-y, y));
Real ythick = slt * ss;
l --;
}
- Molecule r (musfont->find_by_name ("rests-" + to_str (k)));
+ Molecule r (musfont->find_by_name ("rests-" + to_string (k)));
if (k == 0)
{
Real staff_space = Staff_symbol_referencer::staff_space (me);
return SCM_UNSPECIFIED;
}
- Item * l = sp->get_bound (LEFT)->column_l ();
- Item * r = sp->get_bound (RIGHT)->column_l ();
+ Item * l = sp->get_bound (LEFT)->get_column ();
+ Item * r = sp->get_bound (RIGHT)->get_column ();
Item * lb = l->find_prebroken_piece (RIGHT);
Item * rb = r->find_prebroken_piece (LEFT);
rod.item_l_drul_[RIGHT] = r;
- rod.distance_f_ = l->extent (l, X_AXIS)[BIGGER] - r->extent (r, X_AXIS)[SMALLER]
+ rod.distance_ = l->extent (l, X_AXIS)[BIGGER] - r->extent (r, X_AXIS)[SMALLER]
+ sym_width + 2.0; // 2.0 = magic!
rod.add_to_cols ();
Music_iterator::Music_iterator (Music_iterator const& src)
{
handle_ = *src.handle_.clone ();
- music_l_ = src.music_l_;
+ music_ = src.music_;
music_length_ = src.music_length_;
start_mom_ = src.start_mom_;
}
Translator_group*
-Music_iterator::report_to_l () const
+Music_iterator::report_to () const
{
- return handle_.report_to_l ();
+ return handle_.report_to ();
}
}
Music_iterator*
-Music_iterator::static_get_iterator_p (Music *m)
+Music_iterator::get_static_get_iterator (Music *m)
{
Music_iterator * p =0;
p = new Simple_music_iterator ;
}
- p->music_l_ = m;
+ p->music_ = m;
assert (m);
p->music_length_ = m->length_mom ();
p->start_mom_ = m->start_mom ();
}
void
-Music_iterator::init_translator (Music *m, Translator_group *report_l)
+Music_iterator::init_translator (Music *m, Translator_group *report)
{
- music_l_ = m;
+ music_ = m;
assert (m);
if (Context_specced_music * csm =dynamic_cast<Context_specced_music *> (m))
{
c_id = ly_scm2string (ci);
Translator_group* a
- =report_l->find_create_translator_l (c_type, c_id);
+ =report->find_create_translator (c_type, c_id);
set_translator (a);
}
- if (! report_to_l ())
- set_translator (report_l);
+ if (! report_to ())
+ set_translator (report);
}
Music_iterator*
-Music_iterator::get_iterator_p (Music *m) const
+Music_iterator::get_iterator (Music *m) const
{
- Music_iterator*p = static_get_iterator_p (m);
- p->init_translator (m, report_to_l ());
+ Music_iterator*p = get_static_get_iterator (m);
+ p->init_translator (m, report_to ());
p->construct_children ();
return p;
Music_iterator*
Music_iterator::try_music (Music *m) const
{
- bool b = report_to_l ()->try_music ((Music*)m); // ugh
+ bool b = report_to ()->try_music ((Music*)m); // ugh
Music_iterator * it = b ? (Music_iterator*) this : 0; // ugh
if (!it)
it = try_music_in_children (m);
IMPLEMENT_CTOR_CALLBACK (Music_iterator);
Music *
-Music_iterator::music_l () const
+Music_iterator::get_music () const
{
- return music_l_;
+ return music_;
}
find the translator for NAME. NAME may be a string or a symbol.
*/
SCM
-Music_output_def::find_translator_l (SCM name) const
+Music_output_def::find_translator (SCM name) const
{
if (gh_string_p (name))
name = scm_string_to_symbol (name);
Global_translator *
-Music_output_def::get_global_translator_p ()
+Music_output_def::get_global_translator ()
{
SCM key = ly_symbol2scm ("Score");
- Translator_def * t = unsmob_translator_def (find_translator_l (key));
+ Translator_def * t = unsmob_translator_def (find_translator (key));
if (!t)
error (_f ("can't find `%s' context", "Score"));
ugh: should move into Music_output_def (complication: .midi and .tex
need separate counts.) */
String
-Music_output_def::outname_str ()
+Music_output_def::outname_string ()
{
String out = output_name_global;
int def = get_next_score_count ();
if (def && out != "-")
{
Path p = split_path (out);
- p.base += "-" + to_str (def);
- out = p.str ();
+ p.base += "-" + to_string (def);
+ out = p.string ();
}
return out;
}
Music_wrapper_iterator::Music_wrapper_iterator ()
{
- child_iter_p_ =0;
+ child_iter_ =0;
}
Music_wrapper_iterator::Music_wrapper_iterator (Music_wrapper_iterator const &src)
: Music_iterator (src)
{
- if (src.child_iter_p_)
- child_iter_p_ = src.child_iter_p_->clone ();
+ if (src.child_iter_)
+ child_iter_ = src.child_iter_->clone ();
else
- child_iter_p_ = 0;
+ child_iter_ = 0;
}
Music_wrapper_iterator::~Music_wrapper_iterator ()
{
- delete child_iter_p_;
+ delete child_iter_;
}
void
Music_wrapper_iterator::construct_children ()
{
- child_iter_p_ =
- get_iterator_p (dynamic_cast<Music_wrapper const*> (music_l ())->element ());
+ child_iter_ =
+ get_iterator (dynamic_cast<Music_wrapper const*> (get_music ())->element ());
}
bool
Music_wrapper_iterator::ok () const
{
- return child_iter_p_ && child_iter_p_->ok ();
+ return child_iter_ && child_iter_->ok ();
}
void
Music_wrapper_iterator::skip (Moment m)
iter->process ()
*/
- child_iter_p_->skip (m);
+ child_iter_->skip (m);
}
void
Music_wrapper_iterator::process (Moment m)
{
- child_iter_p_->process (m);
+ child_iter_->process (m);
}
SCM
Music_wrapper_iterator::get_pending_events (Moment m)const
{
- return child_iter_p_->get_pending_events (m);
+ return child_iter_->get_pending_events (m);
}
Moment
Music_wrapper_iterator::pending_moment () const
{
- return child_iter_p_->pending_moment ();
+ return child_iter_->pending_moment ();
}
Music_iterator*
Music_wrapper_iterator::try_music_in_children (Music *m) const
{
- return child_iter_p_->try_music (m);
+ return child_iter_->try_music (m);
}
IMPLEMENT_CTOR_CALLBACK (Music_wrapper_iterator);
Pitch np = *p;
np.transpose (delta);
- if (abs (np.alteration_i_) > 2)
+ if (abs (np.alteration_) > 2)
{
warning (_f ("Transposition by %s makes accidental larger than two",
- delta.str ()));
+ delta.string ()));
}
set_mus_property ("pitch", np.smobbed_copy ());
{
Music * sc = unsmob_music (mus);
SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "music");
- SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE(gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
return sc->internal_get_mus_property (sym);
}
{
Music * sc = unsmob_music (mus);
SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE(gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?"));
if (ok)
type does not yet offer many manipulations.
")
{
- SCM_ASSERT_TYPE(gh_string_p(type), type, SCM_ARG1, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE(gh_string_p (type), type, SCM_ARG1, __FUNCTION__, "string");
SCM s = make_music (ly_scm2string (type))->self_scm ();
scm_gc_unprotect_object (s);
My_lily_lexer::My_lily_lexer ()
{
- keytable_p_ = new Keyword_table (the_key_tab);
+ keytable_ = new Keyword_table (the_key_tab);
toplevel_variable_tab_ = new Scheme_hash_table ;
- scope_l_arr_.push (toplevel_variable_tab_);
+ scopes_.push (toplevel_variable_tab_);
- errorlevel_i_ = 0;
+ errorlevel_ = 0;
main_input_b_ = false;
}
int
My_lily_lexer::lookup_keyword (String s)
{
- return keytable_p_->lookup (s.ch_C ());
+ return keytable_->lookup (s.to_str0 ());
}
SCM
My_lily_lexer::lookup_identifier (String s)
{
- SCM sym = ly_symbol2scm (s.ch_C ());
+ SCM sym = ly_symbol2scm (s.to_str0 ());
- for (int i = scope_l_arr_.size (); i--;)
+ for (int i = scopes_.size (); i--;)
{
SCM val = SCM_UNSPECIFIED;
- if (scope_l_arr_[i]->try_retrieve (sym, &val))
+ if (scopes_[i]->try_retrieve (sym, &val))
return val;
}
return SCM_UNSPECIFIED;
void
My_lily_lexer::start_main_input ()
{
- new_input (main_input_str_, source_global_l);
+ new_input (main_input_string_, source_global);
allow_includes_b_ = allow_includes_b_ && ! (safe_global_b);
}
free (str);
}
- scope_l_arr_.top ()->set (scm_string_to_symbol (name), s);
+ scopes_.top ()->set (scm_string_to_symbol (name), s);
}
My_lily_lexer::~My_lily_lexer ()
{
- delete keytable_p_;
+ delete keytable_;
scm_gc_unprotect_object (toplevel_variable_tab_->self_scm ());
}
}
else
{
- errorlevel_i_ |= 1;
- Input spot (source_file_l (),here_ch_C ());
+ errorlevel_ |= 1;
+ Input spot (get_source_file (),here_str0 ());
spot.error (s);
}
}
Input
My_lily_lexer::here_input () const
{
- Source_file * f_l= source_file_l ();
- return Input (f_l, (char*)here_ch_C ());
+ Source_file * f= get_source_file ();
+ return Input (f, (char*)here_str0 ());
}
#include "file-results.hh"
#include "scm-hash.hh"
-My_lily_parser::My_lily_parser (Sources * source_l)
+My_lily_parser::My_lily_parser (Sources * source)
{
- source_l_ = source_l;
- lexer_p_ = 0;
+ source_ = source;
+ lexer_ = 0;
default_duration_ = Duration (2,0);
- error_level_i_ = 0;
+ error_level_ = 0;
last_beam_start_ = SCM_EOL;
- default_header_p_ =0;
+ default_header_ =0;
}
My_lily_parser::~My_lily_parser ()
{
- delete lexer_p_;
- if (default_header_p_)
- scm_gc_unprotect_object (default_header_p_->self_scm());
+ delete lexer_;
+ if (default_header_)
+ scm_gc_unprotect_object (default_header_->self_scm());
}
void
void
My_lily_parser::parse_file (String init, String s)
{
- lexer_p_ = new My_lily_lexer;
+ lexer_ = new My_lily_lexer;
- lexer_p_->main_input_str_ = s;
+ lexer_->main_input_string_ = s;
progress_indication (_ ("Parsing..."));
set_yydebug (0);
- lexer_p_->new_input (init, source_l_);
+ lexer_->new_input (init, source_);
do_yyparse ();
progress_indication ("\n");
- if (!define_spot_array_.empty ())
+ if (!define_spots_.empty ())
{
- define_spot_array_.top ().warning (_ ("Braces don't match"));
- error_level_i_ = 1;
+ define_spots_.top ().warning (_ ("Braces don't match"));
+ error_level_ = 1;
}
- inclusion_global_array = lexer_p_->filename_str_arr_;
+ inclusion_globals = lexer_->filename_strings_;
- error_level_i_ = error_level_i_ | lexer_p_->errorlevel_i_; // ugh naming.
+ error_level_ = error_level_ | lexer_->errorlevel_; // ugh naming.
}
void
My_lily_parser::push_spot ()
{
- define_spot_array_.push (here_input ());
+ define_spots_.push (here_input ());
}
char const *
-My_lily_parser::here_ch_C () const
+My_lily_parser::here_str0 () const
{
- return lexer_p_->here_ch_C ();
+ return lexer_->here_str0 ();
}
void
My_lily_parser::parser_error (String s)
{
here_input ().error (s);
- error_level_i_ = 1;
+ error_level_ = 1;
exit_status_global = 1;
}
Input
My_lily_parser::pop_spot ()
{
- return define_spot_array_.pop ();
+ return define_spots_.pop ();
}
Input
My_lily_parser::here_input () const
{
- return lexer_p_->here_input ();
+ return lexer_->here_input ();
}
// move me?
{
My_lily_parser * me = current_parser;
- Music_output_def *id = unsmob_music_output_def (me->lexer_p_->lookup_identifier ("$defaultpaper"));
+ Music_output_def *id = unsmob_music_output_def (me->lexer_->lookup_identifier ("$defaultpaper"));
Paper_def *p = dynamic_cast<Paper_def*> (id->clone ());
SCM al = p->translator_tab_->to_alist ();
/*
The next
*/
- Array<New_accidental_entry> accidental_arr_;
+ Array<New_accidental_entry> accidentals_;
- Link_array<Grob> tie_arr_;
+ Link_array<Grob> ties_;
};
const char * from_sym, const char * to_sym)
{
merge_property_on_children (trans, from_sym, to_sym);
- trans = trans->daddy_trans_l_;
+ trans = trans->daddy_trans_;
while (trans)
{
SCM from = trans->get_property(from_sym);
to = merge_alists_front_x(from, to);
trans->set_property (to_sym, to);
trans->set_property (from_sym, SCM_EOL);
- trans = trans->daddy_trans_l_;
+ trans = trans->daddy_trans_;
}
}
static void set_property_on_family(Translator_group * trans, const char * sym, SCM val)
{
set_property_on_children (trans, sym, val);
- trans = trans->daddy_trans_l_;
+ trans = trans->daddy_trans_;
while (trans)
{
trans -> set_property (sym, ly_deep_copy (val));
- trans = trans->daddy_trans_l_;
+ trans = trans->daddy_trans_;
}
}
*/
static int
-number_accidentals (SCM sig, Note_req * note_l, Pitch *pitch, SCM curbarnum, SCM lazyness,
+number_accidentals (SCM sig, Note_req * note, Pitch *pitch, SCM curbarnum, SCM lazyness,
bool ignore_octave_b)
{
- int n = pitch->notename_i_;
- int o = pitch->octave_i_;
- int a = pitch->alteration_i_;
+ int n = pitch->notename_;
+ int o = pitch->octave_;
+ int a = pitch->alteration_;
int curbarnum_i = gh_scm2int (curbarnum);
int accbarnum_i = 0;
int num;
if (a == p
- && !to_boolean (note_l->get_mus_property ("force-accidental"))
+ && !to_boolean (note->get_mus_property ("force-accidental"))
&& gh_number_p (prev_acc))
num = 0;
else if ( (abs (a)<abs (p) || p*a<0) && a != 0 )
}
static int
-number_accidentals (Note_req * note_l, Pitch *pitch, Translator_group * origin_l,
+number_accidentals (Note_req * note, Pitch *pitch, Translator_group * origin,
SCM accidentals, SCM curbarnum)
{
int number = 0;
bool diff = false;
if (gh_pair_p (accidentals) && !gh_symbol_p (ly_car (accidentals)))
warning (_f ("Accidental typesetting list must begin with context-name: %s",
- ly_scm2string (ly_car (accidentals)).ch_C ()));
+ ly_scm2string (ly_car (accidentals)).to_str0 ()));
- while (gh_pair_p (accidentals) && origin_l)
+ while (gh_pair_p (accidentals) && origin)
{
// If pair then it is a new accidentals typesetting rule to be checked
if (gh_pair_p (ly_car (accidentals)))
{
SCM type = gh_caar (accidentals);
SCM lazyness = gh_cdar (accidentals);
- SCM localsig = origin_l->get_property ("localKeySignature");
+ SCM localsig = origin->get_property ("localKeySignature");
bool same_octave_b =
gh_eq_p (ly_symbol2scm ("same-octave"), type);
if (same_octave_b || any_octave_b)
{
int n = number_accidentals
- (localsig, note_l, pitch, curbarnum, lazyness, any_octave_b);
+ (localsig, note, pitch, curbarnum, lazyness, any_octave_b);
diff = diff || (n < 0);
number = max (number, abs (n));
}
else
warning (_f ("unknown accidental typesetting: %s. Ignored",
- ly_symbol2string (type).ch_C ()));
+ ly_symbol2string (type).to_str0 ()));
}
{
String context = ly_symbol2string (ly_car (accidentals));
- while (origin_l && !origin_l->is_alias_b (context))
- origin_l = origin_l->daddy_trans_l_;
+ while (origin && !origin->is_alias_b (context))
+ origin = origin->daddy_trans_;
- if (!origin_l)
+ if (!origin)
warning (_f ("Symbol is not a parent context: %s. Ignored",
- context.ch_C ()));
+ context.to_str0 ()));
}
else warning (_f ("Accidental typesetting must be pair or context-name: %s",
- ly_scm2string (ly_car (accidentals)).ch_C ()));
+ ly_scm2string (ly_car (accidentals)).to_str0 ()));
accidentals = ly_cdr (accidentals);
}
SCM cautionaries = get_property ("autoCautionaries");
SCM barnum = get_property ("currentBarNumber");
- for (int i = 0; i < accidental_arr_.size (); i++)
+ for (int i = 0; i < accidentals_.size (); i++)
{
- if (accidental_arr_[i].pass_done_ >= 1)
+ if (accidentals_[i].pass_done_ >= 1)
continue;
- accidental_arr_[i].pass_done_ = 1;
+ accidentals_[i].pass_done_ = 1;
- Grob * support_l = accidental_arr_[i].head_;
- Note_req * note_l = accidental_arr_[i].melodic_;
- Translator_group * origin_l = accidental_arr_[i].origin_;
- Pitch * pitch = unsmob_pitch (note_l->get_mus_property ("pitch"));
+ Grob * support = accidentals_[i].head_;
+ Note_req * note = accidentals_[i].melodic_;
+ Translator_group * origin = accidentals_[i].origin_;
+ Pitch * pitch = unsmob_pitch (note->get_mus_property ("pitch"));
int num;
- num = number_accidentals (note_l, pitch, origin_l, accidentals, barnum);
- accidental_arr_[i].number_accidentals_ = abs(num);
- accidental_arr_[i].different_ = num<0;
+ num = number_accidentals (note, pitch, origin, accidentals, barnum);
+ accidentals_[i].number_accidentals_ = abs(num);
+ accidentals_[i].different_ = num<0;
- num = number_accidentals (note_l, pitch, origin_l, cautionaries, barnum);
- accidental_arr_[i].number_cautionaries_ = abs(num);
- accidental_arr_[i].different_ = accidental_arr_[i].different_ || num<0;
+ num = number_accidentals (note, pitch, origin, cautionaries, barnum);
+ accidentals_[i].number_cautionaries_ = abs(num);
+ accidentals_[i].different_ = accidentals_[i].different_ || num<0;
bool tie_changes = false;
- for (int j = 0; j < tie_arr_.size (); j++)
- if (support_l == Tie::head (tie_arr_[j], RIGHT))
- tie_changes = accidental_arr_[i].different_;
- int n = pitch->notename_i_;
- int o = pitch->octave_i_;
- int a = pitch->alteration_i_;
+ for (int j = 0; j < ties_.size (); j++)
+ if (support == Tie::head (ties_[j], RIGHT))
+ tie_changes = accidentals_[i].different_;
+ int n = pitch->notename_;
+ int o = pitch->octave_;
+ int a = pitch->alteration_;
SCM o_s = gh_int2scm (o);
SCM n_s = gh_int2scm (n);
SCM on_s = gh_cons (o_s,n_s);
- while (origin_l)
+ while (origin)
{
- SCM sigch = origin_l->get_property ("localKeySignatureChanges");
+ SCM sigch = origin->get_property ("localKeySignatureChanges");
SCM alt;
if (tie_changes)
/*
if(other_alt_any_oct && !other_alt_same_oct) {
sigch = ly_assoc_front_x (sigch, on_s, gh_cons(SCM_BOOL_T,barnum));
}
- origin_l->set_property ("localKeySignatureChanges", sigch);
- origin_l = origin_l->daddy_trans_l_;
+ origin->set_property ("localKeySignatureChanges", sigch);
+ origin = origin->daddy_trans_;
}
}
}
SCM barnum = get_property ("currentBarNumber");
bool extra_natural_b = get_property ("extraNatural") == SCM_BOOL_T;
- for (int i = 0; i < accidental_arr_.size (); i++)
+ for (int i = 0; i < accidentals_.size (); i++)
{
- if (accidental_arr_[i].pass_done_ >= 2)
+ if (accidentals_[i].pass_done_ >= 2)
continue;
- accidental_arr_[i].pass_done_ = 2;
- Grob * support_l = accidental_arr_[i].head_;
- Note_req * note_l = accidental_arr_[i].melodic_;
- Translator_group * origin_l = accidental_arr_[i].origin_;
+ accidentals_[i].pass_done_ = 2;
+ Grob * support = accidentals_[i].head_;
+ Note_req * note = accidentals_[i].melodic_;
+ Translator_group * origin = accidentals_[i].origin_;
- Pitch * pitch = unsmob_pitch (note_l->get_mus_property ("pitch"));
+ Pitch * pitch = unsmob_pitch (note->get_mus_property ("pitch"));
int num;
- num = number_accidentals (note_l, pitch, origin_l, accidentals, barnum);
- accidental_arr_[i].number_accidentals_ =
- max (accidental_arr_[i].number_accidentals_, abs(num));
- accidental_arr_[i].different_ = accidental_arr_[i].different_ || num<0;
+ num = number_accidentals (note, pitch, origin, accidentals, barnum);
+ accidentals_[i].number_accidentals_ =
+ max (accidentals_[i].number_accidentals_, abs(num));
+ accidentals_[i].different_ = accidentals_[i].different_ || num<0;
- num = number_accidentals (note_l, pitch, origin_l, cautionaries, barnum);
- accidental_arr_[i].number_cautionaries_ =
- max (accidental_arr_[i].number_cautionaries_, abs(num));
- accidental_arr_[i].different_ = accidental_arr_[i].different_ || num<0;
+ num = number_accidentals (note, pitch, origin, cautionaries, barnum);
+ accidentals_[i].number_cautionaries_ =
+ max (accidentals_[i].number_cautionaries_, abs(num));
+ accidentals_[i].different_ = accidentals_[i].different_ || num<0;
- bool cautionary = to_boolean (note_l->get_mus_property ("cautionary"));
+ bool cautionary = to_boolean (note->get_mus_property ("cautionary"));
- if (accidental_arr_[i].number_cautionaries_ >accidental_arr_[i].number_accidentals_ )
+ if (accidentals_[i].number_cautionaries_ >accidentals_[i].number_accidentals_ )
{
- num = accidental_arr_[i].number_cautionaries_;
+ num = accidentals_[i].number_cautionaries_;
cautionary = true;
}
else
- num = accidental_arr_[i].number_accidentals_;
+ num = accidentals_[i].number_accidentals_;
bool tie_changes = false;
Grob *tie_break_reminder = 0;
- for (int j = 0; j < tie_arr_.size (); j++)
- if (support_l == Tie::head (tie_arr_[j], RIGHT))
+ for (int j = 0; j < ties_.size (); j++)
+ if (support == Tie::head (ties_[j], RIGHT))
{
- tie_changes = accidental_arr_[i].different_;
- tie_break_reminder = tie_arr_[j];
+ tie_changes = accidentals_[i].different_;
+ tie_break_reminder = ties_[j];
}
if (num)
{
Grob * a = new Item (get_property ("Accidental"));
- a->set_parent (support_l, Y_AXIS);
+ a->set_parent (support, Y_AXIS);
if (!accidental_placement_)
{
announce_grob (a, SCM_EOL);
- SCM accs = gh_cons (gh_int2scm (pitch->alteration_i_), SCM_EOL);
+ SCM accs = gh_cons (gh_int2scm (pitch->alteration_), SCM_EOL);
if (num == 2 && extra_natural_b)
accs = gh_cons (gh_int2scm (0), accs);
}
- support_l->set_grob_property ("accidental-grob", a->self_scm ());
+ support->set_grob_property ("accidental-grob", a->self_scm ());
a->set_grob_property ("accidentals", accs);
- accidental_arr_[i].accidental_ = a;
+ accidentals_[i].accidental_ = a;
/*
We add the accidentals to the support of the arpeggio, so it is
put left of the accidentals.
void
New_accidental_engraver::process_acknowledged_grobs ()
{
- if (accidental_arr_.size () && accidental_arr_.top().pass_done_ < 1)
+ if (accidentals_.size () && accidentals_.top().pass_done_ < 1)
process_grobs_first_pass ();
}
void
New_accidental_engraver::stop_translation_timestep ()
{
- merge_property_on_family(daddy_trans_l_, "localKeySignatureChanges", "localKeySignature");
- if (accidental_arr_.size () && accidental_arr_.top().pass_done_ < 2)
+ merge_property_on_family(daddy_trans_, "localKeySignatureChanges", "localKeySignature");
+ if (accidentals_.size () && accidentals_.top().pass_done_ < 2)
process_grobs_second_pass ();
- for (int i = 0; i < accidental_arr_.size(); i++)
+ for (int i = 0; i < accidentals_.size(); i++)
{
- Grob *a = accidental_arr_[i].accidental_;
+ Grob *a = accidentals_[i].accidental_;
if (a)
{
typeset_grob (a);
typeset_grob(accidental_placement_);
accidental_placement_ = 00;
- set_property_on_family(daddy_trans_l_, "localKeySignatureChanges", SCM_EOL);
- accidental_arr_.clear();
+ set_property_on_family(daddy_trans_, "localKeySignatureChanges", SCM_EOL);
+ accidentals_.clear();
arpeggios_.clear ();
- tie_arr_.clear ();
+ ties_.clear ();
}
void
New_accidental_engraver::acknowledge_grob (Grob_info info)
{
- Note_req * note_l = dynamic_cast <Note_req *> (info.music_cause ());
+ Note_req * note = dynamic_cast <Note_req *> (info.music_cause ());
- if (note_l && Rhythmic_head::has_interface (info.grob_l_))
+ if (note && Rhythmic_head::has_interface (info.grob_))
{
New_accidental_entry entry ;
- entry.head_ = info.grob_l_;
- entry.origin_ = info.origin_trans_l_->daddy_trans_l_;
- entry.melodic_ = note_l;
+ entry.head_ = info.grob_;
+ entry.origin_ = info.origin_trans_->daddy_trans_;
+ entry.melodic_ = note;
- accidental_arr_.push (entry);
+ accidentals_.push (entry);
}
- else if (Tie::has_interface (info.grob_l_))
+ else if (Tie::has_interface (info.grob_))
{
- tie_arr_.push (info.grob_l_);
+ ties_.push (info.grob_);
}
- else if (Arpeggio::has_interface (info.grob_l_))
+ else if (Arpeggio::has_interface (info.grob_))
{
- arpeggios_.push (info.grob_l_);
+ arpeggios_.push (info.grob_);
}
}
*/
if (last_keysig_ != sig)
{
- set_property_on_family(daddy_trans_l_, "localKeySignature", sig);
- set_property_on_family(daddy_trans_l_, "localKeySignatureChanges", SCM_EOL); //This souldn't be neccesary
+ set_property_on_family(daddy_trans_, "localKeySignature", sig);
+ set_property_on_family(daddy_trans_, "localKeySignatureChanges", SCM_EOL); //This souldn't be neccesary
last_keysig_ = sig;
}
}
Grob *cu =clash_groups[UP][0];
Grob *cd =clash_groups[DOWN][0];
- Grob * nu_l= Note_column::first_head (cu);
- Grob * nd_l = Note_column::first_head (cd);
+ Grob * nu= Note_column::first_head (cu);
+ Grob * nd = Note_column::first_head (cd);
/*
Let's not crash.
*/
- if (!Note_column::stem_l (cu)
- || !Note_column::stem_l (cd))
+ if (!Note_column::get_stem (cu)
+ || !Note_column::get_stem (cd))
return ;
*/
- Array<int> ups = Stem::note_head_positions (Note_column::stem_l (cu));
- Array<int> dps = Stem::note_head_positions (Note_column::stem_l (cd));
+ Array<int> ups = Stem::note_head_positions (Note_column::get_stem (cu));
+ Array<int> dps = Stem::note_head_positions (Note_column::get_stem (cd));
/*
they're too far apart to collide.
don't merge whole notes (or longer, like breve, longa, maxima)
*/
- int upball_type = Note_head::balltype_i (nu_l);
- int dnball_type = Note_head::balltype_i (nd_l);
+ int upball_type = Note_head::get_balltype (nu);
+ int dnball_type = Note_head::get_balltype (nd);
merge_possible = merge_possible && (upball_type > 0);
if (!to_boolean (me->get_grob_property ("merge-differently-dotted")))
- merge_possible = merge_possible && Rhythmic_head::dot_count (nu_l) == Rhythmic_head::dot_count (nd_l);
+ merge_possible = merge_possible && Rhythmic_head::dot_count (nu) == Rhythmic_head::dot_count (nd);
if (!to_boolean (me->get_grob_property ("merge-differently-headed")))
Can't merge quarter and half notes.
*/
merge_possible = merge_possible &&
- !((Rhythmic_head::duration_log (nu_l) == 1
- && Rhythmic_head::duration_log (nd_l) == 2)
- ||(Rhythmic_head::duration_log (nu_l) == 2
- && Rhythmic_head::duration_log (nd_l) == 1));
+ !((Rhythmic_head::duration_log (nu) == 1
+ && Rhythmic_head::duration_log (nd) == 2)
+ ||(Rhythmic_head::duration_log (nu) == 2
+ && Rhythmic_head::duration_log (nd) == 1));
int i = 0, j=0;
while (i < ups.size () && j < dps.size ())
for full collisions, the right hand head may obscure dots, so
make sure the dotted heads go to the right.
*/
- if ((Rhythmic_head::dot_count (nu_l) > Rhythmic_head::dot_count (nd_l)
+ if ((Rhythmic_head::dot_count (nu) > Rhythmic_head::dot_count (nd)
&& full_collide))
shift_amount = 1;
Grob *wipe_ball = 0;
if (upball_type < dnball_type)
- wipe_ball = nd_l;
+ wipe_ball = nd;
else if (upball_type > dnball_type)
- wipe_ball = nu_l;
+ wipe_ball = nu;
if (wipe_ball)
{
/*
we're meshing.
*/
- else if (Rhythmic_head::dot_count (nu_l) || Rhythmic_head::dot_count (nd_l))
+ else if (Rhythmic_head::dot_count (nu) || Rhythmic_head::dot_count (nd))
shift_amount *= 0.1;
else
shift_amount *= 0.25;
Grob * s = unsmob_grob (ly_caar (autos));
Real amount = gh_scm2double (ly_cdar (autos));
- if (!done.find_l (s))
+ if (!done.find (s))
s->translate_axis (amount * wid, X_AXIS);
}
}
}
void
-Note_collision_interface::add_column (Grob*me,Grob* ncol_l)
+Note_collision_interface::add_column (Grob*me,Grob* ncol)
{
- ncol_l->add_offset_callback (Note_collision_interface::force_shift_callback_proc, X_AXIS);
- Axis_group_interface::add_element (me, ncol_l);
- me->add_dependency (ncol_l);
+ ncol->add_offset_callback (Note_collision_interface::force_shift_callback_proc, X_AXIS);
+ Axis_group_interface::add_element (me, ncol);
+ me->add_dependency (ncol);
}
}
Item *
-Note_column::stem_l (Grob*me)
+Note_column::get_stem (Grob*me)
{
SCM s = me->get_grob_property ("stem");
return unsmob_item (s);
{
Grob *se = unsmob_grob (ly_car (h));
- int j = int (Staff_symbol_referencer::position_f (se));
+ int j = int (Staff_symbol_referencer::get_position (se));
iv.unite (Slice (j,j));
}
return iv;
void
-Note_column::set_stem (Grob*me,Grob * stem_l)
+Note_column::set_stem (Grob*me,Grob * stem)
{
- me->set_grob_property ("stem", stem_l->self_scm ());
- me->add_dependency (stem_l);
- Axis_group_interface::add_element (me, stem_l);
+ me->set_grob_property ("stem", stem->self_scm ());
+ me->add_dependency (stem);
+ Axis_group_interface::add_element (me, stem);
}
void
Grob*
Note_column::first_head (Grob*me)
{
- Grob * st = stem_l (me);
+ Grob * st = get_stem (me);
return st? Stem::first_head (st): 0;
}
void
Note_head_line_engraver::acknowledge_grob (Grob_info info)
{
- if (Rhythmic_head::has_interface (info.grob_l_))
+ if (Rhythmic_head::has_interface (info.grob_))
{
- head_ = info.grob_l_;
+ head_ = info.grob_;
if (to_boolean (get_property ("followVoice")))
{
- Translator_group * tr = daddy_trans_l_;
- while (tr && tr->type_str_ != "Staff")
- tr = tr->daddy_trans_l_ ;
+ Translator_group * tr = daddy_trans_;
+ while (tr && tr->type_string_ != "Staff")
+ tr = tr->daddy_trans_ ;
- if (tr && tr->type_str_ == "Staff" && tr != last_staff_)
+ if (tr && tr->type_string_ == "Staff" && tr != last_staff_)
{
if (last_head_)
follow_ = true;
/* Note, mustn't set y-parent of breakable symbol to simple item:
one of the two broken parts won't have an y-parent! */
/* X parent is set by set_bound */
- line_->set_parent (Staff_symbol_referencer::staff_symbol_l (last_head_),
+ line_->set_parent (Staff_symbol_referencer::get_staff_symbol (last_head_),
Y_AXIS);
SCM c = last_req_? last_req_->self_scm () : SCM_EOL;
if (lines_i)
{
Real ledgerlinethickness =
- (me->paper_l ()->get_var ("ledgerlinethickness"));
+ (me->get_paper ()->get_var ("ledgerlinethickness"));
Real blotdiameter = ledgerlinethickness;
- // (me->paper_l ()->get_var ("blotdiameter"));
+ // (me->get_paper ()->get_var ("blotdiameter"));
Interval y_extent =
Interval (-0.5*(ledgerlinethickness),
+0.5*(ledgerlinethickness));
UGH: use grob-property.
*/
- SCM log = gh_int2scm (Note_head::balltype_i (me));
+ SCM log = gh_int2scm (Note_head::get_balltype (me));
SCM exp = scm_list_n (ly_symbol2scm ("find-notehead-symbol"), log,
ly_quote_scm (style),
SCM_UNDEFINED);
Molecule out = Font_interface::get_default_font (me)->find_by_name (name);
if (out.empty_b())
{
- warning (_f("Symbol not found, ", name.ch_C()));
+ warning (_f("Symbol not found, ", name.to_str0 ()));
}
int interspaces = Staff_symbol_referencer::line_count (me)-1;
- int pos = (int)rint (Staff_symbol_referencer::position_f (me));
+ int pos = (int)rint (Staff_symbol_referencer::get_position (me));
if (abs (pos) - interspaces > 1)
{
Interval hd = out.extent (X_AXIS);
Note_head::brew_ez_molecule (SCM smob)
{
Grob *me = unsmob_grob (smob);
- int l = Note_head::balltype_i (me);
+ int l = Note_head::get_balltype (me);
int b = (l >= 2);
Pitch* pit = unsmob_pitch (spitch);
char s[2] = "a";
- s[0] = (pit->notename_i_ + 2)%7 + 'a';
+ s[0] = (pit->notename_ + 2)%7 + 'a';
s[0] = toupper (s[0]);
SCM charstr = ly_str02scm (s);
Box bx (Interval (0, 1.0), Interval (-0.5, 0.5));
Molecule m (bx, at);
- int pos = (int)rint (Staff_symbol_referencer::position_f (me));
+ int pos = (int)rint (Staff_symbol_referencer::get_position (me));
int interspaces = Staff_symbol_referencer::line_count (me)-1;
if (abs (pos) - interspaces > 1)
{
int
-Note_head::balltype_i (Grob*me)
+Note_head::get_balltype (Grob*me)
{
SCM s = me->get_grob_property ("duration-log");
return gh_number_p (s) ? gh_scm2int (s) <? 2 : 0;
*/
class Note_heads_engraver : public Engraver
{
- Link_array<Item> note_p_arr_;
+ Link_array<Item> notes_;
- Link_array<Item> dot_p_arr_;
- Link_array<Note_req> note_req_l_arr_;
+ Link_array<Item> dots_;
+ Link_array<Note_req> note_reqs_;
public:
TRANSLATOR_DECLARATIONS(Note_heads_engraver);
protected:
virtual void start_translation_timestep ();
- virtual bool try_music (Music *req_l) ;
+ virtual bool try_music (Music *req) ;
virtual void process_music ();
virtual void stop_translation_timestep ();
{
if (Note_req * n =dynamic_cast <Note_req *> (m))
{
- note_req_l_arr_.push (n);
+ note_reqs_.push (n);
return true;
}
else if (dynamic_cast<Busy_playing_req*> (m))
{
- return note_req_l_arr_.size ();
+ return note_reqs_.size ();
}
else if (Span_req *req_ = dynamic_cast<Span_req*> (m))
{
void
Note_heads_engraver::process_music ()
{
- for (int i=0; i < note_req_l_arr_.size (); i++)
+ for (int i=0; i < note_reqs_.size (); i++)
{
- Item *note_p =
+ Item *note =
new Item (get_property ((in_ligature) ? "LigatureHead" : "NoteHead"));
- Music * req = note_req_l_arr_[i];
+ Music * req = note_reqs_[i];
Duration dur = *unsmob_duration (req->get_mus_property ("duration"));
- note_p->set_grob_property ("duration-log", gh_int2scm (dur.duration_log ()));
+ note->set_grob_property ("duration-log", gh_int2scm (dur.duration_log ()));
if (dur.dot_count ())
{
Item * d = new Item (get_property ("Dots"));
- Rhythmic_head::set_dots (note_p, d);
+ Rhythmic_head::set_dots (note, d);
if (dur.dot_count ()
!= gh_scm2int (d->get_grob_property ("dot-count")))
d->set_grob_property ("dot-count", gh_int2scm (dur.dot_count ()));
- d->set_parent (note_p, Y_AXIS);
+ d->set_parent (note, Y_AXIS);
announce_grob (d, SCM_EOL);
- dot_p_arr_.push (d);
+ dots_.push (d);
}
Pitch *pit =unsmob_pitch (req->get_mus_property ("pitch"));
if (gh_number_p (c0))
pos += gh_scm2int (c0);
- note_p->set_grob_property ("staff-position", gh_int2scm (pos));
- announce_grob (note_p,req->self_scm());
- note_p_arr_.push (note_p);
+ note->set_grob_property ("staff-position", gh_int2scm (pos));
+ announce_grob (note,req->self_scm());
+ notes_.push (note);
}
}
void
Note_heads_engraver::stop_translation_timestep ()
{
- for (int i=0; i < note_p_arr_.size (); i++)
+ for (int i=0; i < notes_.size (); i++)
{
- typeset_grob (note_p_arr_[i]);
+ typeset_grob (notes_[i]);
}
- note_p_arr_.clear ();
- for (int i=0; i < dot_p_arr_.size (); i++)
+ notes_.clear ();
+ for (int i=0; i < dots_.size (); i++)
{
- typeset_grob (dot_p_arr_[i]);
+ typeset_grob (dots_[i]);
}
- dot_p_arr_.clear ();
+ dots_.clear ();
- note_req_l_arr_.clear ();
+ note_reqs_.clear ();
}
void
public:
TRANSLATOR_DECLARATIONS(Note_name_engraver);
- Link_array<Note_req> req_l_arr_;
+ Link_array<Note_req> reqs_;
Link_array<Item> texts_;
virtual bool try_music (Music*m);
virtual void process_acknowledged_grobs ();
{
if (Note_req *r = dynamic_cast<Note_req* > (m))
{
- req_l_arr_.push (r);
+ reqs_.push (r);
return true;
}
return false;
if (texts_.size ())
return;
String s ;
- for (int i=0; i < req_l_arr_.size (); i++)
+ for (int i=0; i < reqs_.size (); i++)
{
if (i)
s += " ";
- s += unsmob_pitch (req_l_arr_[i]->get_mus_property ("pitch"))->str ();
+ s += unsmob_pitch (reqs_[i]->get_mus_property ("pitch"))->string ();
}
- if (s.length_i ())
+ if (s.length ())
{
Item * t = new Item (get_property ("NoteName"));
- t->set_grob_property ("text", ly_str02scm (s.ch_C ()));
- announce_grob(t, req_l_arr_[0]->self_scm());
+ t->set_grob_property ("text", ly_str02scm (s.to_str0 ()));
+ announce_grob(t, reqs_[0]->self_scm());
texts_.push (t);
}
}
typeset_grob (texts_[i]);
}
texts_.clear () ;
- req_l_arr_.clear ();
+ reqs_.clear ();
}
TRANSLATOR_DECLARATIONS(Note_performer);
protected:
- virtual bool try_music (Music *req_l) ;
+ virtual bool try_music (Music *req) ;
virtual void stop_translation_timestep ();
virtual void create_audio_elements ();
- Global_translator* global_translator_l ();
+ Global_translator* get_global_translator ();
private:
- Array<Note_req*> note_req_l_arr_;
- Array<Audio_note*> note_p_arr_;
- Array<Audio_note*> delayed_p_arr_;
+ Array<Note_req*> note_reqs_;
+ Array<Audio_note*> notes_;
+ Array<Audio_note*> delayeds_;
};
void
Note_performer::create_audio_elements ()
{
- if (note_req_l_arr_.size ())
+ if (note_reqs_.size ())
{
int transposing_i = 0;
//urg
if (gh_number_p (prop))
transposing_i = gh_scm2int (prop);
- while (note_req_l_arr_.size ())
+ while (note_reqs_.size ())
{
- Note_req* n = note_req_l_arr_.pop ();
+ Note_req* n = note_reqs_.pop ();
Pitch pit = * unsmob_pitch (n->get_mus_property ("pitch"));
Audio_note* p = new Audio_note (pit, n->length_mom (), transposing_i);
Audio_element_info info (p, n);
announce_element (info);
- note_p_arr_.push (p);
+ notes_.push (p);
}
- note_req_l_arr_.clear ();
+ note_reqs_.clear ();
}
}
Global_translator*
-Note_performer::global_translator_l ()
+Note_performer::get_global_translator ()
{
Translator *t = this;
- Global_translator *global_l =0;
+ Global_translator *global =0;
do
{
- t = t->daddy_trans_l_ ;
- global_l = dynamic_cast<Global_translator*> (t);
+ t = t->daddy_trans_ ;
+ global = dynamic_cast<Global_translator*> (t);
}
- while (!global_l);
+ while (!global);
- return global_l;
+ return global;
}
// why don't grace notes show up here?
// --> grace notes effectively do not get delayed
- Global_translator* global_l = global_translator_l ();
- for (int i=0; i < note_p_arr_.size (); i++)
+ Global_translator* global = get_global_translator ();
+ for (int i=0; i < notes_.size (); i++)
{
- Audio_note* n = note_p_arr_[i];
+ Audio_note* n = notes_[i];
Moment m= n->delayed_until_mom_;
if (m.to_bool ())
{
- global_l->add_moment_to_process (m);
- delayed_p_arr_.push (n);
- note_p_arr_[i] = 0;
- note_p_arr_.del (i);
+ global->add_moment_to_process (m);
+ delayeds_.push (n);
+ notes_[i] = 0;
+ notes_.del (i);
i--;
}
}
Moment now = now_mom ();
- for (int i=0; i < note_p_arr_.size (); i++)
+ for (int i=0; i < notes_.size (); i++)
{
- play_element (note_p_arr_[i]);
+ play_element (notes_[i]);
}
- note_p_arr_.clear ();
- note_req_l_arr_.clear ();
- for (int i=0; i < delayed_p_arr_.size (); i++)
+ notes_.clear ();
+ note_reqs_.clear ();
+ for (int i=0; i < delayeds_.size (); i++)
{
- Audio_note* n = delayed_p_arr_[i];
+ Audio_note* n = delayeds_[i];
if (n->delayed_until_mom_ <= now)
{
play_element (n);
- delayed_p_arr_[i] = 0;
- delayed_p_arr_.del (i);
+ delayeds_[i] = 0;
+ delayeds_.del (i);
i--;
}
}
}
bool
-Note_performer::try_music (Music* req_l)
+Note_performer::try_music (Music* req)
{
- if (Note_req *nr = dynamic_cast <Note_req *> (req_l))
+ if (Note_req *nr = dynamic_cast <Note_req *> (req))
{
- note_req_l_arr_.push (nr);
+ note_reqs_.push (nr);
return true;
}
return false;
if (!it)
continue;
- Item *it_col = it->column_l ();
+ Item *it_col = it->get_column ();
if (d == RIGHT && right_col != it_col)
continue;
if (!me->live())
return 0;
- return dynamic_cast<Item*> (me)->column_l ();
+ return dynamic_cast<Item*> (me)->get_column ();
}
/*
{
Item * ri = unsmob_item (gh_car (s));
- Item * col = ri->column_l ();
- int rank = Paper_column::rank_i (col);
+ Item * col = ri->get_column ();
+ int rank = Paper_column::get_rank (col);
if (rank < min_rank)
{
SCM newright = SCM_EOL;
for (SCM s = right ; gh_pair_p (s) ; s =gh_cdr (s))
{
- if (unsmob_item (gh_car (s))->column_l () == mincol)
+ if (unsmob_item (gh_car (s))->get_column () == mincol)
newright = gh_cons (gh_car (s), newright);
}
if (!mincol)
{
/*
- int r = Paper_column::rank_i (dynamic_cast<Item*>(me)->column_l ());
+ int r = Paper_column::get_rank (dynamic_cast<Item*>(me)->get_column ());
programming_error (_f("Spacing wish column %d has no right item.", r));
*/
if (d == RIGHT)
acc_right = acc_right || Note_column::accidentals (it);
- Grob *stem = Note_column::stem_l (it);
+ Grob *stem = Note_column::get_stem (it);
if (!stem)
{
if (d == RIGHT && Separation_item::has_interface (it))
{
- if (it->column_l () != rcolumn)
+ if (it->get_column () != rcolumn)
{
it = it->find_prebroken_piece (rcolumn->break_status_dir ());
}
return ;
}
- beams_drul[d] = Stem::beam_l (stem);
+ beams_drul[d] = Stem::get_beam (stem);
Direction sd = Stem::get_direction (stem);
hanging from the note.
*/
if (d == LEFT
- && Stem::duration_log (stem) > 2 && !Stem::beam_l (stem))
+ && Stem::duration_log (stem) > 2 && !Stem::get_beam (stem))
{
return;
should typecheck pred.
*/
SCM result=gh_apply (pred,
- scm_list_n (inf.grob_l_->self_scm (), SCM_UNDEFINED));
+ scm_list_n (inf.grob_->self_scm (), SCM_UNDEFINED));
if (to_boolean (result))
{
SCM sym = o->get_mus_property ("grob-property");
SCM val = o->get_mus_property ("grob-value");
- inf.grob_l_->internal_set_grob_property (sym, val);
+ inf.grob_->internal_set_grob_property (sym, val);
}
}
}
{
if (last_processed_mom_ < Moment (0))
{
- bool accepted = try_music (music_l ());
+ bool accepted = try_music (get_music ());
if (!accepted)
- music_l ()->origin ()->warning (_f ("Junking request: `%s'",
- classname (music_l ())));
+ get_music ()->origin ()->warning (_f ("Junking request: `%s'",
+ classname (get_music ())));
}
skip (m);
int
-Paper_column::rank_i (Grob*me)
+Paper_column::get_rank (Grob*me)
{
- return dynamic_cast<Paper_column*> (me)->rank_i_;
+ return dynamic_cast<Paper_column*> (me)->rank_;
}
System*
}
Paper_column*
-Paper_column::column_l () const
+Paper_column::get_column () const
{
return (Paper_column*) (this);
}
: Item (l) // guh.?
{
system_=0;
- rank_i_ = -1;
+ rank_ = -1;
}
Moment
{
Grob *me = unsmob_grob (p);
- String r = to_str (Paper_column::rank_i (me));
+ String r = to_string (Paper_column::get_rank (me));
SCM properties = Font_interface::font_alist_chain (me);
- Molecule t = Text_item::text2molecule (me, ly_str02scm (r.ch_C()),
+ Molecule t = Text_item::text2molecule (me, ly_str02scm (r.to_str0 ()),
properties);
t.align_to (X_AXIS, CENTER);
t.align_to (Y_AXIS, DOWN);
#include "scaled-font-metric.hh"
#include "main.hh"
#include "scm-hash.hh"
-#include "file-results.hh" // urg? header_global_p
+#include "file-results.hh" // urg? header_global
#include "paper-outputter.hh"
/*
Real
Paper_def::get_var (String s) const
{
- return get_realvar (ly_symbol2scm (s.ch_C ()));
+ return get_realvar (ly_symbol2scm (s.to_str0 ()));
}
SCM
Paper_def::get_scmvar (String s) const
{
- return variable_tab_->get (ly_symbol2scm (s.ch_C ()));
+ return variable_tab_->get (ly_symbol2scm (s.to_str0 ()));
}
-int Paper_def::score_count_i_ = 0;
+int Paper_def::score_count_ = 0;
int
Paper_def::get_next_score_count () const
{
- return score_count_i_ ++;
+ return score_count_ ++;
}
void
Paper_def::reset_score_count ()
{
- score_count_i_ = 0;
+ score_count_ = 0;
}
Paper_outputter*
-Paper_def::paper_outputter_p ()
+Paper_def::get_paper_outputter ()
{
- String outname = outname_str ();
+ String outname = outname_string ();
progress_indication (_f ("paper output to `%s'...",
outname == "-" ? String ("<stdout>") : outname));
- target_str_global_array.push (outname);
+ target_string_globals.push (outname);
Paper_outputter * po = new Paper_outputter (outname);
Path p = split_path (outname);
p.ext = "";
- po->basename_ = p.str ();
+ po->basename_ = p.string ();
return po;
}
m /= gh_scm2double (ssc);
}
- Font_metric* f = all_fonts_global_p->find_font (ly_scm2string (fn));
+ Font_metric* f = all_fonts_global->find_font (ly_scm2string (fn));
SCM val = Scaled_font_metric::make_scaled_font_metric (f, m);
scaled_fonts_ = scm_acons (key, val, scaled_fonts_);
gh_define ("security-paranoia", SCM_BOOL_T);
}
- file_ = scm_open_file (ly_str02scm (name.ch_C()),
+ file_ = scm_open_file (ly_str02scm (name.to_str0 ()),
ly_str02scm ("w"));
SCM exp = scm_list_n (ly_symbol2scm ("find-dumper"),
- ly_str02scm (output_format_global.ch_C()),
+ ly_str02scm (output_format_global.to_str0 ()),
SCM_UNDEFINED);
output_func_ = scm_primitive_eval (exp);
String generate = _ (", at ");
time_t t (time (0));
generate += ctime (&t);
- generate = generate.left_str (generate.length_i () - 1);
+ generate = generate.left_string (generate.length () - 1);
/*
Make fixed length time stamps
*/
- generate = generate + to_str (' ' * (120 - generate.length_i ())>? 0) ;
+ generate = generate + to_string (' ' * (120 - generate.length ())>? 0) ;
String creator = "lelie";
- SCM args_scm = scm_list_n (ly_str02scm (creator.ch_C ()),
- ly_str02scm (generate.ch_C ()), SCM_UNDEFINED);
+ SCM args_scm = scm_list_n (ly_str02scm (creator.to_str0 ()),
+ ly_str02scm (generate.to_str0 ()), SCM_UNDEFINED);
SCM scm = gh_cons (ly_symbol2scm ("header"), args_scm);
Paper_outputter::output_comment (String str)
{
output_scheme (scm_list_n (ly_symbol2scm ("comment"),
- ly_str02scm ((char*)str.ch_C ()),
+ ly_str02scm ((char*)str.to_str0 ()),
SCM_UNDEFINED)
);
}
void
Paper_outputter::output_version ()
{
- String id_str = "Lily was here";
- id_str += String_convert::pad_to (String (", ") + version_str (), 40);
+ String id_string = "Lily was here";
+ id_string += String_convert::pad_to (String (", ") + version_string (), 40);
- output_String_def ("lilypondtagline", id_str);
- output_String_def ("LilyPondVersion", version_str ());
+ output_String_def ("lilypondtagline", id_string);
+ output_String_def ("LilyPondVersion", version_string ());
output_String_def ("lilypondpaperunit", String (INTERNAL_UNIT));
}
{
SCM scm = scm_list_n (ly_symbol2scm ("lily-def"),
- ly_str02scm (k.ch_l ()),
- ly_str02scm (to_str (v).ch_l ()),
+ ly_str02scm (k.get_str0 ()),
+ ly_str02scm (to_string (v).get_str0 ()),
SCM_UNDEFINED);
output_scheme (scm);
}
{
SCM scm = scm_list_n (ly_symbol2scm ("lily-def"),
- ly_str02scm (k.ch_l ()),
- ly_str02scm (v.ch_l ()),
+ ly_str02scm (k.get_str0 ()),
+ ly_str02scm (v.get_str0 ()),
SCM_UNDEFINED);
output_scheme (scm);
}
Paper_outputter::output_int_def (String k, int v)
{
SCM scm = scm_list_n (ly_symbol2scm ("lily-def"),
- ly_str02scm (k.ch_l ()),
- ly_str02scm (to_str (v).ch_l ()),
+ ly_str02scm (k.get_str0 ()),
+ ly_str02scm (to_string (v).get_str0 ()),
SCM_UNDEFINED);
output_scheme (scm);
}
Paper_outputter::write_header_field_to_file (String filename, SCM key, SCM value)
{
output_scheme (scm_list_n (ly_symbol2scm ("header-to-file"),
- ly_str02scm (filename.ch_C()),
+ ly_str02scm (filename.to_str0 ()),
ly_quote_scm (key), value,
SCM_UNDEFINED));
}
for (int i = 0; i < dump_header_fieldnames_global.size (); i++)
{
String key = dump_header_fieldnames_global[i];
- SCM val = gh_assoc (ly_symbol2scm (key.ch_C ()), fields);
+ SCM val = gh_assoc (ly_symbol2scm (key.to_str0 ()), fields);
String s;
/* Only write header field to file if it exists */
if (gh_pair_p (val))
Paper_score::Paper_score ()
{
- paper_l_ =0;
- outputter_l_ =0;
+ paper_ =0;
+ outputter_ =0;
system_ = 0;
main_smob_ = SCM_EOL;
}
system_ = l; // ugh.
}
main_smob_ = gh_cons (l->self_scm (), main_smob_);
- l->pscore_l_ = this;
+ l->pscore_ = this;
/*
We don't unprotect l->self_scm (), we haven't got any place else to
Array<Column_x_positions>
Paper_score::calc_breaking ()
{
- Break_algorithm *algorithm_p=0;
+ Break_algorithm *algorithm=0;
Array<Column_x_positions> sol;
- algorithm_p = new Gourlay_breaking ;
- algorithm_p->set_pscore (this);
- sol = algorithm_p->solve ();
- delete algorithm_p;
+ algorithm = new Gourlay_breaking ;
+ algorithm->set_pscore (this);
+ sol = algorithm->solve ();
+ delete algorithm;
return sol;
}
/*
Be sure to set breakability on first & last column.
*/
- Link_array<Grob> pc (system_->column_l_arr ());
+ Link_array<Grob> pc (system_->columns ());
pc[0]->set_grob_property ("breakable", SCM_BOOL_T);
pc.top ()->set_grob_property ("breakable", SCM_BOOL_T);
Array<Column_x_positions> breaking = calc_breaking ();
system_->break_into_pieces (breaking);
- outputter_l_ = paper_l_->paper_outputter_p ();
+ outputter_ = paper_->get_paper_outputter ();
;
- outputter_l_->output_header ();
- outputter_l_->output_version ();
+ outputter_->output_header ();
+ outputter_->output_version ();
progress_indication ("\n");
- if (global_header_p)
+ if (global_header)
{
- outputter_l_->output_scope (global_header_p, "lilypond");
- outputter_l_->write_header_fields_to_file (global_header_p);
+ outputter_->output_scope (global_header, "lilypond");
+ outputter_->write_header_fields_to_file (global_header);
}
- if (header_l_)
+ if (header_)
{
- outputter_l_->output_scope (header_l_, "lilypond");
- outputter_l_->write_header_fields_to_file (header_l_);
+ outputter_->output_scope (header_, "lilypond");
+ outputter_->write_header_fields_to_file (header_);
}
- outputter_l_->output_comment (_ ("Outputting Score, defined at: "));
- outputter_l_->output_comment (origin_str_);
+ outputter_->output_comment (_ ("Outputting Score, defined at: "));
+ outputter_->output_comment (origin_string_);
- if (paper_l_->variable_tab_)
- outputter_l_->output_scope (paper_l_->variable_tab_, "lilypondpaper");
+ if (paper_->variable_tab_)
+ outputter_->output_scope (paper_->variable_tab_, "lilypondpaper");
SCM scm = scm_list_n (ly_symbol2scm ("header-end"), SCM_UNDEFINED);
- outputter_l_->output_scheme (scm);
+ outputter_->output_scheme (scm);
system_->output_lines ();
scm = scm_list_n (ly_symbol2scm ("end-output"), SCM_UNDEFINED);
- outputter_l_->output_scheme (scm);
+ outputter_->output_scheme (scm);
progress_indication ("\n");
// huh?
- delete outputter_l_;
- outputter_l_ = 0;
+ delete outputter_;
+ outputter_ = 0;
if (verbose_global_b)
ly_display_scm (scm_gc_stats ());
regular_identifier_b (SCM id)
{
String str = ly_scm2string (id);
- char const *s = str.ch_C() ;
+ char const *s = str.to_str0 () ;
bool v = true;
while (*s && v)
#define YYERROR_VERBOSE 1
-#define YYPARSE_PARAM my_lily_parser_l
-#define YYLEX_PARAM my_lily_parser_l
+#define YYPARSE_PARAM my_lily_parser
+#define YYLEX_PARAM my_lily_parser
#define THIS\
- ((My_lily_parser *) my_lily_parser_l)
+ ((My_lily_parser *) my_lily_parser)
#define yyerror THIS->parser_error
#define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f ("Expecting %d arguments", s))
%{
int
-yylex (YYSTYPE *s, void * v_l)
+yylex (YYSTYPE *s, void * v)
{
- My_lily_parser *pars_l = (My_lily_parser*) v_l;
- My_lily_lexer * lex_l = pars_l->lexer_p_;
+ My_lily_parser *pars = (My_lily_parser*) v;
+ My_lily_lexer * lex = pars->lexer_;
- lex_l->lexval_l = (void*) s;
- return lex_l->yylex ();
+ lex->lexval = (void*) s;
+ return lex->yylex ();
}
| lilypond toplevel_expression {}
| lilypond assignment { }
| lilypond error {
- THIS->error_level_i_ = 1;
+ THIS->error_level_ = 1;
}
| lilypond INVALID {
- THIS->error_level_i_ = 1;
+ THIS->error_level_ = 1;
}
;
toplevel_expression:
notenames_block {
- THIS->lexer_p_->pitchname_tab_ = $1;
+ THIS->lexer_->pitchname_tab_ = $1;
}
| chordmodifiers_block {
- THIS->lexer_p_->chordmodifier_tab_ = $1;
+ THIS->lexer_->chordmodifier_tab_ = $1;
}
| lilypond_header {
- if (global_header_p)
- scm_gc_unprotect_object (global_header_p->self_scm ());
- global_header_p = $1;
+ if (global_header)
+ scm_gc_unprotect_object (global_header->self_scm ());
+ global_header = $1;
}
| score_block {
- score_global_array.push ($1);
+ score_globals.push ($1);
}
| output_def {
if (dynamic_cast<Paper_def*> ($1))
- THIS->lexer_p_->set_identifier (gh_str02scm ("$defaultpaper"), $1->self_scm ());
+ THIS->lexer_->set_identifier (gh_str02scm ("$defaultpaper"), $1->self_scm ());
else if (dynamic_cast<Midi_def*> ($1))
- THIS->lexer_p_->set_identifier (gh_str02scm ("$defaultmidi"), $1->self_scm ());
+ THIS->lexer_->set_identifier (gh_str02scm ("$defaultmidi"), $1->self_scm ());
}
| embedded_scm {
// junk value
lilypond_header_body:
{
$$ = new Scheme_hash_table;
- THIS->lexer_p_-> scope_l_arr_.push ($$);
+ THIS->lexer_-> scopes_.push ($$);
}
| lilypond_header_body assignment {
lilypond_header:
HEADER '{' lilypond_header_body '}' {
$$ = $3;
- THIS->lexer_p_->scope_l_arr_.pop ();
+ THIS->lexer_->scopes_.pop ();
}
;
ip.warning (_ ("Identifier should have alphabetic characters only"));
}
- THIS->lexer_p_->set_identifier ($1, $4);
+ THIS->lexer_->set_identifier ($1, $4);
/*
TODO: devise standard for protection in parser.
/*cont*/ '{' score_body '}' {
THIS->pop_spot ();
$$ = $4;
- if (!$$->def_p_arr_.size ())
+ if (!$$->defs_.size ())
{
Music_output_def *id =
- unsmob_music_output_def (THIS->lexer_p_->lookup_identifier ("$defaultpaper"));
+ unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
$$->add_output (id ? id->clone () : new Paper_def );
}
}
}
| score_body lilypond_header {
scm_gc_unprotect_object ($2->self_scm ());
- $$->header_p_ = $2;
+ $$->header_ = $2;
}
| score_body output_def {
$$->add_output ($2);
output_def:
music_output_def_body '}' {
$$ = $1;
- THIS-> lexer_p_-> scope_l_arr_.pop ();
+ THIS-> lexer_-> scopes_.pop ();
}
;
music_output_def_body:
MIDI '{' {
- Music_output_def *id = unsmob_music_output_def (THIS->lexer_p_->lookup_identifier ("$defaultmidi"));
+ Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultmidi"));
Midi_def* p =0;
p = new Midi_def;
$$ = p;
- THIS->lexer_p_->scope_l_arr_.push (p->variable_tab_);
+ THIS->lexer_->scopes_.push (p->variable_tab_);
}
| PAPER '{' {
- Music_output_def *id = unsmob_music_output_def (THIS->lexer_p_->lookup_identifier ("$defaultpaper"));
+ Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
Paper_def *p = 0;
if (id)
p = dynamic_cast<Paper_def*> (id->clone ());
else
p = new Paper_def;
- THIS-> lexer_p_-> scope_l_arr_.push (p->variable_tab_);
+ THIS-> lexer_-> scopes_.push (p->variable_tab_);
$$ = p;
}
| PAPER '{' MUSIC_OUTPUT_DEF_IDENTIFIER {
Music_output_def *p = unsmob_music_output_def ($3);
p = p->clone ();
- THIS->lexer_p_->scope_l_arr_.push (p->variable_tab_);
+ THIS->lexer_->scopes_.push (p->variable_tab_);
$$ = p;
}
| MIDI '{' MUSIC_OUTPUT_DEF_IDENTIFIER {
Music_output_def *p = unsmob_music_output_def ($3);
p = p->clone ();
- THIS->lexer_p_->scope_l_arr_.push (p->variable_tab_);
+ THIS->lexer_->scopes_.push (p->variable_tab_);
$$ = p;
}
| music_output_def_body assignment {
Sequential_music_iterator in combination with grace notes.
*/
- SCM start = THIS->lexer_p_->lookup_identifier ("startGraceMusic");
- SCM stop = THIS->lexer_p_->lookup_identifier ("stopGraceMusic");
+ SCM start = THIS->lexer_->lookup_identifier ("startGraceMusic");
+ SCM stop = THIS->lexer_->lookup_identifier ("stopGraceMusic");
Music *startm = unsmob_music (start);
Music *stopm = unsmob_music (stop);
$$ = m;
}
| NOTES
- { THIS->lexer_p_->push_note_state (); }
+ { THIS->lexer_->push_note_state (); }
Music
{ $$ = $3;
- THIS->lexer_p_->pop_state ();
+ THIS->lexer_->pop_state ();
}
| FIGURES
- { THIS->lexer_p_->push_figuredbass_state (); }
+ { THIS->lexer_->push_figuredbass_state (); }
Music
{
Music * chm = new Untransposable_music () ;
$$ = chm;
scm_gc_unprotect_object ($3->self_scm());
- THIS->lexer_p_->pop_state ();
+ THIS->lexer_->pop_state ();
}
| CHORDS
- { THIS->lexer_p_->push_chord_state (); }
+ { THIS->lexer_->push_chord_state (); }
Music
{
Music * chm = new Un_relativable_music ;
scm_gc_unprotect_object ($3->self_scm());
$$ = chm;
- THIS->lexer_p_->pop_state ();
+ THIS->lexer_->pop_state ();
}
| LYRICS
- { THIS->lexer_p_->push_lyric_state (); }
+ { THIS->lexer_->push_lyric_state (); }
Music
{
$$ = $3;
- THIS->lexer_p_->pop_state ();
+ THIS->lexer_->pop_state ();
}
| relative_music { $$ = $1; }
| re_rhythmed_music { $$ = $1; }
verbose_command_req:
COMMANDSPANREQUEST bare_int STRING { /*TODO: junkme */
- Span_req * sp_p = new Span_req;
- sp_p-> set_span_dir ( Direction ($2));
- sp_p->set_mus_property ("span-type",$3);
- sp_p->set_spot (THIS->here_input ());
- $$ = sp_p;
+ Span_req * sp = new Span_req;
+ sp-> set_span_dir ( Direction ($2));
+ sp->set_mus_property ("span-type",$3);
+ sp->set_spot (THIS->here_input ());
+ $$ = sp;
}
| MARK DEFAULT {
Mark_req * m = new Mark_req;
$$ = b;
}
| SKIP duration_length {
- Skip_req * skip_p = new Skip_req;
- skip_p->set_mus_property ("duration", $2);
+ Skip_req * skip = new Skip_req;
+ skip->set_mus_property ("duration", $2);
- $$ = skip_p;
+ $$ = skip;
}
| tempo_request {
$$ = $1;
}
| KEY DEFAULT {
- Key_change_req *key_p= new Key_change_req;
- $$ = key_p;
+ Key_change_req *key= new Key_change_req;
+ $$ = key;
}
| KEY NOTENAME_PITCH SCM_IDENTIFIER {
- Key_change_req *key_p= new Key_change_req;
+ Key_change_req *key= new Key_change_req;
- key_p->set_mus_property ("pitch-alist", $3);
- ((Music*)key_p)->transpose (* unsmob_pitch ($2));
- $$ = key_p;
+ key->set_mus_property ("pitch-alist", $3);
+ ((Music*)key)->transpose (* unsmob_pitch ($2));
+ $$ = key;
}
;
gen_text_def
| verbose_request
| script_abbreviation {
- SCM s = THIS->lexer_p_->lookup_identifier ("dash" + ly_scm2string ($1));
+ SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1));
Articulation_req *a = new Articulation_req;
if (gh_string_p (s))
a->set_mus_property ("articulation-type", s);
$$ = d;
}
| SPANREQUEST bare_int STRING {
- Span_req * sp_p = new Span_req;
- sp_p->set_span_dir ( Direction ($2));
- sp_p->set_mus_property ("span-type", $3);
- sp_p->set_spot (THIS->here_input ());
- $$ = sp_p;
+ Span_req * sp = new Span_req;
+ sp->set_span_dir ( Direction ($2));
+ sp->set_mus_property ("span-type", $3);
+ sp->set_spot (THIS->here_input ());
+ $$ = sp;
}
| tremolo_type {
Tremolo_req* a = new Tremolo_req;
}
| NOTENAME_PITCH sup_quotes {
Pitch p = *unsmob_pitch ($1);
- p.octave_i_ += $2;
+ p.octave_ += $2;
$$ = p.smobbed_copy ();
}
| NOTENAME_PITCH sub_quotes {
Pitch p =* unsmob_pitch ($1);
- p.octave_i_ += -$2;
+ p.octave_ += -$2;
$$ = p.smobbed_copy ();
}
}
| TONICNAME_PITCH sup_quotes {
Pitch p = *unsmob_pitch ($1);
- p.octave_i_ += $2;
+ p.octave_ += $2;
$$ = p.smobbed_copy ();
}
| TONICNAME_PITCH sub_quotes {
Pitch p =* unsmob_pitch ($1);
- p.octave_i_ += -$2;
+ p.octave_ += -$2;
$$ = p.smobbed_copy ();
}
extender_req:
EXTENDER {
- if (!THIS->lexer_p_->lyric_state_b ())
+ if (!THIS->lexer_->lyric_state_b ())
THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
$$ = new Extender_req;
}
hyphen_req:
HYPHEN {
- if (!THIS->lexer_p_->lyric_state_b ())
+ if (!THIS->lexer_->lyric_state_b ())
THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
$$ = new Hyphen_req;
}
$$ = t;
}
| DIGIT {
- String ds = to_str ($1);
+ String ds = to_string ($1);
Text_script_req* t = new Text_script_req;
SCM finger = ly_symbol2scm ("finger");
- t->set_mus_property ("text", ly_str02scm (ds.ch_C ()));
+ t->set_mus_property ("text", ly_str02scm (ds.to_str0 ()));
t->set_mus_property ("text-type" , finger);
t->set_spot (THIS->here_input ());
$$ = t;
Music *m = unsmob_music ($1);
if ($2) {
SCM salter =m->get_mus_property ("alteration");
- int alter = gh_number_p( salter) ? gh_scm2int (salter) : 0;
+ int alter = gh_number_p ( salter) ? gh_scm2int (salter) : 0;
m->set_mus_property ("alteration",
gh_int2scm (alter + $2));
} else {
pitch exclamations questions optional_notemode_duration optional_rest {
Input i = THIS->pop_spot ();
- if (!THIS->lexer_p_->note_state_b ())
+ if (!THIS->lexer_->note_state_b ())
THIS->parser_error (_ ("Have to be in Note mode for notes"));
Music *n = 0;
SCM e = SCM_UNDEFINED;
if (ly_scm2string ($1) =="s") {
/* Space */
- Skip_req * skip_p = new Skip_req;
- skip_p->set_mus_property ("duration" ,$2);
- skip_p->set_spot (i);
- e = skip_p->self_scm ();
+ Skip_req * skip = new Skip_req;
+ skip->set_mus_property ("duration" ,$2);
+ skip->set_spot (i);
+ e = skip->self_scm ();
}
else {
- Rest_req * rest_req_p = new Rest_req;
- rest_req_p->set_mus_property ("duration", $2);
- rest_req_p->set_spot (i);
- e = rest_req_p->self_scm ();
+ Rest_req * rest_req = new Rest_req;
+ rest_req->set_mus_property ("duration", $2);
+ rest_req->set_spot (i);
+ e = rest_req->self_scm ();
}
- Simultaneous_music* velt_p = new Request_chord (SCM_EOL);
- velt_p-> set_mus_property ("elements", scm_list_n (e,SCM_UNDEFINED));
- velt_p->set_spot (i);
+ Simultaneous_music* velt = new Request_chord (SCM_EOL);
+ velt-> set_mus_property ("elements", scm_list_n (e,SCM_UNDEFINED));
+ velt->set_spot (i);
- $$ = velt_p;
+ $$ = velt;
}
| MULTI_MEASURE_REST optional_notemode_duration {
Input i = THIS->pop_spot ();
| STRING optional_notemode_duration {
Input i = THIS->pop_spot ();
- Lyric_req* lreq_p = new Lyric_req;
- lreq_p->set_mus_property ("text", $1);
- lreq_p->set_mus_property ("duration",$2);
- lreq_p->set_spot (i);
- Simultaneous_music* velt_p = new Request_chord (SCM_EOL);
- velt_p->set_mus_property ("elements", scm_list_n (lreq_p->self_scm (), SCM_UNDEFINED));
+ Lyric_req* lreq = new Lyric_req;
+ lreq->set_mus_property ("text", $1);
+ lreq->set_mus_property ("duration",$2);
+ lreq->set_spot (i);
+ Simultaneous_music* velt = new Request_chord (SCM_EOL);
+ velt->set_mus_property ("elements", scm_list_n (lreq->self_scm (), SCM_UNDEFINED));
- $$= velt_p;
+ $$= velt;
}
| chord {
Input i = THIS->pop_spot ();
- if (!THIS->lexer_p_->chord_state_b ())
+ if (!THIS->lexer_->chord_state_b ())
THIS->parser_error (_ ("Have to be in Chord mode for chords"));
$$ = $1;
}
chord_note:
bare_unsigned {
Pitch m;
- m.notename_i_ = ($1 - 1) % 7;
- m.octave_i_ = $1 > 7 ? 1 : 0;
- m.alteration_i_ = 0;
+ m.notename_ = ($1 - 1) % 7;
+ m.octave_ = $1 > 7 ? 1 : 0;
+ m.alteration_ = 0;
$$ = m.smobbed_copy ();
}
| bare_unsigned '+' {
Pitch m;
- m.notename_i_ = ($1 - 1) % 7;
- m.octave_i_ = $1 > 7 ? 1 : 0;
- m.alteration_i_ = 1;
+ m.notename_ = ($1 - 1) % 7;
+ m.octave_ = $1 > 7 ? 1 : 0;
+ m.alteration_ = 1;
$$ = m.smobbed_copy ();
}
| bare_unsigned CHORD_MINUS {
Pitch m;
- m.notename_i_ = ($1 - 1) % 7;
- m.octave_i_ = $1 > 7 ? 1 : 0;
- m.alteration_i_ = -1;
+ m.notename_ = ($1 - 1) % 7;
+ m.octave_ = $1 > 7 ? 1 : 0;
+ m.alteration_ = -1;
$$ = m.smobbed_copy ();
}
Part_combine_music_iterator::Part_combine_music_iterator ()
{
- first_iter_p_ = 0;
- second_iter_p_ = 0;
+ first_iter_ = 0;
+ second_iter_ = 0;
first_until_ = 0;
second_until_ = 0;
}
Part_combine_music_iterator::~Part_combine_music_iterator ()
{
- delete second_iter_p_;
- delete first_iter_p_;
+ delete second_iter_;
+ delete first_iter_;
}
Part_combine_music_iterator::Part_combine_music_iterator (Part_combine_music_iterator const &src)
: Music_iterator (src)
{
- second_iter_p_ = src.second_iter_p_ ? src.second_iter_p_->clone () : 0;
- first_iter_p_ = src.first_iter_p_ ? src.first_iter_p_->clone () : 0;
+ second_iter_ = src.second_iter_ ? src.second_iter_->clone () : 0;
+ first_iter_ = src.first_iter_ ? src.first_iter_->clone () : 0;
first_until_ = src.first_until_;
second_until_ = src.second_until_;
{
Moment p;
p.set_infinite (1);
- if (first_iter_p_->ok ())
- p = p <? first_iter_p_->pending_moment ();
+ if (first_iter_->ok ())
+ p = p <? first_iter_->pending_moment ();
- if (second_iter_p_->ok ())
- p = p <? second_iter_p_->pending_moment ();
+ if (second_iter_->ok ())
+ p = p <? second_iter_->pending_moment ();
return p;
}
bool
Part_combine_music_iterator::ok () const
{
- return first_iter_p_->ok () || second_iter_p_->ok ();
+ return first_iter_->ok () || second_iter_->ok ();
}
void
Part_combine_music_iterator::construct_children ()
{
- Part_combine_music const * m = dynamic_cast<Part_combine_music const*> (music_l ());
+ Part_combine_music const * m = dynamic_cast<Part_combine_music const*> (get_music ());
- first_iter_p_ = get_iterator_p (m->first_l ());
- second_iter_p_ = get_iterator_p (m->second_l ());
+ first_iter_ = get_iterator (m->get_first ());
+ second_iter_ = get_iterator (m->get_second ());
}
void
Part_combine_music_iterator::change_to (Music_iterator *it, String to_type,
String to_id)
{
- Translator_group * current = it->report_to_l ();
+ Translator_group * current = it->report_to ();
Translator_group * last = 0;
/*
If \translator Staff = bass, then look for Staff = *
*/
- while (current && current->type_str_ != to_type)
+ while (current && current->type_string_ != to_type)
{
last = current;
- current = current->daddy_trans_l_;
+ current = current->daddy_trans_;
}
- if (current && current->id_str_ == to_id)
+ if (current && current->id_string_ == to_id)
{
String msg;
msg += _ ("Can't switch translators, I'm there already");
if (last)
{
Translator_group * dest =
- it->report_to_l ()->find_create_translator_l (to_type, to_id);
- current->remove_translator_p (last);
+ it->report_to ()->find_create_translator (to_type, to_id);
+ current->remove_translator (last);
dest->add_used_group_translator (last);
}
else
We could change the current translator's id, but that would make
errors hard to catch
- last->translator_id_str_ = change_l ()->change_to_id_str_;
+ last->translator_id_string_ = get_change ()->change_to_id_string_;
*/
- error (_f ("I'm one myself: `%s'", to_type.ch_C ()));
+ error (_f ("I'm one myself: `%s'", to_type.to_str0 ()));
}
else
- error (_f ("none of these in my family: `%s'", to_id.ch_C ()));
+ error (_f ("none of these in my family: `%s'", to_id.to_str0 ()));
}
Part_combine_music_iterator::get_state (Moment)
{
int state = UNKNOWN;
- Part_combine_music const *p = dynamic_cast<Part_combine_music const* > (music_l ());
+ Part_combine_music const *p = dynamic_cast<Part_combine_music const* > (get_music ());
String w = ly_scm2string (p->get_mus_property ("what"));
- Translator_group *first_translator = first_iter_p_->report_to_l ()->find_create_translator_l (w, "one" + suffix_);
+ Translator_group *first_translator = first_iter_->report_to ()->find_create_translator (w, "one" + suffix_);
SCM s = first_translator->get_property ("changeMoment");
if (!gh_pair_p (s))
Moment diff_until = diff_mom + now;
bool first = true;
- Music_iterator *first_iter = first_iter_p_->clone ();
- Music_iterator *second_iter = second_iter_p_->clone ();
+ Music_iterator *first_iter = first_iter_->clone ();
+ Music_iterator *second_iter = second_iter_->clone ();
Moment last_pending (-1);
Moment pending = now;
*/
if (suffix_.empty_b ())
- suffix_ = first_iter_p_->report_to_l ()
- ->daddy_trans_l_->id_str_.cut_str (3, INT_MAX);
+ suffix_ = first_iter_->report_to ()
+ ->daddy_trans_->id_string_.cut_string (3, INT_MAX);
int state = get_state (m);
if (state)
state = state_;
Part_combine_music const *p =
- dynamic_cast<Part_combine_music const* > (music_l ());
+ dynamic_cast<Part_combine_music const* > (get_music ());
- bool previously_combined_b = first_iter_p_->report_to_l ()->daddy_trans_l_
- == second_iter_p_->report_to_l ()->daddy_trans_l_;
+ bool previously_combined_b = first_iter_->report_to ()->daddy_trans_
+ == second_iter_->report_to ()->daddy_trans_;
bool combine_b = previously_combined_b;
if (combine_b && combine_b != previously_combined_b)
{
- if (second_iter_p_ && second_iter_p_->ok ())
- second_iter_p_->try_music (abort_req);
+ if (second_iter_ && second_iter_->ok ())
+ second_iter_->try_music (abort_req);
}
String w = ly_scm2string (p->get_mus_property ("what"));
if (combine_b != previously_combined_b)
- change_to (second_iter_p_, w, (combine_b ? "one" : "two")
+ change_to (second_iter_, w, (combine_b ? "one" : "two")
+ suffix_);
- Translator_group *first_translator = first_iter_p_->report_to_l ()->find_create_translator_l (w, "one" + suffix_);
- Translator_group *second_translator = second_iter_p_->report_to_l ()->find_create_translator_l (w, "two" + suffix_);
+ Translator_group *first_translator = first_iter_->report_to ()->find_create_translator (w, "one" + suffix_);
+ Translator_group *second_translator = second_iter_->report_to ()->find_create_translator (w, "two" + suffix_);
/* Hmm */
first_translator->set_property ("othersolo", b2);
second_translator->set_property ("othersolo", b1);
- if (first_iter_p_->ok ())
- first_iter_p_->process (m);
+ if (first_iter_->ok ())
+ first_iter_->process (m);
- if (second_iter_p_->ok ())
- second_iter_p_->process (m);
+ if (second_iter_->ok ())
+ second_iter_->process (m);
}
Music_iterator*
Part_combine_music_iterator::try_music_in_children (Music *m) const
{
- Music_iterator * i = first_iter_p_->try_music (m);
+ Music_iterator * i = first_iter_->try_music (m);
if (i)
return i;
else
- return second_iter_p_->try_music (m);
+ return second_iter_->try_music (m);
}
Part_combine_music_iterator::get_pending_events (Moment m)const
{
SCM s = SCM_EOL;
- if (first_iter_p_)
- s = gh_append2 (s,first_iter_p_->get_pending_events (m));
- if (second_iter_p_)
- s = gh_append2 (second_iter_p_->get_pending_events (m),s);
+ if (first_iter_)
+ s = gh_append2 (s,first_iter_->get_pending_events (m));
+ if (second_iter_)
+ s = gh_append2 (second_iter_->get_pending_events (m),s);
return s;
}
void
Part_combine_music::transpose (Pitch p)
{
- first_l ()->transpose (p);
- second_l () ->transpose (p);
+ get_first ()->transpose (p);
+ get_second () ->transpose (p);
}
Moment
Part_combine_music::length_mom () const
{
- return first_l ()->length_mom ();
+ return get_first ()->length_mom ();
}
Pitch
Part_combine_music::to_relative_octave (Pitch p)
{
- p = first_l ()->to_relative_octave (p);
- return second_l ()->to_relative_octave (p);
+ p = get_first ()->to_relative_octave (p);
+ return get_second ()->to_relative_octave (p);
}
void
Part_combine_music::compress (Moment m)
{
- first_l ()->compress (m);
- second_l ()->compress (m);
+ get_first ()->compress (m);
+ get_second ()->compress (m);
}
Music*
-Part_combine_music::first_l () const
+Part_combine_music::get_first () const
{
SCM l = get_mus_property ("elements");
if (!gh_pair_p (l))
Music*
-Part_combine_music::second_l () const
+Part_combine_music::get_second () const
{
SCM l = get_mus_property ("elements");
if (!gh_pair_p (l))
Item * beat_slash_;
Item * double_percent_;
- Spanner * perc_p_;
- Spanner * finished_perc_p_;
+ Spanner * perc_;
+ Spanner * finished_perc_;
Item * stem_tremolo_;
protected:
virtual void finalize ();
Percent_repeat_engraver::Percent_repeat_engraver ()
{
- perc_p_ = finished_perc_p_ = 0;
+ perc_ = finished_perc_ = 0;
repeat_ =0;
stem_tremolo_ = 0;
repeat_ = rp;
- Global_translator *global_l =0;
+ Global_translator *global =0;
Translator *t = this;
do
{
- t = t->daddy_trans_l_ ;
- global_l = dynamic_cast<Global_translator*> (t);
+ t = t->daddy_trans_ ;
+ global = dynamic_cast<Global_translator*> (t);
}
- while (!global_l);
+ while (!global);
for (int i = 0; i < count; i++)
- global_l->add_moment_to_process (now + Moment (1+i) * body_length_);
+ global->add_moment_to_process (now + Moment (1+i) * body_length_);
return true;
}
}
else if (repeat_sign_type_ == MEASURE)
{
- finished_perc_p_ = perc_p_;
+ finished_perc_ = perc_;
typeset_perc ();
- perc_p_ = new Spanner (get_property ("PercentRepeat"));
+ perc_ = new Spanner (get_property ("PercentRepeat"));
SCM col =get_property ("currentCommandColumn");
- perc_p_->set_bound (LEFT, unsmob_grob (col));
- announce_grob(perc_p_, repeat_->self_scm());
+ perc_->set_bound (LEFT, unsmob_grob (col));
+ announce_grob(perc_, repeat_->self_scm());
}
else if (repeat_sign_type_ == DOUBLE_MEASURE)
Percent_repeat_engraver::finalize ()
{
typeset_perc ();
- if (perc_p_)
+ if (perc_)
{
repeat_->origin ()->warning (_ ("unterminated chord tremolo"));
- perc_p_->suicide ();
+ perc_->suicide ();
}
}
void
Percent_repeat_engraver::typeset_perc ()
{
- if (finished_perc_p_)
+ if (finished_perc_)
{
SCM col =get_property ("currentCommandColumn");
- finished_perc_p_->set_bound (RIGHT, unsmob_grob (col));
- typeset_grob (finished_perc_p_);
- finished_perc_p_ = 0;
+ finished_perc_->set_bound (RIGHT, unsmob_grob (col));
+ typeset_grob (finished_perc_);
+ finished_perc_ = 0;
}
if (beat_slash_)
{
if (stop_mom_ == now_mom ())
{
- if (perc_p_)
+ if (perc_)
{
- finished_perc_p_ = perc_p_;
+ finished_perc_ = perc_;
typeset_perc ();
}
repeat_ = 0;
- perc_p_ = 0;
+ perc_ = 0;
repeat_sign_type_ = UNKNOWN;
}
}
Percent_repeat_iterator::Percent_repeat_iterator (Percent_repeat_iterator const & p)
: Music_iterator (p)
{
- child_iter_p_ = p.child_iter_p_ ? p.child_iter_p_->clone (): 0;
+ child_iter_ = p.child_iter_ ? p.child_iter_->clone (): 0;
finish_mom_ = p.finish_mom_ ;
}
bool
Percent_repeat_iterator::ok () const
{
- return child_iter_p_;
+ return child_iter_;
}
void
Percent_repeat_iterator::construct_children ()
{
- Repeated_music * mus =dynamic_cast<Repeated_music *> (music_l ());
+ Repeated_music * mus =dynamic_cast<Repeated_music *> (get_music ());
finish_mom_ = mus->length_mom ();
- child_iter_p_ = get_iterator_p (mus->body ());
+ child_iter_ = get_iterator (mus->body ());
}
{
if (!m.to_bool ())
{
- Music_iterator *yeah = try_music (music_l ());
+ Music_iterator *yeah = try_music (get_music ());
if (yeah)
- set_translator (yeah->report_to_l ());
+ set_translator (yeah->report_to ());
else
- music_l ()->origin ()->warning ( _ ("no one to print a percent"));
+ get_music ()->origin ()->warning ( _ ("no one to print a percent"));
}
- if (child_iter_p_->ok ())
- child_iter_p_->process (m);
+ if (child_iter_->ok ())
+ child_iter_->process (m);
if (finish_mom_ <= m )
{
- delete child_iter_p_;
- child_iter_p_ = 0;
+ delete child_iter_;
+ child_iter_ = 0;
}
}
Moment
Percent_repeat_iterator::pending_moment ()const
{
- if (child_iter_p_->ok ())
- return child_iter_p_->pending_moment ();
+ if (child_iter_->ok ())
+ return child_iter_->pending_moment ();
else
return finish_mom_ ;
}
Music_iterator*
Percent_repeat_iterator::try_music_in_children (Music *m) const
{
- return child_iter_p_->try_music (m);
+ return child_iter_->try_music (m);
}
Percent_repeat_iterator::~Percent_repeat_iterator ()
{
- delete child_iter_p_;
+ delete child_iter_;
}
Performance::Performance ()
{
- midi_l_ =0;
+ midi_ =0;
audio_elem_p_list_ = 0;
}
void
Performance::output (Midi_stream& midi_stream)
{
- int tracks_i = audio_staff_l_arr_.size () + 1;
+ int tracks_i = audio_staffs_.size () + 1;
// ugh
int clocks_per_4_i = 384;
progress_indication ("\n");
progress_indication (_ ("Track ... "));
int channel = 0;
- for (int i =0; i < audio_staff_l_arr_.size (); i++)
+ for (int i =0; i < audio_staffs_.size (); i++)
{
- Audio_staff *s = audio_staff_l_arr_[i];
+ Audio_staff *s = audio_staffs_[i];
if (verbose_global_b)
- progress_indication ("[" + to_str (i)) ;
+ progress_indication ("[" + to_string (i)) ;
/*
MIDI players tend to ignore instrument settings on
*/
if (channel == 9)
channel++;
- if (s->channel_i_ < 0)
- s->channel_i_ = channel;
+ if (s->channel_ < 0)
+ s->channel_ = channel;
s->output (midi_stream, channel++);
if (verbose_global_b)
progress_indication ("]");
{
Midi_track midi_track;
- midi_track.channel_i_ = 9;
+ midi_track.channel_ = 9;
// perhaps multiple text events?
- String id_str;
+ String id_string;
String str = String (_ ("Creator: "));
- id_str = String_convert::pad_to (gnu_lilypond_version_str (), 30);
- str += id_str;
+ id_string = String_convert::pad_to (gnu_lilypond_version_string (), 30);
+ str += id_string;
/*
This seems silly, but in fact the audio elements should
/* Better not translate this */
str = "Generated automatically by: ";
- str += id_str;
+ str += id_string;
Audio_text generate_a (Audio_text::TEXT, str);
Midi_text generate (&generate_a);
str = _ ("at ");
time_t t (time (0));
str += ctime (&t);
- str = str.left_str (str.length_i () - 1);
+ str = str.left_string (str.length () - 1);
str = String_convert::pad_to (str, 60);
Audio_text at_a (Audio_text::TEXT, str);
midi_track.add (Moment (0), &at);
- str = _f ("from musical definition: %s", origin_str_);
+ str = _f ("from musical definition: %s", origin_string_);
Audio_text from_a (Audio_text::TEXT, str);
Midi_text from (&from_a);
midi_track.add (Moment (0), &from);
Audio_text track_name_a (Audio_text::TRACK_NAME, "Track "
- + String_convert::i2dec_str (0, 0, '0'));
+ + String_convert::int2dec (0, 0, '0'));
Midi_text track_name (&track_name_a);
midi_track.add (Moment (0), &track_name);
// Some sequencers read track 0 last.
- // Audio_tempo tempo_a (midi_l_->get_tempo_i (Moment (Rational (1, 4))));
+ // Audio_tempo tempo_a (midi_->get_tempo (Moment (Rational (1, 4))));
// Midi_tempo tempo (&tempo_a);
// midi_track.add (Moment (0), &tempo);
{
if (Audio_staff*s=dynamic_cast<Audio_staff *> (p))
{
- audio_staff_l_arr_.push (s);
+ audio_staffs_.push (s);
}
else if (Audio_column *c = dynamic_cast<Audio_column*> (p))
{
- c->performance_l_ = this;
+ c->performance_ = this;
}
audio_elem_p_list_ = new Killing_cons<Audio_element> (p, audio_elem_p_list_);
}
String out = output_name_global;
if (out == "-")
out = "lelie.midi";
- int def = midi_l_->get_next_score_count ();
+ int def = midi_->get_next_score_count ();
if (def)
{
Path p = split_path (out);
- p.base += "-" + to_str (def);
- out = p.str ();
+ p.base += "-" + to_string (def);
+ out = p.string ();
}
/* Maybe a bit crude, but we had this before */
Path p = split_path (out);
p.ext = "midi";
- out = p.str ();
+ out = p.string ();
Midi_stream midi_stream (out);
progress_indication (_f ("MIDI output to `%s'...", out));
- target_str_global_array.push (out);
+ target_string_globals.push (out);
output (midi_stream);
progress_indication ("\n");
void
Performer_group_performer::announce_element (Audio_element_info info)
{
- announce_info_arr_.push (info);
+ announce_infos_.push (info);
Performer::announce_element (info);
}
void
Performer_group_performer::acknowledge_audio_elements ()
{
- for (int j =0; j < announce_info_arr_.size (); j++)
+ for (int j =0; j < announce_infos_.size (); j++)
{
- Audio_element_info info = announce_info_arr_[j];
+ Audio_element_info info = announce_infos_[j];
for (SCM p = simple_trans_list_; gh_pair_p (p); p = ly_cdr (p))
{
Translator * t = unsmob_translator (ly_car (p));
Performer * eng = dynamic_cast<Performer*> (t);
- if (eng && eng!= info.origin_trans_l_)
+ if (eng && eng!= info.origin_trans_)
eng->acknowledge_audio_element (info);
}
}
create_audio_elements ();
- while (announce_info_arr_.size ())
+ while (announce_infos_.size ())
{
acknowledge_audio_elements ();
- announce_info_arr_.clear ();
+ announce_infos_.clear ();
create_audio_elements ();
}
- if (announce_info_arr_.size ())
+ if (announce_infos_.size ())
{
#if 0 //printf? -> include <stdio.h>
printf ("do_announces: elt: %s\n",
- classname (announce_info_arr_[0].elem_l_));
+ classname (announce_infos_[0].elem_));
#endif
- announce_info_arr_.clear ();
+ announce_infos_.clear ();
}
}
void
Performer::play_element (Audio_element* p)
{
- daddy_perf_l ()->play_element (p);
+ get_daddy_perf ()->play_element (p);
}
int
-Performer::get_tempo_i () const
+Performer::get_tempo () const
{
- return daddy_perf_l ()->get_tempo_i ();
+ return get_daddy_perf ()->get_tempo ();
}
Performer_group_performer*
-Performer::daddy_perf_l () const
+Performer::get_daddy_perf () const
{
- return (daddy_trans_l_)
- ?dynamic_cast<Performer_group_performer *> (daddy_trans_l_)
+ return (daddy_trans_)
+ ?dynamic_cast<Performer_group_performer *> (daddy_trans_)
: 0;
}
void
Performer::announce_element (Audio_element_info i)
{
- if (!i.origin_trans_l_)
- i.origin_trans_l_= this;
- daddy_perf_l ()->announce_element (i);
+ if (!i.origin_trans_)
+ i.origin_trans_= this;
+ get_daddy_perf ()->announce_element (i);
}
class Phrasing_slur_engraver : public Engraver
{
- Link_array<Span_req> requests_arr_;
- Link_array<Span_req> new_phrasing_slur_req_l_arr_;
+ Link_array<Span_req> requestses_;
+ Link_array<Span_req> new_phrasing_slur_reqs_;
Link_array<Grob> phrasing_slur_l_stack_;
- Link_array<Grob> end_phrasing_slur_l_arr_;
+ Link_array<Grob> end_phrasing_slurs_;
Moment last_start_;
protected:
}
bool
-Phrasing_slur_engraver::try_music (Music *req_l)
+Phrasing_slur_engraver::try_music (Music *req)
{
- if (Span_req *sl = dynamic_cast <Span_req *> (req_l))
+ if (Span_req *sl = dynamic_cast <Span_req *> (req))
{
String t = ly_scm2string (sl->get_mus_property ("span-type"));
if (t == "abort")
phrasing_slur_l_stack_[i]->suicide ();
}
phrasing_slur_l_stack_.clear ();
- for (int i = 0; i < end_phrasing_slur_l_arr_.size (); i++)
+ for (int i = 0; i < end_phrasing_slurs_.size (); i++)
{
- end_phrasing_slur_l_arr_[i]->suicide ();
+ end_phrasing_slurs_[i]->suicide ();
}
- end_phrasing_slur_l_arr_.clear ();
- requests_arr_.clear ();
- new_phrasing_slur_req_l_arr_.clear ();
+ end_phrasing_slurs_.clear ();
+ requestses_.clear ();
+ new_phrasing_slur_reqs_.clear ();
}
else if (t == "phrasing-slur")
{
{
if (now_mom () > last_start_)
{
- new_phrasing_slur_req_l_arr_.push (sl);
+ new_phrasing_slur_reqs_.push (sl);
last_start_ = now_mom ();
return true;
}
}
else
{
- new_phrasing_slur_req_l_arr_.push (sl);
+ new_phrasing_slur_reqs_.push (sl);
return true;
}
}
void
Phrasing_slur_engraver::acknowledge_grob (Grob_info info)
{
- if (Note_column::has_interface (info.grob_l_))
+ if (Note_column::has_interface (info.grob_))
{
- Grob *e =info.grob_l_;
+ Grob *e =info.grob_;
for (int i = 0; i < phrasing_slur_l_stack_.size (); i++)
Slur::add_column (phrasing_slur_l_stack_[i], e);
- for (int i = 0; i < end_phrasing_slur_l_arr_.size (); i++)
- Slur::add_column (end_phrasing_slur_l_arr_[i], e);
+ for (int i = 0; i < end_phrasing_slurs_.size (); i++)
+ Slur::add_column (end_phrasing_slurs_[i], e);
}
}
}
phrasing_slur_l_stack_.clear ();
- for (int i=0; i < requests_arr_.size (); i++)
+ for (int i=0; i < requestses_.size (); i++)
{
- requests_arr_[i]->origin ()->warning (_ ("unterminated phrasing slur"));
+ requestses_[i]->origin ()->warning (_ ("unterminated phrasing slur"));
}
}
void
Phrasing_slur_engraver::process_acknowledged_grobs ()
{
- Link_array<Grob> start_phrasing_slur_l_arr;
- for (int i=0; i< new_phrasing_slur_req_l_arr_.size (); i++)
+ Link_array<Grob> start_phrasing_slurs;
+ for (int i=0; i< new_phrasing_slur_reqs_.size (); i++)
{
- Span_req* phrasing_slur_req_l = new_phrasing_slur_req_l_arr_[i];
+ Span_req* phrasing_slur_req = new_phrasing_slur_reqs_[i];
// end phrasing slur: move the phrasing slur to other array
- if (phrasing_slur_req_l->get_span_dir () == STOP)
+ if (phrasing_slur_req->get_span_dir () == STOP)
{
if (phrasing_slur_l_stack_.empty ())
- phrasing_slur_req_l->origin ()->warning (_f ("can't find start of phrasing slur"));
+ phrasing_slur_req->origin ()->warning (_f ("can't find start of phrasing slur"));
else
{
Grob* phrasing_slur = phrasing_slur_l_stack_.pop ();
- end_phrasing_slur_l_arr_.push (phrasing_slur);
- requests_arr_.pop ();
+ end_phrasing_slurs_.push (phrasing_slur);
+ requestses_.pop ();
}
}
- else if (phrasing_slur_req_l->get_span_dir () == START)
+ else if (phrasing_slur_req->get_span_dir () == START)
{
// push a new phrasing_slur onto stack.
// (use temp. array to wait for all phrasing_slur STOPs)
Grob* phrasing_slur = new Spanner (get_property ("PhrasingSlur"));
Slur::set_interface (phrasing_slur); // can't remove.
- start_phrasing_slur_l_arr.push (phrasing_slur);
- requests_arr_.push (phrasing_slur_req_l);
- announce_grob(phrasing_slur, phrasing_slur_req_l->self_scm());
+ start_phrasing_slurs.push (phrasing_slur);
+ requestses_.push (phrasing_slur_req);
+ announce_grob(phrasing_slur, phrasing_slur_req->self_scm());
}
}
- for (int i=0; i < start_phrasing_slur_l_arr.size (); i++)
- phrasing_slur_l_stack_.push (start_phrasing_slur_l_arr[i]);
- new_phrasing_slur_req_l_arr_.clear ();
+ for (int i=0; i < start_phrasing_slurs.size (); i++)
+ phrasing_slur_l_stack_.push (start_phrasing_slurs[i]);
+ new_phrasing_slur_reqs_.clear ();
}
void
Phrasing_slur_engraver::stop_translation_timestep ()
{
- for (int i = 0; i < end_phrasing_slur_l_arr_.size (); i++)
+ for (int i = 0; i < end_phrasing_slurs_.size (); i++)
{
- typeset_grob (end_phrasing_slur_l_arr_[i]);
+ typeset_grob (end_phrasing_slurs_[i]);
}
- end_phrasing_slur_l_arr_.clear ();
+ end_phrasing_slurs_.clear ();
}
void
Phrasing_slur_engraver::start_translation_timestep ()
{
- new_phrasing_slur_req_l_arr_.clear ();
+ new_phrasing_slur_reqs_.clear ();
}
struct Pedal_info
{
char const * name_;
- Span_req* start_req_l_;
+ Span_req* start_req_;
Drul_array<Span_req*> req_l_drul_;
- Item* item_p_;
- Spanner* bracket_p_; // A single portion of a pedal bracket
- Spanner* finished_bracket_p_;
+ Item* item_;
+ Spanner* bracket_; // A single portion of a pedal bracket
+ Spanner* finished_bracket_;
/*
This grob contains all the pedals of the same type on the same staff
Why 4, why not 3. Why not 3423 ? ---hwn.
*/
- Spanner *previous_p_ [4];
+ Spanner *previous_ [4];
int spanner_count_;
spanner_count_ = 0;
for (int i = 0; i < 3; ++i)
- previous_p_[i] = 0;
+ previous_[i] = 0;
char * names [] = { "Sostenuto", "Sustain", "UnaCorda", 0 };
do
{
p->name_ = *np;
- p->item_p_ = 0;
- p->bracket_p_ = 0;
- p->finished_bracket_p_ = 0;
+ p->item_ = 0;
+ p->bracket_ = 0;
+ p->finished_bracket_ = 0;
p->line_spanner_ = 0;
p->finished_line_spanner_ = 0;
p->current_bracket_req_ = 0;
p->req_l_drul_[START] = 0;
p->req_l_drul_[STOP] = 0;
- p->start_req_l_ = 0;
+ p->start_req_ = 0;
p++;
}
{
for (Pedal_info*p = info_list_; p && p->name_; p ++)
{
- if (Note_column::has_interface (info.grob_l_))
+ if (Note_column::has_interface (info.grob_))
{
if (p->line_spanner_)
{
- Side_position_interface::add_support (p->line_spanner_, info.grob_l_);
+ Side_position_interface::add_support (p->line_spanner_, info.grob_);
- add_bound_item (p->line_spanner_,info.grob_l_);
+ add_bound_item (p->line_spanner_,info.grob_);
}
- if (p->bracket_p_)
- add_bound_item (p->bracket_p_,info.grob_l_);
+ if (p->bracket_)
+ add_bound_item (p->bracket_,info.grob_);
}
}
p->req_l_drul_[START] = 0;
p->req_l_drul_[STOP] = 0;
- if (p->bracket_p_)
- p->bracket_p_->suicide (); /* as in dynamic-engraver.cc */
- p->bracket_p_ = 0;
+ if (p->bracket_)
+ p->bracket_->suicide (); /* as in dynamic-engraver.cc */
+ p->bracket_ = 0;
}
if (scm_equal_p (s->get_mus_property ("span-type"),
ly_str02scm (p->name_))==SCM_BOOL_T)
if (!p->line_spanner_)
{
String name = String (p->name_) + "PedalLineSpanner";
- p->line_spanner_ = new Spanner (get_property (name.ch_C ()));
+ p->line_spanner_ = new Spanner (get_property (name.to_str0 ()));
Side_position_interface::set_axis (p->line_spanner_, Y_AXIS);
Music * rq = (p->req_l_drul_[START] ? p->req_l_drul_[START] : p->req_l_drul_[STOP]);
announce_grob (p->line_spanner_, rq->self_scm ());
These can be text items or text-spanners
*/
SCM type = ly_cdr (scm_assoc (ly_symbol2scm ("pedal-type"),
- get_property ( (String (p->name_) + "Pedal").ch_C ())));
+ get_property ( (String (p->name_) + "Pedal").to_str0 ())));
if (type == ly_symbol2scm ("text") || // Ped. *Ped. *
type == ly_symbol2scm ("mixed") ) // Ped. _____/\____|
{
- if (! p->item_p_)
+ if (! p->item_)
create_text_grobs (p, type);
}
if (type == ly_symbol2scm ("bracket") || // |_________/\____|
{
SCM b;
SCM s = SCM_EOL;
- SCM strings = get_property ( ("pedal" + String (p->name_) + "Strings").ch_C ());
+ SCM strings = get_property ( ("pedal" + String (p->name_) + "Strings").to_str0 ());
if (scm_ilength (strings) >= 3)
{
{
if (pedaltype == ly_symbol2scm ("text"))
{
- if (!p->start_req_l_)
+ if (!p->start_req_)
{
p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_));
}
{
s = ly_cadr (strings);
}
- p->start_req_l_ = p->req_l_drul_[START];
+ p->start_req_ = p->req_l_drul_[START];
}
}
else if (p->req_l_drul_[STOP])
{
if (pedaltype == ly_symbol2scm ("text"))
{
- if (!p->start_req_l_)
+ if (!p->start_req_)
{
p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_));
}
s = ly_caddr (strings);
spanner_count_ --;
}
- p->start_req_l_ = 0;
+ p->start_req_ = 0;
}
}
else if (p->req_l_drul_[START])
{
- p->start_req_l_ = p->req_l_drul_[START];
+ p->start_req_ = p->req_l_drul_[START];
s = ly_car (strings);
if (pedaltype == ly_symbol2scm ("text"))
{
spanner_count_ ++;
- previous_p_[spanner_count_] = p->line_spanner_;
+ previous_[spanner_count_] = p->line_spanner_;
if (spanner_count_ > 1)
// add extra space below the previous already-occuring pedal
Side_position_interface::add_support (p->line_spanner_,
- previous_p_[spanner_count_ - 1]);
+ previous_[spanner_count_ - 1]);
}
}
if (gh_string_p (s))
{
String propname = String (p->name_) + "Pedal";
- b = get_property (propname.ch_C ());
- p->item_p_ = new Item (b);
- p->item_p_->set_grob_property ("text", s);
- Axis_group_interface::add_element (p->line_spanner_, p->item_p_);
+ b = get_property (propname.to_str0 ());
+ p->item_ = new Item (b);
+ p->item_->set_grob_property ("text", s);
+ Axis_group_interface::add_element (p->line_spanner_, p->item_);
- announce_grob (p->item_p_,
+ announce_grob (p->item_,
(p->req_l_drul_[START]
? p->req_l_drul_[START]
: p->req_l_drul_[STOP])->self_scm ());
if (p->req_l_drul_[STOP])
{
- if (!p->start_req_l_)
+ if (!p->start_req_)
{
p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", p->name_));
}
else if (!p->req_l_drul_[START])
spanner_count_ -- ;
- assert (!p->finished_bracket_p_ && p->bracket_p_);
+ assert (!p->finished_bracket_ && p->bracket_);
Grob *cmc = unsmob_grob (get_property ("currentMusicalColumn"));
- p->bracket_p_->set_bound (RIGHT, cmc);
+ p->bracket_->set_bound (RIGHT, cmc);
/*
Set properties so that the molecule-creating function will
know whether the right edge should be flared ___/
*/
- SCM eleft = ly_car (p->bracket_p_->get_grob_property ("edge-widen"));
+ SCM eleft = ly_car (p->bracket_->get_grob_property ("edge-widen"));
SCM eright = (p->req_l_drul_[START] ? edge_width_drul_[RIGHT] : gh_double2scm (0));
- p->bracket_p_->set_grob_property ("edge-widen", gh_cons (eleft, eright));
+ p->bracket_->set_grob_property ("edge-widen", gh_cons (eleft, eright));
- p->finished_bracket_p_ = p->bracket_p_;
- p->bracket_p_ = 0;
+ p->finished_bracket_ = p->bracket_;
+ p->bracket_ = 0;
p->current_bracket_req_ = 0;
- p->start_req_l_ = p->req_l_drul_[START];
+ p->start_req_ = p->req_l_drul_[START];
}
if (p->req_l_drul_[START])
{
- p->start_req_l_ = p->req_l_drul_[START];
+ p->start_req_ = p->req_l_drul_[START];
p->current_bracket_req_ = p->req_l_drul_[START];
- p->bracket_p_ = new Spanner (get_property ("PianoPedalBracket"));
+ p->bracket_ = new Spanner (get_property ("PianoPedalBracket"));
/*
Set properties so that the molecule-creating function will
know whether the left edge should be flared \___
*/
- SCM ew = p->bracket_p_->get_grob_property ("edge-widen");
+ SCM ew = p->bracket_->get_grob_property ("edge-widen");
edge_width_drul_[LEFT] = ly_car (ew);
edge_width_drul_[RIGHT] = ly_cdr (ew);
edge_width_drul_[LEFT] :
gh_double2scm (0));
SCM eright = gh_double2scm (0);
- p->bracket_p_->set_grob_property ("edge-widen", gh_cons (eleft, eright));
+ p->bracket_->set_grob_property ("edge-widen", gh_cons (eleft, eright));
/* Set this property for 'mixed style' pedals, Ped._______/\ ,
so the molecule function will shorten the ____ line by the length of the Ped. text.
*/
- p->bracket_p_->set_grob_property ("text-start",
+ p->bracket_->set_grob_property ("text-start",
pedaltype == ly_symbol2scm ("mixed") ?
gh_bool2scm ( (bool) ! p->req_l_drul_[STOP]) :
gh_bool2scm (false));
Mixed style: Store a pointer to the preceding text for use in
calculating the length of the line
*/
- if (p->item_p_)
- p->bracket_p_->set_grob_property ("pedal-text", p->item_p_->self_scm ());
+ if (p->item_)
+ p->bracket_->set_grob_property ("pedal-text", p->item_->self_scm ());
- p->bracket_p_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
- Axis_group_interface::add_element (p->line_spanner_, p->bracket_p_);
+ p->bracket_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
+ Axis_group_interface::add_element (p->line_spanner_, p->bracket_);
- add_bound_item (p->line_spanner_, p->bracket_p_->get_bound (LEFT));
- announce_grob (p->bracket_p_, p->req_l_drul_[START]->self_scm ());
+ add_bound_item (p->line_spanner_, p->bracket_->get_bound (LEFT));
+ announce_grob (p->bracket_, p->req_l_drul_[START]->self_scm ());
if (!p->req_l_drul_[STOP])
{
spanner_count_ ++;
- previous_p_[spanner_count_] = p->line_spanner_;
+ previous_[spanner_count_] = p->line_spanner_;
if (spanner_count_ > 1)
// position new pedal spanner below the current one
- Side_position_interface::add_support (p->line_spanner_, previous_p_[spanner_count_ - 1]);
+ Side_position_interface::add_support (p->line_spanner_, previous_[spanner_count_ - 1]);
}
}
p->finished_line_spanner_ = p->line_spanner_;
typeset_all ();
}
- if (p->bracket_p_
- && !p->bracket_p_->live())
- p->bracket_p_ = 0;
- if (p->bracket_p_)
+ if (p->bracket_
+ && !p->bracket_->live())
+ p->bracket_ = 0;
+ if (p->bracket_)
{
p->current_bracket_req_->origin ()->warning (_ ("unterminated pedal bracket"));
- p->bracket_p_->suicide ();
- p->bracket_p_ = 0;
+ p->bracket_->suicide ();
+ p->bracket_ = 0;
}
}
}
{
for (Pedal_info*p = info_list_; p && p->name_; p ++)
{
- if (!p->bracket_p_)
+ if (!p->bracket_)
{
p->finished_line_spanner_ = p->line_spanner_;
p->line_spanner_ = 0;
if (p->finished_line_spanner_
&& !p->finished_line_spanner_->live ())
p->finished_line_spanner_ = 0;
- if (p->finished_bracket_p_
- && !p->finished_bracket_p_->live())
- p->finished_bracket_p_ = 0;
+ if (p->finished_bracket_
+ && !p->finished_bracket_->live())
+ p->finished_bracket_ = 0;
if (p->name_ == String ("Sustain"))
- sustain = p->item_p_;
+ sustain = p->item_;
- if (p->item_p_)
+ if (p->item_)
{
/*
Hmm.
{
if (sustain)
{
- Side_position_interface::add_support (p->item_p_,sustain);
+ Side_position_interface::add_support (p->item_,sustain);
}
}
- typeset_grob (p->item_p_);
- p->item_p_ = 0;
+ typeset_grob (p->item_);
+ p->item_ = 0;
}
- if (p->finished_bracket_p_)
+ if (p->finished_bracket_)
{
- Grob * l = p->finished_bracket_p_->get_bound (LEFT);
- Grob * r = p->finished_bracket_p_->get_bound (RIGHT);
+ Grob * l = p->finished_bracket_->get_bound (LEFT);
+ Grob * r = p->finished_bracket_->get_bound (RIGHT);
if (!r)
{
- p->finished_bracket_p_->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn")));
+ p->finished_bracket_->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn")));
}
- typeset_grob (p->finished_bracket_p_);
- p->finished_bracket_p_ =0;
+ typeset_grob (p->finished_bracket_);
+ p->finished_bracket_ =0;
}
if (p->finished_line_spanner_)
struct Pedal_info
{
char const *name_;
- Span_req* start_req_l_;
+ Span_req* start_req_;
Drul_array<Span_req*> req_l_drul_;
};
virtual void start_translation_timestep ();
private:
- Link_array<Audio_piano_pedal> audio_p_arr_;
+ Link_array<Audio_piano_pedal> audios_;
Pedal_info * info_alist_;
};
p->name_ = *np;
p->req_l_drul_[START] = 0;
p->req_l_drul_[STOP] = 0;
- p->start_req_l_ = 0;
+ p->start_req_ = 0;
p++;
}
{
if (p->req_l_drul_[STOP])
{
- if (!p->start_req_l_)
+ if (!p->start_req_)
{
p->req_l_drul_[STOP]->origin ()->warning (_f ("can't find start of piano pedal: `%s'", String (p->name_)));
}
else
{
Audio_piano_pedal* a = new Audio_piano_pedal;
- a->type_str_ = String (p->name_);
+ a->type_string_ = String (p->name_);
a->dir_ = STOP;
- audio_p_arr_.push (a);
+ audios_.push (a);
}
- p->start_req_l_ = 0;
+ p->start_req_ = 0;
}
if (p->req_l_drul_[START])
{
- p->start_req_l_ = p->req_l_drul_[START];
+ p->start_req_ = p->req_l_drul_[START];
Audio_piano_pedal* a = new Audio_piano_pedal;
- a->type_str_ = String (p->name_);
+ a->type_string_ = String (p->name_);
a->dir_ = START;
- audio_p_arr_.push (a);
+ audios_.push (a);
}
p->req_l_drul_[START] = 0;
p->req_l_drul_[STOP] = 0;
void
Piano_pedal_performer::stop_translation_timestep ()
{
- for (int i=0; i< audio_p_arr_.size (); i++)
- play_element (audio_p_arr_[i]);
- audio_p_arr_.clear ();
+ for (int i=0; i< audios_.size (); i++)
+ play_element (audios_[i]);
+ audios_.clear ();
}
void
Pitch_squash_engraver::acknowledge_grob (Grob_info i)
{
SCM newpos = get_property ("squashedPosition");
- if (Note_head::has_interface (i.grob_l_))
+ if (Note_head::has_interface (i.grob_))
{
- i.grob_l_->set_grob_property ("staff-position", newpos);
+ i.grob_->set_grob_property ("staff-position", newpos);
}
}
Pitch::Pitch (int o, int n, int a)
{
- notename_i_ = n;
- alteration_i_ = a;
- octave_i_ = o;
+ notename_ = n;
+ alteration_ = a;
+ octave_ = o;
if (n < 0 || n >= 7 ||
a < -2 || a > 2)
{
String s = _ ("Pitch arguments out of range");
- s += ": alteration = " + to_str (a);
- s += ", notename = " + to_str (n);
+ s += ": alteration = " + to_string (a);
+ s += ", notename = " + to_string (n);
warning (s);
}
normalise ();
Pitch::Pitch ()
{
- notename_i_ = 0;
- alteration_i_ = 0;
- octave_i_ = 0;
+ notename_ = 0;
+ alteration_ = 0;
+ octave_ = 0;
}
int
Pitch::compare (Pitch const &m1, Pitch const &m2)
{
- int o= m1.octave_i_ - m2.octave_i_;
- int n = m1.notename_i_ - m2.notename_i_;
- int a = m1.alteration_i_ - m2.alteration_i_;
+ int o= m1.octave_ - m2.octave_;
+ int n = m1.notename_ - m2.notename_;
+ int a = m1.alteration_ - m2.alteration_;
if (o)
return o;
int
Pitch::steps () const
{
- return notename_i_ + octave_i_*7;
+ return notename_ + octave_*7;
}
/*
int
Pitch::semitone_pitch () const
{
- int o = octave_i_;
- int n = notename_i_;
+ int o = octave_;
+ int n = notename_;
while (n < 0)
{
n += 7;
o --;
}
- return (o + n / 7) * 12 + pitch_byte_a[n % 7] + alteration_i_;
+ return (o + n / 7) * 12 + pitch_byte_a[n % 7] + alteration_;
}
void
Pitch::normalise ()
{
int pitch = semitone_pitch ();
- while (notename_i_ >= 7)
+ while (notename_ >= 7)
{
- notename_i_ -= 7;
- octave_i_++;
- alteration_i_ -= semitone_pitch () - pitch;
+ notename_ -= 7;
+ octave_++;
+ alteration_ -= semitone_pitch () - pitch;
}
- while (notename_i_ < 0)
+ while (notename_ < 0)
{
- notename_i_ += 7;
- octave_i_--;
- alteration_i_ -= semitone_pitch () - pitch;
+ notename_ += 7;
+ octave_--;
+ alteration_ -= semitone_pitch () - pitch;
}
- while (alteration_i_ >= 3)
+ while (alteration_ >= 3)
{
- if (notename_i_ == 6)
+ if (notename_ == 6)
{
- notename_i_ = 0;
- octave_i_++;
+ notename_ = 0;
+ octave_++;
}
else
- notename_i_++;
+ notename_++;
- alteration_i_ = 0;
- alteration_i_ -= semitone_pitch () - pitch;
+ alteration_ = 0;
+ alteration_ -= semitone_pitch () - pitch;
}
- while (alteration_i_ <= -3)
+ while (alteration_ <= -3)
{
- if (notename_i_ == 0)
+ if (notename_ == 0)
{
- notename_i_ = 6;
- octave_i_--;
+ notename_ = 6;
+ octave_--;
}
else
- notename_i_--;
+ notename_--;
- alteration_i_ = 0;
- alteration_i_ -= semitone_pitch () - pitch;
+ alteration_ = 0;
+ alteration_ -= semitone_pitch () - pitch;
}
}
{
int old_semi = semitone_pitch ();
int delta_semi = delta.semitone_pitch ();
- octave_i_ += delta.octave_i_;
- notename_i_ += delta.notename_i_;
+ octave_ += delta.octave_;
+ notename_ += delta.notename_;
int new_semi = semitone_pitch ();
int delta_acc = new_semi - old_semi - delta_semi;
- alteration_i_ -= delta_acc;
+ alteration_ -= delta_acc;
normalise ();
}
char const *accname[] = {"eses", "es", "", "is" , "isis"};
String
-Pitch::str () const
+Pitch::string () const
{
- int n = (notename_i_ + 2) % 7;
- String s = to_str (char (n + 'a'));
- if (alteration_i_)
- s += String (accname[alteration_i_ + 2]);
+ int n = (notename_ + 2) % 7;
+ String s = to_string (char (n + 'a'));
+ if (alteration_)
+ s += String (accname[alteration_ + 2]);
- if (octave_i_ >= 0)
+ if (octave_ >= 0)
{
- int o = octave_i_ + 1;
+ int o = octave_ + 1;
while (o--)
s += "'";
}
- else if (octave_i_ < 0)
+ else if (octave_ < 0)
{
- int o = (-octave_i_) - 1;
+ int o = (-octave_) - 1;
while (o--)
- s += to_str (',');
+ s += to_string (',');
}
return s;
Pitch
Pitch::to_relative_octave (Pitch p)
{
- int oct_mod = octave_i_ + 1; // account for c' = octave 1 iso. 0 4
+ int oct_mod = octave_ + 1; // account for c' = octave 1 iso. 0 4
Pitch up_pitch (p);
Pitch down_pitch (p);
- up_pitch.alteration_i_ = alteration_i_;
- down_pitch.alteration_i_ = alteration_i_;
+ up_pitch.alteration_ = alteration_;
+ down_pitch.alteration_ = alteration_;
Pitch n = *this;
- up_pitch.up_to (notename_i_);
- down_pitch.down_to (notename_i_);
+ up_pitch.up_to (notename_);
+ down_pitch.down_to (notename_);
int h = p.steps ();
if (abs (up_pitch.steps () - h) < abs (down_pitch.steps () - h))
else
n = down_pitch;
- n.octave_i_ += oct_mod;
+ n.octave_ += oct_mod;
*this = n;
return *this;
void
Pitch::up_to (int notename)
{
- if (notename_i_ > notename)
+ if (notename_ > notename)
{
- octave_i_ ++;
+ octave_ ++;
}
- notename_i_ = notename;
+ notename_ = notename;
}
void
Pitch::down_to (int notename)
{
- if (notename_i_ < notename)
+ if (notename_ < notename)
{
- octave_i_ --;
+ octave_ --;
}
- notename_i_ = notename;
+ notename_ = notename;
}
LY_DEFINE(ly_pitch_transpose,
Pitch *r = (Pitch *) ly_cdr (s);
scm_puts ("#<Pitch ", port);
- scm_display (ly_str02scm (r->str ().ch_C ()), port);
+ scm_display (ly_str02scm (r->string ().to_str0 ()), port);
scm_puts (" >", port);
return 1;
Pitch *p = (Pitch *) ly_cdr (a);
Pitch *q = (Pitch *) ly_cdr (b);
- bool eq = p->notename_i_ == q->notename_i_
- && p->octave_i_ == q->octave_i_
- && p->alteration_i_ == q->alteration_i_;
+ bool eq = p->notename_ == q->notename_
+ && p->octave_ == q->octave_
+ && p->alteration_ == q->alteration_;
return eq ? SCM_BOOL_T : SCM_BOOL_F;
}
")
{
- SCM_ASSERT_TYPE(gh_number_p(o), o, SCM_ARG1, __FUNCTION__, "number");
- SCM_ASSERT_TYPE(gh_number_p(n), n, SCM_ARG2, __FUNCTION__, "number");
- SCM_ASSERT_TYPE(gh_number_p(a), a, SCM_ARG3, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE(gh_number_p (o), o, SCM_ARG1, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE(gh_number_p (n), n, SCM_ARG2, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE(gh_number_p (a), a, SCM_ARG3, __FUNCTION__, "number");
Pitch p (gh_scm2int (o), gh_scm2int (n), gh_scm2int (a));
return p.smobbed_copy ();
{
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
- int q = p->octave_i ();
+ int q = p->get_octave ();
return gh_int2scm (q);
}
{
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
- int q = p->alteration_i ();
+ int q = p->get_alteration ();
return gh_int2scm (q);
}
{
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
- int q = p->notename_i ();
+ int q = p->get_notename ();
return gh_int2scm (q);
}
}
int
-Pitch::octave_i ()const
+Pitch::get_octave ()const
{
- return octave_i_;
+ return octave_;
}
int
-Pitch::notename_i () const
+Pitch::get_notename () const
{
- return notename_i_;
+ return notename_;
}
int
-Pitch::alteration_i () const
+Pitch::get_alteration () const
{
- return alteration_i_;
+ return alteration_;
}
TRANSLATOR_DECLARATIONS(Porrectus_engraver);
protected:
- virtual bool try_music (Music *req_l);
+ virtual bool try_music (Music *req);
virtual void process_music ();
virtual void process_acknowledged_grobs ();
virtual void stop_translation_timestep ();
private:
PQueue<Grob_pitch_tuple> past_notes_pq_;
- Porrectus_req *porrectus_req_l_;
+ Porrectus_req *porrectus_req_;
Array<Grob_pitch_tuple> left_heads_;
Array<Grob_pitch_tuple> right_heads_;
- Link_array<Grob> porrectus_p_arr_;
+ Link_array<Grob> porrectuses_;
};
Porrectus_engraver::Porrectus_engraver ()
{
- porrectus_req_l_ = 0;
+ porrectus_req_ = 0;
}
bool
Porrectus_engraver::try_music (Music *m)
{
- if (Porrectus_req *req_l_ = dynamic_cast <Porrectus_req *> (m))
+ if (Porrectus_req *req_ = dynamic_cast <Porrectus_req *> (m))
{
- porrectus_req_l_ = req_l_;
+ porrectus_req_ = req_;
return true;
}
else
void
Porrectus_engraver::process_music ()
{
- if (porrectus_req_l_)
+ if (porrectus_req_)
{
top_engraver ()->forbid_breaks ();
}
}
void
-Porrectus_engraver::acknowledge_grob (Grob_info info_l_)
+Porrectus_engraver::acknowledge_grob (Grob_info info_)
{
- if (Rhythmic_head::has_interface (info_l_.grob_l_))
+ if (Rhythmic_head::has_interface (info_.grob_))
{
- Note_req *note_req_l_ = dynamic_cast <Note_req *> (info_l_.music_cause ());
- if (!note_req_l_)
+ Note_req *note_req_ = dynamic_cast <Note_req *> (info_.music_cause ());
+ if (!note_req_)
return;
- right_heads_.push (Grob_pitch_tuple (info_l_.grob_l_, note_req_l_,
+ right_heads_.push (Grob_pitch_tuple (info_.grob_, note_req_,
now_mom () +
- note_req_l_->length_mom ()));
+ note_req_->length_mom ()));
}
}
void
Porrectus_engraver::process_acknowledged_grobs ()
{
- if (porrectus_req_l_)
+ if (porrectus_req_)
{
left_heads_.sort (Grob_pitch_tuple::pitch_compare);
right_heads_.sort (Grob_pitch_tuple::pitch_compare);
while ((i >= 0) && (j >= 0))
{
- Item *left_head = dynamic_cast<Item*> (left_heads_[i].head_l_);
- Item *right_head = dynamic_cast<Item*> (right_heads_[j].head_l_);
+ Item *left_head = dynamic_cast<Item*> (left_heads_[i].head_);
+ Item *right_head = dynamic_cast<Item*> (right_heads_[j].head_);
left_head->set_grob_property("transparent", gh_bool2scm(true));
right_head->set_grob_property("transparent", gh_bool2scm(true));
- Grob *porrectus_p_ = new Item (get_property ("Porrectus"));
- Porrectus::set_left_head(porrectus_p_, left_head);
- Porrectus::set_right_head(porrectus_p_, right_head);
- porrectus_p_arr_.push (porrectus_p_);
- announce_grob(porrectus_p_, porrectus_req_l_->self_scm());
+ Grob *porrectus_ = new Item (get_property ("Porrectus"));
+ Porrectus::set_left_head(porrectus_, left_head);
+ Porrectus::set_right_head(porrectus_, right_head);
+ porrectuses_.push (porrectus_);
+ announce_grob(porrectus_, porrectus_req_->self_scm());
past_notes_pq_. insert (right_heads_[i]);
left_heads_.del (i);
}
right_heads_.clear ();
- for (int i = 0; i < porrectus_p_arr_.size (); i++)
+ for (int i = 0; i < porrectuses_.size (); i++)
{
- typeset_grob (porrectus_p_arr_[i]);
+ typeset_grob (porrectuses_[i]);
}
- porrectus_p_arr_.clear ();
+ porrectuses_.clear ();
}
void
Porrectus_engraver::start_translation_timestep ()
{
- porrectus_req_l_ = 0;
+ porrectus_req_ = 0;
Moment now = now_mom ();
while (past_notes_pq_.size () && past_notes_pq_.front ().end_ < now)
past_notes_pq_.delmin ();
if (auto_properties)
// determine add_stem and stem_direction automatically from durations
{
- if (String::compare_i (style, "mensural") != 0)
+ if (String::compare (style, "mensural") != 0)
me->warning (String("auto-property should be used for\r\n") +
String("mensural style porrectus only; trying anyway"));
}
}
- Real left_position_f = Staff_symbol_referencer::position_f (left_head);
- Real right_position_f = Staff_symbol_referencer::position_f (right_head);
+ Real left_position_f = Staff_symbol_referencer::get_position (left_head);
+ Real right_position_f = Staff_symbol_referencer::get_position (right_head);
Real interval = right_position_f - left_position_f;
Molecule molecule;
line_thickness = 1.0;
}
Real thickness =
- line_thickness * me->paper_l ()->get_var ("linethickness");
+ line_thickness * me->get_paper ()->get_var ("linethickness");
SCM porrectus_width_scm = me->get_grob_property ("width");
Real porrectus_width;
}
Real width = porrectus_width * Staff_symbol_referencer::staff_space (me);
- if (String::compare_i (style, "vaticana") == 0)
+ if (String::compare (style, "vaticana") == 0)
molecule = brew_vaticana_molecule (me, interval,
solid, width, thickness,
add_stem, stem_direction);
- else if (String::compare_i (style, "mensural") == 0)
+ else if (String::compare (style, "mensural") == 0)
molecule = brew_mensural_molecule (me, interval,
solid, width, thickness,
add_stem, stem_direction);
void
Property_iterator::process (Moment m)
{
- SCM sym = music_l ()->get_mus_property ("symbol");
+ SCM sym = get_music ()->get_mus_property ("symbol");
if (gh_symbol_p (sym))
{
- SCM val = music_l ()->get_mus_property ("value");
+ SCM val = get_music ()->get_mus_property ("value");
bool ok= true;
if (val != SCM_EOL)
ok = type_check_assignment (sym, val, ly_symbol2scm ("translation-type?"));
if (ok)
- report_to_l ()->internal_set_property (sym, val);
+ report_to ()->internal_set_property (sym, val);
}
Simple_music_iterator::process (m);
}
void
Property_unset_iterator::process (Moment m)
{
- SCM sym = music_l ()->get_mus_property ("symbol");
+ SCM sym = get_music ()->get_mus_property ("symbol");
type_check_assignment (sym, SCM_EOL, ly_symbol2scm ("translation-type?"));
- report_to_l ()->unset_property (sym);
+ report_to ()->unset_property (sym);
Simple_music_iterator::process (m);
}
}
- SCM type_p = scm_object_property (sym, ly_symbol2scm ("translation-type?"));
- bool ok = type_p == list_p;
+ SCM type = scm_object_property (sym, ly_symbol2scm ("translation-type?"));
+ bool ok = type == list_p;
if (!ok)
{
void
Push_property_iterator::process (Moment m)
{
- SCM sym = music_l ()->get_mus_property ("symbol");
- if (check_grob (music_l (), sym))
+ SCM sym = get_music ()->get_mus_property ("symbol");
+ if (check_grob (get_music (), sym))
{
- SCM eprop = music_l ()->get_mus_property ("grob-property");
- SCM val = music_l ()->get_mus_property ("grob-value");
+ SCM eprop = get_music ()->get_mus_property ("grob-property");
+ SCM val = get_music ()->get_mus_property ("grob-value");
- if (to_boolean (music_l ()->get_mus_property ("pop-first")))
- Translator_def::apply_pushpop_property (report_to_l (),
+ if (to_boolean (get_music ()->get_mus_property ("pop-first")))
+ Translator_def::apply_pushpop_property (report_to (),
sym, eprop, SCM_UNDEFINED);
- Translator_def::apply_pushpop_property (report_to_l (), sym, eprop, val);
+ Translator_def::apply_pushpop_property (report_to (), sym, eprop, val);
}
Simple_music_iterator::process (m);
}
void
Pop_property_iterator::process (Moment m)
{
- SCM sym = music_l ()->get_mus_property ("symbol");
- if (check_grob (music_l (), sym))
+ SCM sym = get_music ()->get_mus_property ("symbol");
+ if (check_grob (get_music (), sym))
{
- SCM eprop = music_l ()->get_mus_property ("grob-property");
- Translator_def::apply_pushpop_property (report_to_l (), sym, eprop, SCM_UNDEFINED);
+ SCM eprop = get_music ()->get_mus_property ("grob-property");
+ Translator_def::apply_pushpop_property (report_to (), sym, eprop, SCM_UNDEFINED);
}
Simple_music_iterator::process (m);
}
Repeat_acknowledge_engraver::initialize ()
{
first_b_ = true;
- daddy_trans_l_->set_property ("repeatCommands", SCM_EOL);
+ daddy_trans_->set_property ("repeatCommands", SCM_EOL);
}
Repeat_acknowledge_engraver::start_translation_timestep ()
{
first_b_ = true;
- Translator_group * tr = daddy_trans_l_->where_defined (ly_symbol2scm ("repeatCommands"));
+ Translator_group * tr = daddy_trans_->where_defined (ly_symbol2scm ("repeatCommands"));
if (!tr)
- tr = daddy_trans_l_;
+ tr = daddy_trans_;
tr->set_property ("repeatCommands", SCM_EOL);
}
{
if (s != "" || (volta_found && !gh_string_p (wb)))
{
- daddy_trans_l_->set_property ("whichBar", ly_str02scm (s.ch_C ()));
+ daddy_trans_->set_property ("whichBar", ly_str02scm (s.to_str0 ()));
}
}
}
}
Translator_group*
-Request_chord_iterator::get_req_translator_l ()
+Request_chord_iterator::get_req_translator ()
{
- assert (report_to_l ());
- if (report_to_l ()->is_bottom_translator_b ())
- return report_to_l ();
+ assert (report_to ());
+ if (report_to ()->is_bottom_translator_b ())
+ return report_to ();
- set_translator (report_to_l ()->get_default_interpreter ());
- return report_to_l ();
+ set_translator (report_to ()->get_default_interpreter ());
+ return report_to ();
}
void
Request_chord_iterator::construct_children ()
{
Simple_music_iterator::construct_children ();
- get_req_translator_l ();
+ get_req_translator ();
}
Request_chord*
-Request_chord_iterator::elt_l () const
+Request_chord_iterator::get_elt () const
{
- return (Request_chord*) music_l ();
+ return (Request_chord*) get_music ();
}
SCM
SCM s = SCM_EOL;
if (last_processed_mom_ < Moment (0))
{
- Music_sequence * ms = dynamic_cast<Music_sequence*> (music_l ());
+ Music_sequence * ms = dynamic_cast<Music_sequence*> (get_music ());
for (SCM m = ms->music_list (); gh_pair_p (m); m = ly_cdr (m))
{
{
if (last_processed_mom_ < Moment (0))
{
- for (SCM s = dynamic_cast<Music_sequence *> (music_l ())->music_list ();
+ for (SCM s = dynamic_cast<Music_sequence *> (get_music ())->music_list ();
gh_pair_p (s); s = ly_cdr (s))
{
Music *mus = unsmob_music (ly_car (s));
class Rest_collision_engraver : public Engraver
{
- Item* rest_collision_p_;
+ Item* rest_collision_;
- Link_array<Grob> note_column_l_arr_;
+ Link_array<Grob> note_columns_;
protected:
virtual void acknowledge_grob (Grob_info);
virtual void process_acknowledged_grobs ();
Rest_collision_engraver::Rest_collision_engraver ()
{
- rest_collision_p_ =0;
+ rest_collision_ =0;
}
void
Rest_collision_engraver::process_acknowledged_grobs ()
{
- if (rest_collision_p_ || note_column_l_arr_.size () < 2)
+ if (rest_collision_ || note_columns_.size () < 2)
return;
- rest_collision_p_ = new Item (get_property ("RestCollision"));
+ rest_collision_ = new Item (get_property ("RestCollision"));
- announce_grob(rest_collision_p_, SCM_EOL);
- for (int i=0; i< note_column_l_arr_.size (); i++)
- Rest_collision::add_column (rest_collision_p_,note_column_l_arr_[i]);
+ announce_grob(rest_collision_, SCM_EOL);
+ for (int i=0; i< note_columns_.size (); i++)
+ Rest_collision::add_column (rest_collision_,note_columns_[i]);
}
void
Rest_collision_engraver::acknowledge_grob (Grob_info i)
{
- if (Note_column::has_interface (i.grob_l_))
- note_column_l_arr_.push (i.grob_l_);
+ if (Note_column::has_interface (i.grob_))
+ note_columns_.push (i.grob_);
}
void
Rest_collision_engraver::stop_translation_timestep ()
{
- if (rest_collision_p_)
+ if (rest_collision_)
{
- typeset_grob (rest_collision_p_);
- rest_collision_p_ = 0;
+ typeset_grob (rest_collision_);
+ rest_collision_ = 0;
}
- note_column_l_arr_.clear ();
+ note_columns_.clear ();
}
ENTER_DESCRIPTION(Rest_collision_engraver,
/* descr */ "Handles collisions of rests.",
class Rest_engraver : public Engraver
{
- Rest_req *rest_req_l_;
- Item * dot_p_;
- Grob* rest_p_;
+ Rest_req *rest_req_;
+ Item * dot_;
+ Grob* rest_;
protected:
virtual bool try_music (Music *);
virtual void stop_translation_timestep ();
*/
Rest_engraver::Rest_engraver ()
{
- rest_req_l_ =0;
- rest_p_ =0;
- dot_p_ =0;
+ rest_req_ =0;
+ rest_ =0;
+ dot_ =0;
}
void
Rest_engraver::start_translation_timestep ()
{
- rest_req_l_ =0;
+ rest_req_ =0;
}
void
Rest_engraver::stop_translation_timestep ()
{
- if (rest_p_)
+ if (rest_)
{
- typeset_grob (rest_p_);
- rest_p_ =0;
+ typeset_grob (rest_);
+ rest_ =0;
}
- if (dot_p_)
+ if (dot_)
{
- typeset_grob (dot_p_);
- dot_p_ =0;
+ typeset_grob (dot_);
+ dot_ =0;
}
}
void
Rest_engraver::process_music ()
{
- if (rest_req_l_ && !rest_p_)
+ if (rest_req_ && !rest_)
{
- rest_p_ = new Item (get_property ("Rest"));
+ rest_ = new Item (get_property ("Rest"));
- int durlog = unsmob_duration (rest_req_l_->get_mus_property ("duration"))-> duration_log ();
+ int durlog = unsmob_duration (rest_req_->get_mus_property ("duration"))-> duration_log ();
- rest_p_->set_grob_property ("duration-log",
+ rest_->set_grob_property ("duration-log",
gh_int2scm (durlog));
- int dots =unsmob_duration (rest_req_l_->get_mus_property ("duration"))->dot_count ();
+ int dots =unsmob_duration (rest_req_->get_mus_property ("duration"))->dot_count ();
if (dots)
{
- dot_p_ = new Item (get_property ("Dots"));
+ dot_ = new Item (get_property ("Dots"));
- Rhythmic_head::set_dots (rest_p_, dot_p_);
- dot_p_->set_parent (rest_p_, Y_AXIS);
- dot_p_->set_grob_property ("dot-count", gh_int2scm (dots));
- announce_grob (dot_p_, SCM_EOL);
+ Rhythmic_head::set_dots (rest_, dot_);
+ dot_->set_parent (rest_, Y_AXIS);
+ dot_->set_grob_property ("dot-count", gh_int2scm (dots));
+ announce_grob (dot_, SCM_EOL);
}
- Pitch *p = unsmob_pitch (rest_req_l_->get_mus_property ("pitch"));
+ Pitch *p = unsmob_pitch (rest_req_->get_mus_property ("pitch"));
/*
This is ridiculous -- rests don't have pitch, but we act as if
if (gh_number_p (c0))
pos += gh_scm2int (c0);
- rest_p_->set_grob_property ("staff-position", gh_int2scm (pos));
+ rest_->set_grob_property ("staff-position", gh_int2scm (pos));
}
- announce_grob(rest_p_, rest_req_l_->self_scm());
+ announce_grob(rest_, rest_req_->self_scm());
}
}
{
if (Rest_req *r = dynamic_cast <Rest_req *> (m))
{
- rest_req_l_ = r;
+ rest_req_ = r;
return true;
}
return false;
if (balltype == 0 || balltype == 1)
{
Real rad = Staff_symbol_referencer::staff_radius (me) * 2.0;
- Real pos = Staff_symbol_referencer::position_f (me);
+ Real pos = Staff_symbol_referencer::get_position (me);
/*
Figure out when the rest is far enough outside the staff. This
(pos <= -rad -2 || pos > rad));
}
- return ("rests-") + to_str (balltype)
+ return ("rests-") + to_string (balltype)
+ (ledger_b ? "o" : "") + style;
}
class Rhythmic_column_engraver :public Engraver
{
- Link_array<Grob> rhead_l_arr_;
- Grob * stem_l_;
+ Link_array<Grob> rheads_;
+ Grob * stem_;
Grob * note_column_;
- Grob * dotcol_l_;
+ Grob * dotcol_;
Grob * last_spacing_;
Grob * spacing_;
spacing_ =0 ;
last_spacing_ = 0;
- stem_l_ =0;
+ stem_ =0;
note_column_=0;
- dotcol_l_ =0;
+ dotcol_ =0;
}
void
Rhythmic_column_engraver::process_acknowledged_grobs ()
{
- if (rhead_l_arr_.size ())
+ if (rheads_.size ())
{
if (!note_column_)
{
}
- for (int i=0; i < rhead_l_arr_.size (); i++)
+ for (int i=0; i < rheads_.size (); i++)
{
- if (!rhead_l_arr_[i]->get_parent (X_AXIS))
- Note_column::add_head (note_column_, rhead_l_arr_[i]);
+ if (!rheads_[i]->get_parent (X_AXIS))
+ Note_column::add_head (note_column_, rheads_[i]);
}
- rhead_l_arr_.set_size (0);
+ rheads_.set_size (0);
}
if (note_column_)
{
- if (dotcol_l_
- && !dotcol_l_->get_parent (X_AXIS))
+ if (dotcol_
+ && !dotcol_->get_parent (X_AXIS))
{
- Note_column::set_dotcol (note_column_, dotcol_l_);
+ Note_column::set_dotcol (note_column_, dotcol_);
}
- if (stem_l_
- && !stem_l_->get_parent (X_AXIS))
+ if (stem_
+ && !stem_->get_parent (X_AXIS))
{
- Note_column::set_stem (note_column_, stem_l_);
- stem_l_ = 0;
+ Note_column::set_stem (note_column_, stem_);
+ stem_ = 0;
}
}
void
Rhythmic_column_engraver::acknowledge_grob (Grob_info i)
{
- Item * item = dynamic_cast <Item *> (i.grob_l_);
+ Item * item = dynamic_cast <Item *> (i.grob_);
if (!item || item->get_parent (X_AXIS))
return ;
if (Stem::has_interface (item))
{
- stem_l_ = item;
+ stem_ = item;
}
else if (Rhythmic_head::has_interface (item))
{
- rhead_l_arr_.push (item);
+ rheads_.push (item);
}
else if (Dot_column::has_interface (item))
{
- dotcol_l_ = item;
+ dotcol_ = item;
}
}
void
Rhythmic_column_engraver::start_translation_timestep ()
{
- dotcol_l_ =0;
- stem_l_ =0;
+ dotcol_ =0;
+ stem_ =0;
}
Item*
-Rhythmic_head::dots_l (Grob*me)
+Rhythmic_head::get_dots (Grob*me)
{
SCM s = me->get_grob_property ("dot");
return unsmob_item (s);
}
Item*
-Rhythmic_head::stem_l (Grob*me)
+Rhythmic_head::get_stem (Grob*me)
{
SCM s = me->get_grob_property ("stem");
return unsmob_item (s);
int
Rhythmic_head::dot_count (Grob*me)
{
- return dots_l (me)
- ? gh_scm2int (dots_l (me)->get_grob_property ("dot-count")) : 0;
+ return get_dots (me)
+ ? gh_scm2int (get_dots (me)->get_grob_property ("dot-count")) : 0;
}
void
-Rhythmic_head::set_dots (Grob*me,Item *dot_l)
+Rhythmic_head::set_dots (Grob*me,Item *dot)
{
- me->set_grob_property ("dot", dot_l->self_scm ());
+ me->set_grob_property ("dot", dot->self_scm ());
}
Rod::Rod ()
{
- distance_f_ = 0.0;
+ distance_ = 0.0;
item_l_drul_[LEFT] = item_l_drul_[RIGHT] =0;
}
{
Direction d = LEFT;
do {
- Paper_column * pc = item_l_drul_[d]->column_l ();
- distance_f_ += - d * item_l_drul_[d]->relative_coordinate (pc, X_AXIS);
+ Paper_column * pc = item_l_drul_[d]->get_column ();
+ distance_ += - d * item_l_drul_[d]->relative_coordinate (pc, X_AXIS);
item_l_drul_[d] = pc;
} while ((flip (&d))!=LEFT);
if (item_l_drul_[LEFT] != item_l_drul_[RIGHT])
Spaceable_grob::add_rod (item_l_drul_[LEFT],
item_l_drul_[RIGHT],
- distance_f_);
+ distance_);
}
Scaled_font_metric::Scaled_font_metric (Font_metric* m, Real magn)
{
- magnification_f_ = magn;
+ magnification_ = magn;
SCM desc = m->description_;
Real total_mag = magn * gh_scm2double (ly_cdr (desc));
description_ = gh_cons (ly_car (desc), gh_double2scm (total_mag));
- orig_l_ = m;
+ orig_ = m;
}
SCM
Molecule
Scaled_font_metric::find_by_name (String s) const
{
- Molecule m = orig_l_->find_by_name (s);
+ Molecule m = orig_->find_by_name (s);
Box b = m.extent_box ();
- b.scale (magnification_f_);
+ b.scale (magnification_);
Molecule q (b,fontify_atom ((Font_metric*) this, m.get_expr ()));
return q ;
Box
Scaled_font_metric::get_char (int i) const
{
- Box b = orig_l_->get_char (i);
- b.scale (magnification_f_);
+ Box b = orig_->get_char (i);
+ b.scale (magnification_);
return b;
}
Box
Scaled_font_metric::text_dimension (String t) const
{
- Box b (orig_l_->text_dimension (t));
+ Box b (orig_->text_dimension (t));
- b.scale (magnification_f_);
+ b.scale (magnification_);
return b;
}
int
Scaled_font_metric::count () const
{
- return orig_l_->count ();
+ return orig_->count ();
}
(set-lily-option SYMBOL VAL)
possible options for SYMBOL are :
-").ch_C()<< std::endl;
+").to_str0 ()<< std::endl;
std::cout << " help (any-symbol)"<< std::endl;
std::cout << " internal-type-checking (boolean)"<< std::endl;
Score_engraver::Score_engraver ()
{
system_ =0;
- command_column_l_ =0;
- musical_column_l_ =0;
- breaks_i_ =0;
- pscore_p_ = 0;
+ command_column_ =0;
+ musical_column_ =0;
+ breaks_ =0;
+ pscore_ = 0;
}
void
/*
ugh.
*/
- if (!command_column_l_)
+ if (!command_column_)
{
set_columns (new Paper_column (get_property ("NonMusicalPaperColumn")),
new Paper_column (get_property ("PaperColumn")));
- command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
+ command_column_->set_grob_property ("breakable", SCM_BOOL_T);
- Grob_info i1 (command_column_l_);
- i1.origin_trans_l_ = this;
+ Grob_info i1 (command_column_);
+ i1.origin_trans_ = this;
- Grob_info i2 (musical_column_l_);
- i2.origin_trans_l_ = this;
+ Grob_info i2 (musical_column_);
+ i2.origin_trans_ = this;
announce_grob (i1);
*/
make_columns ();
- command_column_l_->set_grob_property ("when", now_mom_.smobbed_copy ());
- musical_column_l_->set_grob_property ("when", now_mom_.smobbed_copy ());
+ command_column_->set_grob_property ("when", now_mom_.smobbed_copy ());
+ musical_column_->set_grob_property ("when", now_mom_.smobbed_copy ());
Translator_group::start_translation_timestep();
void
Score_engraver::finish ()
{
- if ((breaks_i_%8))
- progress_indication ("[" + to_str (breaks_i_) + "]");
+ if ((breaks_%8))
+ progress_indication ("[" + to_string (breaks_) + "]");
check_removal ();
removal_processing ();
Score_engraver::initialize ()
{
Font_metric *fm =
- all_fonts_global_p->find_afm("feta20");
+ all_fonts_global->find_afm("feta20");
if (!fm)
error (_("Could not find feta20.afm. Fonts have not been installed properly; Aborting"));
unsmob_translator_def (definition_)->apply_property_operations (this);
- assert (dynamic_cast<Paper_def *> (output_def_l_));
- assert (!daddy_trans_l_);
- pscore_p_ = new Paper_score;
- pscore_p_->paper_l_ = dynamic_cast<Paper_def*> (output_def_l_);
+ assert (dynamic_cast<Paper_def *> (output_def_));
+ assert (!daddy_trans_);
+ pscore_ = new Paper_score;
+ pscore_->paper_ = dynamic_cast<Paper_def*> (output_def_);
SCM props = get_property ("System");
- pscore_p_->typeset_line (new System (props));
+ pscore_->typeset_line (new System (props));
make_columns ();
- system_ = pscore_p_->system_;
- system_->set_bound (LEFT, command_column_l_);
- command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
+ system_ = pscore_->system_;
+ system_->set_bound (LEFT, command_column_);
+ command_column_->set_grob_property ("breakable", SCM_BOOL_T);
Engraver_group_engraver::initialize ();
}
check_removal ();
- for (int i = announce_info_arr_.size(); i--;)
+ for (int i = announce_infos_.size(); i--;)
{
- Grob *g = announce_info_arr_[i].grob_l_;
+ Grob *g = announce_infos_[i].grob_;
if (!dynamic_cast<Paper_column*> (g)) // ugh.
{
g->programming_error (msg);
}
}
- announce_info_arr_.clear ();
+ announce_infos_.clear ();
}
void
Score_engraver::announce_grob (Grob_info info)
{
- announce_info_arr_.push (info);
- pscore_p_->system_->typeset_grob (info.grob_l_);
+ announce_infos_.push (info);
+ pscore_->system_->typeset_grob (info.grob_);
}
void
-Score_engraver::typeset_grob (Grob *elem_p)
+Score_engraver::typeset_grob (Grob *elem)
{
- if (!elem_p)
+ if (!elem)
programming_error ("Score_engraver: empty elt\n");
else
- elem_p_arr_.push (elem_p);
+ elems_.push (elem);
}
void
Score_engraver::typeset_all ()
{
- for (int i =0; i < elem_p_arr_.size (); i++)
+ for (int i =0; i < elems_.size (); i++)
{
- Grob * elem_p = elem_p_arr_[i];
+ Grob * elem = elems_[i];
- if (Spanner *s = dynamic_cast <Spanner *> (elem_p))
+ if (Spanner *s = dynamic_cast <Spanner *> (elem))
{
/*
do something sensible if spanner not
do {
if (!s->get_bound (d))
{
- s->set_bound (d, command_column_l_);
+ s->set_bound (d, command_column_);
/* don't warn for empty/suicided spanners,
it makes real warningsinvisible.
maybe should be junked earlier? */
- if (!elem_p->live())
+ if (!elem->live())
; // gdb hook
else
- elem_p->warning (_f ("unbound spanner `%s'", s->name ().ch_C ()));
+ elem->warning (_f ("unbound spanner `%s'", s->name ().to_str0 ()));
}
}
while (flip (&d) != LEFT);
}
else
{
- if (!elem_p->get_parent (X_AXIS))
+ if (!elem->get_parent (X_AXIS))
{
- bool br = to_boolean (elem_p->get_grob_property ("breakable"));
- Axis_group_interface::add_element (br ? command_column_l_ : musical_column_l_, elem_p);
+ bool br = to_boolean (elem->get_grob_property ("breakable"));
+ Axis_group_interface::add_element (br ? command_column_ : musical_column_, elem);
}
}
- if (!elem_p->get_parent (Y_AXIS))
- Axis_group_interface::add_element (system_, elem_p);
+ if (!elem->get_parent (Y_AXIS))
+ Axis_group_interface::add_element (system_, elem);
}
- elem_p_arr_.clear ();
+ elems_.clear ();
}
void
Engraver_group_engraver::stop_translation_timestep ();
typeset_all ();
- if (to_boolean (command_column_l_->get_grob_property ("breakable")))
+ if (to_boolean (command_column_->get_grob_property ("breakable")))
{
- breaks_i_ ++;
- if (! (breaks_i_%8))
- progress_indication ("[" + to_str (breaks_i_) + "]");
+ breaks_ ++;
+ if (! (breaks_%8))
+ progress_indication ("[" + to_string (breaks_) + "]");
}
- system_->add_column (command_column_l_);
- system_->add_column (musical_column_l_);
+ system_->add_column (command_column_);
+ system_->add_column (musical_column_);
- command_column_l_ = 0;
- musical_column_l_ = 0;
+ command_column_ = 0;
+ musical_column_ = 0;
}
void
-Score_engraver::set_columns (Paper_column *new_command_l,
- Paper_column *new_musical_l)
+Score_engraver::set_columns (Paper_column *new_command,
+ Paper_column *new_musical)
{
- assert (!command_column_l_ && !musical_column_l_);
+ assert (!command_column_ && !musical_column_);
- command_column_l_ = new_command_l;
- musical_column_l_ = new_musical_l;
- if (new_command_l)
+ command_column_ = new_command;
+ musical_column_ = new_musical;
+ if (new_command)
{
- set_property ("currentCommandColumn", new_command_l->self_scm ());
+ set_property ("currentCommandColumn", new_command->self_scm ());
}
- if (new_musical_l)
+ if (new_musical)
{
- set_property ("currentMusicalColumn", new_musical_l->self_scm ());
+ set_property ("currentMusicalColumn", new_musical->self_scm ());
}
}
Music_output*
-Score_engraver::get_output_p ()
+Score_engraver::get_output ()
{
- Music_output * o = pscore_p_;
- pscore_p_=0;
+ Music_output * o = pscore_;
+ pscore_=0;
return o;
}
gotcha = true;
- SCM pen = command_column_l_->get_grob_property ("penalty");
+ SCM pen = command_column_->get_grob_property ("penalty");
Real total_penalty = gh_number_p (pen)
? gh_scm2double (pen)
: 0.0;
if (total_penalty > 10000.0) // ugh. arbitrary.
forbid_breaks ();
- command_column_l_->set_grob_property ("penalty",
+ command_column_->set_grob_property ("penalty",
gh_double2scm (total_penalty));
}
}
/*
result is junked.
*/
- if (command_column_l_)
- command_column_l_->remove_grob_property ("breakable");
+ if (command_column_)
+ command_column_->remove_grob_property ("breakable");
}
void
Score_engraver::acknowledge_grob (Grob_info gi)
{
- if (Staff_spacing::has_interface (gi.grob_l_))
+ if (Staff_spacing::has_interface (gi.grob_))
{
- Pointer_group_interface::add_grob (command_column_l_,
+ Pointer_group_interface::add_grob (command_column_,
ly_symbol2scm ("spacing-wishes"),
- gi.grob_l_);
+ gi.grob_);
}
- if (Note_spacing::has_interface (gi.grob_l_))
+ if (Note_spacing::has_interface (gi.grob_))
{
- Pointer_group_interface::add_grob (musical_column_l_,
+ Pointer_group_interface::add_grob (musical_column_,
ly_symbol2scm ("spacing-wishes"),
- gi.grob_l_);
+ gi.grob_);
}
}
Score_performer::Score_performer ()
{
- performance_p_ = 0;
+ performance_ = 0;
}
{
if (Audio_item * i=dynamic_cast<Audio_item *> (p))
{
- audio_column_l_->add_audio_item (i);
+ audio_column_->add_audio_item (i);
}
- performance_p_->add_element (p);
+ performance_->add_element (p);
}
void
Score_performer::announce_element (Audio_element_info info)
{
- announce_info_arr_.push (info);
+ announce_infos_.push (info);
/*
huh?
copied from score-engraver, but
this way staff gets in list twice
- if (Audio_item* i = dynamic_cast<Audio_item*> (info.elem_l_))
- performance_p_->add_element (i);
+ if (Audio_item* i = dynamic_cast<Audio_item*> (info.elem_))
+ performance_->add_element (i);
*/
}
Score_performer::prepare (Moment m)
{
Global_translator::prepare (m);
- audio_column_l_ = new Audio_column (m);
- play_element (audio_column_l_);
+ audio_column_ = new Audio_column (m);
+ play_element (audio_column_);
start_translation_timestep ();
}
int
-Score_performer::get_tempo_i () const
+Score_performer::get_tempo () const
{
- return performance_p_->midi_l_->get_tempo_i (Moment (Rational (1, 4)));
+ return performance_->midi_->get_tempo (Moment (Rational (1, 4)));
}
void
}
Music_output *
-Score_performer::get_output_p ()
+Score_performer::get_output ()
{
- Music_output * o = performance_p_;
- performance_p_ =0;
+ Music_output * o = performance_;
+ performance_ =0;
return o;
}
Score_performer::initialize ()
{
unsmob_translator_def (definition_)->apply_property_operations (this);
- assert (dynamic_cast<Midi_def *> (output_def_l_));
- performance_p_ = new Performance;
- performance_p_->midi_l_ = dynamic_cast<Midi_def*> (output_def_l_);
+ assert (dynamic_cast<Midi_def *> (output_def_));
+ performance_ = new Performance;
+ performance_->midi_ = dynamic_cast<Midi_def*> (output_def_);
Translator_group::initialize ();
}
Score::Score ()
: Input ()
{
- header_p_ = 0;
+ header_ = 0;
music_ = SCM_EOL;
- errorlevel_i_ = 0;
+ errorlevel_ = 0;
smobify_self ();
}
: Input (s)
{
music_ = SCM_EOL;
- header_p_ = 0;
+ header_ = 0;
smobify_self ();
Music * m =unsmob_music (s.music_);
music_ = m?m->clone ()->self_scm () : SCM_EOL;
scm_gc_unprotect_object (music_);
- for (int i=0; i < s.def_p_arr_.size (); i++)
- def_p_arr_.push (s.def_p_arr_[i]->clone ());
- errorlevel_i_ = s.errorlevel_i_;
- if (s.header_p_)
+ for (int i=0; i < s.defs_.size (); i++)
+ defs_.push (s.defs_[i]->clone ());
+ errorlevel_ = s.errorlevel_;
+ if (s.header_)
{
- header_p_ = (s.header_p_) ? new Scheme_hash_table (*s.header_p_): 0;
+ header_ = (s.header_) ? new Scheme_hash_table (*s.header_): 0;
- scm_gc_unprotect_object (header_p_->self_scm ());
+ scm_gc_unprotect_object (header_->self_scm ());
}
}
#endif
void
-Score::run_translator (Music_output_def *odef_l)
+Score::run_translator (Music_output_def *odef)
{
store_locations_global_b = (gh_eval_str ("point-and-click") != SCM_BOOL_F);
Cpu_timer timer;
- Global_translator * trans_p = odef_l->get_global_translator_p ();
- if (!trans_p)
+ Global_translator * trans = odef->get_global_translator ();
+ if (!trans)
{
programming_error ("no toplevel translator");
return ;
progress_indication (_ ("Interpreting music..."));
Music * music = unsmob_music (music_);
- trans_p->final_mom_ = music->length_mom ();
+ trans->final_mom_ = music->length_mom ();
- Music_iterator * iter = Music_iterator::static_get_iterator_p (music);
- iter->init_translator (music, trans_p);
+ Music_iterator * iter = Music_iterator::get_static_get_iterator (music);
+ iter->init_translator (music, trans);
iter->construct_children ();
{
delete iter;
warning (_ ("Need music in a score"));
- errorlevel_i_ =1;
+ errorlevel_ =1;
return ;
}
- trans_p->start ();
- trans_p->run_iterator_on_me (iter);
+ trans->start ();
+ trans->run_iterator_on_me (iter);
delete iter;
- trans_p->finish ();
+ trans->finish ();
- if (errorlevel_i_)
+ if (errorlevel_)
{
// should we? hampers debugging.
warning (_ ("Errors found/*, not processing score*/"));
}
- Music_output * output = trans_p->get_output_p ();
- scm_gc_unprotect_object (trans_p->self_scm ());
+ Music_output * output = trans->get_output ();
+ scm_gc_unprotect_object (trans->self_scm ());
if (verbose_global_b)
progress_indication (_f ("elapsed time: %.2f seconds", timer.read ()));
- if (!header_p_)
- header_p_ = new Scheme_hash_table; // ugh
+ if (!header_)
+ header_ = new Scheme_hash_table; // ugh
- output->header_l_ = header_p_;
- output->origin_str_ = location_str ();
+ output->header_ = header_;
+ output->origin_string_ = location_string ();
progress_indication ("\n");
output->process ();
return;
- for (int i=0; i < def_p_arr_.size (); i++)
+ for (int i=0; i < defs_.size (); i++)
{
if (no_paper_global_b
- && dynamic_cast<Paper_def*> (def_p_arr_[i]))
+ && dynamic_cast<Paper_def*> (defs_[i]))
continue;
- run_translator (def_p_arr_[i]);
+ run_translator (defs_[i]);
}
}
void
-Score::add_output (Music_output_def *pap_p)
+Score::add_output (Music_output_def *pap)
{
- def_p_arr_.push (pap_p);
+ defs_.push (pap);
}
IMPLEMENT_SMOBS (Score);
Score::mark_smob (SCM s)
{
Score * sc = (Score*) SCM_CELL_WORD_1 (s);
- if (sc->header_p_)
- scm_gc_mark (sc->header_p_->self_scm ());
- for (int i = sc->def_p_arr_.size (); i--;)
- scm_gc_mark (sc->def_p_arr_[i]->self_scm ());
+ if (sc->header_)
+ scm_gc_mark (sc->header_->self_scm ());
+ for (int i = sc->defs_.size (); i--;)
+ scm_gc_mark (sc->defs_[i]->self_scm ());
return sc->music_;
}
#include "lily-version.hh"
#include "scm-hash.hh"
-Sources* source_global_l = 0;
-Array<String> inclusion_global_array;
-Array<String> target_str_global_array;
-Link_array<Score> score_global_array;
-Scheme_hash_table * global_header_p;
+Sources* source_global = 0;
+Array<String> inclusion_globals;
+Array<String> target_string_globals;
+Link_array<Score> score_globals;
+Scheme_hash_table * global_header;
void write_dependency_file (String fn, Array<String> targets,
{
const int WRAPWIDTH = 65;
- progress_indication (_f ("dependencies output to `%s'...", fn.ch_C ()));
+ progress_indication (_f ("dependencies output to `%s'...", fn.to_str0 ()));
progress_indication ("\n");
- FILE * f = fopen (fn.ch_C (), "w");
+ FILE * f = fopen (fn.to_str0 (), "w");
if (!f)
warning (_f ("can't open file: `%s'", fn));
- fprintf (f, "# Generated automatically by: %s\n", gnu_lilypond_version_str ().ch_C());
+ fprintf (f, "# Generated automatically by: %s\n", gnu_lilypond_version_string ().to_str0 ());
String out;
for (int i=0; i < targets.size (); i ++)
for (int i=0; i < deps.size (); i ++)
{
- if (out.length_i () > WRAPWIDTH)
+ if (out.length () > WRAPWIDTH)
{
- fprintf (f, "%s\\\n", out.ch_C());
+ fprintf (f, "%s\\\n", out.to_str0 ());
out = " ";
}
String dep = deps[i];
if (!dependency_prefix_global.empty_b ())
{
#if 0//thinko?
- if (stat (dep.ch_C (), &stat_buf) == -1 && errno == ENOENT)
+ if (stat (dep.to_str0 (), &stat_buf) == -1 && errno == ENOENT)
; //make emacs happy
#else
- if (dep.index_i ('/') < 0)
+ if (dep.index ('/') < 0)
#endif
dep = dependency_prefix_global + dep;
}
out += " " + dep;
}
- fprintf (f, "%s\n", out.ch_C());
+ fprintf (f, "%s\n", out.to_str0 ());
}
void
{
Path p = split_path (output_name_global);
p.ext = "dep";
- write_dependency_file (p.str (),
- target_str_global_array,
- inclusion_global_array);
+ write_dependency_file (p.string (),
+ target_string_globals,
+ inclusion_globals);
}
}
void
do_scores ()
{
- if (!global_header_p)
- global_header_p = new Scheme_hash_table;
- for (int i=0; i < score_global_array.size (); i++)
+ if (!global_header)
+ global_header = new Scheme_hash_table;
+ for (int i=0; i < score_globals.size (); i++)
{
- Score* is_p = score_global_array[i];
+ Score* is = score_globals[i];
- if (is_p->errorlevel_i_)
+ if (is->errorlevel_)
{
- is_p->warning (_ ("Score contains errors; will not process it"));
+ is->warning (_ ("Score contains errors; will not process it"));
exit_status_global |= 1;
}
else
{
- is_p->process ();
+ is->process ();
}
}
do_deps ();
void
clear_scores ()
{
- for (int i=0; i < score_global_array.size (); i++)
- scm_gc_unprotect_object (score_global_array[i]->self_scm ());
- score_global_array.clear ();
+ for (int i=0; i < score_globals.size (); i++)
+ scm_gc_unprotect_object (score_globals[i]->self_scm ());
+ score_globals.clear ();
- inclusion_global_array.clear ();
- if (global_header_p)
- scm_gc_unprotect_object (global_header_p ->self_scm ());
- global_header_p =0;
+ inclusion_globals.clear ();
+ if (global_header)
+ scm_gc_unprotect_object (global_header ->self_scm ());
+ global_header =0;
}
void
-do_one_file (String init_str, String file_str)
+do_one_file (String init_string, String file_string)
{
- if (init_str.length_i () && global_path.find (init_str).empty_b ())
+ if (init_string.length () && global_path.find (init_string).empty_b ())
{
- warning (_f ("can't find file: `%s'", init_str));
- warning (_f ("(search path: `%s')", global_path.str ().ch_C ()));
+ warning (_f ("can't find file: `%s'", init_string));
+ warning (_f ("(search path: `%s')", global_path.string ().to_str0 ()));
return;
}
- if ((file_str != "-") && global_path.find (file_str).empty_b ())
+ if ((file_string != "-") && global_path.find (file_string).empty_b ())
{
- warning (_f ("can't find file: `%s'", file_str));
+ warning (_f ("can't find file: `%s'", file_string));
return;
}
Sources sources;
- source_global_l = &sources;
- source_global_l->set_path (&global_path);
+ source_global = &sources;
+ source_global->set_path (&global_path);
{
- My_lily_parser parser (source_global_l);
+ My_lily_parser parser (source_global);
parser.set_version_check (false);
- progress_indication (_f ("Now processing: `%s'", file_str.ch_C ()));
+ progress_indication (_f ("Now processing: `%s'", file_string.to_str0 ()));
progress_indication ("\n");
- parser.parse_file (init_str, file_str);
+ parser.parse_file (init_string, file_string);
- if (parser.error_level_i_)
+ if (parser.error_level_)
{
exit_status_global = 1;
}
do_scores ();
clear_scores ();
}
- source_global_l = 0;
+ source_global = 0;
}
Script_column, that will fix the collisions. */
class Script_column_engraver : public Engraver
{
- Grob *scol_p_;
- Link_array<Item> script_l_arr_;
+ Grob *scol_;
+ Link_array<Item> scripts_;
public:
TRANSLATOR_DECLARATIONS(Script_column_engraver);
Script_column_engraver::Script_column_engraver ()
{
- scol_p_ =0;
+ scol_ =0;
}
void
Script_column_engraver::stop_translation_timestep ()
{
- if (scol_p_)
+ if (scol_)
{
- typeset_grob (scol_p_);
- scol_p_ =0;
+ typeset_grob (scol_);
+ scol_ =0;
}
}
void
Script_column_engraver::start_translation_timestep ()
{
- script_l_arr_.clear ();
+ scripts_.clear ();
}
void
Script_column_engraver::acknowledge_grob (Grob_info inf)
{
- Item *thing = dynamic_cast<Item*> (inf.grob_l_);
- if (thing && Side_position_interface::has_interface (inf.grob_l_)) // ugh FIXME
+ Item *thing = dynamic_cast<Item*> (inf.grob_);
+ if (thing && Side_position_interface::has_interface (inf.grob_)) // ugh FIXME
{
if (!Item::breakable_b (thing)
- && Side_position_interface::get_axis (inf.grob_l_) == Y_AXIS)
+ && Side_position_interface::get_axis (inf.grob_) == Y_AXIS)
{
- script_l_arr_.push (thing);
+ scripts_.push (thing);
}
}
}
void
Script_column_engraver::process_acknowledged_grobs ()
{
- if (!scol_p_ && script_l_arr_.size () > 1)
+ if (!scol_ && scripts_.size () > 1)
{
- scol_p_ = new Item (get_property ("ScriptColumn"));
- announce_grob(scol_p_, SCM_EOL);
+ scol_ = new Item (get_property ("ScriptColumn"));
+ announce_grob(scol_, SCM_EOL);
}
- if (scol_p_)
+ if (scol_)
{
- for (int i=0; i < script_l_arr_.size (); i++)
- Script_column::add_staff_sided (scol_p_, script_l_arr_[i]);
- script_l_arr_.clear ();
+ for (int i=0; i < scripts_.size (); i++)
+ Script_column::add_staff_sided (scol_, scripts_[i]);
+ scripts_.clear ();
}
}
class Script_engraver : public Engraver
{
- Link_array<Grob> script_p_arr_;
- Link_array<Articulation_req> script_req_l_arr_;
+ Link_array<Grob> scripts_;
+ Link_array<Articulation_req> script_reqs_;
public:
TRANSLATOR_DECLARATIONS(Script_engraver);
void
Script_engraver::initialize ()
{
- script_req_l_arr_.clear ();
+ script_reqs_.clear ();
}
bool
-Script_engraver::try_music (Music *r_l)
+Script_engraver::try_music (Music *r)
{
- if (Articulation_req *mr = dynamic_cast <Articulation_req *> (r_l))
+ if (Articulation_req *mr = dynamic_cast <Articulation_req *> (r))
{
- for (int i=0; i < script_req_l_arr_.size (); i++)
+ for (int i=0; i < script_reqs_.size (); i++)
{
- if (script_req_l_arr_[i]->equal_b (mr))
+ if (script_reqs_[i]->equal_b (mr))
return true;
}
- script_req_l_arr_.push (mr);
+ script_reqs_.push (mr);
return true;
}
return false;
void
Script_engraver::process_music ()
{
- for (int i=0; i < script_req_l_arr_.size (); i++)
+ for (int i=0; i < script_reqs_.size (); i++)
{
- Articulation_req* l=script_req_l_arr_[i];
+ Articulation_req* l=script_reqs_[i];
SCM alist = get_property ("scriptDefinitions");
SCM art = scm_assoc (l->get_mus_property ("articulation-type"), alist);
if (art == SCM_BOOL_F)
{
String a = ly_scm2string (l->get_mus_property ("articulation-type"));
- l->origin ()->warning (_f ("Don't know how to interpret articulation `%s'", a.ch_C ()));
+ l->origin ()->warning (_f ("Don't know how to interpret articulation `%s'", a.to_str0 ()));
continue;
}
p->set_grob_property ("script-priority", gh_int2scm (priority));
- script_p_arr_.push (p);
+ scripts_.push (p);
announce_grob (p, l->self_scm());
}
void
Script_engraver::acknowledge_grob (Grob_info inf)
{
- if (Stem::has_interface (inf.grob_l_))
+ if (Stem::has_interface (inf.grob_))
{
- for (int i=0; i < script_p_arr_.size (); i++)
+ for (int i=0; i < scripts_.size (); i++)
{
- Grob*e = script_p_arr_[i];
+ Grob*e = scripts_[i];
- e->set_grob_property ("direction-source", inf.grob_l_->self_scm ());
- e->add_dependency (inf.grob_l_);
- Side_position_interface::add_support (e, inf.grob_l_);
+ e->set_grob_property ("direction-source", inf.grob_->self_scm ());
+ e->add_dependency (inf.grob_);
+ Side_position_interface::add_support (e, inf.grob_);
}
}
- else if (Rhythmic_head::has_interface (inf.grob_l_))
+ else if (Rhythmic_head::has_interface (inf.grob_))
{
- for (int i=0; i < script_p_arr_.size (); i++)
+ for (int i=0; i < scripts_.size (); i++)
{
- Grob *e = script_p_arr_[i];
+ Grob *e = scripts_[i];
if (Side_position_interface::get_axis (e) == X_AXIS
&& !e->get_parent (Y_AXIS))
{
- e->set_parent (inf.grob_l_, Y_AXIS);
- e->add_dependency (inf.grob_l_); // ??
+ e->set_parent (inf.grob_, Y_AXIS);
+ e->add_dependency (inf.grob_); // ??
}
- Side_position_interface::add_support (e,inf.grob_l_);
+ Side_position_interface::add_support (e,inf.grob_);
}
}
- else if (Note_column::has_interface (inf.grob_l_))
+ else if (Note_column::has_interface (inf.grob_))
{
/*
Script_interface::before_line_breaking ().
*/
- for (int i=0; i < script_p_arr_.size (); i++)
+ for (int i=0; i < scripts_.size (); i++)
{
- Grob *e = script_p_arr_[i];
+ Grob *e = scripts_[i];
if (!e->get_parent (X_AXIS) &&
Side_position_interface::get_axis (e) == Y_AXIS)
{
- e->set_parent (inf.grob_l_, X_AXIS);
+ e->set_parent (inf.grob_, X_AXIS);
}
}
}
void
Script_engraver::stop_translation_timestep ()
{
- for (int i=0; i < script_p_arr_.size (); i++)
+ for (int i=0; i < scripts_.size (); i++)
{
/*
TODO: junk staff-support.
*/
- Grob * sc = script_p_arr_[i];
+ Grob * sc = scripts_[i];
if (to_boolean (sc->get_grob_property ("staff-support")))
{
Side_position_interface::add_staff_support (sc);
}
typeset_grob (sc);
}
- script_p_arr_.clear ();
+ scripts_.clear ();
}
void
Script_engraver::start_translation_timestep ()
{
- script_req_l_arr_.clear ();
+ script_reqs_.clear ();
}
if (Grob * par = me->get_parent (X_AXIS))
{
- Grob * stem = Note_column::stem_l (par);
+ Grob * stem = Note_column::get_stem (par);
if (stem && Stem::first_head (stem))
{
me->set_parent (Stem::first_head (stem), X_AXIS);
rod.item_l_drul_[LEFT] = lb;
rod.item_l_drul_[RIGHT] = r;
- rod.distance_f_ = li[RIGHT] - ri[LEFT];
+ rod.distance_ = li[RIGHT] - ri[LEFT];
rod.add_to_cols ();
}
}
rod.item_l_drul_[LEFT] =l;
rod.item_l_drul_[RIGHT]=r;
- rod.distance_f_ = li[RIGHT] - ri[LEFT];
+ rod.distance_ = li[RIGHT] - ri[LEFT];
rod.add_to_cols ();
break;
class Separating_line_group_engraver : public Engraver
{
protected:
- Item * break_malt_p_;
- Item * musical_malt_p_;
- Item * last_musical_malt_p_;
+ Item * break_malt_;
+ Item * musical_malt_;
+ Item * last_musical_malt_;
Spacings current_spacings_;
Spacings last_spacings_;
- Spanner * sep_span_p_;
+ Spanner * sep_span_;
virtual void acknowledge_grob (Grob_info);
virtual void initialize ();
Separating_line_group_engraver::Separating_line_group_engraver ()
{
- sep_span_p_ = 0;
- break_malt_p_ = 0;
- musical_malt_p_ =0;
+ sep_span_ = 0;
+ break_malt_ = 0;
+ musical_malt_ =0;
}
void
Separating_line_group_engraver::initialize ()
{
- sep_span_p_ = new Spanner (get_property ("SeparatingGroupSpanner"));
+ sep_span_ = new Spanner (get_property ("SeparatingGroupSpanner"));
- announce_grob(sep_span_p_, SCM_EOL);
- sep_span_p_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+ announce_grob(sep_span_, SCM_EOL);
+ sep_span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
}
void
SCM ccol = get_property ("currentCommandColumn");
Grob *column = unsmob_grob (ccol);
- sep_span_p_->set_bound (RIGHT, unsmob_grob (ccol));
- typeset_grob (sep_span_p_);
- sep_span_p_ =0;
+ sep_span_->set_bound (RIGHT, unsmob_grob (ccol));
+ typeset_grob (sep_span_);
+ sep_span_ =0;
for (int i= 0 ; i < last_spacings_.note_spacings_.size(); i++)
{
}
if(last_spacings_.staff_spacing_
- && last_spacings_.staff_spacing_->column_l () == column)
+ && last_spacings_.staff_spacing_->get_column () == column)
{
last_spacings_.staff_spacing_->suicide ();
}
void
Separating_line_group_engraver::acknowledge_grob (Grob_info i)
{
- Item * it = dynamic_cast <Item *> (i.grob_l_);
+ Item * it = dynamic_cast <Item *> (i.grob_);
if (!it)
return;
if (it->get_parent (X_AXIS)
}
bool ib =Item::breakable_b (it);
- Item *&p_ref_ (ib ? break_malt_p_
- : musical_malt_p_);
+ Item *&p_ref_ (ib ? break_malt_
+ : musical_malt_);
if (!p_ref_)
{
p_ref_->set_grob_property ("breakable", SCM_BOOL_T);
announce_grob(p_ref_, SCM_EOL);
- if (p_ref_ == break_malt_p_)
+ if (p_ref_ == break_malt_)
{
Item *it = new Item (get_property ("StaffSpacing"));
current_spacings_.staff_spacing_ = it;
- it->set_grob_property ("left-items", gh_cons (break_malt_p_->self_scm (), SCM_EOL));
+ it->set_grob_property ("left-items", gh_cons (break_malt_->self_scm (), SCM_EOL));
announce_grob(it, SCM_EOL);
for (; i--;)
Pointer_group_interface::add_grob (last_spacings_.note_spacings_[i],
ly_symbol2scm ("right-items"),
- break_malt_p_);
+ break_malt_);
}
else if (last_spacings_.staff_spacing_)
{
last_spacings_.staff_spacing_->set_grob_property ("right-items",
- gh_cons (break_malt_p_->self_scm(), SCM_EOL));
+ gh_cons (break_malt_->self_scm(), SCM_EOL));
}
}
}
void
Separating_line_group_engraver::stop_translation_timestep ()
{
- if (break_malt_p_)
+ if (break_malt_)
{
- Separating_group_spanner::add_spacing_unit (sep_span_p_, break_malt_p_);
- typeset_grob (break_malt_p_);
+ Separating_group_spanner::add_spacing_unit (sep_span_, break_malt_);
+ typeset_grob (break_malt_);
- break_malt_p_ =0;
+ break_malt_ =0;
}
if (Item * sp = current_spacings_.staff_spacing_)
TODO: should really look at the left-items of following
note-spacing grobs.
*/
- if (musical_malt_p_)
+ if (musical_malt_)
Pointer_group_interface::add_grob (sp, ly_symbol2scm ("right-items"),
- musical_malt_p_);
+ musical_malt_);
typeset_grob (sp);
}
current_spacings_.clear ();
- if (musical_malt_p_)
+ if (musical_malt_)
{
- Separating_group_spanner::add_spacing_unit (sep_span_p_, musical_malt_p_);
- typeset_grob (musical_malt_p_);
+ Separating_group_spanner::add_spacing_unit (sep_span_, musical_malt_);
+ typeset_grob (musical_malt_);
}
- musical_malt_p_ =0;
+ musical_malt_ =0;
}
Interval w = width (me);
Item *item = dynamic_cast<Item*> (me);
- Paper_column * pc = item->column_l ();
+ Paper_column * pc = item->get_column ();
for (SCM s = me->get_grob_property ("conditional-elements"); gh_pair_p (s); s = ly_cdr (s))
continue;
Item *il = unsmob_item (elt);
- if (pc != il->column_l ())
+ if (pc != il->get_column ())
{
/* this shouldn't happen, but let's continue anyway. */
programming_error (_ ("Separation_item: I've been drinking too much"));
}
Item *item = dynamic_cast<Item*> (me);
- Paper_column * pc = item->column_l ();
+ Paper_column * pc = item->get_column ();
Interval w;
for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
continue;
Item *il = unsmob_item (elt);
- if (pc != il->column_l ())
+ if (pc != il->get_column ())
{
/* this shouldn't happen, but let's continue anyway. */
programming_error (_ ("Separation_item: I've been drinking too much"));
if (gh_pair_p (cursor_))
- iter_p_->music_l_ == unsmob_music (ly_car (cursor_))
+ iter_->music_ == unsmob_music (ly_car (cursor_))
else
- iter_p_ == 0;
+ iter_ == 0;
The length of musiclist from start to up to cursor_ (cursor_ not
including), is summed
{
here_mom_ = Moment (0);
grace_fixups_ = 0;
- iter_p_ =0;
+ iter_ =0;
}
SCM
cursor_ = src.cursor_;
list_ = src.cursor_;
here_mom_ = src.here_mom_;
- if (src.iter_p_)
- iter_p_ = src.iter_p_->clone ();
+ if (src.iter_)
+ iter_ = src.iter_->clone ();
else
- iter_p_ = 0;
+ iter_ = 0;
}
Sequential_iterator::~Sequential_iterator ()
{
- delete iter_p_;
+ delete iter_;
}
list_ = get_music_list ();
cursor_ = list_;
- iter_p_ = gh_pair_p (cursor_) ? get_iterator_p (unsmob_music (ly_car (cursor_))) : 0;
- while (iter_p_ && !iter_p_->ok ())
+ iter_ = gh_pair_p (cursor_) ? get_iterator (unsmob_music (ly_car (cursor_))) : 0;
+ while (iter_ && !iter_->ok ())
{
next_element (true);
}
- here_mom_ = music_l ()->start_mom ();
+ here_mom_ = get_music ()->start_mom ();
grace_fixups_ = get_grace_fixups (cursor_);
/*
- iter_p_->ok () is tautology, but what the heck.
+ iter_->ok () is tautology, but what the heck.
*/
- if (iter_p_ && iter_p_->ok ())
+ if (iter_ && iter_->ok ())
descend_to_child ();
}
void
Sequential_iterator::next_element (bool side_effect)
{
- Moment len =iter_p_->music_length_mom () - iter_p_->music_start_mom ();
+ Moment len =iter_->music_length_mom () - iter_->music_start_mom ();
assert (!grace_fixups_ || grace_fixups_->start_ >= here_mom_);
if (len.main_part_ && grace_fixups_ &&
here_mom_ += len;
}
- delete iter_p_;
+ delete iter_;
cursor_ = ly_cdr (cursor_);
if (gh_pair_p (cursor_))
- iter_p_ = get_iterator_p (unsmob_music (ly_car (cursor_)));
+ iter_ = get_iterator (unsmob_music (ly_car (cursor_)));
else
- iter_p_ = 0;
+ iter_ = 0;
}
/*
dynamic_cast<Sequential_iterator*> (clone ());
while (me->ok ())
{
- SCM nm = me->iter_p_->get_pending_events (until - me->here_mom_);
+ SCM nm = me->iter_->get_pending_events (until - me->here_mom_);
s = gh_append2 (nm, s);
Moment m = 0;
/*
do the stuff/note/rest preceding a grace.
*/
- iter_p_->skip (iter_p_->music_length_mom ());
+ iter_->skip (iter_->music_length_mom ());
}
- else if (iter_p_->music_length_mom () >= until - here_mom_)
- iter_p_->skip (until - here_mom_ + iter_p_->music_start_mom ());
+ else if (iter_->music_length_mom () >= until - here_mom_)
+ iter_->skip (until - here_mom_ + iter_->music_start_mom ());
- if (iter_p_->ok ())
+ if (iter_->ok ())
return ;
next_element (false);
void
Sequential_iterator::process (Moment until)
{
- while (iter_p_)
+ while (iter_)
{
if (grace_fixups_ &&
grace_fixups_->start_ == here_mom_
/*
do the stuff/note/rest preceding a grace.
*/
- iter_p_->process (iter_p_->music_length_mom ());
+ iter_->process (iter_->music_length_mom ());
}
else
- iter_p_->process (until - here_mom_ + iter_p_->music_start_mom ());
+ iter_->process (until - here_mom_ + iter_->music_start_mom ());
/*
if the iter is still OK, there must be events left that have
TIME > LEFT
*/
- if (iter_p_->ok ())
+ if (iter_->ok ())
return ;
descend_to_child ();
Moment
Sequential_iterator::pending_moment () const
{
- Moment cp = iter_p_->pending_moment ();
+ Moment cp = iter_->pending_moment ();
/*
Fix-up a grace note halfway in the music.
*/
if (grace_fixups_ && here_mom_ == grace_fixups_->start_
- && grace_fixups_->length_ + iter_p_->music_start_mom () == cp)
+ && grace_fixups_->length_ + iter_->music_start_mom () == cp)
{
return here_mom_ + grace_fixups_->length_ + Moment (0, grace_fixups_->grace_start_);
}
/*
Fix-up a grace note at the start of the music.
*/
- return cp + here_mom_ - iter_p_->music_start_mom ();
+ return cp + here_mom_ - iter_->music_start_mom ();
}
bool
Sequential_iterator::ok () const
{
- return iter_p_;
+ return iter_;
}
Music_iterator*
Sequential_iterator::try_music_in_children (Music *m) const
{
- return iter_p_ ? iter_p_->try_music (m) : 0;
+ return iter_ ? iter_->try_music (m) : 0;
}
IMPLEMENT_CTOR_CALLBACK (Sequential_iterator);
void
Sequential_music_iterator::descend_to_child ()
{
- Translator_group * child_report = child_report = iter_p_->report_to_l ();
- Translator_group * me_report = report_to_l ();
+ Translator_group * child_report = child_report = iter_->report_to ();
+ Translator_group * me_report = report_to ();
Translator_group * c = child_report;
while (c && c != me_report)
{
- c= c->daddy_trans_l_;
+ c= c->daddy_trans_;
}
if (c == me_report)
SCM
Sequential_music_iterator::get_music_list()const
{
- return dynamic_cast<Music_sequence const*> (music_l ())->music_list ();
+ return dynamic_cast<Music_sequence const*> (get_music ())->music_list ();
}
if (Staff_symbol_referencer::has_interface (me))
{
- Real p = Staff_symbol_referencer::position_f (me);
+ Real p = Staff_symbol_referencer::get_position (me);
Real rp = directed_round (p, d);
Real rad = Staff_symbol_referencer::staff_radius (me) *2 ;
int ip = int (rp);
void
Side_position_interface::add_staff_support (Grob*me)
{
- Grob* st = Staff_symbol_referencer::staff_symbol_l (me);
+ Grob* st = Staff_symbol_referencer::get_staff_symbol (me);
if (st && get_axis (me) == Y_AXIS)
{
add_support (me,st);
uncommented because setting MUSIC_L_ = 0 causes core dumps with
grace notes. */
- // music_l_ = 0;
+ // music_ = 0;
last_processed_mom_ = m;
}
*/
compression_penalty_b_ = false;
active_count_ = 0;
- force_f_ = 0.;
- indent_f_ =0.0;
- default_space_f_ = 20 PT;
+ force_ = 0.;
+ indent_ =0.0;
+ default_space_ = 20 PT;
}
void
*/
Real total_dist = 0.;
for (int i = l ; i < r; i++)
- total_dist += springs_[i].ideal_f_;
+ total_dist += springs_[i].ideal_;
if (total_dist < dist)
for (int i = l ; i < r; i++)
- springs_[i].ideal_f_ *= dist/total_dist;
+ springs_[i].ideal_ *= dist/total_dist;
return;
}
Real block_stretch = dist - d;
Real block_force = c * block_stretch;
- force_f_ = force_f_ >? block_force;
+ force_ = force_ >? block_force;
for (int i=l; i < r; i++)
- springs_[i].block_force_f_ = block_force >?
- springs_[i].block_force_f_ ;
+ springs_[i].block_force_ = block_force >?
+ springs_[i].block_force_ ;
}
Real
{
Real d =0.;
for (int i=l; i < r; i++)
- d += springs_[i].ideal_f_;
+ d += springs_[i].ideal_;
return d;
}
for (int i=l; i < r; i++)
{
if (springs_[i].active_b_)
- den += 1 / springs_[i].hooke_f_;
+ den += 1 / springs_[i].hooke_;
}
return 1 / den;
for (int i=0; i < springs_.size (); i++)
if (springs_[i].active_b_)
{
- bf = bf >? springs_[i].block_force_f_;
+ bf = bf >? springs_[i].block_force_;
}
return bf;
}
for (int i=0; i < springs_.size (); i++)
if (springs_[i].active_b_)
{
- den += 1 / springs_[i].hooke_f_;
+ den += 1 / springs_[i].hooke_;
}
return 1/den;
}
/* float comparison is safe, since force is only copied. */
for (int i=0 ; i <springs_.size (); i++)
if (springs_[i].active_b_
- && springs_[i].block_force_f_ >= force_f_)
+ && springs_[i].block_force_ >= force_)
{
springs_[i].active_b_ = false;
active_count_ --;
{
Real l =0.;
for (int i=0; i < springs_.size (); i++)
- l += springs_[i].length (force_f_);
+ l += springs_[i].length (force_);
return l;
}
{
while (active_b ())
{
- force_f_ = active_blocking_force ();
+ force_ = active_blocking_force ();
Real conf = configuration_length ();
- if (conf < line_len_f_)
+ if (conf < line_len_)
{
- force_f_ += (line_len_f_ - conf) * active_springs_stiffness ();
+ force_ += (line_len_ - conf) * active_springs_stiffness ();
break;
}
else
{
while (active_b ())
{
- force_f_ = active_blocking_force () >? 0.0;
+ force_ = active_blocking_force () >? 0.0;
- if (force_f_ < 1e-8) // ugh.,
+ if (force_ < 1e-8) // ugh.,
break;
set_active_states ();
Spring_description desc;
if (spring)
{
- desc.ideal_f_ = spring->distance_f_;
- desc.hooke_f_ = spring->strength_f_;
+ desc.ideal_ = spring->distance_;
+ desc.hooke_ = spring->strength_;
}
else
{
programming_error (_f("No spring between column %d and next one",
- Paper_column::rank_i (cols[i])
+ Paper_column::get_rank (cols[i])
));
- desc.hooke_f_ = 1.0;
- desc.ideal_f_ = default_space_f_;
+ desc.hooke_ = 1.0;
+ desc.ideal_ = default_space_;
continue;
}
{
programming_error ("Insane spring found. Setting to unit spring.");
- desc.hooke_f_ = 1.0;
- desc.ideal_f_ = 1.0;
+ desc.hooke_ = 1.0;
+ desc.ideal_ = 1.0;
}
- if (isinf (desc.hooke_f_))
+ if (isinf (desc.hooke_))
{
desc.active_b_ = false;
springs_.push (desc);
}
else
{
- desc.block_force_f_ = - desc.hooke_f_ * desc.ideal_f_; // block at distance 0
+ desc.block_force_ = - desc.hooke_ * desc.ideal_; // block at distance 0
springs_.push (desc);
active_count_ ++;
gh_pair_p (s); s = ly_cdr (s))
{
Grob * other = unsmob_grob (ly_caar (s));
- int oi = cols.find_i (other);
+ int oi = cols.find_index (other);
if (oi >= 0)
{
add_rod (i, oi, gh_scm2double (ly_cdar (s)));
/*
TODO: should support natural length on only the last line.
*/
- if (line_len_f_ < 0)
+ if (line_len_ < 0)
my_solve_natural_len ();
else
my_solve_linelen ();
void
Simple_spacer::solve (Column_x_positions *positions, bool ragged) const
{
- positions->force_f_ = force_f_;
- if ((force_f_ < 0))
+ positions->force_ = force_;
+ if ((force_ < 0))
{
/*
maybe this should be tunable?
*/
if (compression_penalty_b_)
- ; // positions->force_f_ *= 2; // hmm.
+ ; // positions->force_ *= 2; // hmm.
}
- positions->config_.push (indent_f_);
+ positions->config_.push (indent_);
for (int i=0; i <springs_.size (); i++)
{
- Real l = springs_[i].length ((ragged) ? 0.0 : force_f_);
+ Real l = springs_[i].length ((ragged) ? 0.0 : force_);
positions->config_.push (positions->config_.top () + l);
/*
we have l>= 0 here, up to rounding errors
positions->cols_ = spaced_cols_;
positions->loose_cols_ = loose_cols_;
- positions->satisfies_constraints_b_ = (line_len_f_ < 0) || active_b ();
+ positions->satisfies_constraints_b_ = (line_len_ < 0) || active_b ();
/*
positions->satisfies_constraints_b_ =
positions->satisfies_constraints_b_ && break_satisfy;
- if (ragged && force_f_ < 0)
+ if (ragged && force_ < 0)
positions->satisfies_constraints_b_ = false;
}
Spring_description::Spring_description ()
{
- ideal_f_ =0.0;
- hooke_f_ =0.0;
+ ideal_ =0.0;
+ hooke_ =0.0;
active_b_ = true;
- block_force_f_ = 0.0;
+ block_force_ = 0.0;
}
bool
Spring_description::sane_b () const
{
- return (hooke_f_ > 0) && !isinf (ideal_f_) && !isnan (ideal_f_);
+ return (hooke_ > 0) && !isinf (ideal_) && !isnan (ideal_);
}
Real
Spring_description::length (Real f) const
{
if (!active_b_)
- f = block_force_f_;
- return ideal_f_ + f / hooke_f_ ;
+ f = block_force_;
+ return ideal_ + f / hooke_ ;
}
{
int j = 0;
- SCM i = music_l ()->get_mus_property ("elements");
+ SCM i = get_music ()->get_mus_property ("elements");
for (; gh_pair_p (i); i = ly_cdr (i), j++)
{
Music *mus = unsmob_music (ly_car (i));
- Music_iterator * mi = static_get_iterator_p (mus);
+ Music_iterator * mi = get_static_get_iterator (mus);
/* if separate_contexts_b_ is set, create a new context with the
number number as name */
Translator_group * t = (j && separate_contexts_b_)
- ? report_to_l ()->find_create_translator_l (report_to_l ()->type_str_,
- to_str (j))
- : report_to_l ();
+ ? report_to ()->find_create_translator (report_to ()->type_string_,
+ to_string (j))
+ : report_to ();
if (!t)
- t = report_to_l ();
+ t = report_to ();
mi->init_translator (mus, t);
mi->construct_children ();
Real
-Slur_bezier_bow::enclosed_area_f () const
+Slur_bezier_bow::get_enclosed_area () const
{
Real a = 0;
for (int i=0; i < encompass_.size (); i++)
}
Array<Real>
-Slur_bezier_bow::area_x_gradients_array (Real area)
+Slur_bezier_bow::area_x_gradientses (Real area)
{
Real len = curve_.control_[3][X_AXIS];
Real grow = len / 10.0;
{
Real r = curve_.control_[i+1][X_AXIS];
curve_.control_[i+1][X_AXIS] += grow;
- da[i] = (enclosed_area_f () - area) / grow;
+ da[i] = (get_enclosed_area () - area) / grow;
curve_.control_[i+1][X_AXIS] = r;
}
return da;
for (int i=0; i < steps; i++)
{
- Real area = enclosed_area_f ();
+ Real area = get_enclosed_area ();
if (area <= beautiful)
break;
- Array<Real> da = area_x_gradients_array (area);
+ Array<Real> da = area_x_gradientses (area);
// urg
Real pct = pct_c0 + pct_c3 * length * length * length;
class Slur_engraver : public Engraver
{
- Link_array<Span_req> requests_arr_;
- Link_array<Span_req> new_slur_req_l_arr_;
+ Link_array<Span_req> requestses_;
+ Link_array<Span_req> new_slur_reqs_;
Link_array<Grob> slur_l_stack_;
- Link_array<Grob> end_slur_l_arr_;
+ Link_array<Grob> end_slurs_;
Moment last_start_;
void set_melisma (bool);
}
bool
-Slur_engraver::try_music (Music *req_l)
+Slur_engraver::try_music (Music *req)
{
- if (Span_req *sl = dynamic_cast <Span_req *> (req_l))
+ if (Span_req *sl = dynamic_cast <Span_req *> (req))
{
String t = ly_scm2string (sl->get_mus_property ("span-type"));
if (t == "abort")
slur_l_stack_[i]->suicide ();
}
slur_l_stack_.clear ();
- for (int i = 0; i < end_slur_l_arr_.size (); i++)
+ for (int i = 0; i < end_slurs_.size (); i++)
{
- end_slur_l_arr_[i]->suicide ();
+ end_slurs_[i]->suicide ();
}
- end_slur_l_arr_.clear ();
- requests_arr_.clear ();
- new_slur_req_l_arr_.clear ();
+ end_slurs_.clear ();
+ requestses_.clear ();
+ new_slur_reqs_.clear ();
}
else if (t == "slur")
{
{
if (now_mom () > last_start_)
{
- new_slur_req_l_arr_.push (sl);
+ new_slur_reqs_.push (sl);
last_start_ = now_mom ();
return true;
}
}
else
{
- new_slur_req_l_arr_.push (sl);
+ new_slur_reqs_.push (sl);
return true;
}
}
void
Slur_engraver::set_melisma (bool m)
{
- daddy_trans_l_->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
+ daddy_trans_->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
}
void
Slur_engraver::acknowledge_grob (Grob_info info)
{
- if (Note_column::has_interface (info.grob_l_))
+ if (Note_column::has_interface (info.grob_))
{
- Grob *e =info.grob_l_;
+ Grob *e =info.grob_;
for (int i = 0; i < slur_l_stack_.size (); i++)
Slur::add_column (slur_l_stack_[i], e);
- for (int i = 0; i < end_slur_l_arr_.size (); i++)
- Slur::add_column (end_slur_l_arr_[i], e);
+ for (int i = 0; i < end_slurs_.size (); i++)
+ Slur::add_column (end_slurs_[i], e);
}
}
}
slur_l_stack_.clear ();
- for (int i=0; i < requests_arr_.size (); i++)
+ for (int i=0; i < requestses_.size (); i++)
{
- requests_arr_[i]->origin ()->warning (_ ("unterminated slur"));
+ requestses_[i]->origin ()->warning (_ ("unterminated slur"));
}
}
void
Slur_engraver::process_acknowledged_grobs ()
{
- Link_array<Grob> start_slur_l_arr;
- for (int i=0; i< new_slur_req_l_arr_.size (); i++)
+ Link_array<Grob> start_slurs;
+ for (int i=0; i< new_slur_reqs_.size (); i++)
{
- Span_req* slur_req_l = new_slur_req_l_arr_[i];
+ Span_req* slur_req = new_slur_reqs_[i];
// end slur: move the slur to other array
- if (slur_req_l->get_span_dir () == STOP)
+ if (slur_req->get_span_dir () == STOP)
{
if (slur_l_stack_.empty ())
/* How to shut up this warning, when Voice_devnull_engraver has
eaten start request? */
- slur_req_l->origin ()->warning (_f ("can't find start of slur"));
+ slur_req->origin ()->warning (_f ("can't find start of slur"));
else
{
Grob* slur = slur_l_stack_.pop ();
- end_slur_l_arr_.push (slur);
- requests_arr_.pop ();
+ end_slurs_.push (slur);
+ requestses_.pop ();
}
}
- else if (slur_req_l->get_span_dir () == START)
+ else if (slur_req->get_span_dir () == START)
{
// push a new slur onto stack.
// (use temp. array to wait for all slur STOPs)
Grob* slur = new Spanner (get_property ("Slur"));
Slur::set_interface (slur); // cannot remove yet!
- start_slur_l_arr.push (slur);
- requests_arr_.push (slur_req_l);
- announce_grob (slur, slur_req_l->self_scm ());
+ start_slurs.push (slur);
+ requestses_.push (slur_req);
+ announce_grob (slur, slur_req->self_scm ());
}
}
- for (int i=0; i < start_slur_l_arr.size (); i++)
- slur_l_stack_.push (start_slur_l_arr[i]);
- new_slur_req_l_arr_.clear ();
+ for (int i=0; i < start_slurs.size (); i++)
+ slur_l_stack_.push (start_slurs[i]);
+ new_slur_reqs_.clear ();
}
void
Slur_engraver::stop_translation_timestep ()
{
- for (int i = 0; i < end_slur_l_arr_.size (); i++)
+ for (int i = 0; i < end_slurs_.size (); i++)
{
- typeset_grob (end_slur_l_arr_[i]);
+ typeset_grob (end_slurs_[i]);
}
- end_slur_l_arr_.clear ();
+ end_slurs_.clear ();
}
void
Slur_engraver::start_translation_timestep ()
{
- new_slur_req_l_arr_.clear ();
+ new_slur_reqs_.clear ();
SCM m = get_property ("automaticMelismata");
if (to_boolean (m))
{
Direction
Slur::get_default_dir (Grob*me)
{
- Link_array<Grob> encompass_arr =
+ Link_array<Grob> encompasses =
Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns");
Direction d = DOWN;
- for (int i=0; i < encompass_arr.size (); i ++)
+ for (int i=0; i < encompasses.size (); i ++)
{
- if (Note_column::dir (encompass_arr[i]) < 0)
+ if (Note_column::dir (encompasses[i]) < 0)
{
d = UP;
break;
SCM s = me->get_grob_property ("slope-limit");
if (gh_number_p (s))
{
- Array<Offset> encompass = get_encompass_offset_arr (me);
+ Array<Offset> encompass = get_encompass_offsets (me);
Drul_array<Offset> attachment;
attachment[LEFT] = encompass[0];
attachment[RIGHT] = encompass.top ();
the unbroken slur would have had.
*/
Offset o;
- if (Spanner *mother = dynamic_cast<Spanner*> (me->original_l_))
+ if (Spanner *mother = dynamic_cast<Spanner*> (me->original_))
{
- for (int i = dir == LEFT ? 0 : mother->broken_into_l_arr_.size () - 1;
- dir == LEFT ? i < mother->broken_into_l_arr_.size () : i > 0;
+ for (int i = dir == LEFT ? 0 : mother->broken_intos_.size () - 1;
+ dir == LEFT ? i < mother->broken_intos_.size () : i > 0;
dir == LEFT ? i++ : i--)
{
- if (mother->broken_into_l_arr_[i - dir] == me)
+ if (mother->broken_intos_[i - dir] == me)
{
- Grob *neighbour = mother->broken_into_l_arr_[i];
+ Grob *neighbour = mother->broken_intos_[i];
if (dir == RIGHT)
neighbour->set_grob_property ("direction",
me->get_grob_property ("direction"));
if (Note_column::has_interface (sp->get_bound (dir)))
{
Grob * n =sp->get_bound (dir);
- if ((stem = Note_column::stem_l (n)))
+ if ((stem = Note_column::get_stem (n)))
{
Real x_extent;
if (Grob *head = Note_column::first_head (n))
*/
Real stem_thickness =
gh_scm2double (stem->get_grob_property ("thickness"))
- * stem->paper_l ()->get_var ("linethickness");
+ * stem->get_paper ()->get_var ("linethickness");
o += Offset (0.5 *
x_extent * (1 + Stem::get_direction (stem))
- ((dir + 1)/2) * stem_thickness
Grob **common)
{
Offset o;
- Grob* stem_l = unsmob_grob (col->get_grob_property ("stem"));
+ Grob* stem = unsmob_grob (col->get_grob_property ("stem"));
Direction dir = Directional_element_interface::get (me);
- if (!stem_l)
+ if (!stem)
{
me->warning (_ ("Slur over rest?"));
o[X_AXIS] = col->relative_coordinate (common[X_AXIS], X_AXIS);
o[Y_AXIS] = col->relative_coordinate (common[Y_AXIS], Y_AXIS);
return o;
}
- Direction stem_dir = Directional_element_interface::get (stem_l);
- o[X_AXIS] = stem_l->relative_coordinate (0, X_AXIS);
+ Direction stem_dir = Directional_element_interface::get (stem);
+ o[X_AXIS] = stem->relative_coordinate (0, X_AXIS);
/*
Simply set x to middle of notehead
o[X_AXIS] -= 0.5 * stem_dir * x_extent;
if ((stem_dir == dir)
- && !stem_l->extent (stem_l, Y_AXIS).empty_b ())
+ && !stem->extent (stem, Y_AXIS).empty_b ())
{
- o[Y_AXIS] = stem_l->extent (common[Y_AXIS], Y_AXIS)[dir];
+ o[Y_AXIS] = stem->extent (common[Y_AXIS], Y_AXIS)[dir];
}
else
{
}
Array<Offset>
-Slur::get_encompass_offset_arr (Grob *me)
+Slur::get_encompass_offsets (Grob *me)
{
Spanner*sp = dynamic_cast<Spanner*> (me);
SCM eltlist = me->get_grob_property ("note-columns");
common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
common[X_AXIS] = common[X_AXIS]->common_refpoint (sp->get_bound (LEFT), X_AXIS);
- Link_array<Grob> encompass_arr = ly_scm2grob_array (eltlist);
- Array<Offset> offset_arr;
+ Link_array<Grob> encompasses = ly_scm2grobs (eltlist);
+ Array<Offset> offsets;
Offset origin (me->relative_coordinate (common[X_AXIS], X_AXIS),
me->relative_coordinate (common[Y_AXIS], Y_AXIS));
int first = 1;
- int last = encompass_arr.size () - 2;
+ int last = encompasses.size () - 2;
- offset_arr.push (get_attachment (me, LEFT, common));
+ offsets.push (get_attachment (me, LEFT, common));
/*
left is broken edge
*/
- if (encompass_arr[0] != sp->get_bound (LEFT))
+ if (encompasses[0] != sp->get_bound (LEFT))
{
first--;
// ?
- offset_arr[0][Y_AXIS] -=
- encompass_arr[0]->relative_coordinate (common[Y_AXIS], Y_AXIS)
+ offsets[0][Y_AXIS] -=
+ encompasses[0]->relative_coordinate (common[Y_AXIS], Y_AXIS)
- me->relative_coordinate (common[Y_AXIS], Y_AXIS);
}
/*
right is broken edge
*/
- if (encompass_arr.top () != sp->get_bound (RIGHT))
+ if (encompasses.top () != sp->get_bound (RIGHT))
{
last++;
}
for (int i = first; i <= last; i++)
{
- Offset o (encompass_offset (me, encompass_arr[i], common));
- offset_arr.push (o - origin);
+ Offset o (encompass_offset (me, encompasses[i], common));
+ offsets.push (o - origin);
}
- offset_arr.push (Offset (sp->spanner_length (), 0) + get_attachment (me, RIGHT,common));
+ offsets.push (Offset (sp->spanner_length (), 0) + get_attachment (me, RIGHT,common));
- if (encompass_arr[0] != sp->get_bound (LEFT))
+ if (encompasses[0] != sp->get_bound (LEFT))
{
- offset_arr.top ()[Y_AXIS] -= encompass_arr.top ()->relative_coordinate (common[Y_AXIS], Y_AXIS)
+ offsets.top ()[Y_AXIS] -= encompasses.top ()->relative_coordinate (common[Y_AXIS], Y_AXIS)
- me->relative_coordinate (common[Y_AXIS], Y_AXIS);
}
- return offset_arr;
+ return offsets;
}
return SCM_EOL;
}
- Real thick = me->paper_l ()->get_var ("linethickness") *
+ Real thick = me->get_paper ()->get_var ("linethickness") *
gh_scm2double (me->get_grob_property ("thickness"));
Bezier one = get_curve (me);
Real r_0 = gh_scm2double (ly_cdr (r_0_scm));
Real h_inf = staff_space * gh_scm2double (ly_cdr (h_inf_scm));
- Slur_bezier_bow bb (get_encompass_offset_arr (me),
+ Slur_bezier_bow bb (get_encompass_offsets (me),
Directional_element_interface::get (me),
h_inf, r_0);
Real beautiful = length * default_height * sb;
- Real area = bb.enclosed_area_f ();
+ Real area = bb.get_enclosed_area ();
/*
Slurs that fit beautifully are not ugly
i++;
}
- Array<Offset> enc (get_encompass_offset_arr (me));
+ Array<Offset> enc (get_encompass_offsets (me));
Direction dir = Directional_element_interface::get (me);
Real x1 = enc[0][X_AXIS];
#endif
Spring_smob spring;
- spring.strength_f_ = strength;
- spring.distance_f_ = d;
+ spring.strength_ = strength;
+ spring.distance_ = d;
spring.expand_only_b_ = expand_only;
spring.other_ = p;
Array<Rhythmic_tuple> now_durations_;
Array<Rhythmic_tuple> stopped_durations_;
Moment now_;
- Spanner * spacing_p_;
+ Spanner * spacing_;
TRANSLATOR_DECLARATIONS(Spacing_engraver);
protected:
Spacing_engraver::Spacing_engraver ()
{
- spacing_p_ = 0;
+ spacing_ = 0;
}
void
Spacing_engraver::initialize ()
{
- spacing_p_ =new Spanner (get_property ("SpacingSpanner"));
- spacing_p_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
- announce_grob(spacing_p_, SCM_EOL);
+ spacing_ =new Spanner (get_property ("SpacingSpanner"));
+ spacing_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+ announce_grob(spacing_, SCM_EOL);
}
void
Spacing_engraver::finalize ()
{
Grob * p = unsmob_grob (get_property ("currentCommandColumn"));
- spacing_p_->set_bound (RIGHT, p);
- typeset_grob (spacing_p_);
- spacing_p_ =0;
+ spacing_->set_bound (RIGHT, p);
+ typeset_grob (spacing_);
+ spacing_ =0;
}
void
Spacing_engraver::acknowledge_grob (Grob_info i)
{
- if (Note_spacing::has_interface (i.grob_l_) || Staff_spacing::has_interface (i.grob_l_))
+ if (Note_spacing::has_interface (i.grob_) || Staff_spacing::has_interface (i.grob_))
{
- Pointer_group_interface::add_grob (spacing_p_, ly_symbol2scm ("wishes"), i.grob_l_);
+ Pointer_group_interface::add_grob (spacing_, ly_symbol2scm ("wishes"), i.grob_);
}
- if (i.grob_l_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+ if (i.grob_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
return;
/*
if (!l_neighbor || !r_neighbor)
return false;
- l_neighbor = l_neighbor->column_l();
+ l_neighbor = l_neighbor->get_column ();
r_neighbor = dynamic_cast<Item*> (Note_spacing::right_column (r_neighbor));
if (l == l_neighbor && r == r_neighbor)
while (flip (&d) != LEFT);
Rod r;
- r.distance_f_ = dists[LEFT] + dists[RIGHT];
+ r.distance_ = dists[LEFT] + dists[RIGHT];
r.item_l_drul_[LEFT] = dynamic_cast<Item*> (cols->elem(i-1));
r.item_l_drul_[RIGHT] = dynamic_cast<Item*> (cols->elem (i+1));
{
Item * wish = dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
- Item * lc = wish->column_l ();
+ Item * lc = wish->get_column ();
Grob * right = Note_spacing::right_column (wish);
if (!right)
Item * rc = dynamic_cast<Item*> (right);
- int right_rank = Paper_column::rank_i (rc);
- int left_rank = Paper_column::rank_i (lc);
+ int right_rank = Paper_column::get_rank (rc);
+ int left_rank = Paper_column::get_rank (lc);
/*
update the left column.
&& unsmob_grob (gh_car (left_neighs)))
{
Item * it = dynamic_cast<Item*> (unsmob_grob (gh_car (left_neighs)));
- maxrank = Paper_column::rank_i (it->column_l());
+ maxrank = Paper_column::get_rank (it->get_column ());
}
if (left_rank >= maxrank)
{
Grob *me = unsmob_grob (smob);
- Link_array<Grob> all (me->pscore_l_->system_->column_l_arr ()) ;
+ Link_array<Grob> all (me->pscore_->system_->columns ()) ;
set_explicit_neighbor_columns (all);
global_shortest = find_shortest (me, all);
if (verbose_global_b)
{
- progress_indication (_f("Global shortest duration is %s\n", global_shortest.str()));
+ progress_indication (_f("Global shortest duration is %s\n", global_shortest.string ()));
}
}
prune_loose_colunms (me, &all, global_shortest);
Item *wish_rcol = Note_spacing::right_column (wish);
if (Note_spacing::left_column (wish) != lc
- || (wish_rcol != rc && wish_rcol != rc->original_l_))
+ || (wish_rcol != rc && wish_rcol != rc->original_))
continue;
/*
max_fixed_note_space = increment;
}
- bool ragged = to_boolean (me->paper_l ()->get_scmvar ("raggedright"));
+ bool ragged = to_boolean (me->get_paper ()->get_scmvar ("raggedright"));
/*
Whatever we do, the fixed space is smaller than the real
pointer munging.
*/
- assert (spacing_grob-> column_l () == l);
+ assert (spacing_grob-> get_column () == l);
Staff_spacing::get_spacing_params (spacing_grob,
&space, &fixed_space);
works on all architectures.
*/
- bool ragged = to_boolean (me->paper_l ()->get_scmvar ("raggedright"));
+ bool ragged = to_boolean (me->get_paper ()->get_scmvar ("raggedright"));
Real strength = (ragged) ? 1.0 : 1 / (max_space - max_fixed);
Real distance = (ragged) ? max_fixed : max_space;
Spaceable_grob::add_spring (l, r, distance, strength, false);
if (! shortest_playing_len.to_bool ())
{
- programming_error ("can't find a ruling note at " + Paper_column::when_mom (lc).str ());
+ programming_error ("can't find a ruling note at " + Paper_column::when_mom (lc).string ());
shortest_playing_len = 1;
}
void
Span_arpeggio_engraver::acknowledge_grob (Grob_info info)
{
- if (info.origin_trans_l_arr (this).size ()
- && Arpeggio::has_interface (info.grob_l_))
+ if (info.origin_transes (this).size ()
+ && Arpeggio::has_interface (info.grob_))
{
- arpeggios_.push (info.grob_l_);
+ arpeggios_.push (info.grob_);
}
}
*/
class Span_bar_engraver : public Engraver
{
- Item * spanbar_p_;
- Link_array<Item> bar_l_arr_;
+ Item * spanbar_;
+ Link_array<Item> bars_;
public:
TRANSLATOR_DECLARATIONS(Span_bar_engraver);
Span_bar_engraver::Span_bar_engraver ()
{
- spanbar_p_ =0;
+ spanbar_ =0;
}
void
Span_bar_engraver::acknowledge_grob (Grob_info i)
{
- int depth = i.origin_trans_l_arr (this).size ();
+ int depth = i.origin_transes (this).size ();
if (depth > 1
- && Bar_line::has_interface (i.grob_l_))
+ && Bar_line::has_interface (i.grob_))
{
- Item * it = dynamic_cast<Item*> (i.grob_l_);
- bar_l_arr_.push (it);
+ Item * it = dynamic_cast<Item*> (i.grob_);
+ bars_.push (it);
- if (bar_l_arr_.size () >= 2 && !spanbar_p_)
+ if (bars_.size () >= 2 && !spanbar_)
{
- spanbar_p_ = new Item (get_property ("SpanBar"));
+ spanbar_ = new Item (get_property ("SpanBar"));
- spanbar_p_->set_parent (bar_l_arr_[0], X_AXIS);
+ spanbar_->set_parent (bars_[0], X_AXIS);
- announce_grob (spanbar_p_, SCM_EOL);
+ announce_grob (spanbar_, SCM_EOL);
}
}
}
void
Span_bar_engraver::stop_translation_timestep ()
{
- if (spanbar_p_)
+ if (spanbar_)
{
- for (int i=0; i < bar_l_arr_.size () ; i++)
- Span_bar::add_bar (spanbar_p_,bar_l_arr_[i]);
+ for (int i=0; i < bars_.size () ; i++)
+ Span_bar::add_bar (spanbar_,bars_[i]);
SCM vissym =ly_symbol2scm ("break-visibility");
- SCM vis = bar_l_arr_[0]->internal_get_grob_property (vissym);
- if (scm_equal_p (spanbar_p_->internal_get_grob_property (vissym), vis) != SCM_BOOL_T)
- spanbar_p_->internal_set_grob_property (vissym, vis);
+ SCM vis = bars_[0]->internal_get_grob_property (vissym);
+ if (scm_equal_p (spanbar_->internal_get_grob_property (vissym), vis) != SCM_BOOL_T)
+ spanbar_->internal_set_grob_property (vissym, vis);
- typeset_grob (spanbar_p_);
- spanbar_p_ =0;
+ typeset_grob (spanbar_);
+ spanbar_ =0;
}
- bar_l_arr_.set_size (0);
+ bars_.set_size (0);
}
if (!gh_string_p (glyph))
return SCM_EOL;
- String glyph_str = ly_scm2string (glyph);
+ String glyph_string = ly_scm2string (glyph);
// compose span_bar_mol
Molecule span_bar_mol;
else
{
Molecule interbar
- = Bar_line::compound_barline (staff_bar, glyph_str, l.length());
+ = Bar_line::compound_barline (staff_bar, glyph_string, l.length());
interbar.translate_axis (l.center (), Y_AXIS);
span_bar_mol.add_molecule (interbar);
}
type = ".|.";
}
- gl = ly_str02scm (type.ch_C ());
+ gl = ly_str02scm (type.to_str0 ());
if (scm_equal_p (me->internal_get_grob_property (glyph_symbol), gl) != SCM_BOOL_T)
me->internal_set_grob_property (glyph_symbol, gl);
}
struct Audio_dynamic_tuple
{
- Audio_dynamic* audio_l_;
+ Audio_dynamic* audio_;
Moment mom_;
};
virtual void start_translation_timestep ();
private:
- Audio_dynamic* audio_p_;
+ Audio_dynamic* audio_;
Real last_volume_;
- Span_req* span_start_req_l_;
+ Span_req* span_start_req_;
Drul_array<Span_req*> span_req_l_drul_;
- Array<Audio_dynamic_tuple> dynamic_tuple_arr_;
- Array<Audio_dynamic_tuple> finished_dynamic_tuple_arr_;
+ Array<Audio_dynamic_tuple> dynamic_tuples_;
+ Array<Audio_dynamic_tuple> finished_dynamic_tuples_;
Direction dir_;
Direction finished_dir_;
};
{
span_req_l_drul_[START] = 0;
span_req_l_drul_[STOP] = 0;
- span_start_req_l_ = 0;
- audio_p_ = 0;
+ span_start_req_ = 0;
+ audio_ = 0;
last_volume_ = 0;
}
void
Span_dynamic_performer::acknowledge_audio_element (Audio_element_info i)
{
- if (Audio_dynamic * d = dynamic_cast <Audio_dynamic*> (i.elem_l_))
+ if (Audio_dynamic * d = dynamic_cast <Audio_dynamic*> (i.elem_))
{
last_volume_ = d->volume_;
}
void
Span_dynamic_performer::process_music ()
{
- if (span_start_req_l_ || span_req_l_drul_[START])
+ if (span_start_req_ || span_req_l_drul_[START])
{
- audio_p_ = new Audio_dynamic (0);
- Audio_element_info info (audio_p_, span_req_l_drul_[START]
+ audio_ = new Audio_dynamic (0);
+ Audio_element_info info (audio_, span_req_l_drul_[START]
? span_req_l_drul_[START]
: span_req_l_drul_[STOP]);
announce_element (info);
- Audio_dynamic_tuple a = { audio_p_, now_mom () };
- dynamic_tuple_arr_.push (a);
+ Audio_dynamic_tuple a = { audio_, now_mom () };
+ dynamic_tuples_.push (a);
}
if (span_req_l_drul_[STOP])
{
- if (!span_start_req_l_)
+ if (!span_start_req_)
{
span_req_l_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo"));
span_req_l_drul_[STOP] = 0;
else
{
finished_dir_ = dir_;
- finished_dynamic_tuple_arr_ = dynamic_tuple_arr_;
+ finished_dynamic_tuples_ = dynamic_tuples_;
}
- dynamic_tuple_arr_.clear ();
- span_start_req_l_ = 0;
+ dynamic_tuples_.clear ();
+ span_start_req_ = 0;
}
if (span_req_l_drul_[START])
{
String t = ly_scm2string (span_req_l_drul_[START]->get_mus_property ("span-type"));
dir_ = (t == "crescendo") ? RIGHT : LEFT;
- span_start_req_l_ = span_req_l_drul_[START];
+ span_start_req_ = span_req_l_drul_[START];
- dynamic_tuple_arr_.clear ();
- Audio_dynamic_tuple a = { audio_p_, now_mom () };
- dynamic_tuple_arr_.push (a);
+ dynamic_tuples_.clear ();
+ Audio_dynamic_tuple a = { audio_, now_mom () };
+ dynamic_tuples_.push (a);
}
if (span_req_l_drul_[STOP])
{
- finished_dynamic_tuple_arr_.top ().audio_l_->volume_ = last_volume_;
+ finished_dynamic_tuples_.top ().audio_->volume_ = last_volume_;
}
if (span_req_l_drul_[START])
{
- dynamic_tuple_arr_[0].audio_l_->volume_ = last_volume_;
+ dynamic_tuples_[0].audio_->volume_ = last_volume_;
}
- span_start_req_l_ = 0;
+ span_start_req_ = 0;
span_req_l_drul_[START] = 0;
span_req_l_drul_[STOP] = 0;
}
void
Span_dynamic_performer::stop_translation_timestep ()
{
- if (finished_dynamic_tuple_arr_.size () > 1)
+ if (finished_dynamic_tuples_.size () > 1)
{
- Real start_volume = finished_dynamic_tuple_arr_[0].audio_l_->volume_;
- Real dv = finished_dynamic_tuple_arr_.top ().audio_l_->volume_
+ Real start_volume = finished_dynamic_tuples_[0].audio_->volume_;
+ Real dv = finished_dynamic_tuples_.top ().audio_->volume_
- start_volume;
/*
urg.
// urg. 20%: about two volume steps
dv = (Real)finished_dir_ * 0.2;
if (!start_volume)
- start_volume = finished_dynamic_tuple_arr_.top
- ().audio_l_->volume_ - dv;
+ start_volume = finished_dynamic_tuples_.top
+ ().audio_->volume_ - dv;
}
- Moment start_mom = finished_dynamic_tuple_arr_[0].mom_;
- Moment dt = finished_dynamic_tuple_arr_.top ().mom_ - start_mom;
- for (int i=0; i < finished_dynamic_tuple_arr_.size (); i++)
+ Moment start_mom = finished_dynamic_tuples_[0].mom_;
+ Moment dt = finished_dynamic_tuples_.top ().mom_ - start_mom;
+ for (int i=0; i < finished_dynamic_tuples_.size (); i++)
{
- Audio_dynamic_tuple* a = &finished_dynamic_tuple_arr_[i];
+ Audio_dynamic_tuple* a = &finished_dynamic_tuples_[i];
Real volume = start_volume + dv * (Real) (a->mom_ - start_mom).main_part_
/ (Real)dt.main_part_;
- a->audio_l_->volume_ = volume;
+ a->audio_->volume_ = volume;
}
- finished_dynamic_tuple_arr_.clear ();
+ finished_dynamic_tuples_.clear ();
}
- if (audio_p_)
+ if (audio_)
{
- play_element (audio_p_);
- audio_p_ = 0;
+ play_element (audio_);
+ audio_ = 0;
}
}
SCM_ASSERT_TYPE (me, spanner, SCM_ARG1, __FUNCTION__, "spanner");
SCM s = SCM_EOL;
- for (int i = me->broken_into_l_arr_.size (); i; i--)
- s = gh_cons (me->broken_into_l_arr_[i-1]->self_scm (), s);
+ for (int i = me->broken_intos_.size (); i; i--)
+ s = gh_cons (me->broken_intos_[i-1]->self_scm (), s);
return s;
}
{
if (!parent->spanned_rank_iv ().contains_b (this->spanned_rank_iv ()))
{
- programming_error (to_str ("Spanner `%s' is not fully contained in parent spanner `%s'.",
- name ().ch_C (),
- parent->name ().ch_C ()));
+ programming_error (to_string ("Spanner `%s' is not fully contained in parent spanner `%s'.",
+ name ().to_str0 (),
+ parent->name ().to_str0 ()));
}
}
}
programming_error ("no broken bound");
else if (bound->get_system ())
{
- Spanner * span_p = dynamic_cast<Spanner*> (clone ());
- span_p->set_bound (LEFT, bound);
- span_p->set_bound (RIGHT, bound);
+ Spanner * span = dynamic_cast<Spanner*> (clone ());
+ span->set_bound (LEFT, bound);
+ span->set_bound (RIGHT, bound);
- assert (span_p->get_system ());
- span_p->get_system ()->typeset_grob (span_p);
- broken_into_l_arr_.push (span_p);
+ assert (span->get_system ());
+ span->get_system ()->typeset_grob (span);
+ broken_intos_.push (span);
}
}
while ((flip (&d))!= LEFT);
}
else
{
- Link_array<Item> break_points = pscore_l_->system_->broken_col_range (left,right);
+ Link_array<Item> break_points = pscore_->system_->broken_col_range (left,right);
break_points.insert (left,0);
break_points.push (right);
continue;
}
- Spanner *span_p = dynamic_cast<Spanner*> (clone ());
- span_p->set_bound (LEFT,bounds[LEFT]);
- span_p->set_bound (RIGHT,bounds[RIGHT]);
+ Spanner *span = dynamic_cast<Spanner*> (clone ());
+ span->set_bound (LEFT,bounds[LEFT]);
+ span->set_bound (RIGHT,bounds[RIGHT]);
if (!bounds[LEFT]->get_system ()
|| bounds[LEFT]->get_system () != bounds[RIGHT]->get_system ())
{
programming_error ("bounds of spanner are invalid");
- span_p->suicide ();
+ span->suicide ();
}
else
{
- bounds[LEFT]->get_system ()->typeset_grob (span_p);
- broken_into_l_arr_.push (span_p);
+ bounds[LEFT]->get_system ()->typeset_grob (span);
+ broken_intos_.push (span);
}
}
}
- broken_into_l_arr_.sort (Spanner::compare);
+ broken_intos_.sort (Spanner::compare);
}
void
if (spanned_drul_[LEFT])
{
- iv[LEFT] = Paper_column::rank_i (spanned_drul_[LEFT]->column_l ());
+ iv[LEFT] = Paper_column::get_rank (spanned_drul_[LEFT]->get_column ());
}
if (spanned_drul_[RIGHT])
{
- iv[RIGHT] = Paper_column::rank_i (spanned_drul_[RIGHT]->column_l ());
+ iv[RIGHT] = Paper_column::get_rank (spanned_drul_[RIGHT]->get_column ());
}
return iv;
}
Grob*
Spanner::find_broken_piece (System*l) const
{
- int idx = binsearch_link_array (broken_into_l_arr_, (Spanner*)l, Spanner::compare);
+ int idx = binsearch_links (broken_intos_, (Spanner*)l, Spanner::compare);
if (idx < 0)
return 0;
else
- return broken_into_l_arr_ [idx];
+ return broken_intos_ [idx];
}
int
Spanner::compare (Spanner * const &p1, Spanner * const &p2)
{
- return p1->get_system ()->rank_i_ - p2->get_system ()->rank_i_;
+ return p1->get_system ()->rank_ - p2->get_system ()->rank_;
}
bool
Spanner::broken_b () const
{
- return broken_into_l_arr_.size ();
+ return broken_intos_.size ();
}
Real
Spanner::get_broken_left_end_align () const
{
- Paper_column *sc = dynamic_cast<Paper_column*> (spanned_drul_[LEFT]->column_l ());
+ Paper_column *sc = dynamic_cast<Paper_column*> (spanned_drul_[LEFT]->get_column ());
// Relevant only if left span point is first column in line
if (sc != NULL &&
{
/*
We'd be fucked if this is called before spanned_drul_[] is inited. */
- if (status_c_ == ORPHAN)
+ if (status_ == ORPHAN)
return SCM_EOL;
Direction d = LEFT;
scm_gc_mark (spanned_drul_[d]->self_scm ());
while (flip (&d) != LEFT);
- for (int i= broken_into_l_arr_.size () ; i--;)
- scm_gc_mark (broken_into_l_arr_[i]->self_scm ());
+ for (int i= broken_intos_.size () ; i--;)
+ scm_gc_mark (broken_intos_[i]->self_scm ());
return SCM_EOL;
}
Spanner*sp = dynamic_cast<Spanner*> (me);
r.item_l_drul_[LEFT] = sp->get_bound (LEFT);
r.item_l_drul_[RIGHT] = sp->get_bound (RIGHT);
- r.distance_f_ =
+ r.distance_ =
gh_scm2double (me->get_grob_property ("minimum-length"))
* 1.0;
Spring_smob::Spring_smob()
{
- distance_f_ =0.;
- strength_f_ =1.0;
+ distance_ =0.;
+ strength_ =1.0;
expand_only_b_ = false;
other_ = 0;
}
Spring_smob::print_smob (SCM s, SCM p, scm_print_state *)
{
Spring_smob *ss = unsmob_spring (s);
- scm_puts (_f("#<spring smob d= %f>", ss->distance_f_).ch_C(), p);
+ scm_puts (_f("#<spring smob d= %f>", ss->distance_).to_str0 (), p);
return 1;
}
void
Staff_collecting_engraver::acknowledge_grob (Grob_info gi)
{
- if (Staff_symbol::has_interface (gi.grob_l_))
+ if (Staff_symbol::has_interface (gi.grob_))
{
SCM staffs = get_property ("stavesFound");
- staffs = gh_cons (gi.grob_l_->self_scm (), staffs);
+ staffs = gh_cons (gi.grob_->self_scm (), staffs);
- daddy_trans_l_->set_property ("stavesFound", staffs);
+ daddy_trans_->set_property ("stavesFound", staffs);
}
}
TRANSLATOR_DECLARATIONS(Staff_performer);
~Staff_performer ();
- String new_instrument_str ();
- String instrument_str_;
+ String new_instrument_string ();
+ String instrument_string_;
protected:
virtual void play_element (Audio_element* p);
virtual void stop_translation_timestep ();
private:
- Audio_staff* audio_staff_p_;
- Audio_instrument* instrument_p_;
- Audio_text* instrument_name_p_;
- Audio_text* name_p_;
- Audio_tempo* tempo_p_;
+ Audio_staff* audio_staff_;
+ Audio_instrument* instrument_;
+ Audio_text* instrument_name_;
+ Audio_text* name_;
+ Audio_tempo* tempo_;
};
ENTER_DESCRIPTION (Staff_performer, "","","","","" );
Staff_performer::Staff_performer ()
{
- audio_staff_p_ = 0;
- instrument_p_ = 0;
- instrument_name_p_ = 0;
- name_p_ = 0;
- tempo_p_ = 0;
+ audio_staff_ = 0;
+ instrument_ = 0;
+ instrument_name_ = 0;
+ name_ = 0;
+ tempo_ = 0;
}
Staff_performer::~Staff_performer ()
void
Staff_performer::initialize ()
{
- audio_staff_p_ = new Audio_staff;
- announce_element (Audio_element_info (audio_staff_p_, 0));
+ audio_staff_ = new Audio_staff;
+ announce_element (Audio_element_info (audio_staff_, 0));
- name_p_ = new Audio_text (Audio_text::TRACK_NAME, id_str_);
- announce_element (Audio_element_info (name_p_, 0));
+ name_ = new Audio_text (Audio_text::TRACK_NAME, id_string_);
+ announce_element (Audio_element_info (name_, 0));
- tempo_p_ = new Audio_tempo (get_tempo_i ());
- announce_element (Audio_element_info (tempo_p_, 0));
+ tempo_ = new Audio_tempo (get_tempo ());
+ announce_element (Audio_element_info (tempo_, 0));
Performer_group_performer::initialize ();
}
void
Staff_performer::create_audio_elements ()
{
- String str = new_instrument_str ();
- if (str.length_i ())
+ String str = new_instrument_string ();
+ if (str.length ())
{
- instrument_name_p_ = new Audio_text (Audio_text::INSTRUMENT_NAME, str);
- announce_element (Audio_element_info (instrument_name_p_, 0));
- instrument_p_ = new Audio_instrument (str);
- announce_element (Audio_element_info (instrument_p_, 0));
+ instrument_name_ = new Audio_text (Audio_text::INSTRUMENT_NAME, str);
+ announce_element (Audio_element_info (instrument_name_, 0));
+ instrument_ = new Audio_instrument (str);
+ announce_element (Audio_element_info (instrument_, 0));
}
Performer_group_performer::create_audio_elements ();
}
Staff_performer::stop_translation_timestep ()
{
SCM proc = scm_primitive_eval (ly_symbol2scm ("percussion-p"));
- SCM drums_p = gh_call1 (proc, ly_symbol2scm (instrument_str_.ch_C()));
- audio_staff_p_->channel_i_ = (drums_p == SCM_BOOL_T ? 9 : -1 );
- if (name_p_)
+ SCM drums = gh_call1 (proc, ly_symbol2scm (instrument_string_.to_str0 ()));
+ audio_staff_->channel_ = (drums == SCM_BOOL_T ? 9 : -1 );
+ if (name_)
{
- play_element (name_p_);
- name_p_ = 0;
+ play_element (name_);
+ name_ = 0;
}
- if (tempo_p_)
+ if (tempo_)
{
- play_element (tempo_p_);
- tempo_p_ = 0;
+ play_element (tempo_);
+ tempo_ = 0;
}
- if (instrument_name_p_)
+ if (instrument_name_)
{
- play_element (instrument_name_p_);
- instrument_name_p_ = 0;
+ play_element (instrument_name_);
+ instrument_name_ = 0;
}
- if (instrument_p_)
+ if (instrument_)
{
- play_element (instrument_p_);
- instrument_p_ = 0;
+ play_element (instrument_);
+ instrument_ = 0;
}
Performer_group_performer::stop_translation_timestep ();
}
Staff_performer::finalize ()
{
Performer_group_performer::finalize ();
- Performer::play_element (audio_staff_p_);
- audio_staff_p_ = 0;
+ Performer::play_element (audio_staff_);
+ audio_staff_ = 0;
}
String
-Staff_performer::new_instrument_str ()
+Staff_performer::new_instrument_string ()
{
// mustn't ask Score for instrument: it will return piano!
SCM minstr = get_property ("midiInstrument");
minstr = get_property ("instrument");
if (!gh_string_p (minstr)
- || ly_scm2string (minstr) == instrument_str_)
+ || ly_scm2string (minstr) == instrument_string_)
return "";
- instrument_str_ = ly_scm2string (minstr);
+ instrument_string_ = ly_scm2string (minstr);
- return instrument_str_;
+ return instrument_string_;
}
void
{
if (Audio_item *ai = dynamic_cast<Audio_item *> (p))
{
- audio_staff_p_->add_audio_item (ai);
+ audio_staff_->add_audio_item (ai);
}
Performer::play_element (p);
}
if (!g || !Note_column::has_interface (g))
return 0.0;
- Item *col =dynamic_cast<Item*> (g)->column_l ();
+ Item *col =dynamic_cast<Item*> (g)->get_column ();
Real max_corr = 0. >? (- g->extent (col, X_AXIS)[LEFT]);
/*
max_corr *= 0.75;
if (!bar_size.empty_b())
- if (Grob *stem = Note_column::stem_l (g))
+ if (Grob *stem = Note_column::get_stem (g))
{
Direction d = Stem::get_direction (stem);
if (d == DOWN)
{
SCM glyph = bar_grob->get_grob_property ("glyph");
- String glyph_str = gh_string_p (glyph) ? ly_scm2string (glyph) : "";
- if (glyph_str.left_str (1) == "|" || glyph_str.left_str (1) == ".")
+ String glyph_string = gh_string_p (glyph) ? ly_scm2string (glyph) : "";
+ if (glyph_string.left_string (1) == "|" || glyph_string.left_string (1) == ".")
{
SCM sz = Bar_line::get_staff_bar_size (bar_grob->self_scm());
bar_size = Interval (-1,1);
Staff_spacing::extremal_break_aligned_grob (Grob *separation_item, Direction d,
Interval * last_ext)
{
- Grob *left_col = dynamic_cast<Item*> (separation_item)->column_l ();
+ Grob *left_col = dynamic_cast<Item*> (separation_item)->get_column ();
last_ext->set_empty ();
Grob *last_grob = 0;
for (SCM s = separation_item->get_grob_property ("elements");
separation_item = cand ;
}
- // printf ("doing col %d\n" , Paper_column::rank_i(left_col));
+ // printf ("doing col %d\n" , Paper_column::get_rank (left_col));
if (!separation_item)
{
Manage the staff symbol.
*/
class Staff_symbol_engraver : public Engraver {
- Spanner *span_p_;
+ Spanner *span_;
public:
TRANSLATOR_DECLARATIONS(Staff_symbol_engraver);
Staff_symbol_engraver::~Staff_symbol_engraver ()
{
- assert (!span_p_);
+ assert (!span_);
}
Staff_symbol_engraver::Staff_symbol_engraver ()
{
- span_p_ = 0;
+ span_ = 0;
}
void
Staff_symbol_engraver::initialize ()
{
- span_p_ = new Spanner (get_property ("StaffSymbol"));
+ span_ = new Spanner (get_property ("StaffSymbol"));
- span_p_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+ span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
- announce_grob(span_p_, SCM_EOL);
+ announce_grob(span_, SCM_EOL);
}
void
Staff_symbol_engraver::finalize ()
{
- span_p_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
- typeset_grob (span_p_);
- span_p_ =0;
+ span_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
+ typeset_grob (span_);
+ span_ =0;
}
void
Staff_symbol_engraver::acknowledge_grob (Grob_info s)
{
- s.grob_l_->set_grob_property ("staff-symbol", span_p_->self_scm ());
+ s.grob_->set_grob_property ("staff-symbol", span_->self_scm ());
// remove this. probly not necessary?
- s.grob_l_->add_dependency (span_p_); // UGH. UGH. UGH
+ s.grob_->add_dependency (span_); // UGH. UGH. UGH
}
int
Staff_symbol_referencer::line_count (Grob*me)
{
- Grob *st = staff_symbol_l (me);
+ Grob *st = get_staff_symbol (me);
return st ? Staff_symbol::line_count (st) : 0;
}
bool
Staff_symbol_referencer::on_staffline (Grob*me)
{
- return on_staffline (me, (int) rint (position_f (me)));
+ return on_staffline (me, (int) rint (get_position (me)));
}
bool
}
Grob*
-Staff_symbol_referencer::staff_symbol_l (Grob*me)
+Staff_symbol_referencer::get_staff_symbol (Grob*me)
{
SCM st = me->get_grob_property ("staff-symbol");
return unsmob_grob (st);
Real
Staff_symbol_referencer::staff_space (Grob*me)
{
- Grob * st = staff_symbol_l (me);
+ Grob * st = get_staff_symbol (me);
if (st)
return Staff_symbol::staff_space (st);
}
Real
-Staff_symbol_referencer::position_f (Grob*me)
+Staff_symbol_referencer::get_position (Grob*me)
{
Real p =0.0;
- Grob * st = staff_symbol_l (me);
+ Grob * st = get_staff_symbol (me);
Grob * c = st ? me->common_refpoint (st, Y_AXIS) : 0;
if (st && c)
{
void
Staff_symbol_referencer::set_position (Grob*me,Real p)
{
- Grob * st = staff_symbol_l (me);
+ Grob * st = get_staff_symbol (me);
if (st && me->common_refpoint (st, Y_AXIS))
{
- Real oldpos = position_f (me);
+ Real oldpos = get_position (me);
me->set_grob_property ("staff-position", gh_double2scm (p - oldpos));
}
else
int
compare_position (Grob *const &a, Grob * const &b)
{
- return sign (Staff_symbol_referencer::position_f ((Grob*)a) -
- Staff_symbol_referencer::position_f ((Grob*)b));
+ return sign (Staff_symbol_referencer::get_position ((Grob*)a) -
+ Staff_symbol_referencer::get_position ((Grob*)b));
}
width = 0;
}
- Real t = me->paper_l ()->get_var ("linethickness");
+ Real t = me->get_paper ()->get_var ("linethickness");
SCM my_thick = me->get_grob_property("thickness");
- if (gh_number_p(my_thick))
+ if (gh_number_p (my_thick))
t *= gh_scm2double (my_thick);
int l = Staff_symbol::line_count (me);
}
int
-Staff_symbol::steps_i (Grob*me)
+Staff_symbol::get_steps (Grob*me)
{
return line_count (me) * 2;
}
if (gh_string_p (s) || gh_pair_p (s))
/*
- if (i.grob_l_->internal_has_interface (symbol ("lyric-syllable-interface")))
+ if (i.grob_->internal_has_interface (symbol ("lyric-syllable-interface")))
Tried catching lyric items to generate stanza numbers, but it
spoils lyric spacing.
virtual bool try_music (Music*);
private:
- Grob *stem_p_;
- Grob *tremolo_p_;
- Rhythmic_req *rhythmic_req_l_;
- Tremolo_req* tremolo_req_l_;
+ Grob *stem_;
+ Grob *tremolo_;
+ Rhythmic_req *rhythmic_req_;
+ Tremolo_req* tremolo_req_;
};
Stem_engraver::Stem_engraver ()
{
- tremolo_req_l_ = 0;
- stem_p_ = 0;
- tremolo_p_ = 0;
- rhythmic_req_l_ =0;
+ tremolo_req_ = 0;
+ stem_ = 0;
+ tremolo_ = 0;
+ rhythmic_req_ =0;
}
void
Stem_engraver::acknowledge_grob (Grob_info i)
{
- Grob* h = i.grob_l_;
+ Grob* h = i.grob_;
if (Rhythmic_head::has_interface (h))
{
- if (Rhythmic_head::stem_l (h))
+ if (Rhythmic_head::get_stem (h))
return;
/* Reverted to the old method so chord tremolos work again. /MB
if (rhythmic_req)
duration_log = unsmob_duration (rhythmic_req->get_mus_property ("duration"))-> duration_log ();
- if (!stem_p_)
+ if (!stem_)
{
- stem_p_ = new Item (get_property ("Stem"));
+ stem_ = new Item (get_property ("Stem"));
- stem_p_->set_grob_property ("duration-log", gh_int2scm (duration_log));
+ stem_->set_grob_property ("duration-log", gh_int2scm (duration_log));
- if (tremolo_req_l_)
+ if (tremolo_req_)
{
/*
Stem tremolo is never applied to a note by default,
the first and last (quarter) note bothe get one tremolo flag.
*/
- int requested_type = gh_scm2int (tremolo_req_l_->get_mus_property ("tremolo-type"));
+ int requested_type = gh_scm2int (tremolo_req_->get_mus_property ("tremolo-type"));
SCM f = get_property ("tremoloFlags");
if (!requested_type && gh_number_p (f))
requested_type = gh_scm2int (f);
else
- daddy_trans_l_->set_property ("tremoloFlags", gh_int2scm (requested_type));
+ daddy_trans_->set_property ("tremoloFlags", gh_int2scm (requested_type));
if (requested_type)
{
- tremolo_p_ = new Item (get_property ("StemTremolo"));
- announce_grob(tremolo_p_, tremolo_req_l_->self_scm());
+ tremolo_ = new Item (get_property ("StemTremolo"));
+ announce_grob(tremolo_, tremolo_req_->self_scm());
/*
The number of tremolo flags is the number of flags of
- (duration_log > 2 ? duration_log - 2 : 0);
if (tremolo_flags < 0)
tremolo_flags = 0;
- tremolo_p_->set_grob_property ("flag-count",
+ tremolo_->set_grob_property ("flag-count",
gh_int2scm (tremolo_flags));
- tremolo_p_->set_parent (stem_p_, X_AXIS);
+ tremolo_->set_parent (stem_, X_AXIS);
}
}
/*
We announce the cause of the head as cause of the stem.
The stem needs a rhythmic structure to fit it into a beam. */
- announce_grob(stem_p_, i.music_cause ()->self_scm());
+ announce_grob(stem_, i.music_cause ()->self_scm());
}
- if (Stem::duration_log (stem_p_) != duration_log)
+ if (Stem::duration_log (stem_) != duration_log)
{
- i.music_cause ()->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 << Stem::duration_log (stem_p_)));
+ i.music_cause ()->origin ()->warning (_f ("Adding note head to incompatible stem (type = %d)", 1 << Stem::duration_log (stem_)));
}
- Stem::add_head (stem_p_,h);
+ Stem::add_head (stem_,h);
}
}
void
Stem_engraver::stop_translation_timestep ()
{
- if (tremolo_p_)
+ if (tremolo_)
{
- Stem_tremolo::set_stem (tremolo_p_, stem_p_);
- typeset_grob (tremolo_p_);
- tremolo_p_ = 0;
+ Stem_tremolo::set_stem (tremolo_, stem_);
+ typeset_grob (tremolo_);
+ tremolo_ = 0;
}
- if (stem_p_)
+ if (stem_)
{
SCM prop = get_property ("stemLeftBeamCount");
if (gh_number_p (prop))
{
- Stem::set_beaming (stem_p_,gh_scm2int (prop),LEFT);
- daddy_trans_l_->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
+ Stem::set_beaming (stem_,gh_scm2int (prop),LEFT);
+ daddy_trans_->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
}
prop = get_property ("stemRightBeamCount");
if (gh_number_p (prop))
{
- Stem::set_beaming (stem_p_,gh_scm2int (prop), RIGHT);
- daddy_trans_l_->unset_property (ly_symbol2scm ("stemRightBeamCount"));
+ Stem::set_beaming (stem_,gh_scm2int (prop), RIGHT);
+ daddy_trans_->unset_property (ly_symbol2scm ("stemRightBeamCount"));
}
(docme)
*/
- SCM dir = stem_p_->get_grob_property ("direction");
+ SCM dir = stem_->get_grob_property ("direction");
if (gh_number_p (dir) && to_dir (dir))
{
- stem_p_->set_grob_property ("dir-forced", SCM_BOOL_T);
+ stem_->set_grob_property ("dir-forced", SCM_BOOL_T);
}
- typeset_grob (stem_p_);
- stem_p_ = 0;
+ typeset_grob (stem_);
+ stem_ = 0;
}
- tremolo_req_l_ = 0;
+ tremolo_req_ = 0;
}
bool
{
if (Tremolo_req* a = dynamic_cast <Tremolo_req *> (r))
{
- tremolo_req_l_ = a;
+ tremolo_req_ = a;
return true;
}
return false;
{
Grob *me= unsmob_grob (smob);
Grob * stem = unsmob_grob (me->get_grob_property ("stem"));
- Grob * beam = Stem::beam_l (stem);
+ Grob * beam = Stem::get_beam (stem);
Real dydx;
if (beam)
Drul_array<Grob*> e (extremal_heads (me));
- return Interval (Staff_symbol_referencer::position_f (e[DOWN]),
- Staff_symbol_referencer::position_f (e[UP]));
+ return Interval (Staff_symbol_referencer::get_position (e[DOWN]),
+ Staff_symbol_referencer::get_position (e[UP]));
}
Grob * n = unsmob_grob (ly_car (s));
- int p = int (Staff_symbol_referencer::position_f (n));
+ int p = int (Staff_symbol_referencer::get_position (n));
Direction d = LEFT;
do {
for (SCM s = me->get_grob_property ("note-heads"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * n = unsmob_grob (ly_car (s));
- int p = int (Staff_symbol_referencer::position_f (n));
+ int p = int (Staff_symbol_referencer::get_position (n));
ps.push (p);
}
bool
Stem::invisible_b (Grob*me)
{
- return ! (head_count (me) && Note_head::balltype_i (support_head (me)) >= 1);
+ return ! (head_count (me) && Note_head::get_balltype (support_head (me)) >= 1);
}
Direction
good typesetting practice.
*/
- if (!beam_l (me) && dir == UP
+ if (!get_beam (me) && dir == UP
&& duration_log (me) > 2)
{
Grob * closest_to_flag = extremal_heads (me)[dir];
Grob * dots = closest_to_flag
- ? Rhythmic_head::dots_l (closest_to_flag ) : 0;
+ ? Rhythmic_head::get_dots (closest_to_flag ) : 0;
if (dots)
{
- Real dp = Staff_symbol_referencer::position_f (dots);
+ Real dp = Staff_symbol_referencer::get_position (dots);
Real flagy = flag (me).extent (Y_AXIS)[-dir] * 2
/ Staff_symbol_referencer::staff_space (me);
Real thick = 0.0;
if (invisible)
thick = gh_scm2double (me->get_grob_property ("thickness"))
- * me->paper_l ()->get_var ("linethickness");
+ * me->get_paper ()->get_var ("linethickness");
Grob *hed = support_head (me);
}
bool parity= true; // todo: make me settable.
- int lastpos = int (Staff_symbol_referencer::position_f (heads[0]));
+ int lastpos = int (Staff_symbol_referencer::get_position (heads[0]));
for (int i=1; i < heads.size (); i ++)
{
- Real p = Staff_symbol_referencer::position_f (heads[i]);
+ Real p = Staff_symbol_referencer::get_position (heads[i]);
int dy =abs (lastpos- (int)p);
if (dy <= 1)
}
bool adjust = to_boolean (me->get_grob_property ("adjust-if-on-staffline"));
- if (String::compare_i (style, "mensural") == 0)
+ if (String::compare (style, "mensural") == 0)
/* Mensural notation: For notes on staff lines, use different
flags than for notes between staff lines. The idea is that
flags are always vertically aligned with the staff lines,
*/
Grob *first = first_head(me);
int sz = Staff_symbol_referencer::line_count (me)-1;
- int p = (int)rint (Staff_symbol_referencer::position_f (first));
+ int p = (int)rint (Staff_symbol_referencer::get_position (first));
staffline_offs = (((p ^ sz) & 0x1) == 0) ? "1" : "0";
}
else
staffline_offs = "";
}
char c = (get_direction (me) == UP) ? 'u' : 'd';
- String index_str
- = String ("flags-") + style + to_str (c) + staffline_offs + to_str (duration_log (me));
+ String index_string
+ = String ("flags-") + style + to_string (c) + staffline_offs + to_string (duration_log (me));
Molecule m
- = Font_interface::get_default_font (me)->find_by_name (index_str);
+ = Font_interface::get_default_font (me)->find_by_name (index_string);
if (!fstyle.empty_b ())
- m.add_molecule (Font_interface::get_default_font (me)->find_by_name (String ("flags-") + to_str (c) + fstyle));
+ m.add_molecule (Font_interface::get_default_font (me)->find_by_name (String ("flags-") + to_string (c) + fstyle));
return m;
}
Grob * lh = last_head (me);
if (!lh)
return SCM_EOL;
- y1 = Staff_symbol_referencer::position_f (lh);
+ y1 = Staff_symbol_referencer::get_position (lh);
}
else
{
Grob * lh = first_head (me);
if (!lh)
return SCM_EOL;
- y1 = Staff_symbol_referencer::position_f (lh);
+ y1 = Staff_symbol_referencer::get_position (lh);
}
Real y2 = stem_end_position (me);
{
Real stem_width = gh_scm2double (me->get_grob_property ("thickness"))
// URG
- * me->paper_l ()->get_var ("linethickness");
+ * me->get_paper ()->get_var ("linethickness");
Molecule ss =Lookup::filledbox (Box (Interval (-stem_width/2, stem_width/2),
Interval (stem_y[DOWN]*dy, stem_y[UP]*dy)));
mol.add_molecule (ss);
}
- if (!beam_l (me) && abs (duration_log (me)) > 2)
+ if (!get_beam (me) && abs (duration_log (me)) > 2)
{
Molecule fl = flag (me);
fl.translate_axis (stem_y[d]*dy, Y_AXIS);
{
Real rule_thick
= gh_scm2double (me->get_grob_property ("thickness"))
- * me->paper_l ()->get_var ("linethickness");
+ * me->get_paper ()->get_var ("linethickness");
r += - d * rule_thick * 0.5;
Grob*
-Stem::beam_l (Grob*me)
+Stem::get_beam (Grob*me)
{
SCM b= me->get_grob_property ("beam");
return unsmob_grob (b);
Real staff_space = Staff_symbol_referencer::staff_space (me);
Real half_space = staff_space / 2;
- Grob * beam = beam_l (me);
+ Grob * beam = get_beam (me);
int beam_count = beam_multiplicity(me).length()+1;
Real beam_translation= Beam::get_beam_translation (beam);
Real thick = gh_scm2double (beam->get_grob_property ("thickness"));
{
Path p = split_path (filename);
if (!p.dir.empty_b ())
- if (mkdir (p.dir.ch_C (), 0777) == -1 && errno != EEXIST)
+ if (mkdir (p.dir.to_str0 (), 0777) == -1 && errno != EEXIST)
error (_f ("can't create directory: `%s'", p.dir));
- os = new std::ofstream (filename.ch_C (), mode);
+ os = new std::ofstream (filename.to_str0 (), mode);
}
if (!*os)
error (_f ("can't open file: `%s'", filename));
return mol.smobbed_copy ();
String text = ly_scm2string (glyph);
- for (int i = 0; i < text.length_i (); i++)
+ for (int i = 0; i < text.length (); i++)
{
String idx ("pedal-");
- if (text.cut_str (i, 3) == "Ped")
+ if (text.cut_string (i, 3) == "Ped")
{
idx += "Ped";
i += 2;
}
else
- idx += String (&text.byte_C ()[i], 1);
+ idx += String (&text.to_bytes ()[i], 1);
Molecule m = Font_interface::get_default_font (e)->find_by_name (idx);
if (!m.empty_b ())
mol.add_at_edge (X_AXIS, RIGHT, m, 0);
void
Syllable_group::clear ()
{
- notehead_l_=0;
+ notehead_=0;
lyric_list_.clear ();
- longest_lyric_l_=0;
- shortest_lyric_l_=0;
+ longest_lyric_=0;
+ shortest_lyric_=0;
melisma_b_ = false;
- group_translation_f_ = 0.0;
+ group_translation_ = 0.0;
}
void
Syllable_group::copy (Syllable_group *from)
{
- notehead_l_ = from->notehead_l_;
+ notehead_ = from->notehead_;
lyric_list_ = from->lyric_list_;
- longest_lyric_l_ = from->longest_lyric_l_;
- shortest_lyric_l_ = from->shortest_lyric_l_;
+ longest_lyric_ = from->longest_lyric_;
+ shortest_lyric_ = from->shortest_lyric_;
melisma_b_ = from->melisma_b_;
- alignment_i_ = from->alignment_i_;
+ alignment_ = from->alignment_;
first_in_phrase_b_ = from->first_in_phrase_b_;
- group_translation_f_ = from->group_translation_f_;
+ group_translation_ = from->group_translation_;
}
void
void
Syllable_group::set_notehead (Grob * notehead)
{
- if (!notehead_l_) {
+ if (!notehead_) {
/* there should only be a single notehead, so silently ignore any extras */
- notehead_l_=notehead;
+ notehead_=notehead;
}
}
{
lyric_list_.push (lyric);
/* record longest and shortest lyrics */
- if (longest_lyric_l_) {
- if (lyric->extent (lyric,X_AXIS).length () > (longest_lyric_l_->extent (longest_lyric_l_, X_AXIS)).length ())
- longest_lyric_l_ = lyric;
- if (lyric->extent (lyric, X_AXIS).length () < (shortest_lyric_l_->extent (shortest_lyric_l_, X_AXIS)).length ())
- shortest_lyric_l_ = lyric;
+ if (longest_lyric_) {
+ if (lyric->extent (lyric,X_AXIS).length () > (longest_lyric_->extent (longest_lyric_, X_AXIS)).length ())
+ longest_lyric_ = lyric;
+ if (lyric->extent (lyric, X_AXIS).length () < (shortest_lyric_->extent (shortest_lyric_, X_AXIS)).length ())
+ shortest_lyric_ = lyric;
}
else
- longest_lyric_l_ = shortest_lyric_l_ = lyric;
+ longest_lyric_ = shortest_lyric_ = lyric;
}
void
Syllable_group::add_extender (Grob * extender)
{
- if (notehead_l_ && melisma_b_) {
- dynamic_cast<Spanner*> (extender)->set_bound (RIGHT, notehead_l_);
+ if (notehead_ && melisma_b_) {
+ dynamic_cast<Spanner*> (extender)->set_bound (RIGHT, notehead_);
// should the extender finish at the right of the last note of the melisma, or the left?
// Comments in lyric-extender.hh say left, but right looks better to me. GP.
// Right:
Real ss = 1.0;
extender->set_grob_property ("right-trim-amount",
- gh_double2scm (-notehead_l_->extent (notehead_l_, X_AXIS).length ()/ss));
+ gh_double2scm (-notehead_->extent (notehead_, X_AXIS).length ()/ss));
}
}
bool
-Syllable_group::set_lyric_align (const char *punc, Grob *default_notehead_l)
+Syllable_group::set_lyric_align (const char *punc, Grob *default_notehead)
{
if (lyric_list_.size ()==0) {
// No lyrics: nothing to do.
}
Grob * lyric;
- alignment_i_ = appropriate_alignment (punc);
+ alignment_ = appropriate_alignment (punc);
// If there was no notehead in the matching voice context, use the first
// notehead caught from any voice context (any port in a storm).
- if (!notehead_l_) {
- notehead_l_ = default_notehead_l;
+ if (!notehead_) {
+ notehead_ = default_notehead;
}
- group_translation_f_ = amount_to_translate ();
+ group_translation_ = amount_to_translate ();
// set the x alignment of each lyric
for (int l = 0; l < lyric_list_.size (); l++) {
lyric = lyric_list_[l];
- lyric->set_grob_property ("self-alignment-X", gh_int2scm (alignment_i_));
+ lyric->set_grob_property ("self-alignment-X", gh_int2scm (alignment_));
// centre on notehead ... if we have one.
- if (notehead_l_) {
- lyric->set_parent (notehead_l_, X_AXIS);
+ if (notehead_) {
+ lyric->set_parent (notehead_, X_AXIS);
lyric->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS);
// reference is on the right of the notehead; move it left half way, and add translation
- lyric->translate_axis (group_translation_f_- (notehead_l_->extent (notehead_l_, X_AXIS)).center (), X_AXIS);
+ lyric->translate_axis (group_translation_- (notehead_->extent (notehead_, X_AXIS)).center (), X_AXIS);
}
}
- return (notehead_l_);
+ return (notehead_);
}
/** determine the distance to translate lyrics to get correct alignment
Syllable_group::amount_to_translate ()
{
Real translate = 0.0;
- if (alignment_i_ != CENTER) {
- switch (alignment_i_) {
+ if (alignment_ != CENTER) {
+ switch (alignment_) {
// FIXME: do we really know the lyric extent here? Some font sizing comes later?
case LEFT:
- translate = longest_lyric_l_->extent (longest_lyric_l_, X_AXIS).length () / gh_scm2double (longest_lyric_l_->get_grob_property("begin-alignment"));
+ translate = longest_lyric_->extent (longest_lyric_, X_AXIS).length () / gh_scm2double (longest_lyric_->get_grob_property("begin-alignment"));
break;
case RIGHT:
- translate = longest_lyric_l_->extent (longest_lyric_l_, X_AXIS).length () / gh_scm2double (longest_lyric_l_->get_grob_property("end-alignment"));
+ translate = longest_lyric_->extent (longest_lyric_, X_AXIS).length () / gh_scm2double (longest_lyric_->get_grob_property("end-alignment"));
break;
}
- if (!gh_scm2bool(longest_lyric_l_->get_grob_property("ignore-length-mismatch"))) {
- Real l = shortest_lyric_l_->extent (shortest_lyric_l_, X_AXIS).length ();
+ if (!gh_scm2bool(longest_lyric_->get_grob_property("ignore-length-mismatch"))) {
+ Real l = shortest_lyric_->extent (shortest_lyric_, X_AXIS).length ();
translate = l <? translate;
}
- translate *= alignment_i_ ;
+ translate *= alignment_ ;
}
return translate;
}
Syllable_group::appropriate_alignment (const char *punc)
{
- SCM s=this->longest_lyric_l_->get_grob_property ("alignment");
+ SCM s=this->longest_lyric_->get_grob_property ("alignment");
if (s!=SCM_EOL) {
return gh_scm2int (s);
}
for (int l = 0; l < lyric_list_.size () && end_phrase; l++) {
lyric = lyric_list_[l];
SCM lyric_scm = lyric->get_grob_property ("text");
- String lyric_str = gh_string_p (lyric_scm)?ly_scm2string (lyric_scm):"";
+ String lyric_string = gh_string_p (lyric_scm)?ly_scm2string (lyric_scm):"";
char lastchar;
- if (lyric_str.length_i ()>0) {
- lastchar = lyric_str[lyric_str.length_i ()-1];
+ if (lyric_string.length ()>0) {
+ lastchar = lyric_string[lyric_string.length ()-1];
/* If it doesn't end in punctuation then it ain't an end of phrase */
if (! strchr (punc, lastchar)) {
/*
FIXME: The extra space throws alignment out a bit.
*/
if (lastchar == ' ') {
- if (lyric_str.length_i ()>1) {
- lastchar = lyric_str[lyric_str.length_i ()-2];
+ if (lyric_string.length ()>1) {
+ lastchar = lyric_string[lyric_string.length ()-2];
if (strchr (punc, lastchar))
end_phrase=false;
}
void
Syllable_group::adjust_melisma_align ()
{
- if (notehead_l_ && lyric_list_.size ()) {
+ if (notehead_ && lyric_list_.size ()) {
// override any previous offset adjustments
- Real translation = -group_translation_f_;
+ Real translation = -group_translation_;
// melisma aligning:
- switch (alignment_i_) {
+ switch (alignment_) {
// case LEFT: // that's all
case CENTER: // move right so smallest lyric is left-aligned on notehead
- translation += (shortest_lyric_l_->extent (shortest_lyric_l_, X_AXIS)).length ()/2;
+ translation += (shortest_lyric_->extent (shortest_lyric_, X_AXIS)).length ()/2;
break;
case RIGHT: // move right so smallest lyric is left-aligned on notehead
- translation += (shortest_lyric_l_->extent (shortest_lyric_l_, X_AXIS)).length ();
+ translation += (shortest_lyric_->extent (shortest_lyric_, X_AXIS)).length ();
break;
}
- group_translation_f_ += translation;
+ group_translation_ += translation;
for (int l = 0; l < lyric_list_.size (); l++) {
lyric_list_[l]->translate_axis (translation, X_AXIS);
}
void
Syllable_group::next_lyric ()
{
- first_in_phrase_b_ = (alignment_i_ == RIGHT);
+ first_in_phrase_b_ = (alignment_ == RIGHT);
clear ();
}
void
System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
{
- if (Staff_symbol::has_interface (inf.grob_l_))
+ if (Staff_symbol::has_interface (inf.grob_))
{
/*
don't add as Axis_group_interface::add_element (delim_,),
because that would set the parent as well */
- Pointer_group_interface::add_grob (delim_, ly_symbol2scm ("elements"), inf.grob_l_);
+ Pointer_group_interface::add_grob (delim_, ly_symbol2scm ("elements"), inf.grob_);
}
- else if (System_start_delimiter::has_interface (inf.grob_l_))
+ else if (System_start_delimiter::has_interface (inf.grob_))
{
- SCM gl = inf.grob_l_->get_grob_property ("glyph");
+ SCM gl = inf.grob_->get_grob_property ("glyph");
SCM my_gl = delim_->get_grob_property ("glyph");
/*
*/
if (gh_string_p (gl) && gh_equal_p (gl, ly_str02scm ("brace"))
&& gh_string_p (my_gl) && gh_equal_p (my_gl, ly_str02scm ("bracket")))
- inf.grob_l_->translate_axis (-0.8, X_AXIS); // ugh
+ inf.grob_->translate_axis (-0.8, X_AXIS); // ugh
else if (gh_string_p (gl) && gh_equal_p (gl, ly_str02scm ("bracket"))
&& gh_string_p (my_gl) && gh_equal_p (my_gl, ly_str02scm ("bracket")))
{
- inf.grob_l_->translate_axis ( -0.8, X_AXIS); // ugh
- inf.grob_l_->set_grob_property ("arch-height",
- gh_double2scm(gh_scm2double(inf.grob_l_->get_grob_property
+ inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh
+ inf.grob_->set_grob_property ("arch-height",
+ gh_double2scm(gh_scm2double(inf.grob_->get_grob_property
("arch-height"))+0.5));
}
}
Molecule
System_start_delimiter::simple_bar (Grob*me,Real h)
{
- Real w = me->paper_l ()->get_var ("linethickness") *
+ Real w = me->get_paper ()->get_var ("linethickness") *
gh_scm2double (me->get_grob_property ("thickness"));
return Lookup::filledbox (Box (Interval (0,w), Interval (-h/2, h/2)));
}
System::System (SCM s)
: Spanner (s)
{
- rank_i_ = 0;
+ rank_ = 0;
}
int
}
void
-System::typeset_grob (Grob * elem_p)
+System::typeset_grob (Grob * elem)
{
- elem_p->pscore_l_ = pscore_l_;
- Pointer_group_interface::add_grob (this, ly_symbol2scm ("all-elements"),elem_p);
- scm_gc_unprotect_object (elem_p->self_scm ());
+ elem->pscore_ = pscore_;
+ Pointer_group_interface::add_grob (this, ly_symbol2scm ("all-elements"),elem);
+ scm_gc_unprotect_object (elem->self_scm ());
}
void
fixups must be done in broken line_of_scores, because new elements
are put over there. */
int count = 0;
- for (int i=0; i < broken_into_l_arr_.size (); i++)
+ for (int i=0; i < broken_intos_.size (); i++)
{
- Grob *se = broken_into_l_arr_[i];
+ Grob *se = broken_intos_[i];
SCM all = se->get_grob_property ("all-elements");
for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
{
progress_indication (_f ("Element count %d.", count + element_count ()));
- for (int i=0; i < broken_into_l_arr_.size (); i++)
+ for (int i=0; i < broken_intos_.size (); i++)
{
- System *system = dynamic_cast<System*> (broken_into_l_arr_[i]);
+ System *system = dynamic_cast<System*> (broken_intos_[i]);
if (verbose_global_b)
progress_indication ("[");
- system->post_processing (i+1 == broken_into_l_arr_.size ());
+ system->post_processing (i+1 == broken_intos_.size ());
if (verbose_global_b)
{
- progress_indication (to_str (i));
+ progress_indication (to_string (i));
progress_indication ("]");
}
- if (i < broken_into_l_arr_.size () - 1)
+ if (i < broken_intos_.size () - 1)
{
SCM lastcol = ly_car (system->get_grob_property ("columns"));
Grob* e = unsmob_grob (lastcol);
SCM inter = e->internal_get_grob_property (between);
if (gh_string_p (inter))
{
- pscore_l_->outputter_l_
+ pscore_->outputter_
->output_scheme (scm_list_n (between,
inter, SCM_UNDEFINED));
}
if (!left && l)
{
- left = l->column_l ();
+ left = l->get_column ();
}
divide_over ++;
- loose = right = r->column_l ();
+ loose = right = r->get_column ();
}
while (1);
for (int i=0; i < breaking.size (); i++)
{
System *system = dynamic_cast <System*> (clone ());
- system->rank_i_ = i;
+ system->rank_ = i;
// system->set_immutable_grob_property ("rank", gh_int2scm (i));
Link_array<Grob> c (breaking[i].cols_);
- pscore_l_->typeset_line (system);
+ pscore_->typeset_line (system);
system->set_bound (LEFT,c[0]);
system->set_bound (RIGHT,c.top ());
dynamic_cast<Paper_column*> (c[j])->system_ = system;
}
set_loose_columns (system, &breaking[i]);
- broken_into_l_arr_.push (system);
+ broken_intos_.push (system);
}
}
Input * ip = unsmob_input (head);
- pscore_l_->outputter_l_->output_scheme (scm_list_n (ly_symbol2scm ("define-origin"),
- ly_str02scm (ip->file_str ().ch_C ()),
+ pscore_->outputter_->output_scheme (scm_list_n (ly_symbol2scm ("define-origin"),
+ ly_str02scm (ip->file_string ().to_str0 ()),
gh_int2scm (ip->line_number ()),
gh_int2scm (ip->column_number ()),
SCM_UNDEFINED));
}
else if (head == ly_symbol2scm ("no-origin"))
{
- pscore_l_->outputter_l_->output_scheme (scm_list_n (head, SCM_UNDEFINED));
+ pscore_->outputter_->output_scheme (scm_list_n (head, SCM_UNDEFINED));
expr = ly_cadr (expr);
}
else if (head == ly_symbol2scm ("translate-molecule"))
}
else
{
- pscore_l_->outputter_l_->
+ pscore_->outputter_->
output_scheme (scm_list_n (ly_symbol2scm ("placebox"),
gh_double2scm (o[X_AXIS]),
gh_double2scm (o[Y_AXIS]),
void
System::output_scheme (SCM s)
{
- pscore_l_->outputter_l_->output_scheme (s);
+ pscore_->outputter_->output_scheme (s);
}
void
SCM cs = me->get_grob_property ("columns");
Grob * prev = gh_pair_p (cs) ? unsmob_grob (ly_car (cs)) : 0;
- p->rank_i_ = prev ? Paper_column::rank_i (prev) + 1 : 0;
+ p->rank_ = prev ? Paper_column::get_rank (prev) + 1 : 0;
me->set_grob_property ("columns", gh_cons (p->self_scm (), cs));
/*
font defs;
*/
- SCM font_names = ly_quote_scm (paper_l ()->font_descriptions ());
+ SCM font_names = ly_quote_scm (get_paper ()->font_descriptions ());
output_scheme (scm_list_n (ly_symbol2scm ("define-fonts"),
font_names,
SCM_UNDEFINED));
{
Link_array<Item> ret;
- l = l->column_l ();
- r = r->column_l ();
+ l = l->get_column ();
+ r = r->get_column ();
SCM s = get_grob_property ("columns");
while (gh_pair_p (s) && ly_car (s) != r->self_scm ())
disrupt the spacing problem.
*/
Link_array<Grob>
-System::column_l_arr ()const
+System::columns ()const
{
Link_array<Grob> acs
= Pointer_group_interface__extract_grobs (this, (Grob*) 0, "columns");
*/
class Tab_note_heads_engraver : public Engraver
{
- Link_array<Item> note_p_arr_;
+ Link_array<Item> notes_;
- Link_array<Item> dot_p_arr_;
- Link_array<Note_req> note_req_l_arr_;
- Link_array<Text_script_req> tabstring_req_arr_;
+ Link_array<Item> dots_;
+ Link_array<Note_req> note_reqs_;
+ Link_array<Text_script_req> tabstring_reqs_;
public:
TRANSLATOR_DECLARATIONS(Tab_note_heads_engraver);
protected:
virtual void start_translation_timestep ();
- virtual bool try_music (Music *req_l) ;
+ virtual bool try_music (Music *req) ;
virtual void process_music ();
virtual void stop_translation_timestep ();
{
if (Note_req * n =dynamic_cast <Note_req *> (m))
{
- note_req_l_arr_.push (n);
+ note_reqs_.push (n);
return true;
}
else if (Text_script_req * ts = dynamic_cast<Text_script_req*> (m))
{
if (m->get_mus_property ("text-type") != ly_symbol2scm ("finger")) return false;
- //if (tabstring_req_arr_.size () < note_req_l_arr_.size ()) {
- tabstring_req_arr_.push (ts);
+ //if (tabstring_reqs_.size () < note_reqs_.size ()) {
+ tabstring_reqs_.push (ts);
//}
return true;
}
else if (dynamic_cast<Busy_playing_req*> (m))
{
- return note_req_l_arr_.size ();
+ return note_reqs_.size ();
}
return false;
Tab_note_heads_engraver::process_music ()
{
/*
- for (int i=0; i < tabstring_req_arr_.size (); i++) {
- Music * tabstring_req = tabstring_req_arr_[i];
+ for (int i=0; i < tabstring_reqs_.size (); i++) {
+ Music * tabstring_req = tabstring_reqs_[i];
size_t lenp;
- char* tab_string_as_str = gh_scm2newstr(tabstring_req->get_mus_property ("text"), &lenp);
+ char* tab_string_as_string = gh_scm2newstr(tabstring_req->get_mus_property ("text"), &lenp);
}
*/
- for (int i=0; i < note_req_l_arr_.size (); i++)
+ for (int i=0; i < note_reqs_.size (); i++)
{
- Item * note_p = new Item (get_property ("TabNoteHead"));
+ Item * note = new Item (get_property ("TabNoteHead"));
- Music * req = note_req_l_arr_[i];
+ Music * req = note_reqs_[i];
- Music * tabstring_req = tabstring_req_arr_[i];
+ Music * tabstring_req = tabstring_reqs_[i];
size_t lenp;
- char* tab_string_as_str = gh_scm2newstr(tabstring_req->get_mus_property ("text"), &lenp);
- int tab_string = atoi(tab_string_as_str);
+ char* tab_string_as_string = gh_scm2newstr(tabstring_req->get_mus_property ("text"), &lenp);
+ int tab_string = atoi(tab_string_as_string);
Duration dur = *unsmob_duration (req->get_mus_property ("duration"));
- note_p->set_grob_property ("duration-log", gh_int2scm (dur.duration_log ()));
+ note->set_grob_property ("duration-log", gh_int2scm (dur.duration_log ()));
if (dur.dot_count ())
{
Item * d = new Item (get_property ("Dots"));
- Rhythmic_head::set_dots (note_p, d);
+ Rhythmic_head::set_dots (note, d);
if (dur.dot_count ()
!= gh_scm2int (d->get_grob_property ("dot-count")))
d->set_grob_property ("dot-count", gh_int2scm (dur.dot_count ()));
- d->set_parent (note_p, Y_AXIS);
+ d->set_parent (note, Y_AXIS);
announce_grob (d, SCM_EOL);
- dot_p_arr_.push (d);
+ dots_.push (d);
}
SCM stringTunings = get_property ("stringTunings");
SCM scm_pitch = req->get_mus_property ("pitch");
SCM proc = get_property ("tablatureFormat");
SCM text = gh_call3 (proc, gh_int2scm (tab_string), stringTunings, scm_pitch);
- note_p->set_grob_property ("text", text);
+ note->set_grob_property ("text", text);
- note_p->set_grob_property ("staff-position", gh_int2scm (pos));
- announce_grob (note_p, req->self_scm());
- note_p_arr_.push (note_p);
+ note->set_grob_property ("staff-position", gh_int2scm (pos));
+ announce_grob (note, req->self_scm());
+ notes_.push (note);
}
}
void
Tab_note_heads_engraver::stop_translation_timestep ()
{
- for (int i=0; i < note_p_arr_.size (); i++)
+ for (int i=0; i < notes_.size (); i++)
{
- typeset_grob (note_p_arr_[i]);
+ typeset_grob (notes_[i]);
}
- note_p_arr_.clear ();
- for (int i=0; i < dot_p_arr_.size (); i++)
+ notes_.clear ();
+ for (int i=0; i < dots_.size (); i++)
{
- typeset_grob (dot_p_arr_[i]);
+ typeset_grob (dots_[i]);
}
- dot_p_arr_.clear ();
+ dots_.clear ();
- note_req_l_arr_.clear ();
+ note_reqs_.clear ();
- tabstring_req_arr_.clear ();
+ tabstring_reqs_.clear ();
}
void
}
String
-Interval_t<Rational>::T_to_str (Rational a)
+Interval_t<Rational>::T_to_string (Rational a)
{
- return a.str ();
+ return a.string ();
}
protected:
- virtual bool try_music (Music* req_l);
+ virtual bool try_music (Music* req);
virtual void stop_translation_timestep ();
virtual void create_audio_elements ();
private:
- Tempo_req* tempo_req_l_;
- Audio_tempo* audio_p_;
+ Tempo_req* tempo_req_;
+ Audio_tempo* audio_;
};
ENTER_DESCRIPTION (Tempo_performer, "","","","","" );
Tempo_performer::Tempo_performer ()
{
- tempo_req_l_ = 0;
- audio_p_ = 0;
+ tempo_req_ = 0;
+ audio_ = 0;
}
Tempo_performer::~Tempo_performer ()
void
Tempo_performer::create_audio_elements ()
{
- if (tempo_req_l_)
+ if (tempo_req_)
{
- SCM met = tempo_req_l_->get_mus_property ("metronome-count");
- Duration *d = unsmob_duration (tempo_req_l_->get_mus_property ("duration"));
+ SCM met = tempo_req_->get_mus_property ("metronome-count");
+ Duration *d = unsmob_duration (tempo_req_->get_mus_property ("duration"));
Rational r = (d->length_mom () / Moment (Rational (1, 4)) * Moment (gh_scm2int (met))).main_part_;
- audio_p_ = new Audio_tempo (int (r));
+ audio_ = new Audio_tempo (int (r));
- Audio_element_info info (audio_p_, tempo_req_l_);
+ Audio_element_info info (audio_, tempo_req_);
announce_element (info);
- tempo_req_l_ = 0;
+ tempo_req_ = 0;
}
}
void
Tempo_performer::stop_translation_timestep ()
{
- if (audio_p_)
+ if (audio_)
{
- play_element (audio_p_);
- audio_p_ = 0;
+ play_element (audio_);
+ audio_ = 0;
}
}
bool
-Tempo_performer::try_music (Music* req_l)
+Tempo_performer::try_music (Music* req)
{
- if (tempo_req_l_)
+ if (tempo_req_)
return false;
if (Tempo_req *t =
- dynamic_cast <Tempo_req *> (req_l))
+ dynamic_cast <Tempo_req *> (req))
{
- tempo_req_l_ = t;
+ tempo_req_ = t;
return true;
}
void
Text_engraver::acknowledge_grob (Grob_info inf)
{
- if (Rhythmic_head::has_interface (inf.grob_l_))
+ if (Rhythmic_head::has_interface (inf.grob_))
{
for (int i=0; i < texts_.size (); i++)
{
Grob*t = texts_[i];
- Side_position_interface::add_support (t,inf.grob_l_);
+ Side_position_interface::add_support (t,inf.grob_);
/*
ugh.
*/
if (Side_position_interface::get_axis (t) == X_AXIS
&& !t->get_parent (Y_AXIS))
- t->set_parent (inf.grob_l_, Y_AXIS);
+ t->set_parent (inf.grob_, Y_AXIS);
else if (Side_position_interface::get_axis (t) == Y_AXIS
&& !t->get_parent (X_AXIS))
- t->set_parent (inf.grob_l_, X_AXIS);
+ t->set_parent (inf.grob_, X_AXIS);
}
}
- if (Stem::has_interface (inf.grob_l_))
+ if (Stem::has_interface (inf.grob_))
{
for (int i=0; i < texts_.size (); i++)
{
- Side_position_interface::add_support (texts_[i],inf.grob_l_);
+ Side_position_interface::add_support (texts_[i],inf.grob_);
}
}
}
// URG: Text vs TextScript
String basic = "TextScript";
- Item *text = new Item (get_property (basic.ch_C ()));
+ Item *text = new Item (get_property (basic.to_str0 ()));
/*
FIXME -> need to use basic props.
Text_item::markup_text2molecule (Grob *me, SCM markup_text,
SCM alist_chain)
{
- SCM sheet = me->paper_l ()->style_sheet_;
+ SCM sheet = me->get_paper ()->style_sheet_;
SCM f = ly_cdr (scm_assoc (ly_symbol2scm ("markup-to-properties"), sheet));
SCM markup = ly_car (markup_text);
void
Text_spanner_engraver::acknowledge_grob (Grob_info info)
{
- if (span_ && Note_column::has_interface (info.grob_l_))
+ if (span_ && Note_column::has_interface (info.grob_))
{
- Side_position_interface::add_support (span_, info.grob_l_);
- add_bound_item (span_, dynamic_cast<Item*> (info.grob_l_));
+ Side_position_interface::add_support (span_, info.grob_);
+ add_bound_item (span_, dynamic_cast<Item*> (info.grob_));
}
}
/* ugh */
- Real thick = me->paper_l ()->get_var ("linethickness");
+ Real thick = me->get_paper ()->get_var ("linethickness");
SCM st = me->get_grob_property ("thickness");
if (gh_number_p (st))
{
Text_spanner::setup_pedal_bracket(Spanner *me)
{
- Real thick = me->paper_l ()->get_var ("linethickness");
+ Real thick = me->get_paper ()->get_var ("linethickness");
SCM st = me->get_grob_property ("thickness");
if (gh_number_p (st))
{
#include "warn.hh"
#include "warn.hh"
-#define format_str String_convert::form_str
+#define format_string String_convert::form_string
#define FIX_UNITY \
(1 << 20)
static const Real fix_to_real (Fix f);
/* Most quantities are fixed-point fractions. */
Real
-Tex_font_metric_reader::get_U32_fix_f ()
+Tex_font_metric_reader::get_U32_fix ()
{
return fix_to_real (input_.get_U32 ());
}
/* Dimensions are a `Fix' scaled by the design size. */
Real
-Tex_font_metric_reader::get_U32_fix_scaled_f ()
+Tex_font_metric_reader::get_U32_fix_scaled ()
{
- return get_U32_fix_f () * info_.design_size;
+ return get_U32_fix () * info_.design_size;
}
String
-Tex_font_metric_reader::get_bcpl_str ()
+Tex_font_metric_reader::get_bcpl_string ()
{
U8 length_u8 = input_.get_U8 ();
- String str = input_.get_str (length_u8);
+ String str = input_.get_string (length_u8);
return str;
}
if (header_length < 2)
error (_f ("TFM header of `%s' has only %u word (s)",
- input_.name_str ().ch_C (), header_length));
+ input_.name_string ().to_str0 (), header_length));
info_.checksum = input_.get_U32 ();
- info_.design_size = get_U32_fix_f ();
+ info_.design_size = get_U32_fix ();
/* Although the coding scheme might be interesting to the caller, the
font family and face byte probably aren't. So we don't read them. */
info_.coding_scheme = header_length > 2
- ? get_bcpl_str () : "unspecified";
+ ? get_bcpl_string () : "unspecified";
}
//brrr
/* Move to the beginning of the parameter table in the file. */
- input_.seek_ch_C (-4 * header_.param_word_count);
+ input_.seek_str0 (-4 * header_.param_word_count);
/* It's unlikely but possible that this TFM file has more fontdimens
than we can deal with. */
if (header_.param_word_count > TFM_MAX_FONTDIMENS)
{
warning (_f ("%s: TFM file has %u parameters, which is more than the %u I can handle",
- input_.name_str ().ch_C (),
+ input_.name_string ().to_str0 (),
header_.param_word_count,
TFM_MAX_FONTDIMENS));
header_.param_word_count = TFM_MAX_FONTDIMENS;
/* The first parameter is different than all the rest, because it
isn't scaled by the design size. */
- info_.parameters[ (TFM_SLANT_PARAMETER) - 1] = get_U32_fix_f ();
+ info_.parameters[ (TFM_SLANT_PARAMETER) - 1] = get_U32_fix ();
for (Char_code i = 2; i <= header_.param_word_count; i++)
- info_.parameters[i - 1] = get_U32_fix_scaled_f ();
+ info_.parameters[i - 1] = get_U32_fix_scaled ();
}
//brr
/* Move to the appropriate place in the `char_info' array. */
- input_.seek_ch_C (header_.char_info_pos + (code - info_.first_charcode) * 4);
+ input_.seek_str0 (header_.char_info_pos + (code - info_.first_charcode) * 4);
/* Read the character. */
tfm_char = read_char ();
#define GET_CHAR_DIMEN(d) \
if (d##_index != 0) \
{ \
- input_.seek_ch_C (header_. d##_pos + d##_index*4); \
+ input_.seek_str0 (header_. d##_pos + d##_index*4); \
tfm_char.d##_fix_ = input_.get_U32 (); \
tfm_char.d##_ = fix_to_real (tfm_char.d##_fix_) \
* info_.design_size; \
if (tag == 1)
{
- input_.seek_ch_C (header_.lig_kern_pos + remainder * 4);
- read_lig_kern_program (&tfm_char.ligature_arr_, &tfm_char.kern_arr_);
+ input_.seek_str0 (header_.lig_kern_pos + remainder * 4);
+ read_lig_kern_program (&tfm_char.ligatures_, &tfm_char.kerns_);
}
/* We don't handle the other tags. */
#define KERN_FLAG 128
void
-Tex_font_metric_reader::read_lig_kern_program (Array <Tfm_ligature>* ligature_arr_p, Array <Tfm_kern>* kern_arr_p)
+Tex_font_metric_reader::read_lig_kern_program (Array <Tfm_ligature>* ligatures, Array <Tfm_kern>* kerns)
{
bool end_b;
Tfm_kern kern_element;
kern_element.character = next_char;
- char const* old_pos = input_.pos_ch_C ();
- input_.seek_ch_C (header_.kern_pos + remainder * 4);
- kern_element.kern = get_U32_fix_scaled_f ();
+ char const* old_pos = input_.pos_str0 ();
+ input_.seek_str0 (header_.kern_pos + remainder * 4);
+ kern_element.kern = get_U32_fix_scaled ();
input_.set_pos (old_pos);
- kern_arr_p->push (kern_element);
+ kerns->push (kern_element);
}
else
Tfm_ligature ligature_element;
ligature_element.character = next_char;
ligature_element.ligature = remainder;
- ligature_arr_p->push (ligature_element);
+ ligatures->push (ligature_element);
}
} while (!end_b);
italic_correction_fix_ = 0;
}
-#define APPEND_CHAR_METRIC_ELT(k) outstr += to_str (#k) + " " + to_str (k ## _) + "; "
+#define APPEND_CHAR_METRIC_ELT(k) outstr += to_string (#k) + " " + to_string (k ## _) + "; "
String
-Tex_font_char_metric::str () const
+Tex_font_char_metric::string () const
{
String outstr ;
String
-Tex_font_metric::str () const
+Tex_font_metric::string () const
{
String outstr;
for (int i=0; i < char_metrics_.size (); i++)
- outstr += char_metrics_[i].str ();
+ outstr += char_metrics_[i].string ();
return outstr;
}
SCM
Tex_font_metric::make_tfm (String fn)
{
- Tex_font_metric * tfm_p = new Tex_font_metric;
+ Tex_font_metric * tfm = new Tex_font_metric;
Tex_font_metric_reader reader (fn);
- tfm_p->info_ = reader.info_;
- tfm_p->header_ = reader.header_;
- tfm_p->char_metrics_ = reader.char_metrics_;
- tfm_p->ascii_to_metric_idx_ = reader.ascii_to_metric_idx_;
+ tfm->info_ = reader.info_;
+ tfm->header_ = reader.header_;
+ tfm->char_metrics_ = reader.char_metrics_;
+ tfm->ascii_to_metric_idx_ = reader.ascii_to_metric_idx_;
- return tfm_p->self_scm ();
+ return tfm->self_scm ();
}
if (s == ly_symbol2scm ("always")
|| (s == SCM_EOL
&& to_boolean (get_property ("soloADue"))
- && ((daddy_trans_l_->id_str_.left_str (3) == "two"
+ && ((daddy_trans_->id_string_.left_string (3) == "two"
&& (to_boolean (get_property ("unison"))
|| to_boolean (get_property ("unisilence"))))
/* Maybe this should be optional? */
|| to_boolean (get_property ("othersolo")))))
{
- i.grob_l_->suicide ();
+ i.grob_->suicide ();
}
}
Thread_devnull_engraver::Thread_devnull_engraver(){}
tie_compare (Grob* const & s1,
Grob* const & s2)
{
- return sign (Tie::position_f (s1) - Tie::position_f (s2));
+ return sign (Tie::get_position (s1) - Tie::get_position (s2));
}
/*
for (int i=ties.size (); i--;)
{
Grob * t = ties[i];
- Real p = Tie::position_f (t);
+ Real p = Tie::get_position (t);
Direction d = (Direction) sign (p);
if (!d)
d = UP;
Moment end_mom_;
Moment next_end_mom_;
- Tie_req *req_l_;
+ Tie_req *req_;
Link_array<Grob> now_heads_;
Link_array<Grob> stopped_heads_;
- Link_array<Grob> tie_p_arr_;
+ Link_array<Grob> ties_;
- Spanner * tie_column_p_;
+ Spanner * tie_column_;
void set_melisma (bool);
Tie_engraver::Tie_engraver ()
{
- req_l_ = 0;
- tie_column_p_ = 0;
+ req_ = 0;
+ tie_column_ = 0;
}
/* if (end_mom_ > now_mom ())
return false;
*/
- req_l_ = c;
+ req_ = c;
SCM m = get_property ("automaticMelismata");
bool am = gh_boolean_p (m) &&gh_scm2bool (m);
if (am)
void
Tie_engraver::set_melisma (bool m)
{
- daddy_trans_l_->set_property ("tieMelismaBusy", m ? SCM_BOOL_T : SCM_BOOL_F);
+ daddy_trans_->set_property ("tieMelismaBusy", m ? SCM_BOOL_T : SCM_BOOL_F);
}
void
Tie_engraver::acknowledge_grob (Grob_info i)
{
- if (Note_head::has_interface (i.grob_l_))
+ if (Note_head::has_interface (i.grob_))
{
- now_heads_.push (i.grob_l_);
+ now_heads_.push (i.grob_);
}
}
void
Tie_engraver::process_acknowledged_grobs ()
{
- if (req_l_)
+ if (req_)
{
now_heads_.sort (&head_pitch_compare);
/*
Tie::set_head (p,LEFT, dynamic_cast<Item*> (unsmob_grob (ly_car (pair))));
Tie::set_head (p,RIGHT, dynamic_cast<Item*> (unsmob_grob (ly_cdr (pair))));
- tie_p_arr_.push (p);
- announce_grob(p, req_l_->self_scm());
+ ties_.push (p);
+ announce_grob(p, req_->self_scm());
}
else for (SCM s = head_list; gh_pair_p (s); s = ly_cdr (s))
{
Tie::set_head (p, LEFT, dynamic_cast<Item*> (unsmob_grob (ly_caar (s))));
Tie::set_head (p, RIGHT, dynamic_cast<Item*> (unsmob_grob (ly_cdar (s))));
- tie_p_arr_.push (p);
- announce_grob(p, req_l_->self_scm());
+ ties_.push (p);
+ announce_grob(p, req_->self_scm());
}
- if (tie_p_arr_.size () > 1 && !tie_column_p_)
+ if (ties_.size () > 1 && !tie_column_)
{
- tie_column_p_ = new Spanner (get_property ("TieColumn"));
+ tie_column_ = new Spanner (get_property ("TieColumn"));
- for (int i = tie_p_arr_.size (); i--;)
- Tie_column::add_tie (tie_column_p_,tie_p_arr_ [i]);
- announce_grob(tie_column_p_, SCM_EOL);
+ for (int i = ties_.size (); i--;)
+ Tie_column::add_tie (tie_column_,ties_ [i]);
+ announce_grob(tie_column_, SCM_EOL);
}
}
}
void
Tie_engraver::stop_translation_timestep ()
{
- req_l_ = 0;
+ req_ = 0;
now_heads_.clear ();
we don't warn for no ties, since this happens naturally when you
use skipTypesetting. */
- for (int i=0; i< tie_p_arr_.size (); i++)
+ for (int i=0; i< ties_.size (); i++)
{
- typeset_tie (tie_p_arr_[i]);
+ typeset_tie (ties_[i]);
}
- tie_p_arr_.clear ();
- if (tie_column_p_)
+ ties_.clear ();
+ if (tie_column_)
{
- typeset_grob (tie_column_p_);
- tie_column_p_ =0;
+ typeset_grob (tie_column_);
+ tie_column_ =0;
}
}
#include "performer.hh"
struct CNote_melodic_tuple {
- Melodic_req *req_l_ ;
- Audio_note *note_l_;
+ Melodic_req *req_ ;
+ Audio_note *note_;
Moment end_;
CNote_melodic_tuple ();
CNote_melodic_tuple (Audio_note*, Melodic_req*, Moment);
private:
bool done_;
PQueue<CNote_melodic_tuple> past_notes_pq_;
- Tie_req *req_l_;
+ Tie_req *req_;
Array<CNote_melodic_tuple> now_notes_;
Array<CNote_melodic_tuple> stopped_notes_;
- Link_array<Audio_tie> tie_p_arr_;
+ Link_array<Audio_tie> ties_;
protected:
virtual void initialize ();
Tie_performer::Tie_performer ()
{
- req_l_ = 0;
+ req_ = 0;
done_ = false;
}
void
Tie_performer::initialize ()
{
- req_l_ = 0;
+ req_ = 0;
}
bool
Tie_performer::try_music (Music *m)
{
- if (!req_l_)
+ if (!req_)
{
if (Tie_req * c = dynamic_cast<Tie_req*> (m))
{
- req_l_ = c;
+ req_ = c;
return true;
}
}
void
Tie_performer::acknowledge_audio_element (Audio_element_info i)
{
- if (Audio_note *nh = dynamic_cast<Audio_note *> (i.elem_l_))
+ if (Audio_note *nh = dynamic_cast<Audio_note *> (i.elem_))
{
- Note_req * m = dynamic_cast<Note_req *> (i.req_l_);
+ Note_req * m = dynamic_cast<Note_req *> (i.req_);
if (!m)
return;
now_notes_.push (CNote_melodic_tuple (nh, m, now_mom ()+ m->length_mom ()));
void
Tie_performer::create_audio_elements ()
{
- if (req_l_ && ! done_)
+ if (req_ && ! done_)
{
Moment now = now_mom ();
Link_array<Audio_note> nharr;
return;
}
- if (req_l_)
+ if (req_)
{
now_notes_.sort (CNote_melodic_tuple::pitch_compare);
stopped_notes_.sort (CNote_melodic_tuple::pitch_compare);
while (i < now_notes_.size () && j < stopped_notes_.size ())
{
int comp
- = Pitch::compare (*unsmob_pitch (now_notes_[i].req_l_->get_mus_property ("pitch")),
- *unsmob_pitch (stopped_notes_[j].req_l_->get_mus_property ("pitch")));
+ = Pitch::compare (*unsmob_pitch (now_notes_[i].req_->get_mus_property ("pitch")),
+ *unsmob_pitch (stopped_notes_[j].req_->get_mus_property ("pitch")));
if (comp)
{
made. Not infallible. Due to reordering in sort (),
we will make the wrong ties when notenotes are
added. */
- if (tie_count > tie_p_arr_.size ())
+ if (tie_count > ties_.size ())
{
Audio_tie * p = new Audio_tie;
- p->set_note (LEFT, stopped_notes_[j].note_l_);
- p->set_note (RIGHT, now_notes_[i].note_l_);
- tie_p_arr_.push (p);
- announce_element (Audio_element_info (p, req_l_));
+ p->set_note (LEFT, stopped_notes_[j].note_);
+ p->set_note (RIGHT, now_notes_[i].note_);
+ ties_.push (p);
+ announce_element (Audio_element_info (p, req_));
}
i++;
j++;
}
}
- if (!tie_p_arr_.size ())
+ if (!ties_.size ())
{
- req_l_->origin ()->warning (_ ("No ties were created!"));
+ req_->origin ()->warning (_ ("No ties were created!"));
}
}
}
}
now_notes_.clear ();
- for (int i=0; i< tie_p_arr_.size (); i++)
+ for (int i=0; i< ties_.size (); i++)
{
- //play_element (tie_p_arr_[i]);
- tie_p_arr_[i]->note_l_drul_[RIGHT]->tie_to (tie_p_arr_[i]->note_l_drul_[LEFT]);
+ //play_element (ties_[i]);
+ ties_[i]->note_l_drul_[RIGHT]->tie_to (ties_[i]->note_l_drul_[LEFT]);
}
- tie_p_arr_.clear ();
+ ties_.clear ();
}
void
Tie_performer::start_translation_timestep ()
{
- req_l_ =0;
+ req_ =0;
done_ = false;
Moment now = now_mom ();
while (past_notes_pq_.size () && past_notes_pq_.front ().end_ < now)
CNote_melodic_tuple::CNote_melodic_tuple ()
{
- note_l_ =0;
- req_l_ =0;
+ note_ =0;
+ req_ =0;
end_ = 0;
}
CNote_melodic_tuple::CNote_melodic_tuple (Audio_note *h, Melodic_req*m, Moment mom)
{
- note_l_ = h;
- req_l_ = m;
+ note_ = h;
+ req_ = m;
end_ = mom;
}
CNote_melodic_tuple::pitch_compare (CNote_melodic_tuple const&h1,
CNote_melodic_tuple const &h2)
{
- SCM p1 = h1.req_l_->get_mus_property ("pitch");
- SCM p2 = h2.req_l_->get_mus_property ("pitch");
+ SCM p1 = h1.req_->get_mus_property ("pitch");
+ SCM p2 = h2.req_->get_mus_property ("pitch");
return Pitch::compare (*unsmob_pitch (p1),
*unsmob_pitch (p2));
}
}
Real
-Tie::position_f (Grob*me)
+Tie::get_position (Grob*me)
{
Direction d = head (me,LEFT) ? LEFT:RIGHT;
- return Staff_symbol_referencer::position_f (head (me,d));
+ return Staff_symbol_referencer::get_position (head (me,d));
}
Direction
Tie::get_default_dir (Grob*me)
{
- Item * sl = head (me,LEFT) ? Rhythmic_head::stem_l (head (me,LEFT)) :0;
- Item * sr = head (me,RIGHT) ? Rhythmic_head::stem_l (head (me,RIGHT)) :0;
+ Item * sl = head (me,LEFT) ? Rhythmic_head::get_stem (head (me,LEFT)) :0;
+ Item * sr = head (me,RIGHT) ? Rhythmic_head::get_stem (head (me,RIGHT)) :0;
if (sl && sr)
{
*/
- Real ypos = Tie::position_f (me) * staff_space/2
+ Real ypos = Tie::get_position (me) * staff_space/2
+ dir * gh_scm2double (me->get_grob_property ("y-offset"));;
/*
Make sure we don't start on a dots
*/
- if (Note_head::has_interface (l) && Rhythmic_head::dots_l (l))
+ if (Note_head::has_interface (l) && Rhythmic_head::get_dots (l))
{
- Grob* dots = Rhythmic_head::dots_l(l);
- if(fabs (staff_space * Staff_symbol_referencer::position_f (dots) /2
+ Grob* dots = Rhythmic_head::get_dots (l);
+ if(fabs (staff_space * Staff_symbol_referencer::get_position (dots) /2
- ypos) < 0.5)
{
ypos += 0.5 * dir ;
Real thick =
gh_scm2double (me->get_grob_property ("thickness"))
- * me->paper_l ()->get_var ("linethickness");
+ * me->get_paper ()->get_var ("linethickness");
Bezier b;
int i = 0;
{
if (!m.to_bool ())
{
- Music_iterator *yeah = try_music (music_l ());
+ Music_iterator *yeah = try_music (get_music ());
if (yeah)
- set_translator (yeah->report_to_l ());
+ set_translator (yeah->report_to ());
else
- music_l ()->origin ()->warning (_ ("no one to print a tuplet start bracket"));
+ get_music ()->origin ()->warning (_ ("no one to print a tuplet start bracket"));
}
Music_wrapper_iterator::process (m);
*/
class Time_signature_engraver : public Engraver
{
- Item * time_signature_p_;
+ Item * time_signature_;
SCM last_time_fraction_;
protected:
Time_signature_engraver::Time_signature_engraver ()
{
- time_signature_p_ =0;
+ time_signature_ =0;
last_time_fraction_ = SCM_BOOL_F;
}
not rigorously safe, since the value might get GC'd and
reallocated in the same spot */
SCM fr= get_property ("timeSignatureFraction");
- if (!time_signature_p_ && last_time_fraction_ != fr)
+ if (!time_signature_ && last_time_fraction_ != fr)
{
last_time_fraction_ = fr;
- time_signature_p_ = new Item (get_property ("TimeSignature"));
- time_signature_p_->set_grob_property ("fraction",fr);
+ time_signature_ = new Item (get_property ("TimeSignature"));
+ time_signature_->set_grob_property ("fraction",fr);
- if (time_signature_p_)
- announce_grob(time_signature_p_, SCM_EOL);
+ if (time_signature_)
+ announce_grob(time_signature_, SCM_EOL);
}
}
void
Time_signature_engraver::stop_translation_timestep ()
{
- if (time_signature_p_)
+ if (time_signature_)
{
- typeset_grob (time_signature_p_);
- time_signature_p_ =0;
+ typeset_grob (time_signature_);
+ time_signature_ =0;
}
}
SCM prev_fraction_;
private:
- Audio_time_signature* audio_p_;
+ Audio_time_signature* audio_;
};
Time_signature_performer::Time_signature_performer ()
{
prev_fraction_ = SCM_BOOL_F;
- audio_p_ = 0;
+ audio_ = 0;
}
Time_signature_performer::~Time_signature_performer ()
int b = gh_scm2int (ly_car (fr));
int o = gh_scm2int (ly_cdr (fr));
- audio_p_ = new Audio_time_signature (b,o);
- Audio_element_info info (audio_p_, 0);
+ audio_ = new Audio_time_signature (b,o);
+ Audio_element_info info (audio_, 0);
announce_element (info);
}
void
Time_signature_performer::stop_translation_timestep ()
{
- if (audio_p_)
+ if (audio_)
{
- play_element (audio_p_);
- audio_p_ = 0;
+ play_element (audio_);
+ audio_ = 0;
}
}
/*
First guess: s contains only the signature style, append fraction.
*/
- String symbolname = "timesig-" + s + to_str (n) + "/" + to_str (d);
+ String symbolname = "timesig-" + s + to_string (n) + "/" + to_string (d);
Molecule m = feta->find_by_name (symbolname);
if (!m.empty_b ())
SCM chain = Font_interface::font_alist_chain (me);
Molecule n = Text_item::text2molecule (me,
- ly_str02scm (to_str (num).ch_C ()),
+ ly_str02scm (to_string (num).to_str0 ()),
chain);
Molecule d = Text_item::text2molecule (me,
- ly_str02scm (to_str (den).ch_C ()),
+ ly_str02scm (to_string (den).to_str0 ()),
chain);
n.align_to (X_AXIS, CENTER);
d.align_to (X_AXIS, CENTER);
}
}
- daddy_trans_l_->set_property ("whichBar", which);
+ daddy_trans_->set_property ("whichBar", which);
}
void
Timing_engraver::stop_translation_timestep ()
{
Timing_translator::stop_translation_timestep ();
- daddy_trans_l_->set_property ("whichBar", SCM_EOL);
+ daddy_trans_->set_property ("whichBar", SCM_EOL);
last_moment_ = now_mom ();
}
Timing_translator::stop_translation_timestep ()
{
Translator *t = this;
- Global_translator *global_l =0;
+ Global_translator *global =0;
do
{
- t = t->daddy_trans_l_ ;
- global_l = dynamic_cast<Global_translator*> (t);
+ t = t->daddy_trans_ ;
+ global = dynamic_cast<Global_translator*> (t);
}
- while (!global_l);
+ while (!global);
/* allbars == ! skipbars */
SCM sb = get_property ("skipBars");
moment. A waste of cpu?
*/
&& !now.grace_part_)
- global_l->add_moment_to_process (now + barleft);
+ global->add_moment_to_process (now + barleft);
}
}
void
Timing_translator::initialize ()
{
- daddy_trans_l_->set_property ("timing" , SCM_BOOL_T);
- daddy_trans_l_->set_property ("currentBarNumber" , gh_int2scm (1));
+ daddy_trans_->set_property ("timing" , SCM_BOOL_T);
+ daddy_trans_->set_property ("currentBarNumber" , gh_int2scm (1));
- daddy_trans_l_->set_property ("timeSignatureFraction",
+ daddy_trans_->set_property ("timeSignatureFraction",
gh_cons (gh_int2scm (4), gh_int2scm (4)));
- daddy_trans_l_->set_property ("measurePosition", Moment (Rational (0)).smobbed_copy ());
- daddy_trans_l_->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
- daddy_trans_l_->set_property ("beatLength", Moment (Rational (1,4)).smobbed_copy ());
+ daddy_trans_->set_property ("measurePosition", Moment (Rational (0)).smobbed_copy ());
+ daddy_trans_->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
+ daddy_trans_->set_property ("beatLength", Moment (Rational (1,4)).smobbed_copy ());
}
Rational
Timing_translator::start_translation_timestep ()
{
Translator *t = this;
- Global_translator *global_l =0;
+ Global_translator *global =0;
do
{
- t = t->daddy_trans_l_ ;
- global_l = dynamic_cast<Global_translator*> (t);
+ t = t->daddy_trans_ ;
+ global = dynamic_cast<Global_translator*> (t);
}
- while (!global_l);
+ while (!global);
- Moment now = global_l->now_mom_;
- Moment dt = now - global_l -> prev_mom_;
+ Moment now = global->now_mom_;
+ Moment dt = now - global -> prev_mom_;
if (dt < Moment (0))
{
programming_error ("Moving backwards in time");
else
{
measposp = now;
- daddy_trans_l_->set_property ("measurePosition", measposp.smobbed_copy ());
+ daddy_trans_->set_property ("measurePosition", measposp.smobbed_copy ());
}
measposp += dt;
b ++;
}
- daddy_trans_l_->set_property ("currentBarNumber", gh_int2scm (b));
- daddy_trans_l_->set_property ("measurePosition", measposp.smobbed_copy ());
+ daddy_trans_->set_property ("currentBarNumber", gh_int2scm (b));
+ daddy_trans_->set_property ("measurePosition", measposp.smobbed_copy ());
}
ENTER_DESCRIPTION (Timing_translator, "","","","","" );
/*
UGH. Dictionary is deprecated
*/
-Dictionary<Translator*> *global_translator_dict_p=0;
+Dictionary<Translator*> *global_translator_dict=0;
LY_DEFINE(ly_get_all_translators,"ly-get-all-translators", 0, 0, 0, (),
"Return an list of a all translator objects that may be instantiated
during a lilypond run.")
{
SCM l = SCM_EOL;
- for (std::map<String,Translator*>::const_iterator (ci (global_translator_dict_p->begin()));
- ci != global_translator_dict_p->end (); ci++)
+ for (std::map<String,Translator*>::const_iterator (ci (global_translator_dict->begin()));
+ ci != global_translator_dict->end (); ci++)
{
l = scm_cons ((*ci).second->self_scm (), l);
}
void
add_translator (Translator *t)
{
- if (!global_translator_dict_p)
- global_translator_dict_p = new Dictionary<Translator*>;
+ if (!global_translator_dict)
+ global_translator_dict = new Dictionary<Translator*>;
- (*global_translator_dict_p)[classname (t)] = t;
+ (*global_translator_dict)[classname (t)] = t;
}
Translator*
-get_translator_l (String s)
+get_translator (String s)
{
- if (global_translator_dict_p->elem_b (s))
+ if (global_translator_dict->elem_b (s))
{
- Translator* t = (*global_translator_dict_p)[s];
+ Translator* t = (*global_translator_dict)[s];
return t;
}
Translator_def::modify_definition (SCM list, SCM str, bool add)
{
String s = ly_scm2string (str);
- if (!get_translator_l (s))
+ if (!get_translator (s))
error (_ ("Program has no such type"));
if (add)
Link_array<Translator_def>
-Translator_def::path_to_acceptable_translator (SCM type_str, Music_output_def* odef) const
+Translator_def::path_to_acceptable_translator (SCM type_string, Music_output_def* odef) const
{
- assert (gh_string_p (type_str));
+ assert (gh_string_p (type_string));
- Link_array<Translator_def> accepted_arr;
+ Link_array<Translator_def> accepteds;
for (SCM s = accepts_name_list_; gh_pair_p (s); s = ly_cdr (s))
{
- Translator_def *t = unsmob_translator_def (odef->find_translator_l (ly_car (s)));
+ Translator_def *t = unsmob_translator_def (odef->find_translator (ly_car (s)));
if (!t)
continue;
- accepted_arr.push (t);
+ accepteds.push (t);
}
Link_array<Translator_def> best_result;
- for (int i=0; i < accepted_arr.size (); i++)
+ for (int i=0; i < accepteds.size (); i++)
{
/*
don't check aliases, because \context Staff should not create RhythmicStaff.
*/
- if (gh_equal_p (accepted_arr[i]->type_name_, type_str))
+ if (gh_equal_p (accepteds[i]->type_name_, type_string))
{
- best_result.push (accepted_arr[i]);
+ best_result.push (accepteds[i]);
return best_result;
}
}
int best_depth= INT_MAX;
- for (int i=0; i < accepted_arr.size (); i++)
+ for (int i=0; i < accepteds.size (); i++)
{
- Translator_def * g = accepted_arr[i];
+ Translator_def * g = accepteds[i];
Link_array<Translator_def> result
- = g->path_to_acceptable_translator (type_str, odef);
+ = g->path_to_acceptable_translator (type_string, odef);
if (result.size () && result.size () < best_depth)
{
result.insert (g,0);
SCM l = SCM_EOL;
for (SCM s = namelist; gh_pair_p (s) ; s = ly_cdr (s))
{
- Translator * t = get_translator_l (ly_scm2string (ly_car (s)));
+ Translator * t = get_translator (ly_scm2string (ly_car (s)));
if (!t)
warning (_f ("can't find: `%s'", s));
else
SCM str = tr->self_scm ();
l = gh_cons (str, l);
- tr->daddy_trans_l_ = tg;
- tr->output_def_l_ = tg->output_def_l_;
+ tr->daddy_trans_ = tg;
+ tr->output_def_ = tg->output_def_;
scm_gc_unprotect_object (str);
}
Translator_group *
Translator_def::instantiate (Music_output_def* md)
{
- Translator * g = get_translator_l (ly_scm2string (translator_group_type_));
+ Translator * g = get_translator (ly_scm2string (translator_group_type_));
g = g->clone ();
Translator_group *tg = dynamic_cast<Translator_group*> (g);
- tg->output_def_l_ = md;
+ tg->output_def_ = md;
tg->definition_ = self_scm ();
- tg->type_str_ = ly_scm2string (type_name_);
+ tg->type_string_ = ly_scm2string (type_name_);
/*
TODO: ugh. we're reversing CONSISTS_NAME_LIST_ here
Must append, since list ordering must be preserved.
*/
list = gh_append2 (list, gh_cons (t->self_scm (), SCM_EOL));
- t->daddy_trans_l_ = this;
- t->output_def_l_ = output_def_l_;
+ t->daddy_trans_ = this;
+ t->output_def_ = output_def_;
return list;
}
}
Translator_group *
-Translator_group::find_existing_translator_l (String n, String id)
+Translator_group::find_existing_translator (String n, String id)
{
- if (is_alias_b (n) && (id_str_ == id || id.empty_b ()))
+ if (is_alias_b (n) && (id_string_ == id || id.empty_b ()))
return this;
Translator_group* r = 0;
{
Translator * t = unsmob_translator (ly_car (p));
- r = dynamic_cast<Translator_group*> (t)->find_existing_translator_l (n, id);
+ r = dynamic_cast<Translator_group*> (t)->find_existing_translator (n, id);
}
return r;
Translator_group*
-Translator_group::find_create_translator_l (String n, String id)
+Translator_group::find_create_translator (String n, String id)
{
- Translator_group * existing = find_existing_translator_l (n,id);
+ Translator_group * existing = find_existing_translator (n,id);
if (existing)
return existing;
Link_array<Translator_def> path
- = unsmob_translator_def (definition_)->path_to_acceptable_translator (ly_str02scm ((char*)n.ch_C ()), output_def_l ());
+ = unsmob_translator_def (definition_)->path_to_acceptable_translator (ly_str02scm ((char*)n.to_str0 ()), get_output_def ());
if (path.size ())
{
// start at 1. The first one (index 0) will be us.
for (int i=0; i < path.size (); i++)
{
- Translator_group * new_group = path[i]->instantiate (output_def_l_);
+ Translator_group * new_group = path[i]->instantiate (output_def_);
if (i == path.size () -1)
- new_group->id_str_ = id;
+ new_group->id_string_ = id;
current->add_fresh_group_translator (new_group);
current = new_group;
}
}
Translator_group *ret = 0;
- if (daddy_trans_l_)
- ret = daddy_trans_l_->find_create_translator_l (n,id);
+ if (daddy_trans_)
+ ret = daddy_trans_->find_create_translator (n,id);
else
{
warning (_f ("can't find or create `%s' called `%s'", n, id));
{
bool hebbes_b = try_music_on_nongroup_children (m);
- if (!hebbes_b && daddy_trans_l_)
- hebbes_b = daddy_trans_l_->try_music (m);
+ if (!hebbes_b && daddy_trans_)
+ hebbes_b = daddy_trans_->try_music (m);
return hebbes_b ;
}
int
-Translator_group::depth_i () const
+Translator_group::get_depth () const
{
- return (daddy_trans_l_) ? daddy_trans_l_->depth_i () + 1 : 0;
+ return (daddy_trans_) ? daddy_trans_->get_depth () + 1 : 0;
}
Translator_group*
-Translator_group::ancestor_l (int level)
+Translator_group::get_ancestor (int level)
{
- if (!level || !daddy_trans_l_)
+ if (!level || !daddy_trans_)
return this;
- return daddy_trans_l_->ancestor_l (level-1);
+ return daddy_trans_->get_ancestor (level-1);
}
void
-Translator_group::terminate_translator (Translator*r_l)
+Translator_group::terminate_translator (Translator*r)
{
- r_l->removal_processing ();
+ r->removal_processing ();
/*
Return value ignored. GC does the rest.
*/
- remove_translator_p (r_l);
+ remove_translator (r);
}
Remove a translator from the hierarchy.
*/
Translator *
-Translator_group::remove_translator_p (Translator*trans_l)
+Translator_group::remove_translator (Translator*trans)
{
- assert (trans_l);
+ assert (trans);
- trans_group_list_ = scm_delq_x (trans_l->self_scm (), trans_group_list_);
- trans_l->daddy_trans_l_ = 0;
- return trans_l;
+ trans_group_list_ = scm_delq_x (trans->self_scm (), trans_group_list_);
+ trans->daddy_trans_ = 0;
+ return trans;
}
bool
if (!is_bottom_translator_b ())
{
SCM nm = unsmob_translator_def (definition_)->default_child_context_name ();
- SCM st = output_def_l ()->find_translator_l (nm);
+ SCM st = get_output_def ()->find_translator (nm);
Translator_def *t = unsmob_translator_def (st);
if (!t)
{
- warning (_f ("can't find or create: `%s'", ly_scm2string (nm).ch_C ()));
+ warning (_f ("can't find or create: `%s'", ly_scm2string (nm).to_str0 ()));
t = unsmob_translator_def (this->definition_);
}
- Translator_group *tg = t->instantiate (output_def_l_);
+ Translator_group *tg = t->instantiate (output_def_);
add_fresh_group_translator (tg);
if (!tg->is_bottom_translator_b ())
return (Translator_group*)this;
}
- return (daddy_trans_l_) ? daddy_trans_l_->where_defined (sym) : 0;
+ return (daddy_trans_) ? daddy_trans_->where_defined (sym) : 0;
}
/*
if (properties_dict ()->try_retrieve (sym, &val))
return val;
- if (daddy_trans_l_)
- return daddy_trans_l_->internal_get_property (sym);
+ if (daddy_trans_)
+ return daddy_trans_->internal_get_property (sym);
return val;
}
Translator *t = unsmob_translator (context);
Translator_group* tr= dynamic_cast<Translator_group*> (t);
SCM_ASSERT_TYPE(tr, context, SCM_ARG1, __FUNCTION__, "Translator group");
- SCM_ASSERT_TYPE(gh_symbol_p(name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE(gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
return tr->internal_get_property (name);
trans_group_list_ = SCM_EOL;
properties_scm_ = SCM_EOL;
definition_ = SCM_EOL;
- daddy_trans_l_ =0;
+ daddy_trans_ =0;
}
Translator::Translator ()
{
init ();
- output_def_l_ = 0;
+ output_def_ = 0;
smobify_self ();
}
Translator::Translator (Translator const &s)
{
init ();
- output_def_l_ = s.output_def_l_;
- type_str_ = s.type_str_;
+ output_def_ = s.output_def_;
+ type_string_ = s.type_string_;
smobify_self ();
}
bool
Translator::is_alias_b (String s) const
{
- bool b = s == type_str_;
+ bool b = s == type_string_;
for (SCM a = unsmob_translator_def (definition_)->type_aliases_;
!b && gh_pair_p (a); a = ly_cdr (a))
Moment
Translator::now_mom () const
{
- return daddy_trans_l_->now_mom ();
+ return daddy_trans_->now_mom ();
}
void
}
Music_output_def *
-Translator::output_def_l () const
+Translator::get_output_def () const
{
- return output_def_l_;
+ return output_def_;
}
SCM
Translator::internal_get_property (SCM sym) const
{
- return daddy_trans_l_->internal_get_property (sym);
+ return daddy_trans_->internal_get_property (sym);
}
void
static Grob*
get_x_bound_grob (Grob *g, Direction my_dir)
{
- if (Note_column::stem_l (g)
+ if (Note_column::get_stem (g)
&& Note_column::dir (g) == my_dir)
{
- g = Note_column::stem_l (g);
+ g = Note_column::get_stem (g);
}
return g;
}
/*
ugh: code dup.
*/
- Grob *s1 = Note_column::stem_l (cols[0]);
- Grob *s2 = Note_column::stem_l (cols.top());
+ Grob *s1 = Note_column::get_stem (cols[0]);
+ Grob *s2 = Note_column::get_stem (cols.top());
- Grob*b1 = s1 ? Stem::beam_l (s1) : 0;
- Grob*b2 = s2 ? Stem::beam_l (s2) : 0;
+ Grob*b1 = s1 ? Stem::get_beam (s1) : 0;
+ Grob*b2 = s2 ? Stem::get_beam (s2) : 0;
Spanner*sp = dynamic_cast<Spanner*> (me);
{
Grob *me= unsmob_grob (smob);
Molecule mol;
- Link_array<Grob> column_arr=
+ Link_array<Grob> columns=
Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns");
- if (!column_arr.size ())
+ if (!columns.size ())
return mol.smobbed_copy ();
bool equally_long = false;
- Grob * par_beam = parallel_beam (me, column_arr, &equally_long);
+ Grob * par_beam = parallel_beam (me, columns, &equally_long);
Spanner*sp = dynamic_cast<Spanner*> (me);
else if (numb == ly_symbol2scm ("if-no-beam"))
number_visibility = !par_beam;
- Grob * commonx = column_arr[0]->common_refpoint (column_arr.top (),X_AXIS);
+ Grob * commonx = columns[0]->common_refpoint (columns.top (),X_AXIS);
Direction dir = Directional_element_interface::get (me);
- Grob * lgr = get_x_bound_grob (column_arr[0], dir);
- Grob * rgr = get_x_bound_grob (column_arr.top(), dir);
+ Grob * lgr = get_x_bound_grob (columns[0], dir);
+ Grob * rgr = get_x_bound_grob (columns.top(), dir);
Real x0 = lgr->extent (commonx,X_AXIS)[LEFT];
Real x1 = rgr->extent (commonx,X_AXIS)[RIGHT];
if (bracket_visibility)
{
- Real lt = me->paper_l ()->get_var ("linethickness");
+ Real lt = me->get_paper ()->get_var ("linethickness");
SCM thick = me->get_grob_property ("thickness");
if (gh_number_p (thick))
void
Tuplet_bracket::calc_position_and_height (Grob*me,Real *offset, Real * dy)
{
- Link_array<Grob> column_arr=
+ Link_array<Grob> columns=
Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns");
Use outer non-rest columns to determine slope
*/
int l = 0;
- while (l <column_arr.size () && Note_column::rest_b (column_arr[l]))
+ while (l <columns.size () && Note_column::rest_b (columns[l]))
l ++;
- int r = column_arr.size ()- 1;
- while (r >= l && Note_column::rest_b (column_arr[r]))
+ int r = columns.size ()- 1;
+ while (r >= l && Note_column::rest_b (columns[r]))
r--;
if (l < r)
{
- *dy = column_arr[r]->extent (commony, Y_AXIS) [dir]
- - column_arr[l]->extent (commony, Y_AXIS) [dir] ;
+ *dy = columns[r]->extent (commony, Y_AXIS) [dir]
+ - columns[l]->extent (commony, Y_AXIS) [dir] ;
}
else
* dy = 0;
*offset = - dir * infinity_f;
- if (!column_arr.size ())
+ if (!columns.size ())
return;
- Grob * lgr = get_x_bound_grob (column_arr[0], dir);
- Grob * rgr = get_x_bound_grob (column_arr.top(), dir);
+ Grob * lgr = get_x_bound_grob (columns[0], dir);
+ Grob * rgr = get_x_bound_grob (columns.top(), dir);
Real x0 = lgr->extent (commonx,X_AXIS)[LEFT];
Real x1 = rgr->extent (commonx,X_AXIS)[RIGHT];
/*
Slope.
*/
- Real factor = column_arr.size () > 1 ? 1/ (x1 - x0) : 1.0;
+ Real factor = columns.size () > 1 ? 1/ (x1 - x0) : 1.0;
- for (int i = 0; i < column_arr.size (); i++)
+ for (int i = 0; i < columns.size (); i++)
{
- Real notey = column_arr[i]->extent (commony, Y_AXIS)[dir]
+ Real notey = columns[i]->extent (commony, Y_AXIS)[dir]
- me->relative_coordinate (commony, Y_AXIS);
- Real x = column_arr[i]->relative_coordinate (commonx, X_AXIS) - x0;
+ Real x = columns[i]->relative_coordinate (commonx, X_AXIS) - x0;
Real tuplety = *dy * x * factor;
if (notey * dir > (*offset + tuplety) * dir)
void
Tuplet_bracket::calc_dy (Grob*me,Real * dy)
{
- Link_array<Grob> column_arr=
+ Link_array<Grob> columns=
Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns");
/*
ugh. refps.
*/
Direction d = Directional_element_interface::get (me);
- *dy = column_arr.top ()->extent (column_arr.top (), Y_AXIS) [d]
- - column_arr[0]->extent (column_arr[0], Y_AXIS) [d];
+ *dy = columns.top ()->extent (columns.top (), Y_AXIS) [d]
+ - columns[0]->extent (columns[0], Y_AXIS) [d];
}
Tuplet_bracket::before_line_breaking (SCM smob)
{
Grob *me = unsmob_grob (smob);
- Link_array<Grob> column_arr=
+ Link_array<Grob> columns=
Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns");
- for (int i = column_arr.size(); i--;)
+ for (int i = columns.size(); i--;)
{
- Grob * s =Note_column::stem_l (column_arr[i]);
- Grob * b = s ? Stem::beam_l (s): 0;
+ Grob * s =Note_column::get_stem (columns[i]);
+ Grob * b = s ? Stem::get_beam (s): 0;
if (b)
me->add_dependency (b);
}
Tuplet_bracket::after_line_breaking (SCM smob)
{
Grob * me = unsmob_grob (smob);
- Link_array<Grob> column_arr=
+ Link_array<Grob> columns=
Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns");
- if (!column_arr.size ())
+ if (!columns.size ())
{
me->suicide ();
return SCM_UNSPECIFIED;
}
bool equally_long = false;
- Grob * par_beam = parallel_beam (me, column_arr, &equally_long);
+ Grob * par_beam = parallel_beam (me, columns, &equally_long);
/*
We follow the beam only if there is one, and we are next to it.
TRANSLATOR_DECLARATIONS(Tuplet_engraver);
protected:
- Link_array<Time_scaled_music> time_scaled_music_arr_;
- /// when does the scaled music stop? Array order is synced with time_scaled_music_arr_
+ Link_array<Time_scaled_music> time_scaled_musics_;
+ /// when does the scaled music stop? Array order is synced with time_scaled_musics_
Array<Rational> stop_moments_;
- /// when does the current spanner stop? Array order is synced with time_scaled_music_arr_
+ /// when does the current spanner stop? Array order is synced with time_scaled_musics_
Array<Rational> span_stop_moments_;
- /// The spanners. Array order is synced with time_scaled_music_arr_
- Link_array<Spanner> started_span_p_arr_;
+ /// The spanners. Array order is synced with time_scaled_musics_
+ Link_array<Spanner> started_spanners_;
virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
Music *el = c->element ();
if (!dynamic_cast<Request_chord*> (el))
{
- time_scaled_music_arr_.push (c);
+ time_scaled_musics_.push (c);
Rational m = now_mom ().main_part_ + c->length_mom ().main_part_;
stop_moments_.push (m);
if (to_boolean (v))
return;
- for (int i= 0; i < time_scaled_music_arr_.size (); i++)
+ for (int i= 0; i < time_scaled_musics_.size (); i++)
{
- if (i < started_span_p_arr_.size () && started_span_p_arr_[i])
+ if (i < started_spanners_.size () && started_spanners_[i])
continue;
Spanner* glep = new Spanner (get_property ("TupletBracket"));
- if (i >= started_span_p_arr_.size ())
- started_span_p_arr_.push (glep);
+ if (i >= started_spanners_.size ())
+ started_spanners_.push (glep);
else
- started_span_p_arr_[i] = glep;
+ started_spanners_[i] = glep;
SCM proc = get_property ("tupletNumberFormatFunction");
if (gh_procedure_p (proc))
{
- SCM t = gh_apply (proc, scm_list_n (time_scaled_music_arr_[i]->self_scm (), SCM_UNDEFINED));
+ SCM t = gh_apply (proc, scm_list_n (time_scaled_musics_[i]->self_scm (), SCM_UNDEFINED));
glep->set_grob_property ("text", t);
}
- announce_grob(glep, time_scaled_music_arr_ [i]->self_scm());
+ announce_grob(glep, time_scaled_musics_ [i]->self_scm());
}
}
void
Tuplet_engraver::acknowledge_grob (Grob_info i)
{
- if (Note_column::has_interface (i.grob_l_))
+ if (Note_column::has_interface (i.grob_))
{
- for (int j =0; j <started_span_p_arr_.size (); j++)
- if (started_span_p_arr_[j])
- Tuplet_bracket::add_column (started_span_p_arr_[j], dynamic_cast<Item*> (i.grob_l_));
+ for (int j =0; j <started_spanners_.size (); j++)
+ if (started_spanners_[j])
+ Tuplet_bracket::add_column (started_spanners_[j], dynamic_cast<Item*> (i.grob_));
}
}
if (unsmob_moment (s))
tsd = unsmob_moment (s)->main_part_;
- for (int i= started_span_p_arr_.size (); i--;)
+ for (int i= started_spanners_.size (); i--;)
{
if (now.main_part_ >= span_stop_moments_[i])
{
- if (started_span_p_arr_[i])
+ if (started_spanners_[i])
{
- typeset_grob (started_span_p_arr_[i]);
- started_span_p_arr_[i] =0;
+ typeset_grob (started_spanners_[i]);
+ started_spanners_[i] =0;
}
if (tsd.to_bool ())
if (now.main_part_ >= stop_moments_[i])
{
- started_span_p_arr_.del (i);
+ started_spanners_.del (i);
stop_moments_.del (i);
span_stop_moments_.del (i);
- time_scaled_music_arr_.del (i);
+ time_scaled_musics_.del (i);
}
}
}
void
Tuplet_engraver::finalize ()
{
- for (int i=0; i < started_span_p_arr_.size (); i++)
+ for (int i=0; i < started_spanners_.size (); i++)
{
- if (started_span_p_arr_[i])
- typeset_grob (started_span_p_arr_[i]);
+ if (started_spanners_[i])
+ typeset_grob (started_spanners_[i]);
}
}
bool
Type_swallow_translator::try_music (Music*r)
{
- if (classname (r) == swallow_str_)
+ if (classname (r) == swallow_string_)
return true;
return false;
}
SCM l = SCM_EOL;
SCM *tail = &l;
- SCM body = music_l ()->get_mus_property ("element");
- SCM alts = music_l ()->get_mus_property ("elements");
+ SCM body = get_music ()->get_mus_property ("element");
+ SCM alts = get_music ()->get_mus_property ("elements");
int alt_count = scm_ilength (alts);
- int rep_count = gh_scm2int (music_l ()->get_mus_property ("repeat-count"));
+ int rep_count = gh_scm2int (get_music ()->get_mus_property ("repeat-count"));
for (int i = 0; i < rep_count; i++)
{
SCM
Volta_repeat_iterator::get_music_list()const
{
- return gh_cons (music_l ()->get_mus_property ("element"),
- music_l ()->get_mus_property ("elements"));
+ return gh_cons (get_music ()->get_mus_property ("element"),
+ get_music ()->get_mus_property ("elements"));
}
void
{
Sequential_iterator::construct_children();
- SCM alts = music_l ()->get_mus_property ("elements");
+ SCM alts = get_music ()->get_mus_property ("elements");
alt_count_ = scm_ilength (alts);
- rep_count_ = gh_scm2int (music_l ()->get_mus_property ("repeat-count"));
+ rep_count_ = gh_scm2int (get_music ()->get_mus_property ("repeat-count"));
done_count_ = 0;
}
Volta_repeat_iterator::add_repeat_command (SCM what)
{
SCM reps = ly_symbol2scm ("repeatCommands");
- SCM current_reps = report_to_l ()->internal_get_property (reps);
+ SCM current_reps = report_to ()->internal_get_property (reps);
- Translator_group * where = report_to_l ()->where_defined (reps);
+ Translator_group * where = report_to ()->where_defined (reps);
if (where
&& current_reps == SCM_EOL || gh_pair_p (current_reps))
{
{
if (alt_count_)
{
- String repstr = to_str (rep_count_ - alt_count_ + done_count_) + ".";
+ String repstr = to_string (rep_count_ - alt_count_ + done_count_) + ".";
if (done_count_ > 1)
{
add_repeat_command (scm_list_n (ly_symbol2scm ("volta"), SCM_BOOL_F, SCM_UNDEFINED));
if (done_count_ == 1 && alt_count_ < rep_count_)
{
- repstr = "1.--" + to_str (rep_count_ - alt_count_ + done_count_) + ".";
+ repstr = "1.--" + to_string (rep_count_ - alt_count_ + done_count_) + ".";
}
if (done_count_ <= alt_count_)
add_repeat_command (scm_list_n (ly_symbol2scm ("volta"),
- ly_str02scm (repstr.ch_C ()), SCM_UNDEFINED));
+ ly_str02scm (repstr.to_str0 ()), SCM_UNDEFINED));
}
else
{
class Vertical_align_engraver : public Engraver
{
- Spanner * valign_p_;
+ Spanner * valign_;
bool qualifies_b (Grob_info) const;
public:
TRANSLATOR_DECLARATIONS(Vertical_align_engraver);
Vertical_align_engraver::Vertical_align_engraver ()
{
- valign_p_ =0;
+ valign_ =0;
}
void
Vertical_align_engraver::initialize ()
{
- valign_p_ =new Spanner (get_property ("VerticalAlignment"));
- valign_p_->set_bound (LEFT,unsmob_grob (get_property ("currentCommandColumn")));
- announce_grob(valign_p_ , SCM_EOL);
+ valign_ =new Spanner (get_property ("VerticalAlignment"));
+ valign_->set_bound (LEFT,unsmob_grob (get_property ("currentCommandColumn")));
+ announce_grob(valign_ , SCM_EOL);
}
void
Vertical_align_engraver::finalize ()
{
- valign_p_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
- typeset_grob (valign_p_);
- valign_p_ =0;
+ valign_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
+ typeset_grob (valign_);
+ valign_ =0;
}
bool
Vertical_align_engraver::qualifies_b (Grob_info i) const
{
- int sz = i.origin_trans_l_arr ((Translator*)this).size () ;
+ int sz = i.origin_transes ((Translator*)this).size () ;
- return sz > 1 && Axis_group_interface::has_interface (i.grob_l_)
- && !i.grob_l_->get_parent (Y_AXIS) && Axis_group_interface::axis_b (i.grob_l_, Y_AXIS);
+ return sz > 1 && Axis_group_interface::has_interface (i.grob_)
+ && !i.grob_->get_parent (Y_AXIS) && Axis_group_interface::axis_b (i.grob_, Y_AXIS);
}
void
{
if (qualifies_b (i))
{
- Align_interface::add_element (valign_p_,i.grob_l_, get_property ("verticalAlignmentChildCallback"));
+ Align_interface::add_element (valign_,i.grob_, get_property ("verticalAlignmentChildCallback"));
}
}
if (gh_equal_p (s, ly_symbol2scm ("always"))
|| (s == SCM_EOL
- && daddy_trans_l_->id_str_.left_str (3) == "two"
+ && daddy_trans_->id_string_.left_string (3) == "two"
&& (to_boolean (get_property ("unison"))
|| to_boolean (get_property ("unisilence")))))
{
soloADue requirement */
if (s == ly_symbol2scm ("always")
|| (s == SCM_EOL
- && daddy_trans_l_->id_str_.left_str (3) == "two"
+ && daddy_trans_->id_string_.left_string (3) == "two"
&& (to_boolean (get_property ("unison"))
|| to_boolean (get_property ("unisilence")))))
#else
if (s == ly_symbol2scm ("always")
|| (s == SCM_EOL
&& to_boolean (get_property ("soloADue"))
- && ((daddy_trans_l_->id_str_.left_str (3) == "two"
+ && ((daddy_trans_->id_string_.left_string (3) == "two"
&& (to_boolean (get_property ("unison"))
|| to_boolean (get_property ("unisilence"))))
#endif
for (char const **p = junk_interfaces; *p; p++)
- if (i.grob_l_->internal_has_interface (ly_symbol2scm (*p)))
+ if (i.grob_->internal_has_interface (ly_symbol2scm (*p)))
{
- i.grob_l_->suicide ();
+ i.grob_->suicide ();
return;
}
}
Volta_bracket_interface::brew_molecule (SCM smob)
{
Grob *me = unsmob_grob (smob);
- Link_array<Item> bar_arr
+ Link_array<Item> bars
= Pointer_group_interface__extract_grobs (me, (Item*)0, "bars");
- if (!bar_arr.size ())
+ if (!bars.size ())
return SCM_EOL;
- Spanner *orig_span = dynamic_cast<Spanner*> (me->original_l_);
+ Spanner *orig_span = dynamic_cast<Spanner*> (me->original_);
- bool first_bracket = orig_span && (orig_span->broken_into_l_arr_[0] == (Spanner*)me);
+ bool first_bracket = orig_span && (orig_span->broken_intos_[0] == (Spanner*)me);
- bool last_bracket = orig_span && (orig_span->broken_into_l_arr_.top () == (Spanner*)me);
+ bool last_bracket = orig_span && (orig_span->broken_intos_.top () == (Spanner*)me);
bool no_vertical_start = orig_span && !first_bracket;
bool no_vertical_end = orig_span && !last_bracket;
else
return SCM_EOL;
- const char* cs = str.ch_C();
+ const char* cs = str.to_str0 ();
no_vertical_end |=
(strcmp(cs,":|")!=0 && strcmp(cs,"|:")!=0 && strcmp(cs,"|.")!=0
&& strcmp(cs,":|:")!=0 && strcmp(cs,".|")!=0);
- Real staff_thick = me->paper_l ()->get_var ("linethickness");
+ Real staff_thick = me->get_paper ()->get_var ("linethickness");
Real half_space = 0.5;
Item * bound = dynamic_cast<Spanner*> (me)->get_bound (LEFT);
Real left =0.;
if (bound->break_status_dir () == RIGHT)
{
- Paper_column *pc = bound->column_l ();
+ Paper_column *pc = bound->get_column ();
left = pc->extent (pc, X_AXIS)[RIGHT] - bound->relative_coordinate (pc, X_AXIS);
}
else
virtual void process_acknowledged_grobs ();
Moment started_mom_;
- Spanner *volta_span_p_;
- Spanner *end_volta_span_p_;
+ Spanner *volta_span_;
+ Spanner *end_volta_span_;
SCM staff_;
- SCM start_str_;
+ SCM start_string_;
};
Volta_engraver::Volta_engraver ()
{
staff_ = SCM_EOL;
- volta_span_p_ = 0;
- end_volta_span_p_ = 0;
+ volta_span_ = 0;
+ end_volta_span_ = 0;
}
SCM cs = get_property ("repeatCommands");
bool end = false;
- start_str_ = SCM_EOL;
+ start_string_ = SCM_EOL;
while (gh_pair_p (cs))
{
SCM c = ly_car (cs);
if (ly_cadr (c) == SCM_BOOL_F)
end = true;
else
- start_str_ = ly_cadr (c);
+ start_string_ = ly_cadr (c);
}
cs = ly_cdr (cs);
}
- if (volta_span_p_)
+ if (volta_span_)
{
SCM l (get_property ("voltaSpannerDuration"));
Moment now = now_mom ();
}
- if (end && !volta_span_p_)
+ if (end && !volta_span_)
{
warning (_ ("No volta spanner to end")); // fixme: be more verbose.
}
else if (end)
{
- end_volta_span_p_ = volta_span_p_;
- volta_span_p_ =0;
+ end_volta_span_ = volta_span_;
+ volta_span_ =0;
}
- if (gh_string_p (start_str_) && volta_span_p_)
+ if (gh_string_p (start_string_) && volta_span_)
{
warning (_ ("Already have a volta spanner. Stopping that one prematurely."));
- if (end_volta_span_p_)
+ if (end_volta_span_)
{
warning (_ ("Also have a stopped spanner. Giving up."));
return ;
}
- end_volta_span_p_ = volta_span_p_;
- volta_span_p_ = 0;
+ end_volta_span_ = volta_span_;
+ volta_span_ = 0;
}
}
void
Volta_engraver::process_acknowledged_grobs ()
{
- if (!volta_span_p_ && gh_string_p (start_str_))
+ if (!volta_span_ && gh_string_p (start_string_))
{
started_mom_ = now_mom () ;
- volta_span_p_ = new Spanner (get_property ("VoltaBracket"));
+ volta_span_ = new Spanner (get_property ("VoltaBracket"));
- announce_grob (volta_span_p_, SCM_EOL);
- volta_span_p_->set_grob_property ("text", start_str_);
+ announce_grob (volta_span_, SCM_EOL);
+ volta_span_->set_grob_property ("text", start_string_);
}
}
void
Volta_engraver::acknowledge_grob (Grob_info i)
{
- if (Item* item = dynamic_cast<Item*> (i.grob_l_))
+ if (Item* item = dynamic_cast<Item*> (i.grob_))
{
if (Note_column::has_interface (item))
{
- if (volta_span_p_)
- Volta_bracket_interface::add_column (volta_span_p_,item);
+ if (volta_span_)
+ Volta_bracket_interface::add_column (volta_span_,item);
}
if (Bar_line::has_interface (item))
{
- if (volta_span_p_)
- Volta_bracket_interface::add_bar (volta_span_p_, item);
- if (end_volta_span_p_)
- Volta_bracket_interface::add_bar (end_volta_span_p_ , item);
+ if (volta_span_)
+ Volta_bracket_interface::add_bar (volta_span_, item);
+ if (end_volta_span_)
+ Volta_bracket_interface::add_bar (end_volta_span_ , item);
}
}
- else if (Staff_symbol::has_interface (i.grob_l_))
+ else if (Staff_symbol::has_interface (i.grob_))
{
/*
We only want to know about a single staff: then we add to the
staff_ = SCM_UNDEFINED;
if (staff_ != SCM_UNDEFINED)
- staff_ = i.grob_l_->self_scm();
+ staff_ = i.grob_->self_scm();
}
}
void
Volta_engraver::finalize ()
{
- if (volta_span_p_)
+ if (volta_span_)
{
- typeset_grob (volta_span_p_);
+ typeset_grob (volta_span_);
}
- if (end_volta_span_p_)
+ if (end_volta_span_)
{
- typeset_grob (end_volta_span_p_);
+ typeset_grob (end_volta_span_);
}
}
void
Volta_engraver::stop_translation_timestep ()
{
- if (end_volta_span_p_)
+ if (end_volta_span_)
{
- typeset_grob (end_volta_span_p_);
- end_volta_span_p_ =0;
+ typeset_grob (end_volta_span_);
+ end_volta_span_ =0;
}
}
void
progress_indication (String s)
{
- fputs (s.ch_C(), stderr);
+ fputs (s.to_str0 (), stderr);
fflush (stderr);
}