2005-03-16 Jan Nieuwenhuizen <janneke@gnu.org>
+ * Nitpick run.
+
+ * buildscripts/fixcc.py: Update.
+
Builddir run fixes.
* HACKING (datadir): Add VERSION.
# TODO
# * maintainable rules: regexp's using whitespace (?x) and match names
# <identifier>)
-# * trailing * vs function definition
+# * trailing `*' vs. function definition
+# * do not break/change indentation of fixcc-clean files
# * check lexer, parser
# * rewrite in elisp, add to cc-mode
+# * using regexes is broken by design
# * ?
# * profit
#('\)[ \t]*([^\w])', ')\\1'),
# delete space around operator
# ('([\w\(\)\]])([ \t]*)(::|\.)([ \t]*)([\w\(\)])', '\\1\\3\\5'),
- ('([\w\(\)\]])([ \t]*)(\.)([ \t]*)([\w\(\)])', '\\1\\3\\5'),
+ ('([\w\(\)\]])([ \t]*)(\.|->)([ \t]*)([\w\(\)])', '\\1\\3\\5'),
# delete space after operator
('(::)([ \t]*)([\w\(\)])', '\\1\\3'),
# delete superflous space around operator
# space around operator2
('([\w\)\]]) *(&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|>|=|/|:|&|\||\*) ([^\w\s])', '\\1 \\2 \\3'),
# space around operator3
- ('([^\w\s]) (&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|>|=|/|:|&|\||\*) *([\w\(])', '\\1 \\2 \\3'),
+ ('([^\w\s]) (&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|[^-]>|=|/|:|&|\||\*) *([\w\(])', '\\1 \\2 \\3'),
+ # space around operator4
+ ('([\w\(\)\]]) (\*|/|\+|-) *([-:])', '\\1 \\2 \\3'),
# space around +/-; exponent
('([\w\)\]])(\+|-)([_A-Za-z\(])', '\\1 \\2 \\3'),
('([_\dA-Za-df-z\)\]])(\+|-)([\w\(])', '\\1 \\2 \\3'),
# trailing operator
(' (::|&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|>|\+|-|=|/|:|&XXX|\||\*XXX)[ \t]*\n([ \t]*)', '\n\\2\\1 '),
- #breaks function definitions
- #to#(' (::|&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|<|>|\+|-|=|/|&|\||\*)[ \t]*\n([ \t]*)', '\n\\2\\1 '),
# pointer
- ('(bool|char|const|delete|int|stream|unsigned|void|(struct \w+)|([A-Z]\w*)|[,]|&&|\|\|)[ \t]*(\*|&)[ \t]*', '\\1 \\4'),
+ ##('(bool|char|const|delete|int|stream|unsigned|void|size_t|struct \w+|[A-Z]\w*|,|;|&&|<|[^-]>|\|\||-|\+)[ \t]*(\*|&)[ \t]*', '\\1 \\2'),
+ ('(bool|char|const|delete|int|stream|unsigned|void|size_t|struct \w+|[A-Z]\w*|,|;|:|=|\?\)|&&|<|[^-]>|\|\||-|\+)[ \t]*(\*|&)[ \t]*', '\\1 \\2'),
#to#('(bool|char|const|delete|int|stream|unsigned|void|([A-Z]\w*)|[,])[ \n\t]*(\*|&)[ \t]*', '\\1 \\3'),
# pointer with template
- ('(( *((bool|char|delete|int|stream|unsigned|void|(class[ \t]+\w*)|([A-Z]\w*)|[,])[ \*&],*)+)>) *(\*|&) *', '\\1 \\7'),
+ ('(( *((bool|char|const|delete|int|stream|unsigned|void|size_t|class[ \t]+\w*|[A-Z]\w*|\w+::\w+|[,])[ \*&],*)+)>) *(\*|&) *', '\\1 \\5'),
#to#('(( *((bool|char|delete|int|stream|unsigned|void|(class[ \t]+\w*)|([A-Z]\w*)|[,])[ \*&],*)+)>)[ \t\n]*(\*|&) *', '\\1 \\7'),
# unary pointer, minus, not
('(return|=) (\*|&|-|!) ([\w\(])', '\\1 \\2\\3'),
# space after `operator'
('(\Woperator) *([^\w\s])', '\\1 \\2'),
+ # dangling brace close
+ ('\n[ \t]*(\n[ \t]*})', '\\1'),
# dangling newline
('\n[ \t]*\n[ \t]*\n', '\n\n'),
# dangling parenthesis open
('(typedef struct\s+([\w]*\s){([^}]|{[^}]*})*})\s*\n\s*(\w[\w\d]*;)', '\\1 \\4'),
# delete spaces around template brackets
#('(dynamic_cast|template|([A-Z]\w*))[ \t]*<[ \t]*(( *(bool|char|int|unsigned|void|(class[ \t]+\w*)|([A-Z]\w*)),?)+)[ \t]?(| [\*&])[ \t]*>', '\\1<\\3\\8>'),
- ('(dynamic_cast|template|([A-Z]\w*))[ \t]*<[ \t]*(( *(bool|char|int|unsigned|void|(class[ \t]+\w*)|([A-Z]\w*))[,\*&]*)+)[ \t]?(| [\*&])[ \t]*>', '\\1<\\3\\8>'),
+ ('(dynamic_cast|template|typedef|\w+::\w+|[A-Z]\w*)[ \t]*<[ \t]*(( *(bool|char|const|int|unsigned|void|size_t|class[ \t]+\w*|[A-Z]\w*)( *[\*&]?,|[\*&])*)+)[ \t]?(| [\*&])[ \t]*>', '\\1<\\2\\6>'),
+ ('(\w+::\w+|[A-Z]\w*) < ((\w+::\w+|[A-Z]\w*)<[A-Z]\w*>) >', '\\1<\\2 >'),
('((if|while)\s+\(([^\)]|\([^\)]*\))*\))\s*;', '\\1\n;'),
('(for\s+\(([^;]*;[^;]*;([^\)]|\([^\)]*\))*)\))\s*;', '\\1\n;'),
- # do .. while
- ('(\Wdo\s*{([^}]|{[^}]*})*}\s*while\s*)(\(([^\)]|\([^\)]*\))*\))\s*;', '\\1\\3;\n'),
+ # do {..} while
+ ('(}\s*while\s*)(\(([^\)]|\([^\)]*\))*\))\s*;', '\\1\\2;'),
+
## Fix code that gets broken by rules above.
+ ##('->\s+\*', '->*'),
# delete space before #define x()
('#[ \t]*define (\w*)[ \t]*\(', '#define \\1('),
# add space in #define x ()
nitpick_file (outdir, i)
+## TODO: make this compilable and check with g++
TEST = '''
+#include <libio.h>
+#include <map>
+class
+ostream ;
+
+class Foo {
+public: static char* foo ();
+std::map<char*,int>* bar (char, char) { return 0; }
+};
+typedef struct
+{
+ Foo **bar;
+} String;
+
ostream &
operator << (ostream & os, String d);
typedef struct _t_ligature
{
char *succ, *lig;
- struct _t_ligature *next;
struct _t_ligature * next;
} AFM_Ligature;
-
+
+typedef std::map < AFM_Ligature const *, int > Bar;
+
+/* ||
+ * vv
+ * !OK OK
+ */
+/* ||
+ vv
+ !OK OK
+ */
char *
-Bar:: foe ()
+Foo:: foo ()
{
- char* a= ++ 3 ;
- a [x] = foe (*i, &bar) *
+int
+i
+;
+ char* a= &++ i ;
+ a [*++ a] = (char*) foe (*i, &bar) *
2;
int operator double ();
- int x =foe(1 ,3);
- Interval_t<T> &operator*= (T r);
+ std::map<char*,int> y =*bar(-*a ,*b);
+ Interval_t<T> & operator*= (T r);
+ Foo<T>*c;
int compare (Pqueue_ent < K, T > const& e1, Pqueue_ent < K,T> *e2);
delete *p;
if (abs (f)*2 > abs (d) *FUDGE)
;
while (0);
- for (; i < x (); foo > bar);
- for (; i < x > y;
- foo > bar)
+ for (; i<x foo(); foo>bar);
+ for (; *p && > y;
+ foo > bar)
;
do {
- ..
+ ;;;
}
while (foe);
squiggle. extent;
-
1 && * unsmob_moment (lf);
-
- line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm
+ line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->*self_scm
(): SCM_EOL);
-
case foo: k;
- typedef struct
- {
- ...
- } cookie_io_functions_t;
-
-
if (0) {a=b;} else {
c=d;
}
...
};
+ int compare (Array < Pitch> *, Array < Pitch> *);
+ original_ = (Grob *) & s;
+ Drul_array< Link_array<Grob> > o;
}
+
+ header_.char_info_pos = (6 + header_length) * 4;
+ return ly_bool2scm (*ma < * mb);
+
+ 1 *::sign(2);
+
+ (shift) *-d;
+
+ a = 0 ? *x : *y;
'''
def test ():
}
if (!optional_argument_str0_)
report (E_ARGEXPECT);
-
}
else
{
}
const Long_option_init *
-Getopt_long::operator() ()
+Getopt_long::operator () ()
{
if (!ok ())
return 0;
argument_index_ = 0;
// reached end of option table?
- table_len_ =0;
- for (int i = 0; option_a_[i].longname_str0_ ||option_a_[i].shortname_char_; i++)
+ table_len_ = 0;
+ for (int i = 0; option_a_[i].longname_str0_ || option_a_[i].shortname_char_; i++)
table_len_++;
-
}
bool
if (a)
{
array_index_++;
- argument_index_= 0;
+ argument_index_ = 0;
}
return a;
}
Array (T *tp, int n)
{
array_ = new T[n];
- max_ =size_ = n;
+ max_ = size_ = n;
arrcpy (array_, tp, n);
}
Array ()
- { array_ = 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)
{
return array_;
}
- void operator= (Array const &src)
+ void operator = (Array const &src)
{
set_size (src.size_);
arrcpy (array_, src.array_, size_);
T *remove_array ();
/// access element
- T &operator[] (int i)
+ T &operator [] (int i)
{
return elem_ref (i);
}
/// access element
- T const &operator[] (int i) const
+ T const &operator [] (int i) const
{
return elem_ref (i);
}
/// access element
T &elem_ref (int i) const
{
- assert (i >=0 && i < size_);
+ assert (i >= 0 && i < size_);
return ((T *)array_)[i];
}
/// access element
void push (T x)
{
if (size_ == max_)
- remax (2*max_ + 1);
+ remax (2 * max_ + 1);
// T::operator= (T &) is called here. Safe to use with automatic
// vars
void swap (int i, int j)
{
T t ((*this)[i]);
- (*this)[i]= (*this)[j];
+ (*this)[i] = (*this)[j];
(*this)[j] = t;
}
bool is_empty () const
}
void del (int i)
{
- assert (i >=0&& i < size_);
+ assert (i >= 0&& i < size_);
arrcpy (array_ + i, array_ + i + 1, size_ - i - 1);
size_--;
}
template<class T> INLINE void
Array<T>::insert (T k, int j)
{
- assert (j >=0 && j<= size_);
+ assert (j >= 0 && j <= size_);
set_size (size_ + 1);
for (int i = size_ - 1; i > j; i--)
array_[i] = array_[i - 1];
return;
swap (lower, (lower + upper) / 2);
int last = lower;
- for (int i= lower +1; i <= upper; i++)
+ for (int i = lower +1; i <= upper; i++)
if (compare (array_[i], array_[lower]) < 0)
swap (++last, i);
swap (lower, last);
Array<T>::reverse ()
{
int h = size_ / 2;
- for (int i =0, j = size_ - 1; i < h; i++, j--)
+ for (int i = 0, j = size_ - 1; i < h; i++, j--)
swap (i, j);
}
void
Array<T>::OK () const
{
- assert (max_ >= size_ && size_ >=0);
+ assert (max_ >= size_ && size_ >= 0);
if (max_) assert (array_);
}
T *p = array_;
size_ = 0;
max_ = 0;
- array_ =0;
+ array_ = 0;
return p;
}
Array<T>
Array<T>::slice (int lower, int upper) const
{
- assert (lower >= 0 && lower <=upper&& upper <= size_);
+ assert (lower >= 0 && lower <= upper && upper <= size_);
Array<T> r;
- int s =upper - lower;
+ int s = upper - lower;
r.set_size (s);
arrcpy (r.array_, array_ + lower, s);
return r;
enum Axis
{
- X_AXIS =0,
- Y_AXIS =1,
+ X_AXIS = 0,
+ Y_AXIS = 1,
NO_AXES = 2,
};
prefix ONE_OPERATOR (type, function, <) \
prefix ONE_OPERATOR (type, function, <=) \
GPP_MINMAX (type, prefix) \
- prefix inline type max (type t1, type t2) { return (t1 > t2)? t1 : t2; } \
- prefix inline type min (type t1, type t2) { return (t1 < t2)? t1 : t2; } \
+ prefix inline type max (type t1, type t2) { return (t1 > t2) ? t1 : t2; } \
+ prefix inline type min (type t1, type t2) { return (t1 < t2) ? t1 : t2; } \
\
- prefix bool operator< (type t1, type t2) /* stupid fix to allow ; */
+ prefix bool operator < (type t1, type t2) /* stupid fix to allow ; */
#define INSTANTIATE_COMPARE(type, func) TEMPLATE_INSTANTIATE_COMPARE (type, func,)
Cons ()
{
car_ = 0;
- next_ =0;
+ next_ = 0;
}
- Cons (T *t, Cons<T>*c)
+ Cons (T *t, Cons<T> *c)
{
car_ = t;
next_ = c;
return i;
}
-
template<class T>
-Cons<T> * last_cons (Cons<T> * head)
+Cons<T> *last_cons (Cons<T> *head)
{
while (head && head->next_)
{
class Cons_list
{
public:
- Cons<T> * head_;
+ Cons<T> *head_;
Cons<T> ** nil_pointer_address_;
Cons_list ()
{
}
void init ()
{
- head_ =0;
+ head_ = 0;
nil_pointer_address_ = &head_;
}
void append (T *c)
void junk ()
{
delete head_;
- head_ =0;
+ head_ = 0;
}
~Cons_list ()
{
};
template<class T>
-void copy_killing_cons_list (Cons_list<T>&, Cons<T> *src);
+void copy_killing_cons_list (Cons_list<T> &, Cons<T> *src);
template<class T>
void
-clone_killing_cons_list (Cons_list<T>&, Cons<T> *src);
+clone_killing_cons_list (Cons_list<T> &, Cons<T> *src);
#endif /* CONS_HH */
}
inline Direction
-operator- (Direction const d)
+operator - (Direction const d)
{
return other_dir (d);
}
T array_[2];
T &elem_ref (Direction d)
{
- assert (d == 1 || d== -1);
+ assert (d == 1 || d == -1);
return array_[ (d + 1) / 2];
}
T elem (Direction d) const
{
- assert (d == 1 || d== -1);
+ assert (d == 1 || d == -1);
return array_[ (d + 1) / 2];
}
- T &operator[] (Direction d)
+ T &operator [] (Direction d)
{
return elem_ref (d);
}
- T operator[] (Direction d) const
+ T operator [] (Direction d) const
{
return elem (d);
}
template<class T>
void
-scale_drul (Drul_array<T> * dr, T x)
+scale_drul (Drul_array<T> *dr, T x)
{
dr->elem_ref (LEFT) *= x;
dr->elem_ref (RIGHT) *= x;
template<class T> struct Link_array;
template<class T> struct Array;
-template < class T, class K> struct Assoc;
-template < class K, class V> struct Hash_table;
-template < class K, class V> struct Hash_table_iter;
+template<class T, class K> struct Assoc;
+template<class K, class V> struct Hash_table;
+template<class K, class V> struct Hash_table_iter;
template<class T> struct Link_list;
template<class T> struct Interval_t;
template<class T> struct PQueue;
@return pointer to next option found.
0 if error occurred, or next argument is no option.
*/
- const Long_option_init *operator() ();
+ const Long_option_init *operator () ();
char const *current_arg ();
char const *get_next_arg ();
Interval_t (T m, T M) : Drul_array<T> (m, M)
{
}
- Interval_t<T> &operator-= (T r)
+ Interval_t<T> &operator -= (T r)
{
*this += -r;
return *this;
}
- Interval_t<T> &operator+= (T r)
+ Interval_t<T> &operator += (T r)
{
elem_ref (LEFT) += r;
- elem_ref (RIGHT) +=r;
+ elem_ref (RIGHT) += r;
return *this;
}
- Interval_t<T> &operator*= (T r)
+ Interval_t<T> &operator *= (T r)
{
if (!is_empty ())
{
elem_ref (RIGHT) *= r;
if (r < T (0))
swap ();
-
}
return *this;
}
T r = -elem (LEFT);
T l = -elem (RIGHT);
elem_ref (LEFT) = l;
- elem_ref (RIGHT) =r;
+ elem_ref (RIGHT) = r;
}
void swap ()
inclusion ordering. Crash if not comparable.
*/
template<class T>
-int Interval__compare (const Interval_t<T>&, Interval_t<T> const &);
+int Interval__compare (const Interval_t<T> &, Interval_t<T> const &);
/**
Inclusion ordering. return -2 if not comparable
*/
template<class T>
int
-_Interval__compare (const Interval_t<T>&a, Interval_t<T> const &b);
+_Interval__compare (const Interval_t<T> &a, Interval_t<T> const &b);
/*
INLINE
#include "compare.hh"
-TEMPLATE_INSTANTIATE_COMPARE (Interval_t<T>&, Interval__compare, template<class T>);
+TEMPLATE_INSTANTIATE_COMPARE (Interval_t<T> &, Interval__compare, template<class T>);
template<class T>
inline Interval_t<T>
{
a.intersect (b);
return a;
-
}
template<class T>
inline
-Interval_t<T> operator+ (T a, Interval_t<T> i)
+Interval_t<T> operator + (T a, Interval_t<T> i)
{
i += a;
return i;
template<class T>
inline
-Interval_t<T> operator- (Interval_t<T> i, T a)
+Interval_t<T> operator - (Interval_t<T> i, T a)
{
i += -a;
return i;
template<class T>
inline
-Interval_t<T> operator- (T a, Interval_t<T> i)
+Interval_t<T> operator - (T a, Interval_t<T> i)
{
i.negate ();
i += a;
template<class T>
inline
-Interval_t<T> operator+ (Interval_t<T> i, T a)
+Interval_t<T> operator + (Interval_t<T> i, T a)
{
return a + i;
}
template<class T>
inline
-Interval_t<T> operator* (T a, Interval_t<T> i)
+Interval_t<T> operator * (T a, Interval_t<T> i)
{
i *= a;
return i;
template<class T>
inline
-Interval_t<T> operator* (Interval_t<T> i, T a)
+Interval_t<T> operator * (Interval_t<T> i, T a)
{
- return a*i;
+ return a * i;
}
template<class T>
template<class T>
int
-_Interval__compare (const Interval_t<T>&a, Interval_t<T> const &b)
+_Interval__compare (const Interval_t<T> &a, Interval_t<T> const &b)
{
if (a.elem (LEFT) == b.elem (LEFT) && a.elem (RIGHT) == b.elem (RIGHT))
return 0;
}
#define INTERVAL__INSTANTIATE(T) struct Interval_t<T>; \
- template int Interval__compare (const Interval_t<T>&, Interval_t<T> const &)
+ template int Interval__compare (const Interval_t<T> &, Interval_t<T> const &)
#endif // INTERVAL_TCC
template<class T>
void
-clone_killing_cons_list (Cons_list<T> & dest, Cons<T> *src)
+clone_killing_cons_list (Cons_list<T> &dest, Cons<T> *src)
{
for (; src; src = src->next_)
{
ssize_t (*write) (void *, char const *, size_t);
int (*seek) (void *, off64_t *, int);
int (*close) (void *);
- }
- cookie_io_functions_t;
+ } cookie_io_functions_t;
#else
int (*write) (void *, char const *, int);
fpos_t (*seek) (void *, fpos_t, int);
int (*close) (void *);
- }
- cookie_io_functions_t;
+ } cookie_io_functions_t;
#endif /* ! HAVE_FUNOPEN */
#endif /* ! HAVE_LIBIO_H */
public:
Real coordinate_a_[NO_AXES];
- Real &operator[] (Axis i)
+ Real &operator [] (Axis i)
{
return coordinate_a_[i];
}
- Real operator[] (Axis i) const
+ Real operator [] (Axis i) const
{
return coordinate_a_[i];
}
- Offset &operator+= (Offset o)
+ Offset &operator += (Offset o)
{
(*this)[X_AXIS] += o[X_AXIS];
(*this)[Y_AXIS] += o[Y_AXIS];
return *this;
}
- Offset operator- () const
+ Offset operator - () const
{
Offset o = *this;
return o;
}
- Offset &operator-= (Offset o)
+ Offset &operator -= (Offset o)
{
(*this)[X_AXIS] -= o[X_AXIS];
(*this)[Y_AXIS] -= o[Y_AXIS];
return *this;
}
- Offset &operator*= (Real a)
+ Offset &operator *= (Real a)
{
(*this)[X_AXIS] *= a;
(*this)[Y_AXIS] *= a;
Offset (Real ix, Real iy)
{
- coordinate_a_[X_AXIS] =ix;
- coordinate_a_[Y_AXIS] =iy;
+ coordinate_a_[X_AXIS] = ix;
+ coordinate_a_[Y_AXIS] = iy;
}
Offset ()
{
- coordinate_a_[X_AXIS] = coordinate_a_[Y_AXIS]= 0.0;
+ coordinate_a_[X_AXIS] = coordinate_a_[Y_AXIS] = 0.0;
}
String to_string () const;
Real arg () const;
Real length () const;
- Offset operator*= (Offset z2)
+ Offset operator *= (Offset z2)
{
*this = complex_multiply (*this, z2);
return *this;
}
-
};
IMPLEMENT_ARITHMETIC_OPERATOR (Offset, +);
IMPLEMENT_ARITHMETIC_OPERATOR (Offset, *);
inline Offset
-operator* (Real o1, Offset o2)
+operator * (Real o1, Offset o2)
{
o2 *= o1;
return o2;
}
inline Offset
-operator* (Offset o1, Real o2)
+operator * (Offset o1, Real o2)
{
o1 *= o2;
return o1;
}
/// access element
- T *&operator[] (int i)
+ T *&operator [] (int i)
{
return (T *&) Array<void *>::elem_ref (i);
}
/// access element
- T *const operator[] (int i) const
+ T *const operator [] (int i) const
{
return (T *const) Array<void *>::elem (i);
}
void substitute (T *old, T *new_p)
{
int i;
- while ((i = find_index (old)) >=0)
+ while ((i = find_index (old)) >= 0)
if (new_p)
- elem_ref (i) =new_p;
+ elem_ref (i) = new_p;
else
del (i);
}
void unordered_substitute (T *old, T *new_p)
{
int i;
- while ((i = find_index (old)) >=0)
+ while ((i = find_index (old)) >= 0)
if (new_p)
- elem_ref (i) =new_p;
+ elem_ref (i) = new_p;
else
{
unordered_del (i);
}
-
}
void default_sort ()
{
}
};
-template < class T, class V>
+template<class T, class V>
Link_array<T>
typecasts (Link_array<V> const &a, T * /* dummy */)
{
return;
swap (lower, (lower + upper) / 2);
int last = lower;
- for (int i= lower +1; i <= upper; i++)
+ for (int i = lower +1; i <= upper; i++)
if (compare (elem (i), elem (lower)) < 0)
swap (++last, i);
swap (lower, last);
lo = cmp;
}
while (hi - lo > 1);
+
if (!compare (t, arr[lo]))
return lo;
else
{
int cmp;
int result;
- if (hi< 0)
+ if (hi < 0)
hi = arr.size ();
if (hi == 0)
lo = cmp;
}
while (hi - lo > 1);
+
if (!compare (t, arr[lo]))
return lo;
else
{
char *succ, *lig;
struct _t_ligature *next;
-}
- AFM_Ligature;
+} AFM_Ligature;
/* Character Metric Information. This structure is used only if ALL
* character metric information is requested. If only the character
*/
typedef struct
{
- int code, /* key: C */
- wx, /* key: WX */
+ int code, /* key: C */
+ wx, /* key: WX */
wy; /* together wx and wy are associated with key: W */
char *name; /* key: N */
AFM_BBox charBBox; /* key: B */
}
AFM_Font_info;
-
/************************* PROCEDURES ****************************/
/* Call this procedure to do the grunt work of parsing an AFM file.
/// eliminate #x# close to zero
void real_clean ();
void scalarmultiply (Real fact);
- void operator*= (Real f) { scalarmultiply (f); }
- void operator/= (Real f) { scalarmultiply (1 / f); }
- void operator+= (Polynomial const &p2);
- void operator*= (Polynomial const &p2);
- void operator-= (Polynomial const &p2);
- Polynomial (Real a, Real b =0.0);
+ void operator *= (Real f) { scalarmultiply (f); }
+ void operator /= (Real f) { scalarmultiply (1 / f); }
+ void operator += (Polynomial const &p2);
+ void operator *= (Polynomial const &p2);
+ void operator -= (Polynomial const &p2);
+ Polynomial (Real a, Real b = 0.0);
Polynomial (){}
void set_negate (const Polynomial &src);
IMPLEMENT_ARITHMETIC_OPERATOR (Polynomial, *);
inline Polynomial
-operator* (Polynomial p, Real a)
+operator * (Polynomial p, Real a)
{
- p *=a;
+ p *= a;
return p;
}
inline Polynomial
-operator* (Real a, Polynomial p)
+operator * (Real a, Polynomial p)
{
- p *=a;
+ p *= a;
return p;
}
#endif
#define PQUEUE_HH
#include "array.hh"
-template < class K, class T>
+template<class K, class T>
struct PQueue_ent
{
T val;
K key;
};
-template < class K, class T>
-int compare (PQueue_ent < K, T> const &e1, PQueue_ent < K, T> const &e2)
+template<class K, class T>
+int compare (PQueue_ent<K, T> const &e1, PQueue_ent<K, T> const &e2)
{
return compare (e1.key, e2.key);
}
priority might fuck up the invariants
@param 1 <= i < size () */
- T &operator[] (int i) { return heap_array_[i]; }
- T operator[] (int i) const { return heap_array_[i]; }
+ T &operator [] (int i) { return heap_array_[i]; }
+ T operator [] (int i) const { return heap_array_[i]; }
void OK () const
{
#ifndef NDEBUG
- for (int i =2; i <= size (); i++)
+ for (int i = 2; i <= size (); i++)
assert (compare (elt (i / 2), elt (i)) <= 0);
#endif
}
while (mini < size ())
{
- if (compare (elt (mini + 1), elt (mini)) <0)
+ if (compare (elt (mini + 1), elt (mini)) < 0)
mini++;
if (compare (last, elt (mini)) < 0)
break;
// operator bool () const;
int to_int () const;
operator double () const;
- Rational operator- () const;
+ Rational operator - () const;
/**
Initialize to 0.
*/
Rational (int, int);
Rational (double);
Rational (Rational const &r) { copy (r);}
- Rational &operator= (Rational const &r)
+ Rational &operator = (Rational const &r)
{
copy (r); return *this;
}
- Rational &operator*= (Rational);
- Rational &operator/= (Rational);
- Rational &operator+= (Rational);
- Rational &operator-= (Rational);
- Rational &operator%= (Rational);
+ Rational &operator *= (Rational);
+ Rational &operator /= (Rational);
+ Rational &operator += (Rational);
+ Rational &operator -= (Rational);
+ Rational &operator %= (Rational);
static int compare (Rational const &, Rational const &);
int sign () const;
String to_string () const;
#if 0
ostream &
-operator<< (ostream &, Rational);
+operator << (ostream &, Rational);
#endif
const Rational infinity_rat = INT_MAX;
template<class T> inline T sqr (T x)
{
- return x*x;
+ return x * x;
}
template<class T> inline T min (T x, T y)
/// concatenation.
void append (Byte const *byte, int length_i);
- void operator+= (char const *str0);
+ void operator += (char const *str0);
char const *to_str0 () const;
/** access element. not really safe. Can alter length_ without
#String_data# knowing it. */
- Byte &operator[] (int j);
- Byte operator[] (int j) const;
+ Byte &operator [] (int j);
+ Byte operator [] (int j) const;
bool is_binary_bo () const;
};
INLINE
void
-String_data::operator+= (char const *str0)
+String_data::operator += (char const *str0)
{
append ((Byte const *)str0, strlen (str0));
}
}
INLINE Byte &
-String_data::operator[] (int j)
+String_data::operator [] (int j)
{
assert (j >= 0 && j <= length_);
return data_byte_[j];
}
INLINE Byte
-String_data::operator[] (int j) const
+String_data::operator [] (int j) const
{
assert (j >= 0 && j <= length_);
return data_byte_[j];
}
-
#endif // __STRING_UTIL_CC //
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;
+ 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 to_bytes ()
*/
- Byte &operator[] (int j);
+ Byte &operator [] (int j);
void append (Byte const *byte, int length_i);
void set (Byte const *byte, int length_i);
- void operator= (char const *p);
+ void operator = (char const *p);
void trunc (int j);
int length () const;
};
INLINE void
String_handle::copy ()
{
- if (data->ref_count_ !=1)
+ if (data->ref_count_ != 1)
{
String_data *newdata = new String_data (*data);
down ();
}
INLINE void
-String_handle::operator= (String_handle const &src)
+String_handle::operator = (String_handle const &src)
{
if (this == &src)
return;
}
INLINE void
-String_handle::operator+= (char const *s)
+String_handle::operator += (char const *s)
{
copy ();
*data += s;
}
INLINE Byte
-String_handle::operator[] (int j) const
+String_handle::operator [] (int j) const
{
return (*data)[j];
}
// !NOT SAFE!
// don't use this for loops. Use to_bytes ()
INLINE Byte &
-String_handle::operator[] (int j)
+String_handle::operator [] (int j)
{
copy (); // hmm. Not efficient
return data->get_bytes ()[j];
}
INLINE void
-String_handle::operator= (char const *p)
+String_handle::operator = (char const *p)
{
copy ();
data->set (p);
char *get_str0 ();
Byte *get_bytes ();
- String &operator= (String const &source);
+ String &operator = (String const &source);
/// concatenate s
- void operator+= (char const *s) { strh_ += s; }
- void operator+= (String s);
+ void operator += (char const *s) { strh_ += s; }
+ void operator += (String s);
bool is_empty () const;
/**
Return a char. UNSAFE because it may change strlen () result
*/
- char &operator[] (int n);
- char operator[] (int n) const;
+ char &operator [] (int n);
+ char operator [] (int n) const;
/// return n leftmost chars
String left_string (int n) const;
#ifdef STREAM_SUPPORT
/// provide Stream output
- void print_on (ostream& os) const;
+ void print_on (ostream &os) const;
#endif
/// the length of the string
#endif
// because char const* also has an operator ==, this is for safety:
-inline bool operator== (String s1, char const *s2)
+inline bool operator == (String s1, char const *s2)
{
return s1 == String (s2);
}
-inline bool operator== (char const *s1, String s2)
+inline bool operator == (char const *s1, String s2)
{
return String (s1) == s2;
}
-inline bool operator!= (String s1, char const *s2)
+inline bool operator != (String s1, char const *s2)
{
return s1 != String (s2);
}
-inline bool operator!= (char const *s1, String s2)
+inline bool operator != (char const *s1, String s2)
{
- return String (s2) !=s1;
+ return String (s2) != s1;
}
IMPLEMENT_ARITHMETIC_OPERATOR (String, +);
#ifdef STREAM_SUPPORT
-ostream &operator<< (ostream& os, String d);
+ostream &operator << (ostream &os, String d);
#endif
#endif
INLINE
char &
-String::operator[] (int n)
+String::operator [] (int n)
{
return (char &) strh_[n];
}
INLINE
char
-String::operator[] (int n) const
+String::operator [] (int n) const
{
return strh_[n];
}
virtual Base *clone () const \
{ \
/* return new name (*this); */ \
- Base *urg = (Base*) this; \
+ Base *urg = (Base *) this; \
return urg->clone_const_helper (); \
}
#endif /* ! HAVE_FUNOPEN */
#endif /* ! HAVE_FOPENCOOKIE */
-
} /* extern C */
Offset z;
if (!isinf_b (z2[Y_AXIS]))
{
- z[X_AXIS] = z1[X_AXIS] * z2[X_AXIS] - z1[Y_AXIS]*z2[Y_AXIS];
+ z[X_AXIS] = z1[X_AXIS] * z2[X_AXIS] - z1[Y_AXIS] * z2[Y_AXIS];
z[Y_AXIS] = z1[X_AXIS] * z2[Y_AXIS] + z1[Y_AXIS] * z2[X_AXIS];
}
return z;
Real r = exp (o[X_AXIS]);
- return Offset (r*c, r*s);
+ return Offset (r * c, r * s);
}
Real
ident[idx] = 0;
return (ident); /* returns pointer to the token */
-
} /* token */
/*************************** linetoken *************************/
ident[idx] = 0;
return (ident); /* returns pointer to the token */
-
} /* linetoken */
/*************************** recognize *************************/
} /* while */
return (error);
-
} /* parseGlobals */
#if 0
fseek (fp, opos, 0);
return (error);
-
} /* initializeArray */
#endif
} /* while */
return (error);
-
} /* parseCharWidths */
/************************* parseCharMetrics ************************/
error = AFM_parseError;
}
return (error);
-
} /* parseCharMetrics */
/************************* parseAFM_TrackKernData ***********************/
error = AFM_parseError;
return (error);
-
} /* parseAFM_TrackKernData */
/************************* parseAFM_PairKernData ************************/
error = AFM_parseError;
return (error);
-
} /* parseAFM_PairKernData */
/************************* parseAFM_CompCharData **************************/
error = AFM_parseError;
return (error);
-
} /* parseAFM_CompCharData */
-
/*************************** 'PUBLIC' FUNCTION ********************/
void
if ((error != AFM_earlyEOF) && (code < 0))
error = code;
-
} /* while */
if ((error != AFM_earlyEOF) && (code < 0))
if (ident != NULL) { free (ident); ident = NULL; }
return (error);
-
} /* parseFile */
{
Polynomial dest;
- int deg= p1.degree () + p2.degree ();
+ int deg = p1.degree () + p2.degree ();
for (int i = 0; i <= deg; i++)
{
dest.coefs_.push (0);
void
Polynomial::differentiate ()
{
- for (int i = 1; i<= degree (); i++)
+ for (int i = 1; i <= degree (); i++)
{
coefs_[i - 1] = coefs_[i] * i;
}
}
void
-Polynomial::operator+= (Polynomial const &p)
+Polynomial::operator += (Polynomial const &p)
{
while (degree () < p.degree ())
coefs_.push (0.0);
}
void
-Polynomial::operator-= (Polynomial const &p)
+Polynomial::operator -= (Polynomial const &p)
{
while (degree () < p.degree ())
coefs_.push (0.0);
p.differentiate ();
Real d = p.eval (x);
- if (abs (f) > abs (d) * FUDGE);
+ if (abs (f) > abs (d) * FUDGE)
+ ;
/*
warning ("x=%f is not a root of polynomial\n"
"f (x)=%f, f' (x)=%f \n", x, f, d); */
void
Polynomial::check_sols (Array<Real> roots) const
{
- for (int i = 0; i< roots.size (); i++)
+ for (int i = 0; i < roots.size (); i++)
check_sol (roots[i]);
}
sol.push (0);
sol.push (0);
sol.push (0);
- } else { /* one single and one double solution */
+ }
+ else { /* one single and one double solution */
Real u = cubic_root (-q);
sol.push (2 * u);
sol.push (-u);
}
- } else if (D < 0) { /* Casus irreducibilis: three real solutions */
+ }
+ else if (D < 0) { /* Casus irreducibilis: three real solutions */
Real phi = 1.0 / 3 * acos (-q / sqrt (-cb));
Real t = 2 * sqrt (-p);
sol.push (t * cos (phi));
sol.push (-t * cos (phi + M_PI / 3));
sol.push (-t * cos (phi - M_PI / 3));
- } else { /* one real solution */
+ }
+ else { /* one real solution */
Real sqrt_D = sqrt (D);
Real u = cubic_root (sqrt_D - q);
Real v = -cubic_root (sqrt_D + q);
}
void
-Polynomial:: operator*= (Polynomial const &p2)
+Polynomial::operator *= (Polynomial const &p2)
{
*this = multiply (*this, p2);
}
#ifdef STREAM_SUPPORT
ostream &
-operator<< (ostream &o, Rational r)
+operator << (ostream &o, Rational r)
{
o << r.string ();
return o;
{
sign_ = ::sign (n);
num_ = abs (n);
- den_= 1;
+ den_ = 1;
}
static inline
}
Rational
-Rational::operator- () const
+Rational::operator - () const
{
Rational r (*this);
r.negate ();
}
Rational &
-Rational::operator%= (Rational r)
+Rational::operator %= (Rational r)
{
*this = r.mod_rat (r);
return *this;
}
Rational &
-Rational::operator+= (Rational r)
+Rational::operator += (Rational r)
{
- if (is_infinity ());
+ if (is_infinity ())
+ ;
else if (r.is_infinity ())
{
*this = r;
}
else
{
- int n = sign_ * num_ *r.den_ + r.sign_ * den_ * r.num_;
+ int n = sign_ * num_ * r.den_ + r.sign_ * den_ * r.num_;
int d = den_ * r.den_;
sign_ = ::sign (n) * ::sign (d);
num_ = abs (n);
{
num_ = 0;
den_ = 1;
- sign_ =0;
+ sign_ = 0;
normalise ();
}
}
}
Rational &
-Rational::operator*= (Rational r)
+Rational::operator *= (Rational r)
{
sign_ *= ::sign (r.sign_);
if (r.is_infinity ())
}
Rational &
-Rational::operator/= (Rational r)
+Rational::operator /= (Rational r)
{
r.invert ();
return (*this *= r);
}
Rational &
-Rational::operator-= (Rational r)
+Rational::operator -= (Rational r)
{
r.negate ();
return (*this += r);
snprintf (buffer, STRING_BUFFER_LEN,
(fmt ? fmt : "%Ld"), i64); // assume radix 10
return String (buffer);
-
}
// breendet imp from String
double
hex_string = "0" + hex_string;
bin_string_r = "";
- Byte const *byte= hex_string.to_bytes ();
+ Byte const *byte = hex_string.to_bytes ();
int i = 0;
while (i < hex_string.length ())
{
{
Array<String> a;
int i = str.index (c);
- while (i >=0)
+ while (i >= 0)
{
String s = str.left_string (i);
a.push (s);
- while (str[++i] == c);
+ while (str[++i] == c)
+ ;
str = str.cut_string (i, INT_MAX);
i = str.index (c);
}
copying, constructing.
*/
String &
-String::operator= (String const &source)
+String::operator = (String const &source)
{
strh_ = source.strh_;
return *this;
strh_.append (s.to_bytes (), s.length ());
}
void
-String::operator+= (String s)
+String::operator += (String s)
{
append (s);
}
void const *me = (void const *) strh_.to_str0 ();
for (int i = 0; i < set.length (); i++)
{
- char *found= (char *) memchr (me, set[i], n);
+ char *found = (char *) memchr (me, set[i], n);
if (found)
{
return found - (char const *)me;
String
String::cut_string (int index_i, int n) const
{
- if (index_i <0)
+ if (index_i < 0)
{
n += index_i;
index_i = 0;
#ifdef STREAM_SUPPORT
ostream &
-operator<< (ostream& os, String d)
+operator << (ostream &os, String d)
{
d.print_on (os);
return os;
}
void
-String::print_on (ostream& os) const
+String::print_on (ostream &os) const
{
if (!strh_.is_binary_bo ())
os << to_str0 ();
if (alter == prev)
num = 0;
- else if ((abs (alter) < abs (prev) || prev*alter < 0) && alter != 0)
+ else if ((abs (alter) < abs (prev) || prev * alter < 0) && alter != 0)
num = 2;
*different = (alter != prev);
}
insert_extent_into_skyline (&head_skyline, b, Y_AXIS, LEFT);
}
- head_ape-> left_skyline_ = head_skyline;
+ head_ape->left_skyline_ = head_skyline;
head_ape->offset_ = 0.0;
Real padding = robust_scm2double (me->get_property ("padding"), 0.2);
belly[Y_AXIS] *= 0.75;
lstem[X_AXIS][RIGHT] *= .33;
- rstem[X_AXIS][LEFT] = rstem[X_AXIS].linear_combination (1.0/3.0);
+ rstem[X_AXIS][LEFT] = rstem[X_AXIS].linear_combination (1.0 / 3.0);
lstem[Y_AXIS][DOWN] = belly[Y_AXIS][DOWN];
rstem[Y_AXIS][UP] = belly[Y_AXIS][UP];
boxes.push (belly);
int
Adobe_font_metric::name_to_index (String name) const
{
- std::map < String, int>::const_iterator ai = name_to_metric_dict_.find (name);
+ std::map<String, int>::const_iterator ai = name_to_metric_dict_.find (name);
if (ai == name_to_metric_dict_.end ())
return -1;
return (*ai).second;
return 0;
}
-
ADD_INTERFACE (Align_interface, "align-interface",
"Order grobs from top to bottom, left to right, right to left or bottom"
"to top.",
Side_position_interface::add_support (accidentals_[d], heads_[d]);
}
while (flip (&d) != DOWN);
+
ambitus_->set_parent (heads_[DOWN], X_AXIS);
Axis_group_interface::add_element (group_, ambitus_);
heads_[d]->suicide ();
}
while (flip (&d) != DOWN);
+
ambitus_->suicide ();
}
}
Real linethickness = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"))
* robust_scm2double (me->get_property ("thickness"), 1.0);
Real blotdiameter = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
- Interval x_extent = 0.5 * linethickness *Interval (-1, 1);
+ Interval x_extent = 0.5 * linethickness * Interval (-1, 1);
Interval y_extent = Interval (pmin, pmax);
Box line_box (x_extent, y_extent);
Stencil line = Lookup::round_filled_box (line_box, blotdiameter);
- line.translate_axis (- me-> relative_coordinate (common, Y_AXIS),
+ line.translate_axis (- me->relative_coordinate (common, Y_AXIS),
Y_AXIS);
return line.smobbed_copy ();
}
}
for (Real y = heads[LEFT]; y < heads[RIGHT];
- y+= squiggle. extent (Y_AXIS).length ())
+ y += squiggle.extent (Y_AXIS).length ())
mol.add_at_edge (Y_AXIS, UP, squiggle, 0.0, 0);
mol.translate_axis (heads[LEFT], Y_AXIS);
*/
Moment shortest_mom_;
Spanner *finished_beam_;
- Link_array<Item>* stems_;
+ Link_array<Item> *stems_;
int count_;
Moment last_add_mom_;
Interpretation_context_handle up_;
Interpretation_context_handle down_;
-
};
void
*/
}
else;
-
}
void
"", SCM_EOL);
set_context (voice);
Music_wrapper_iterator::construct_children ();
-
}
void
{
up_.set_context (0);
down_.set_context (0);
-
}
IMPLEMENT_CTOR_CALLBACK (Auto_change_iterator);
void
Axis_group_interface::set_axes (Grob *me, Axis a1, Axis a2)
{
- SCM sa1= scm_int2num (a1);
+ SCM sa1 = scm_int2num (a1);
SCM sa2 = scm_int2num (a2);
SCM axes = me->get_property ("axes");
Real y = (- (c - 1.0) / 2 + 0.5 + i * staff_space);
Stencil d (dot);
- d. translate_axis (y, Y_AXIS);
+ d.translate_axis (y, Y_AXIS);
m.add_stencil (d);
}
}
return SCM_UNSPECIFIED;
}
-
MAKE_SCHEME_CALLBACK (Bar_line, get_staff_bar_size, 1);
SCM
Bar_line::get_staff_bar_size (SCM smob)
Real ss = Staff_symbol_referencer::staff_space (me);
SCM size = me->get_property ("bar-size");
if (scm_is_number (size))
- return scm_make_real (scm_to_double (size)*ss);
+ return scm_make_real (scm_to_double (size) * ss);
else if (Staff_symbol_referencer::get_staff_symbol (me))
{
/*
}
}
}
-
}
Bar_number_engraver::Bar_number_engraver ()
note is reached in the opposite direction as the last-first dy
*/
int dy = positions.top () - positions[0];
- int closest = (beam_dir * positions.top ()) >? (beam_dir *positions[0]);
+ int closest = (beam_dir * positions.top ()) >? (beam_dir * positions[0]);
for (int i = 2; !concave && i < positions.size () - 1; i++)
{
int inner_dy = positions[i] - positions[i - 1];
{
SCM b = get_property ("autoBeaming");
if (!to_boolean (b))
- context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+ context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T : SCM_BOOL_F);
}
void
/* urg, must copy to Auto_beam_engraver too */
}
-
}
void
}
last_stem_added_at_ = now;
- int durlog = unsmob_duration (m->get_property ("duration"))-> duration_log ();
+ int durlog = unsmob_duration (m->get_property ("duration"))->duration_log ();
if (durlog <= 2)
{
m->origin ()->warning (_ ("stem doesn't fit in beam"));
}
}
-
ADD_TRANSLATOR (Beam_engraver,
/* descr */ "Handles Beam events by engraving Beams. If omitted, then notes will be "
"printed with flags instead of beams.",
{
SCM b = get_property ("autoBeaming");
if (!to_boolean (b))
- context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+ context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T : SCM_BOOL_F);
}
void
dem += extra_demerit
* (fixed_demerit
- + (1 - fixed_demerit) * (dist / gap.length ())* 2);
+ + (1 - fixed_demerit) * (dist / gap.length ()) * 2);
}
}
}
- while ((flip (&d))!= LEFT);
+ while ((flip (&d)) != LEFT);
if ((beam_counts[LEFT] >? beam_counts[RIGHT]) >= 2)
{
Real thickness = get_thickness (me);
Real beam_translation = scm_to_int (beam_count) < 4
- ? (2*staff_space + line - thickness) / 2.0
- : (3*staff_space + line - thickness) / 3.0;
+ ? (2 * staff_space + line - thickness) / 2.0
+ : (3 * staff_space + line - thickness) / 3.0;
return scm_make_real (beam_translation);
}
int best_count = 0;
int best_start = 0;
for (int i = lslice[-left_dir];
- (i - lslice[left_dir])* left_dir <= 0; i+= left_dir)
+ (i - lslice[left_dir]) * left_dir <= 0; i += left_dir)
{
int count = 0;
for (SCM s = scm_car (right_beaming); scm_is_pair (s); s = scm_cdr (s))
last_int.set_empty ();
SCM last_beaming = SCM_EOL;
Direction last_dir = CENTER;
- for (int i = 0; i< stems.size (); i++)
+ for (int i = 0; i < stems.size (); i++)
{
Grob *this_stem = stems[i];
SCM this_beaming = this_stem->get_property ("beaming");
new_slice.add_point (new_beam_pos);
scm_set_car_x (s, scm_int2num (new_beam_pos));
}
-
}
while (flip (&d) != LEFT);
Stencil the_beam;
Real lt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
- for (int i = 0; i<= stems.size (); i++)
+ for (int i = 0; i <= stems.size (); i++)
{
Grob *st = (i < stems.size ()) ? stems[i] : 0;
SCM this_beaming = st ? st->get_property ("beaming") : SCM_EOL;
Real xposn = st ? st->relative_coordinate (xcommon, X_AXIS) : 0.0;
- Real stem_width = st ? robust_scm2double (st->get_property ("thickness"), 1.0) *lt : 0;
+ Real stem_width = st ? robust_scm2double (st->get_property ("thickness"), 1.0) * lt : 0;
Direction stem_dir = st ? to_dir (st->get_property ("direction")) : CENTER;
/*
We do the space left of ST, with lfliebertjes pointing to the
}
if (st)
- w += stem_width/ 2;
+ w += stem_width / 2;
Real blot = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
Stencil whole = Lookup::beam (slope, w, thick, blot);
return the_beam.smobbed_copy ();
}
-
Direction
Beam::get_default_dir (Grob *me)
{
Link_array<Grob> stems
= extract_grob_array (me, ly_symbol2scm ("stems"));
- for (int i = 0; i <stems.size (); i++)
+ for (int i = 0; i < stems.size (); i++)
{
Grob *s = stems[i];
this routine should take into account the stemlength scoring
of a possible knee/nonknee beam.
-
*/
void
Beam::consider_auto_knees (Grob *me)
Interval head_extents = head_extents_array[j++];
- Direction d = (head_extents.center () < max_gap.center ()) ?
- UP : DOWN;
+ Direction d = (head_extents.center () < max_gap.center ())
+ ? UP : DOWN;
stem->set_property ("direction", scm_int2num (d));
/*
"position" is relative to the staff.
*/
- scale_drul (&pos, 1/ Staff_symbol_referencer::staff_space (me));
+ scale_drul (&pos, 1 / Staff_symbol_referencer::staff_space (me));
me->set_property ("positions", ly_interval2scm (pos));
}
pos = Drul_array<Real> (y, (y + dy));
- scale_drul (&pos, 1/ Staff_symbol_referencer::staff_space (me));
+ scale_drul (&pos, 1 / Staff_symbol_referencer::staff_space (me));
me->set_property ("positions", ly_interval2scm (pos));
return SCM_UNSPECIFIED;
if (gap)
stem_y += thick * 0.5 * get_grob_direction (s);
- Stem::set_stemend (s, 2* stem_y / staff_space);
+ Stem::set_stemend (s, 2 * stem_y / staff_space);
}
}
return f;
}
-
int
Beam::visible_stem_count (Grob *me)
{
< rad
|| (rest->extent (common_y, Y_AXIS)[-d] + staff_space * shift) * -d
< rad)
- shift = ceil (fabs (shift)) *sign (shift);
+ shift = ceil (fabs (shift)) * sign (shift);
return scm_make_real (staff_space * shift);
}
int minidx = -1;
Moment beat_pos;
- for (int i =1; i < infos_.size (); i++)
+ for (int i = 1; i < infos_.size (); i++)
{
beat_pos = infos_[i].start_mom_ / beat_length;
int den = beat_pos.den ();
}
}
- return minidx| (minden ==1 && subdivide ? at_beat : 0);
+ return minidx | (minden == 1 && subdivide ? at_beat : 0);
}
int
}
while (flip (&d) != LEFT);
- int middle_beams = (split ? 1 :
- splits[RIGHT].beam_extend_count (LEFT) <?
+ int middle_beams = (split ? 1
+ : splits[RIGHT].beam_extend_count (LEFT) <?
splits[LEFT].beam_extend_count (RIGHT));
do
Real q = 2 * h_inf / max_fraction;
*indent
- = 2 *h_inf - sqr (q) * max_fraction / (width + q);
+ = 2 * h_inf - sqr (q) * max_fraction / (width + q);
}
Bezier
}
void
-scale (Array<Offset>* array, Real x, Real y)
+scale (Array<Offset> *array, Real x, Real y)
{
for (int i = 0; i < array->size (); i++)
{
- (*array)[i][X_AXIS] = x* (*array)[i][X_AXIS];
- (*array)[i][Y_AXIS] = y* (*array)[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>* array, Real phi)
+rotate (Array<Offset> *array, Real phi)
{
Offset rot (complex_exp (Offset (0, phi)));
for (int i = 0; i < array->size (); i++)
}
void
-translate (Array<Offset>* array, Offset o)
+translate (Array<Offset> *array, Offset o)
{
for (int i = 0; i < array->size (); i++)
(*array)[i] += o;
Bezier::curve_point (Real t) const
{
Real tj = 1;
- Real one_min_tj = (1 - t)* (1 - t)* (1 - t);
+ Real one_min_tj = (1 - t) * (1 - t) * (1 - t);
Offset o;
for (int j = 0; j < 4; j++)
}
#ifdef PARANOID
- assert (fabs (o[X_AXIS] - polynomial (X_AXIS).eval (t))< 1e-8);
- assert (fabs (o[Y_AXIS] - polynomial (Y_AXIS).eval (t))< 1e-8);
+ assert (fabs (o[X_AXIS] - polynomial (X_AXIS).eval (t)) < 1e-8);
+ assert (fabs (o[Y_AXIS] - polynomial (Y_AXIS).eval (t)) < 1e-8);
#endif
return o;
filter_solutions (Array<Real> sol)
{
for (int i = sol.size (); i--;)
- if (sol[i] < 0 || sol[i] >1)
+ if (sol[i] < 0 || sol[i] > 1)
sol.del (i);
return sol;
}
{
int o = (a + 1)%NO_AXES;
Offset d;
- d[Axis (o)] =1.0;
+ d[Axis (o)] = 1.0;
Interval iv;
Array<Real> sols (solve_derivative (d));
sols.push (1.0);
}
Interval &
-Box::operator[] (Axis a)
+Box::operator [] (Axis a)
{
return interval_a_[a];
}
Interval
-Box::operator[] (Axis a) const
+Box::operator [] (Axis a) const
{
return interval_a_[a];
}
Link_array<Grob> all = pscore_->system_->columns ();
Array<int> retval;
- for (int i= 0; i < all.size (); i++)
+ for (int i = 0; i < all.size (); i++)
if (Item::is_breakable (all[i]))
retval.push (i);
Link_array<Grob> all = pscore_->system_->columns ();
Link_array<Grob> retval;
- for (int i= 0; i < all.size (); i++)
+ for (int i = 0; i < all.size (); i++)
if (Item::is_breakable (all[i]))
retval.push (all[i]);
if (linewidth_ <= 0)
- while (retval.size () >2)
+ while (retval.size () > 2)
retval.del (1);
return retval;
{
Grob *e = unsmob_grob (smob);
Break_align_interface::add_element (align_, e);
-
}
void
group->set_parent (align_, Y_AXIS);
column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ());
-
}
Axis_group_interface::add_element (group, item);
}
if (sc->get_system () != line)
{
sc = sc->find_broken_piece (line);
-
}
/* now: !sc || (sc && sc->get_system () == line) */
if (bi && bi->get_system ())
sr.add_point (bi->get_system ()->rank_);
}
- while (flip (&d)!= LEFT);
+ while (flip (&d) != LEFT);
return sr;
}
ordering, since they go across the entire score.
*/
for (int i = sp_indices.size (); i--;)
- sp_indices[i]= Slice (sp_index, len - 1);
+ sp_indices[i] = Slice (sp_index, len - 1);
assert (it_index <= sp_index);
{
Grob *sc = broken_intos_[i];
System *l = sc->get_system ();
- set_break_subsititution (l ? l->self_scm (): SCM_UNDEFINED);
+ set_break_subsititution (l ? l->self_scm () : SCM_UNDEFINED);
SCM newval = SCM_EOL;
SCM *tail = &newval;
for (int j = (*arrs[k])[i][LEFT]; j <= (*arrs[k])[i][RIGHT]; j++)
{
SCM subs = substitute_grob (vec[j].grob_);
- if (subs!= SCM_UNDEFINED)
+ if (subs != SCM_UNDEFINED)
{
*tail = scm_cons (subs, SCM_EOL);
tail = SCM_CDRLOC (*tail);
}
-
}
#ifdef PARANOIA
fast_done = s->fast_fubstitute_grob_list (sym, val);
if (!fast_done)
- for (int i = 0; i < s->broken_intos_ .size (); i++)
+ for (int i = 0; i < s->broken_intos_.size (); i++)
{
Grob *sc = s->broken_intos_[i];
System *l = sc->get_system ();
g->set_parent (clef_, X_AXIS);
g->set_property ("direction", scm_int2num (dir));
octavate_ = g;
-
}
}
}
if (octavate_)
{
octavate_->set_property ("break-visibility", vis);
-
}
}
int pmax = INT_MIN;
int pmin = INT_MAX;
- for (int i = 0; i <cluster_notes_.size (); i++)
+ for (int i = 0; i < cluster_notes_.size (); i++)
{
Pitch *pit = unsmob_pitch (cluster_notes_[i]->get_property ("pitch"));
if (!col_)
{
col_ = make_item ("NoteCollision", SCM_EOL);
-
}
- for (int i = 0; i< note_columns_.size (); i++)
+ for (int i = 0; i < note_columns_.size (); i++)
Note_collision_interface::add_column (col_, note_columns_[i]);
}
col_ = 0;
}
-
ADD_TRANSLATOR (Collision_engraver,
/* descr */ "Collect NoteColumns, and as soon as there are two or more, put them in a NoteCollision object.",
/* creats*/ "NoteCollision",
}
return false;
-
}
/*
Tie::set_head (p, RIGHT, notes_[i]);
ties_.push (p);
-
}
}
}
void
-Interpretation_context_handle::operator= (Interpretation_context_handle const &s)
+Interpretation_context_handle::operator = (Interpretation_context_handle const &s)
{
set_context (s.outlet_);
}
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- return scm_makfrom0str (tr->id_string (). to_str0 ());
+ return scm_makfrom0str (tr->id_string ().to_str0 ());
}
LY_DEFINE (ly_context_name, "ly:context-name",
Context::is_removable () const
{
return context_list_ == SCM_EOL && ! iterator_count_
- && !dynamic_cast < Score_context const *> (this);
+ && !dynamic_cast<Score_context const *> (this);
}
void
Context::~Context ()
{
-
}
Moment
c->set_property ("staff-position",
scm_int2num (p));
-
}
pitches_.clear ();
if (!dotcol_)
{
dotcol_ = make_item ("DotColumn", SCM_EOL);
-
}
Dot_column::add_head (dotcol_, info.grob_);
}
}
-
ADD_TRANSLATOR (Dot_column_engraver,
/* descr */ "Engraves dots on dotted notes shifted to the right of the note.\n"
"If omitted, then dots appear on top of the notes.",
}
};
-typedef std::map < int, Dot_position> Dot_configuration;
+typedef std::map<int, Dot_position> Dot_configuration;
/*
Value CFG according.
}
}
-
ADD_INTERFACE (Dot_column, "dot-column-interface",
"Groups dot objects so they form a column, and position dots so they do not "
"clash with staff lines ",
for (int i = scm_to_int (c); i--;)
{
- d.translate_axis (2*dw, X_AXIS);
+ d.translate_axis (2 * dw, X_AXIS);
mol.add_at_edge (X_AXIS, RIGHT, d, dw, 0);
}
}
return mol.smobbed_copy ();
}
-
ADD_INTERFACE (Dots, "dots-interface",
"The dots to go with a notehead or rest."
"@code{direction} sets the preferred direction to move in case of staff "
{
Rational mom (1 << abs (durlog_));
- if (durlog_> 0)
+ if (durlog_ > 0)
mom = Rational (1) / mom;
Rational delta = mom;
virtual void process_music ();
};
-
Dynamic_engraver::Dynamic_engraver ()
{
script_ = 0;
if (!line_spanner_)
{
Music *rq = accepted_spanreqs_drul_[START];
- line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm (): SCM_EOL);
+ line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm () : SCM_EOL);
if (script_ev_)
rq = script_ev_;
Axis_group_interface::add_element (line_spanner_, script_);
}
- Music *stop_ev = accepted_spanreqs_drul_ [STOP] ?
- accepted_spanreqs_drul_[STOP] : script_ev_;
+ Music *stop_ev = accepted_spanreqs_drul_ [STOP]
+ ? accepted_spanreqs_drul_[STOP] : script_ev_;
if (accepted_spanreqs_drul_[STOP] || script_ev_)
{
accepted_spanreqs_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo"));
stop_ev = 0;
}
-
}
if (accepted_spanreqs_drul_[START])
cresc_->set_property ("grow-direction",
scm_int2num ((start_type == "crescendo")
? BIGGER : SMALLER));
-
}
/*
cresc_->set_bound (LEFT, info.grob_);
add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
}
-
}
else if (Script_interface::has_interface (info.grob_) && script_)
{
#include "warn.hh"
#include "paper-column.hh"
-
class Dynamic_text_spanner
{
public:
static bool has_interface (Grob *);
};
-
/*
This is a partial C&P from text-spanner.cc
group->do_announces ();
}
- do
+ while (1)
{
engraver_each (get_simple_trans_list (),
&Engraver::process_acknowledged_grobs);
acknowledge_grobs ();
announce_infos_.clear ();
}
- while (1);
-
}
while (pending_grob_count () > 0);
-
}
void
g->announce_grob (i);
}
-
Engraver::Engraver ()
{
}
Fingering_engraver::Fingering_engraver ()
{
-
}
ADD_TRANSLATOR (Fingering_engraver,
Font_size_engraver::Font_size_engraver ()
{
-
}
void
if (scm_is_number (s))
{
int i = scm_to_int (s);
- return (i>= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F;
+ return (i >= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F;
}
return SCM_BOOL_F;
}
clear_key_disambiguations ();
if (get_score_context ())
get_score_context ()->prepare (m);
-
}
Moment
void
Global_context::run_iterator_on_me (Music_iterator *iter)
{
- if (iter-> ok ())
+ if (iter->ok ())
prev_mom_ = now_mom_ = iter->pending_moment ();
bool first = true;
bool ragged_last = to_boolean (pscore_->layout_->c_variable ("raggedlast"));
Real worst_force = 0.0;
- for (int break_idx = 1; break_idx< breaks.size (); break_idx++)
+ for (int break_idx = 1; break_idx < breaks.size (); break_idx++)
{
/*
start with a short line, add measures. At some point
Array<Column_x_positions> lines;
/* skip 0-th element, since it is a "dummy" elt*/
- for (int i = optimal_paths.size () - 1; i> 0;)
+ for (int i = optimal_paths.size () - 1; i > 0;)
{
final_breaks.push (i);
int prev = optimal_paths[i].prev_break_;
/* compute head prefix set by inspecting primitive grob properties */
int prefix_set
- = (VIRGA *to_boolean (primitive->get_property ("virga"))) |
- (STROPHA *to_boolean (primitive->get_property ("stropha"))) |
- (INCLINATUM *to_boolean (primitive->get_property ("inclinatum"))) |
- (AUCTUM *to_boolean (primitive->get_property ("auctum"))) |
- (DESCENDENS *to_boolean (primitive->get_property ("descendens"))) |
- (ASCENDENS *to_boolean (primitive->get_property ("ascendens"))) |
- (ORISCUS *to_boolean (primitive->get_property ("oriscus"))) |
- (QUILISMA *to_boolean (primitive->get_property ("quilisma"))) |
- (DEMINUTUM *to_boolean (primitive->get_property ("deminutum"))) |
- (CAVUM *to_boolean (primitive->get_property ("cavum"))) |
- (LINEA *to_boolean (primitive->get_property ("linea"))) |
- (PES_OR_FLEXA *to_boolean (primitive->get_property ("pes-or-flexa")));
+ = (VIRGA *to_boolean (primitive->get_property ("virga")))
+ | (STROPHA *to_boolean (primitive->get_property ("stropha")))
+ | (INCLINATUM *to_boolean (primitive->get_property ("inclinatum")))
+ | (AUCTUM *to_boolean (primitive->get_property ("auctum")))
+ | (DESCENDENS *to_boolean (primitive->get_property ("descendens")))
+ | (ASCENDENS *to_boolean (primitive->get_property ("ascendens")))
+ | (ORISCUS *to_boolean (primitive->get_property ("oriscus")))
+ | (QUILISMA *to_boolean (primitive->get_property ("quilisma")))
+ | (DEMINUTUM *to_boolean (primitive->get_property ("deminutum")))
+ | (CAVUM *to_boolean (primitive->get_property ("cavum")))
+ | (LINEA *to_boolean (primitive->get_property ("linea")))
+ | (PES_OR_FLEXA *to_boolean (primitive->get_property ("pes-or-flexa")));
/* check: ascendens and descendens exclude each other; same with
auctum and deminutum */
otherwise we get in a nasty recursion loop.
*/
return;
-
}
SCM ifs = me->get_property ("interfaces");
return Grob_pitch_tuple::time_compare (a, b);
}
-
Grob_pitch_tuple::Grob_pitch_tuple ()
{
head_ = 0;
#include "grob.hh"
#include "warn.hh"
-class Grob_pq_engraver: public Engraver
+class Grob_pq_engraver : public Engraver
{
public:
TRANSLATOR_DECLARATIONS (Grob_pq_engraver);
: dim_cache_ (s.dim_cache_)
{
key_ = new Copied_key (s.key_, copy_index);
- original_ = (Grob *) &s;
+ original_ = (Grob *) & s;
self_scm_ = SCM_EOL;
immutable_property_alist_ = s.immutable_property_alist_;
{
SCM expr = scm_list_3 (ly_symbol2scm ("grob-cause"), self_scm (),
m->expr ());
- stil = Stencil (m->extent_box (), expr). smobbed_copy ();
+ stil = Stencil (m->extent_box (), expr).smobbed_copy ();
}
/* color support... see interpret_stencil_expression() for more... */
{
Real x = relative_coordinate (refp, a);
- Dimension_cache *d = (Dimension_cache *) &dim_cache_[a];
+ Dimension_cache *d = (Dimension_cache *) & dim_cache_[a];
Interval ext;
SCM dimpair = d->dimension_;
- if (scm_is_pair (dimpair));
+ if (scm_is_pair (dimpair))
+ ;
else if (ly_c_procedure_p (d->dimension_callback_)
&& d->dimension_ == SCM_EOL)
d->dimension_ = scm_call_2 (d->dimension_callback_, self_scm (), scm_int2num (a));
if (parenti && i)
{
Direction my_dir = i->break_status_dir ();
- if (my_dir!= parenti->break_status_dir ())
+ if (my_dir != parenti->break_status_dir ())
{
Item *newparent = parenti->find_prebroken_piece (my_dir);
me->set_parent (newparent, ax);
{
Interval e = b->extent (common, X_AXIS);
if (!e.is_empty ())
- x_points[d] = e[-d] - d*padding;
+ x_points[d] = e[-d] - d * padding;
}
else
{
Axis_group_interface::add_element (me, e);
}
-
void
Hara_kiri_group_spanner::add_interesting_item (Grob *me, Grob *n)
{
virtual void stop_translation_timestep ();
virtual void process_music ();
private:
-
};
-
Hyphen_engraver::Hyphen_engraver ()
{
hyphen_ = 0;
ev_ = 0;
}
-
ADD_TRANSLATOR (Hyphen_engraver,
/* descr */ "Create lyric hyphens",
/* creats*/ "LyricHyphen",
AFM_CharMetricInfo const *find_ascii_metric (int) const;
Array<int> ascii_to_metric_idx_;
- std::map < String, int> name_to_metric_dict_;
+ std::map<String, int> name_to_metric_dict_;
Adobe_font_metric (AFM_Font_info *);
};
private:
Audio_item (Audio_item const &);
- Audio_item &operator= (Audio_item const &);
+ Audio_item &operator = (Audio_item const &);
};
class Audio_dynamic : public Audio_item
static bool has_axis (Grob *, Axis);
static Link_array<Grob> get_children (Grob *);
static bool has_interface (Grob *);
-
};
#endif /* AXIS_GROUP_INTERFACE_HH */
Offset control_[4];
};
-void scale (Array<Offset>* array, Real xscale, Real yscale);
-void rotate (Array<Offset>* array, Real phi);
-void translate (Array<Offset>* array, 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);
Bezier slur_shape (Real width, Real height_limit,
Real height_proportion);
Interval &y (){ return interval_a_[Y_AXIS]; }
Interval x () const{ return interval_a_[X_AXIS]; }
Interval y () const{return interval_a_[Y_AXIS]; }
- Interval operator[] (Axis a) const;
- Interval &operator[] (Axis a);
+ Interval operator [] (Axis a) const;
+ Interval &operator [] (Axis a);
Offset center () const;
static void add_element (Grob *me, Grob *add);
DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis));
DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element, SCM axis));
-
};
struct Break_aligned_interface
{
int iterator_count_;
bool init_;
- std::map < String, int> grob_counts_;
- std::map < String, int> context_counts_;
+ std::map<String, int> grob_counts_;
+ std::map<String, int> context_counts_;
protected:
Object_key const *key_;
SCM ops);
Link_array<Context> path_to_acceptable_context (SCM alias,
Output_def *) const;
-
};
/*
private:
static void add_streepjes (Grob *me, int pos, int interspaces, Stencil *custos_);
static Stencil create_ledger_line (Interval x_extent, Grob *me);
-
};
#endif // CUSTOS_HH
virtual void acknowledge_grobs ();
};
-typedef void (Engraver::*Engraver_method) (void);
+typedef void (Engraver:: *Engraver_method) (void);
void engraver_each (SCM list, Engraver_method method);
Item *make_item_from_properties (Engraver *tg, SCM x, SCM cause, const char *name);
Spanner *make_spanner_from_properties (Engraver *tg, SCM x, SCM cause, const char *name);
-
#endif // ENGRAVER_HH
DECLARE_SCHEME_CALLBACK (length_callback, (SCM));
};
-
#endif
POSTCALCED, // after spacing calcs done
};
-typedef void (Grob::*Grob_method_pointer) (void);
+typedef void (Grob:: *Grob_method_pointer) (void);
// looking at gtk+/pango docstrings .. WIP
Link_array<Grob> extract_grob_array (Grob const *elt, SCM symbol);
Link_array<Item> extract_item_array (Grob const *elt, SCM symbol);
-
#endif /* GROUP_INTERFACE_HH */
void set_context (Context *);
bool try_music (Music *);
- void operator= (Interpretation_context_handle const &);
+ void operator = (Interpretation_context_handle const &);
Interpretation_context_handle (Interpretation_context_handle const &);
Context *get_outlet () const;
Make TYPE::FUNC available as a Scheme function.
*/
#define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT) \
- SCM TYPE :: FUNC ## _proc; \
+ SCM TYPE ::FUNC ## _proc; \
void \
TYPE ## _ ## FUNC ## _init_functions () \
{ \
- TYPE :: FUNC ## _proc = scm_c_define_gsubr (#TYPE "::" #FUNC, \
- (ARGCOUNT), 0, 0, \
- (Scheme_function_unknown)TYPE :: FUNC); \
+ TYPE ::FUNC ## _proc = scm_c_define_gsubr (#TYPE "::" #FUNC, \
+ (ARGCOUNT), 0, 0, \
+ (Scheme_function_unknown)TYPE ::FUNC); \
scm_c_export (#TYPE "::" #FUNC, NULL); \
} \
\
#define LILY_PROTO_HH
#include "flower-proto.hh"
-
class Adobe_font_metric;
class All_font_metrics;
class Audio_column;
Midi_stream (String file_name_string);
~Midi_stream ();
- Midi_stream &operator<< (String str);
- Midi_stream &operator<< (Midi_item const &midi_c_r);
- Midi_stream &operator<< (int i);
+ Midi_stream &operator << (String str);
+ Midi_stream &operator << (Midi_item const &midi_c_r);
+ Midi_stream &operator << (int i);
void open ();
#include "lily-proto.hh"
#include "moment.hh"
-struct Midi_note_event : PQueue_ent < Moment, Midi_note *>
+struct Midi_note_event : PQueue_ent<Moment, Midi_note *>
{
bool ignore_b_;
Midi_note_event ();
~Midi_walker ();
void process ();
- void operator++ (int);
+ void operator ++ (int);
bool ok () const;
private:
Midi_track *track_;
Audio_staff *staff_;
int index_;
- Link_array<Audio_item> * items_;
+ Link_array<Audio_item> *items_;
PQueue<Midi_note_event> stop_note_queue;
Moment last_mom_;
};
Moment (Rational, Rational);
Moment (Rational m);
- Moment operator- () const;
+ Moment operator - () const;
- void operator+= (Moment const &m);
- void operator-= (Moment const &m);
+ void operator += (Moment const &m);
+ void operator -= (Moment const &m);
- void operator*= (Moment const &m);
- void operator/= (Moment const &m);
+ void operator *= (Moment const &m);
+ void operator /= (Moment const &m);
Rational main_part_;
Rational grace_part_;
Moment robust_scm2moment (SCM, Moment);
#ifdef STREAM_SUPPORT
-std::ostream & operator<< (std::ostream &, Moment const &);
+std::ostream &operator << (std::ostream &, Moment const &);
#endif
bool moment_less (SCM a, SCM b);
} \
static void _ ## type ## _adder () \
{ \
- add_music_ctor (#type, & _ ## type ## _ctor); \
+ add_music_ctor (#type, &_ ## type ## _ctor); \
} \
ADD_SCM_INIT_FUNC (_ ## type ## _adder_prefix, _ ## type ## _adder);
void add_music_ctor (String, Music_ctor);
Music *make_music (String, SCM);
-
#endif /* MUSIC_CONSTRUCTOR_HH */
class Note_collision_interface
{
public:
- static SCM automatic_shift (Grob *, Drul_array< Link_array<Grob> >);
+ static SCM automatic_shift (Grob *, Drul_array<Link_array<Grob> >);
static SCM forced_shift (Grob *);
- static Drul_array< Link_array<Grob> > get_clash_groups (Grob *me);
+ 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);
#include "object-key.hh"
-typedef std::map < Object_key const *, Object_key const *, Object_key_less> Key_to_key_map;
-typedef std::map < Object_key const *, int> Pointer_to_int_map;
-typedef std::map < int, Object_key const *> Int_to_key_map;
+typedef std::map<Object_key const *, Object_key const *, Object_key_less> Key_to_key_map;
+typedef std::map<Object_key const *, int> Pointer_to_int_map;
+typedef std::map<int, Object_key const *> Int_to_key_map;
class Object_key_dumper
{
#include <map>
#include "object-key.hh"
-typedef std::map < int, Object_key const *> Int_to_key_map;
+typedef std::map<int, Object_key const *> Int_to_key_map;
struct Object_key_undumper
{
struct Object_key_less
{
- bool operator() (Object_key const *const &t1, Object_key const *const &t2) const
+ bool operator () (Object_key const *const &t1, Object_key const *const &t2) const
{
return t1->compare (t2);
}
#include "freetype.hh"
#include "font-metric.hh"
-typedef std::map < FT_UInt, FT_ULong> Index_to_charcode_map;
+typedef std::map<FT_UInt, FT_ULong> Index_to_charcode_map;
Index_to_charcode_map make_index_to_charcode_map (FT_Face face);
class Open_type_font : public Font_metric
#include "performer.hh"
#include "translator-group.hh"
-typedef void (Performer::*Performer_method) (void);
+typedef void (Performer:: *Performer_method) (void);
class Performer_group_performer : public Performer, public virtual Translator_group
{
INSTANTIATE_COMPARE (Pitch, Pitch::compare);
-int compare (Array<Pitch>*, Array<Pitch>*);
+int compare (Array<Pitch> *, Array<Pitch> *);
extern SCM pitch_less_proc;
Pitch pitch_interval (Pitch const &from, Pitch const &to);
#include "simple-music-iterator.hh"
-
/**
Iterate a property.
*/
virtual void process (Moment);
};
-
/**
Iterate a property.
*/
Protected_scm (SCM);
Protected_scm (Protected_scm const &);
~Protected_scm ();
- Protected_scm &operator= (SCM);
- Protected_scm &operator= (Protected_scm const &);
+ Protected_scm &operator = (SCM);
+ Protected_scm &operator = (Protected_scm const &);
operator SCM () const;
SCM to_SCM () const;
};
#include "lily-proto.hh"
#include "lily-guile.hh"
-
class Rest_collision
{
public:
static int dot_count (Grob *);
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
static bool has_interface (Grob *);
-
};
#endif // RHYTHMIC_HEAD_HH
SCM get (SCM k) const;
void remove (SCM k);
Scheme_hash_table ();
- void operator= (Scheme_hash_table const &);
+ void operator = (Scheme_hash_table const &);
Scheme_hash_table (Scheme_hash_table const &);
SCM to_alist () const;
static void add_staff_sided (Grob *, Item *);
DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
static bool has_interface (Grob *);
-
};
#endif /* Script_COLUMN_HH */
Moment here_mom_;
SCM cursor_;
Grace_fixup *grace_fixups_;
-
};
#endif /* SEQUENTIAL_ITERATOR_HH */
char const *to_str0 () const;
virtual String error_string (char const *pos_str0) const;
- std::istream * get_istream ();
+ std::istream *get_istream ();
bool contains (char const *pos_str0) const;
int length () const;
virtual int get_line (char const *pos_str0) const;
private:
Link_array<char> newline_locations_;
- std::istream* istream_;
+ std::istream *istream_;
char *contents_str0_;
int length_;
void load_stdin ();
static int line_count (Grob *);
DECLARE_SCHEME_CALLBACK (print, (SCM));
static bool has_interface (Grob *);
-
};
#endif // STAFF_SYMBOL_HH
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>* ligatures,
- Array<Tfm_kern>* kerns);
+ void read_lig_kern_program (Array<Tfm_ligature> *ligatures,
+ Array<Tfm_kern> *kerns);
Binary_source_file input_;
#include "translator.hh"
#include "parray.hh"
-typedef void (Translator::*Translator_method) (void);
+typedef void (Translator:: *Translator_method) (void);
class Translator_group : public virtual Translator
{
} \
ADD_GLOBAL_CTOR (_ ## T ## _adder);
-
#define ADD_TRANSLATOR(classname, desc, grobs, accepted, acked, read, write) \
ADD_THIS_TRANSLATOR (classname); \
SCM \
#include "lily-proto.hh"
#include "object-key.hh"
-typedef std::map < Object_key const *, SCM, Object_key_less> Tweak_map;
+typedef std::map<Object_key const *, SCM, Object_key_less> Tweak_map;
class Tweak_registry
{
{ \
TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator); \
}; \
- TYPE ## _swallow_translator :: TYPE ## _swallow_translator () \
+ TYPE ## _swallow_translator ::TYPE ## _swallow_translator () \
{ \
swallow_string_ = #TYPE; \
} \
return source_file_->get_line (start_);
else
return 0;
-
}
int
return source_file_->get_column (start_);
else
return 0;
-
}
int
return source_file_->get_line (end_);
else
return 0;
-
}
int
return source_file_->get_column (end_);
else
return 0;
-
}
if (text_->get_property ("text") != txt)
text_->set_property ("text", txt);
-
}
void
if (text_->get_property ("text") != txt)
text_->set_property ("text", txt);
-
}
ADD_TRANSLATOR (Vocal_name_engraver,
Item::Item (SCM s, Object_key const *key)
: Grob (s, key)
{
- broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]= 0;
+ broken_to_drul_[LEFT] = broken_to_drul_[RIGHT] = 0;
Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("item-interface"));
}
new_copies[i] = item;
}
while (flip (&i) != LEFT);
+
broken_to_drul_ = new_copies;
}
cancellation_->set_property ("old-accidentals", last);
cancellation_->set_property ("c0-position",
get_property ("middleCPosition"));
-
}
item_->set_property ("new-accidentals", key);
}
Pitch p (0, 0, 0);
context ()->set_property ("tonic", p.smobbed_copy ());
-
}
ADD_TRANSLATOR (Key_engraver,
/*
FIXME: too much hardcoding here.
*/
-const int FLAT_TOP_PITCH =2; /* fes, ges, as and bes typeset in lower octave */
-const int SHARP_TOP_PITCH =4; /* ais and bis typeset in lower octave */
+const int FLAT_TOP_PITCH = 2; /* fes, ges, as and bes typeset in lower octave */
+const int SHARP_TOP_PITCH = 4; /* ais and bis typeset in lower octave */
/*
TODO: look this up. I'm not sure where the naturals ought to go.
*/
const int NATURAL_TOP_PITCH = 4;
-
/*
FIXME: key-item should just get a list of (position, acc), and leave
the thinking to other parties.
from_bottom_pos = (from_bottom_pos + 7)%7; // Precaution to get positive.
int c0 = from_bottom_pos - 4;
- if ((alter <0 && ((p > FLAT_TOP_PITCH) || (p + c0 > 4)) && (p + c0 > 1))
- || (alter >0 && ((p > SHARP_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2))
+ if ((alter < 0 && ((p > FLAT_TOP_PITCH) || (p + c0 > 4)) && (p + c0 > 1))
+ || (alter > 0 && ((p > SHARP_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2))
|| (alter == 0 && ((p > NATURAL_TOP_PITCH) || (p + c0 > 5)) && (p + c0 > 2)))
{
p -= 7; /* Typeset below c_position */
it's a hack, but probably not worth
the effort of finding a nicer solution.
--dl. */
- if (c0 == 2 && alter >0 && p ==3)
+ if (c0 == 2 && alter > 0 && p == 3)
p -= 7;
if (c0==-3 && alter > 0 && p ==-1)
p += 7;
int pos = alteration_pos (what, alteration, c0p);
Stencil m = natural;
- m.translate_axis (pos* inter, Y_AXIS);
+ m.translate_axis (pos * inter, Y_AXIS);
/*
The natural sign (unlike flat & sharp)
*/
Real padding = 0.0;
if (last_pos < pos + 2
- && last_pos> pos - 6)
+ && last_pos > pos - 6)
padding = 0.3;
mol.add_at_edge (X_AXIS, LEFT, m, padding, 0);
}
else
{
- *coef = (N *sxy - sx*sy) / den;
+ *coef = (N *sxy - sx * sy) / den;
*offset = (sy - (*coef) * sx) / N;
}
}
{
Real blotdiameter = ledgerlinethickness;
Interval y_extent
- = Interval (-0.5* (ledgerlinethickness),
- +0.5* (ledgerlinethickness));
+ = Interval (-0.5 * (ledgerlinethickness),
+ +0.5 * (ledgerlinethickness));
Stencil proto_ledger_line
= Lookup::round_filled_box (Box (x_extent, y_extent), blotdiameter);
return stencil;
}
-
static void
set_rods (Drul_array<Interval> const ¤t_extents,
Drul_array<Interval> const &previous_extents,
Rod rod;
rod.distance_ = total_head_length
- * (3/2 * min_length_fraction)
+ * (3 / 2 * min_length_fraction)
/*
we go from right to left.
*/
rod.item_drul_[RIGHT] = previous_column;
rod.add_to_cols ();
}
-
}
while (flip (&d) != DOWN);
}
-
MAKE_SCHEME_CALLBACK (Ledger_line_spanner, set_spacing_rods, 1);
SCM
Ledger_line_spanner::set_spacing_rods (SCM smob)
SCM heads = me->get_property ("note-heads");
-
Real min_length_fraction
= robust_scm2double (me->get_property ("minimum-length-fraction"), 0.15);
-
Drul_array<Interval> current_extents;
Drul_array<Interval> previous_extents;
Item *previous_column = 0;
for (SCM hp = heads; scm_is_pair (hp); hp = scm_cdr (hp))
{
Item *h = dynamic_cast<Item *> (unsmob_grob (scm_car (hp)));
-
+
int pos = Staff_symbol_referencer::get_rounded_position (h);
if (abs (pos) <= interspaces)
continue;
-
+
Item *column = h->get_column ();
if (current_column != column)
{
set_rods (current_extents, previous_extents,
current_column, previous_column,
min_length_fraction);
-
+
previous_column = current_column;
current_column = column;
previous_extents = current_extents;
-
- current_extents[DOWN].set_empty();
- current_extents[UP].set_empty();
+
+ current_extents[DOWN].set_empty ();
+ current_extents[UP].set_empty ();
}
-
-
+
Interval head_extent = h->extent (column, X_AXIS);
Direction vdir = Direction (sign (pos));
if (!vdir)
current_column, previous_column,
min_length_fraction);
-
-
return SCM_UNSPECIFIED;
}
/*
TODO: ledger share a lot of info. Lots of room to optimize away
common use of objects/variables.
-
*/
MAKE_SCHEME_CALLBACK (Ledger_line_spanner, print, 1);
SCM
reqs[rank][vdir].ledger_extent_.unite (ledger_extent);
reqs[rank][vdir].head_extent_.unite (head_extent);
reqs[rank][vdir].position_
- = vdir * ((vdir* reqs[rank][vdir].position_) >? (vdir *pos));
+ = vdir * ((vdir * reqs[rank][vdir].position_) >? (vdir * pos));
}
}
Direction which = LEFT;
do
{
- Ledger_request &lr = ((which == LEFT) ? *last : *i).second[d];
+ Ledger_request &lr = ((which == LEFT) ? * last : *i).second[d];
// due tilt of quarter note-heads
bool both
= (abs (last->second[d].position_) > interspaces + 1
&& abs (i->second[d].position_) > interspaces + 1);
- Real limit = (center + (both? which * gap / 2 : 0));
+ Real limit = (center + (both ? which * gap / 2 : 0));
lr.ledger_extent_.elem_ref (-which)
= which * (which * lr.ledger_extent_[-which] >? which * limit);
}
{
Interval head_size = h->extent (common[X_AXIS], X_AXIS);
Interval ledger_size = head_size;
- ledger_size.widen (ledger_size.length ()* length_fraction);
+ ledger_size.widen (ledger_size.length () * length_fraction);
Interval max_size = reqs[Paper_column::get_rank (h->get_column ())][Direction (sign (pos))].ledger_extent_;
TODO: shorten 2 ledger lines for the case natural +
downstem.
*/
-
}
ledgers.add_stencil (brew_ledger_lines (staff, pos, interspaces,
if (scm_is_number (s))
{
int i = scm_to_int (s);
- return i>= -1 && i <= 1;
+ return i >= -1 && i <= 1;
}
return false;
}
before = scm_cons (i, before);
}
return scm_cons (scm_reverse_x (before, SCM_EOL), after);
-
}
void
robust_scm2interval (SCM k, Drul_array<Real> v)
{
Interval i;
- i[LEFT]= v[LEFT];
- i[RIGHT]= v[RIGHT];
+ i[LEFT] = v[LEFT];
+ i[RIGHT] = v[RIGHT];
if (is_number_pair (k))
i = ly_scm2interval (k);
return i;
int
Lilypond_grob_key::do_compare (Object_key const *key) const
{
- Lilypond_grob_key const *other = dynamic_cast < Lilypond_grob_key const *> (key);
+ Lilypond_grob_key const *other = dynamic_cast<Lilypond_grob_key const *> (key);
int c;
c = context_->compare (other->context_);
Lilypond_context_key::do_compare (Object_key const *key) const
{
Lilypond_context_key const *other
- = dynamic_cast < Lilypond_context_key const *> (key);
+ = dynamic_cast<Lilypond_context_key const *> (key);
int c;
if (parent_context_ && other->parent_context_)
Lilypond_general_key::do_compare (Object_key const *key)const
{
Lilypond_general_key const *other
- = dynamic_cast < Lilypond_general_key const *> (key);
+ = dynamic_cast<Lilypond_general_key const *> (key);
if (parent_ && other->parent_)
parent_->compare (other->parent_);
Real staff_space = Staff_symbol_referencer::staff_space (me);
- double w = robust_scm2double (me->get_property ("zigzag-width"), 1)*staff_space;
- double l = robust_scm2double (me->get_property ("zigzag-length"), 1)* w;
- double h = l > w / 2 ? sqrt (l*l - w*w / 4) : 0;
+ double w = robust_scm2double (me->get_property ("zigzag-width"), 1) * staff_space;
+ double l = robust_scm2double (me->get_property ("zigzag-length"), 1) * w;
+ double h = l > w / 2 ? sqrt (l * l - w * w / 4) : 0;
SCM list = scm_list_n (ly_symbol2scm ("zigzag-line"),
ly_bool2scm (true),
Can't do suicide, since this mucks up finding the trend.
*/
me->set_property ("print-function", SCM_EOL);
-
}
return SCM_EOL;
}
mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0);
while (m.extent (X_AXIS).length ()
&& mol.extent (X_AXIS).length ()
- + m.extent (X_AXIS).length () < dz[X_AXIS]);
+ + m.extent (X_AXIS).length () < dz[X_AXIS])
+ ;
/*
FIXME: should center element on x/y
Offset dz (p2 -p1);
Real len = dz.length ();
- Offset dir = dz * (1/ len);
- dz = (dz.length () - 2*gap) *dir;
+ Offset dir = dz * (1 / len);
+ dz = (dz.length () - 2 * gap) * dir;
Stencil l (line_stencil (me, Offset (0, 0), dz));
}
// distance from center to start of line
- Real off = gap + ((bound[LEFT]->extent (bound[LEFT], X_AXIS).length ()*3) / 4);
+ Real off = gap + ((bound[LEFT]->extent (bound[LEFT], X_AXIS).length () * 3) / 4);
for (int a = X_AXIS; a < NO_AXES; a++)
{
my_off[ax] = me->relative_coordinate (common[a], ax);
his_off[ax] = bound[LEFT]->relative_coordinate (common[a], ax);
-
}
ofxy = dxy * (off / dxy.length ());
SCM scontrols[8];
- for (int i =4; i--;)
+ for (int i = 4; i--;)
scontrols[ i ] = ly_offset2scm (back.control_[i]);
- for (int i =4; i--;)
+ for (int i = 4; i--;)
scontrols[i + 4] = ly_offset2scm (curve.control_[i]);
/*
Need the weird order b.o. the way PS want its arguments
*/
- int indices[]= {5, 6, 7, 4, 1, 2, 3, 0};
+ int indices[] = {5, 6, 7, 4, 1, 2, 3, 0};
SCM list = SCM_EOL;
for (int i = 8; i--;)
{
"Copy all bindings from module SRC into DEST.")
{
SCM_VALIDATE_MODULE (1, src);
- scm_internal_hash_fold ((Hash_cl_func) &module_define_closure_func,
+ scm_internal_hash_fold ((Hash_cl_func) & module_define_closure_func,
(void *) dest,
SCM_EOL, SCM_MODULE_OBARRAY (src));
return SCM_UNSPECIFIED;
SCM_VALIDATE_MODULE (1, mod);
SCM obarr = SCM_MODULE_OBARRAY (mod);
- return scm_internal_hash_fold ((Hash_cl_func) &accumulate_symbol,
+ return scm_internal_hash_fold ((Hash_cl_func) & accumulate_symbol,
NULL, SCM_EOL, obarr);
}
SCM_VALIDATE_MODULE (1, mod);
SCM obarr = SCM_MODULE_OBARRAY (mod);
- return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr);
+ return scm_internal_hash_fold ((Hash_cl_func) & entry_to_alist, NULL, SCM_EOL, obarr);
}
/* Lookup SYM, but don't give error when it is not defined. */
for (; scm_is_pair (grobs); grobs = scm_cdr (grobs))
{
SCM grob = scm_cdar (grobs);
- Moment end =*unsmob_moment (scm_caar (grobs));
+ Moment end = *unsmob_moment (scm_caar (grobs));
/*
This is slightly ugh: we are now confunding the frontend
#include "moment.hh"
MAKE_SCHEME_CALLBACK (Hyphen_spanner, print, 1)
-SCM
+ SCM
Hyphen_spanner::print (SCM smob)
{
Spanner *me = unsmob_spanner (smob);
do
{
Interval iv = bounds[d]->extent (common, X_AXIS);
-
+
span_points[d] = iv.is_empty ()
? bounds[d]->relative_coordinate (common, X_AXIS)
: iv[-d];
Real dash_period = robust_scm2double (me->get_property ("dash-period"), 1.0);
Real dash_length = robust_scm2double (me->get_property ("length"), .5);
Real padding = robust_scm2double (me->get_property ("padding"), 0.1);
-
+
if (dash_period < dash_length)
dash_period = 1.5 * dash_length;
-
Real l = span_points.length ();
int n = int (ceil (l / dash_period - 0.5));
if (n <= 0)
n = 1;
- if (l < dash_length + 2*padding
+ if (l < dash_length + 2 * padding
&& !bounds[RIGHT]->break_status_dir ())
{
Real minimum_length = robust_scm2double (me->get_property ("minimum-length"), .3);
- dash_length = (l - 2*padding) >? minimum_length;
+ dash_length = (l - 2 * padding) >? minimum_length;
}
-
+
Real space_left = l - dash_length - (n - 1) * dash_period;
/*
&& r.item_drul_[RIGHT])
r.add_to_cols ();
}
-
+
return SCM_UNSPECIFIED;
}
Audio_text *audio_;
};
-
Lyric_performer::Lyric_performer ()
{
audio_ = 0;
errno = 0;
int uid;
- if (passwd *passwd = getpwnam (components[USER_NAME].to_str0 ()))
+ if (passwd * passwd = getpwnam (components[USER_NAME].to_str0 ()))
uid = passwd->pw_uid;
else
{
errno = 0;
int gid;
- if (group *group = getgrnam (components[GROUP_NAME].to_str0 ()))
+ if (group * group = getgrnam (components[GROUP_NAME].to_str0 ()))
gid = group->gr_gid;
else
{
Music *mark_ev_;
};
-
Mark_engraver::Mark_engraver ()
{
text_ = 0;
else
context ()->unset_property (ly_symbol2scm ("melismaBusy"));
}
-
}
void
// Compensate optical illusion regarding vertical position of left
// and right endings due to slope.
- Real ypos_correction = -0.1*staff_space * sign (slope);
- Real slope_correction = 0.2*staff_space * sign (slope);
+ Real ypos_correction = -0.1 * staff_space * sign (slope);
+ Real slope_correction = 0.2 * staff_space * sign (slope);
Real corrected_slope = slope + slope_correction / width;
if (solid) // this will come handy for colorated flexae
Stencil bottom_edge
= Lookup::beam (corrected_slope, width, thickness, 0.0);
- bottom_edge.translate_axis (-0.5*height, Y_AXIS);
+ bottom_edge.translate_axis (-0.5 * height, Y_AXIS);
stencil.add_stencil (bottom_edge);
Stencil top_edge
= Lookup::beam (corrected_slope, width, thickness, 0.0);
- top_edge.translate_axis (+0.5*height, Y_AXIS);
+ top_edge.translate_axis (+0.5 * height, Y_AXIS);
stencil.add_stencil (top_edge);
}
stencil.translate_axis (ypos_correction, Y_AXIS);
if (primitive & MLP_FLEXA)
{
pos += delta_pitch;
- add_ledger_lines (me, &out, pos, 0.5*delta_pitch, ledger_take_space);
+ add_ledger_lines (me, &out, pos, 0.5 * delta_pitch, ledger_take_space);
}
#endif
return;
text_ = make_item ("MetronomeMark", rq->self_scm ());
-
}
bool
Midi_event::to_string () const
{
Rational rat_dt = (delta_mom_.main_part_ * Rational (384)
- + delta_mom_.grace_part_ * Rational (100))*Rational (4);
+ + delta_mom_.grace_part_ * Rational (100)) * Rational (4);
int delta_i = int (rat_dt);
String delta_string = Midi_item::i2varint_string (delta_i);
else
warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ()));
- String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME: Should be track. -rz
+ String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz
str += ::to_string ((char)program_byte);
return str;
}
*/
static Real const full_scale = 127;
- int volume = (int) (audio_->volume_*full_scale);
+ int volume = (int) (audio_->volume_ * full_scale);
if (volume <= 0)
volume = 1;
if (volume > full_scale)
}
Midi_stream &
-Midi_stream::operator<< (String str)
+Midi_stream::operator << (String str)
{
size_t sz = sizeof (Byte);
size_t n = str.length ();
}
Midi_stream &
-Midi_stream::operator<< (Midi_item const &midi_c_r)
+Midi_stream::operator << (Midi_item const &midi_c_r)
{
String str = midi_c_r.to_string ();
bool
Midi_walker::ok () const
{
- return index_ <items_->size ();
+ return index_ < items_->size ();
}
void
-Midi_walker::operator++ (int)
+Midi_walker::operator ++ (int)
{
assert (ok ());
index_++;
double
log_2 (double x)
{
- return log (x) /log (2.0);
+ return log (x) / log (2.0);
}
Array<String>
Moment *mb = unsmob_moment (b);
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
- return (*ma * *mb).smobbed_copy ();
+ return (*ma * * mb).smobbed_copy ();
}
LY_DEFINE (ly_div_moment, "ly:div-moment",
Moment *mb = unsmob_moment (b);
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
- return (*ma / *mb).smobbed_copy ();
+ return (*ma / * mb).smobbed_copy ();
}
LY_DEFINE (ly_moment_main_numerator, "ly:moment-main-numerator",
}
void
-Moment::operator+= (Moment const &src)
+Moment::operator += (Moment const &src)
{
main_part_ += src.main_part_;
grace_part_ += src.grace_part_;
}
void
-Moment::operator-= (Moment const &src)
+Moment::operator -= (Moment const &src)
{
main_part_ -= src.main_part_;
grace_part_ -= src.grace_part_;
only take the main part of SRC for multiplication.
*/
void
-Moment::operator*= (Moment const &src)
+Moment::operator *= (Moment const &src)
{
main_part_ *= src.main_part_;
grace_part_ *= src.main_part_;
only take the main part of SRC for multiplication.
*/
void
-Moment::operator/= (Moment const &src)
+Moment::operator /= (Moment const &src)
{
main_part_ /= src.main_part_;
grace_part_ /= src.main_part_;
}
Moment
-Moment::operator- () const
+Moment::operator - () const
{
Moment m;
m.grace_part_ = -grace_part_;
- m. main_part_ = -main_part_;
+ m.main_part_ = -main_part_;
return m;
}
#ifdef STREAM_SUPPORT
std::ostream &
-operator<< (std::ostream &os, Moment const &m)
+operator << (std::ostream &os, Moment const &m)
{
os << m.to_string ();
return os;
do
{
Grob *last = 0;
- for (int i = 0; i <numbers_.size (); i++)
+ for (int i = 0; i < numbers_.size (); i++)
{
if (scm_int2num (d) == numbers_[i]->get_property ("direction"))
{
}
}
while (flip (&d) != DOWN);
-
}
for (int i = 0; i < numbers_.size (); i++)
/*
center between stuff.
*/
- x_off += sp_iv.length ()/ 2;
+ x_off += sp_iv.length () / 2;
r.translate_axis (x_off, X_AXIS);
if (measures > scm_to_int (limit))
{
Real padding = 0.15;
- Stencil s = big_rest (me, (1.0 - 2*padding) * space);
+ Stencil s = big_rest (me, (1.0 - 2 * padding) * space);
s.translate_axis (padding * space, X_AXIS);
return s;
}
Real blot = width ? (.8 * (y <? ythick)) : 0.0;
Stencil m = Lookup::round_filled_box (b, blot);
- Stencil yb = Lookup::round_filled_box (Box (Interval (-0.5, 0.5)* ythick, Interval (-ss, ss)), blot);
+ Stencil yb = Lookup::round_filled_box (Box (Interval (-0.5, 0.5) * ythick, Interval (-ss, ss)), blot);
m.add_at_edge (X_AXIS, RIGHT, yb, 0, 0);
m.add_at_edge (X_AXIS, LEFT, yb, 0, 0);
l -= 4;
k = -2;
}
- else if (l>= 2)
+ else if (l >= 2)
{
l -= 2;
k = -1;
#include "warn.hh"
-static std::map < String, Music_ctor> *ctors_map_;
+static std::map<String, Music_ctor> *ctors_map_;
void
add_music_ctor (String s, Music_ctor c)
{
if (!ctors_map_)
- ctors_map_ = new std::map < String, Music_ctor>;
+ ctors_map_ = new std::map<String, Music_ctor>;
(*ctors_map_)[s] = c;
}
else
programming_error ("Music has no duration");
return l.smobbed_copy ();
-
}
LY_DEFINE (ly_music_duration_compress, "ly:music-duration-compress", 2, 0, 0,
void
Music_wrapper_iterator::construct_children ()
{
- Music *m = dynamic_cast < Music_wrapper const *> (get_music ())-> element ();
+ Music *m = dynamic_cast<Music_wrapper const *> (get_music ())->element ();
child_iter_ = unsmob_iterator (get_iterator (m));
}
compress_music_list (get_property ("elements"), factor);
Duration *d = unsmob_duration (get_property ("duration"));
if (d)
- set_property ("duration", d ->compressed (factor.main_part_).smobbed_copy ());
+ set_property ("duration", d->compressed (factor.main_part_).smobbed_copy ());
}
void
{
set_property ("pitch-alist", ly_transpose_key_alist (pa, delta.smobbed_copy ()));
}
-
}
IMPLEMENT_TYPE_P (Music, "ly:music?");
Music::origin () const
{
Input *ip = unsmob_input (get_property ("origin"));
- return ip ? ip : & dummy_input_global;
+ return ip ? ip : &dummy_input_global;
}
int
{
return c1.position_- c2.position_;
}
-
};
class New_fingering_engraver : public Engraver
*/
for (int i = 0; i < fingerings_.size (); i++)
{
- fingerings_[i].position_ = scm_to_int (fingerings_[i].head_ -> get_property ("staff-position"));
+ fingerings_[i].position_ = scm_to_int (fingerings_[i].head_->get_property ("staff-position"));
}
for (int i = fingerings_.size (); i--;)
else if (up_p)
{
up.concat (fingerings_);
- fingerings_ .clear ();
+ fingerings_.clear ();
}
else
{
f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, X_AXIS);
f->set_property ("direction", scm_int2num (UP));
-
}
for (int i = 0; i < down.size (); i++)
void
check_meshing_chords (Grob *me,
- Drul_array< Array<Real> > *offsets,
- Drul_array< Array<Slice> > const &extents,
- Drul_array < Link_array<Grob> > const &clash_groups)
+ Drul_array<Array<Real> > *offsets,
+ Drul_array<Array<Slice> > const &extents,
+ Drul_array<Link_array<Grob> > const &clash_groups)
{
if (!extents[UP].size () || ! extents[DOWN].size ())
else
distant_half_collide = true;
}
- else if (ups[i]== dps[j])
+ else if (ups[i] == dps[j])
full_collide = true;
- else if (ups[i] >dps[0] && ups[i] < dps.top ())
+ else if (ups[i] > dps[0] && ups[i] < dps.top ())
merge_possible = false;
- else if (dps[j] >ups[0] && dps[j] < ups.top ())
+ else if (dps[j] > ups[0] && dps[j] < ups.top ())
merge_possible = false;
if (ups[i] < dps[j])
for (int i = 0; i < clash_groups[d].size (); i++)
(*offsets)[d][i] += d * shift_amount;
}
- while ((flip (&d))!= UP);
+ while ((flip (&d)) != UP);
}
void
Note_collision_interface::do_shifts (Grob *me)
{
- Drul_array< Link_array<Grob> > cg = get_clash_groups (me);
+ Drul_array<Link_array<Grob> > cg = get_clash_groups (me);
SCM autos (automatic_shift (me, cg));
SCM hand (forced_shift (me));
amounts.push (amount);
if (amount < left_most)
left_most = amount;
-
}
for (; scm_is_pair (autos); autos = scm_cdr (autos))
{
Grob *s = unsmob_grob (scm_caar (autos));
- Real amount = scm_to_double (scm_cdar (autos)) *wid;
+ Real amount = scm_to_double (scm_cdar (autos)) * wid;
if (!done.find (s))
{
}
}
-Drul_array< Link_array<Grob>
+Drul_array < Link_array<Grob>
> Note_collision_interface::get_clash_groups (Grob *me)
{
- Drul_array < Link_array<Grob> > clash_groups;
+ Drul_array<Link_array<Grob> > clash_groups;
SCM s = me->get_property ("elements");
for (; scm_is_pair (s); s = scm_cdr (s))
Direction d = UP;
do
{
- Link_array<Grob> & clashes (clash_groups[d]);
+ Link_array<Grob> &clashes (clash_groups[d]);
clashes.sort (Note_column::shift_compare);
}
- while ((flip (&d))!= UP);
+ while ((flip (&d)) != UP);
return clash_groups;
}
*/
SCM
Note_collision_interface::automatic_shift (Grob *me,
- Drul_array< Link_array<Grob>
+ Drul_array < Link_array<Grob>
> clash_groups)
{
Drul_array < Array<int> > shifts;
Direction d = UP;
do
{
- Array<int> & shift (shifts[d]);
- Link_array<Grob> & clashes (clash_groups[d]);
+ Array<int> &shift (shifts[d]);
+ Link_array<Grob> &clashes (clash_groups[d]);
for (int i = 0; i < clashes.size (); i++)
{
shift.push (0);
}
- for (int i =1; i < shift.size (); i++)
+ for (int i = 1; i < shift.size (); i++)
{
if (shift[i - 1] == shift[i])
{
}
}
}
- while ((flip (&d))!= UP);
+ while ((flip (&d)) != UP);
- Drul_array< Array<Slice> > extents;
- Drul_array< Array<Real> > offsets;
+ Drul_array<Array<Slice> > extents;
+ Drul_array<Array<Real> > offsets;
d = UP;
do
{
offsets[d].push (d * 0.5 * i);
}
}
- while ((flip (&d))!= UP);
+ while ((flip (&d)) != UP);
/*
do horizontal shifts of each direction
do
{
- for (int i =1; i < clash_groups[d].size (); i++)
+ for (int i = 1; i < clash_groups[d].size (); i++)
{
Slice prev = extents[d][i - 1];
prev.intersect (extents[d][i]);
- if (prev.length ()> 0
+ if (prev.length () > 0
|| (extents[-d].size () && d * (extents[d][i][-d] - extents[-d][0][d]) < 0))
for (int j = i; j < clash_groups[d].size (); j++)
offsets[d][j] += d * 0.5;
}
}
- while ((flip (&d))!= UP);
+ while ((flip (&d)) != UP);
/*
Check if chords are meshing
tups);
}
while (flip (&d) != UP);
+
return tups;
}
SCM s1 = p1->get_property ("horizontal-shift");
SCM s2 = p2->get_property ("horizontal-shift");
- int h1 = (scm_is_number (s1))? scm_to_int (s1) :0;
- int h2 = (scm_is_number (s2)) ? scm_to_int (s2):0;
+ int h1 = (scm_is_number (s1)) ? scm_to_int (s1) : 0;
+ int h2 = (scm_is_number (s2)) ? scm_to_int (s2) : 0;
return h1 - h2;
}
Axis_group_interface::add_element (me, d);
}
-
Grob *
Note_column::first_head (Grob *me)
{
Grob *st = get_stem (me);
- return st? Stem::first_head (st): 0;
+ return st ? Stem::first_head (st) : 0;
}
/*
head_ = 0;
}
-
ADD_TRANSLATOR (Note_head_line_engraver,
/* descr */ "Engrave a line between two note heads, for example a glissando. If "
" followVoice is set, staff switches also generate a line.",
if (d == RIGHT && it->break_status_dir () != col_dir)
{
- it = it -> find_prebroken_piece (col_dir);
-
+ it = it->find_prebroken_piece (col_dir);
}
/*
some kind of mismatch, eg. a note column, that is behind a
FIXED also includes the left part of the right object.
*/
*fixed
- = (left_head_wid.is_empty () ? increment :
- /*
- Size of the head:
- */
+ = (left_head_wid.is_empty () ? increment
+ : /*
+ Size of the head:
+ */
(left_head_wid[RIGHT]+
/*
stem_posns[RIGHT] = bar_yextent;
}
- if (correct_stem_dirs && stem_dirs[LEFT] *stem_dirs[RIGHT] == -1)
+ if (correct_stem_dirs && stem_dirs[LEFT] * stem_dirs[RIGHT] == -1)
{
if (beams_drul[LEFT] && beams_drul[LEFT] == beams_drul[RIGHT])
{
}
}
- correction = note_head_width* stem_dirs[LEFT];
+ correction = note_head_width * stem_dirs[LEFT];
correction *= robust_scm2double (me->get_property ("knee-spacing-correction"), 0);
*fixed += correction;
}
}
}
}
- else if (correct_stem_dirs && stem_dirs[LEFT] *stem_dirs[RIGHT] == UP)
+ else if (correct_stem_dirs && stem_dirs[LEFT] * stem_dirs[RIGHT] == UP)
{
/*
Correct for the following situation:
/* there used to be a correction for bar_xextent () here, but
it's unclear what that was good for ?
*/
-
}
-
ADD_INTERFACE (Note_spacing, "note-spacing-interface",
"This object calculates spacing wishes for individual voices.",
"left-items right-items stem-spacing-correction knee-spacing-correction");
keys_[number] = k;
scm_gc_unprotect_object (k->self_scm ());
}
-
}
Object_key const *
void
Object_key::derived_mark () const
{
-
}
Object_key::~Object_key ()
int
Copied_key::do_compare (Object_key const *key) const
{
- Copied_key const *other = dynamic_cast < Copied_key const *> (key);
+ Copied_key const *other = dynamic_cast<Copied_key const *> (key);
int c = original_->compare (other->original_);
if (c)
{
if (SCM_HASHTABLE_P (lily_character_table_))
{
- const int len =256;
+ const int len = 256;
char name[len];
int code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
if (code)
pango_description_ = pango_font_description_copy (description);
// context_ = pango_ft2_font_map_create_context (fontmap);
- attribute_list_= pango_attr_list_new ();
+ attribute_list_ = pango_attr_list_new ();
/*
urgh. I don't understand this. Why isn't this 1/(scale *
FcPattern *fcpat = fcfont->font_pattern;
char *filename = 0;
- FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) &filename);
+ FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) & filename);
char const *ps_name_str0 = FT_Get_Postscript_Name (ftface);
if (!ps_name_str0)
{
Stencil frame = Lookup::frame (dest.extent_box (), 0.1, 0.1);
Box empty;
- empty.set_empty();
- Stencil dimless_frame (empty, frame.expr());
+ empty.set_empty ();
+ Stencil dimless_frame (empty, frame.expr ());
dest.add_stencil (frame);
}
#endif
return SCM_UNSPECIFIED;
}
-
LY_DEFINE (ly_outputter_output_scheme, "ly:outputter-output-scheme",
2, 0, 0, (SCM outputter, SCM expr),
"Eval @var{expr} in module of @var{outputter}.")
Paper_system::mark_smob (SCM smob)
{
Paper_system *system = (Paper_system *) SCM_CELL_WORD_1 (smob);
- return system-> stencil_.expr ();
+ return system->stencil_.expr ();
}
int
second_iter_->quit ();
null_.set_context (0);
- one_ .set_context (0);
+ one_.set_context (0);
two_.set_context (0);
shared_.set_context (0);
solo_.set_context (0);
-
}
Part_combine_iterator::Part_combine_iterator ()
{
if (first_iter_)
first_iter_->substitute_outlet (f, t);
-
}
Moment
if (!event)
event = make_music_by_name (ly_symbol2scm ("SoloOneEvent"));
- first_iter_-> try_music_in_children (event);
+ first_iter_->try_music_in_children (event);
}
playing_state_ = SOLO1;
}
if (!event)
event = make_music_by_name (ly_symbol2scm ("SoloTwoEvent"));
- second_iter_-> try_music_in_children (event);
+ second_iter_->try_music_in_children (event);
playing_state_ = SOLO2;
}
}
= get_outlet ()->find_create_context (ly_symbol2scm ("Voice"),
"solo", props);
- solo_ .set_context (solo_tr);
+ solo_.set_context (solo_tr);
Context *null
= get_outlet ()->find_create_context (ly_symbol2scm ("Devnull"),
execute_pushpop_property (two, sym,
ly_symbol2scm ("direction"), scm_int2num (-1));
}
-
}
void
Moment meas_len (robust_scm2moment (get_property ("measureLength"), Moment (1)));
if (meas_len == body_length_)
repeat_sign_type_ = MEASURE;
- else if (Moment (2)* meas_len == body_length_)
+ else if (Moment (2) * meas_len == body_length_)
{
repeat_sign_type_ = DOUBLE_MEASURE;
next_moment_ += meas_len;
*/
if (repeat_sign_type_ == DOUBLE_MEASURE)
global->add_moment_to_process (next_moment_ + meas_len + Moment (i) * body_length_);
-
}
return true;
double_percent_ = 0;
}
-
void
Percent_repeat_engraver::start_translation_timestep ()
{
typeset_perc ();
}
-
ADD_TRANSLATOR (Percent_repeat_engraver,
/* descr */ "Make whole bar and double bar repeats.",
/* creats*/ "PercentRepeat DoublePercentRepeat",
{
Translator *t = unsmob_translator (scm_car (p));
Performer *eng = dynamic_cast<Performer *> (t);
- if (eng && eng!= info.origin_trans_)
+ if (eng && eng != info.origin_trans_)
eng->acknowledge_audio_element (info);
}
}
}
else if (inside == SCM_BOOL_F)
{
- Grob *slur = slurs_.size ()?slurs_[0] : 0;
+ Grob *slur = slurs_.size () ? slurs_[0] : 0;
slur = (end_slurs_.size () && !slur)
? end_slurs_[0] : slur;
{
char *names [] = { "Sostenuto", "Sustain", "UnaCorda", 0 };
- info_list_ = new Pedal_info[sizeof (names)/ sizeof (const char *)];
+ info_list_ = new Pedal_info[sizeof (names) / sizeof (const char *)];
Pedal_info *p = info_list_;
char **np = names;
String name = String (p->name_) + "PedalLineSpanner";
Music *rq = (p->event_drul_[START] ? p->event_drul_[START] : p->event_drul_[STOP]);
p->line_spanner_ = make_spanner (name.to_str0 (), rq->self_scm ());
-
}
/* Choose the appropriate grobs to add to the line spanner
{
p->line_spanner_->set_bound (RIGHT, c);
}
- p->bracket_ ->set_bound (RIGHT, c);
+ p->bracket_->set_bound (RIGHT, c);
p->finished_bracket_ = p->bracket_;
p->bracket_ = 0;
void
Piano_pedal_performer::stop_translation_timestep ()
{
- for (int i = 0; i< audios_.size (); i++)
+ for (int i = 0; i < audios_.size (); i++)
play_element (audios_[i]);
audios_.clear ();
}
"The @var{alter} is zero for a natural, negative for "
"flats, or positive for sharps. ")
{
- SCM_ASSERT_TYPE (scm_integer_p (octave)== SCM_BOOL_T, octave, SCM_ARG1, __FUNCTION__, "integer");
- SCM_ASSERT_TYPE (scm_integer_p (note)== SCM_BOOL_T, note, SCM_ARG2, __FUNCTION__, "integer");
- SCM_ASSERT_TYPE (scm_integer_p (alter)== SCM_BOOL_T, alter, SCM_ARG3, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE (scm_integer_p (octave) == SCM_BOOL_T, octave, SCM_ARG1, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE (scm_integer_p (note) == SCM_BOOL_T, note, SCM_ARG2, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE (scm_integer_p (alter) == SCM_BOOL_T, alter, SCM_ARG3, __FUNCTION__, "integer");
Pitch p (scm_to_int (octave), scm_to_int (note), scm_to_int (alter));
return p.smobbed_copy ();
int
Pitch::steps () const
{
- return notename_ + octave_*7;
+ return notename_ + octave_ * 7;
}
/* Should be settable from input? */
Protected_scm::Protected_scm (SCM s)
{
- object_ = SCM_NIMP (s) ? scm_gc_protect_object (s): s;
+ object_ = SCM_NIMP (s) ? scm_gc_protect_object (s) : s;
}
Protected_scm::Protected_scm (Protected_scm const &s)
}
Protected_scm &
-Protected_scm::operator= (SCM s)
+Protected_scm::operator = (SCM s)
{
if (object_ == s)
return *this;
}
Protected_scm &
-Protected_scm::operator= (Protected_scm const &s)
+Protected_scm::operator = (Protected_scm const &s)
{
- return operator= (s.object_);
+ return operator = (s.object_);
}
Protected_scm::operator SCM () const
virtual void start_translation_timestep ();
virtual void process_music ();
virtual void initialize ();
-
};
void
Music *me = unsmob_music (m);
Music *body = unsmob_music (me->get_property ("element"));
- Moment rv = (body) ? body->start_mom () :
- Music_sequence::first_start (me->get_property ("elements"));
+ Moment rv = (body) ? body->start_mom ()
+ : Music_sequence::first_start (me->get_property ("elements"));
return rv.smobbed_copy ();
}
This is incomplete: in case of an uneven number of rests, the
center one should be centered on the staff.
*/
- Drul_array< Link_array<Grob> > ordered_rests;
+ Drul_array<Link_array<Grob> > ordered_rests;
for (int i = 0; i < rests.size (); i++)
{
Grob *r = Note_column::get_rest (rests[i]);
Real last_y = ordered_rests[d][i + 1]->extent (common, Y_AXIS)[d];
Real y = ordered_rests[d][i]->extent (common, Y_AXIS)[-d];
- Real diff = d * ((last_y - y) /staff_space);
+ Real diff = d * ((last_y - y) / staff_space);
if (diff > 0)
Note_column::translate_rests (ordered_rests[d][i], d * (int) ceil (diff) * 2);
}
}
while (flip (&d) != LEFT);
-
}
else
{
if (!stafflines)
{
programming_error ("No staff line count ? ");
- stafflines =5;
+ stafflines = 5;
}
// move discretely by half spaces.
- int discrete_dist = int (ceil (dist / (0.5 *staff_space)));
+ int discrete_dist = int (ceil (dist / (0.5 * staff_space)));
// move by whole spaces inside the staff.
if (discrete_dist < stafflines + 1)
- discrete_dist = int (ceil (discrete_dist / 2.0)* 2.0);
+ discrete_dist = int (ceil (discrete_dist / 2.0) * 2.0);
Note_column::translate_rests (rcol, dir * discrete_dist);
}
{
rest_ = make_item ("Rest", rest_req_->self_scm ());
- int durlog = unsmob_duration (rest_req_->get_property ("duration"))-> duration_log ();
+ int durlog = unsmob_duration (rest_req_->get_property ("duration"))->duration_log ();
rest_->set_property ("duration-log",
scm_int2num (durlog));
Rhythmic_head::set_dots (rest_, dot_);
dot_->set_parent (rest_, Y_AXIS);
dot_->set_property ("dot-count", scm_int2num (dots));
-
}
Pitch *p = unsmob_pitch (rest_req_->get_property ("pitch"));
rest_->set_property ("staff-position", scm_int2num (pos));
}
-
}
}
the default spacing do its work.
*/
-class Rhythmic_column_engraver :public Engraver
+class Rhythmic_column_engraver : public Engraver
{
Link_array<Grob> rheads_;
Grob *stem_;
spacing_ = make_item ("NoteSpacing", SCM_EOL);
spacing_->set_property ("left-items", scm_cons (note_column_->self_scm (), SCM_EOL));
-
if (last_spacing_)
{
Pointer_group_interface::add_grob (last_spacing_,
ly_symbol2scm ("right-items"),
note_column_);
}
-
}
for (int i = 0; i < rheads_.size (); i++)
Note_column::set_stem (note_column_, stem_);
stem_ = 0;
}
-
}
}
distance_ += -d * item_drul_[d]->relative_coordinate (pc, X_AXIS);
item_drul_[d] = pc;
}
- while ((flip (&d))!= LEFT);
-
+ while ((flip (&d)) != LEFT);
}
void
}
void
-Scheme_hash_table::operator= (Scheme_hash_table const &src)
+Scheme_hash_table::operator = (Scheme_hash_table const &src)
{
if (&src == this)
return;
*/
if (elt_count_ > 2 * scm_c_vector_length (hash_tab_))
{
- SCM nh = scm_make_vector (scm_int2num (3* elt_count_ + 1), SCM_EOL);
+ SCM nh = scm_make_vector (scm_int2num (3 * elt_count_ + 1), SCM_EOL);
elt_count_ = copy_scm_hashes (nh, hash_tab_);
hash_tab_ = nh;
}
puts ("");
printf (_ (" The function ly:set-option allows for access to some internal variables.").to_str0 ());
puts ("\n");
- printf (_ ("Usage: lilypond -e \"(ly:set - option SYMBOL VAL)\"").to_str0 ());
+ printf (_ ("Usage: lilypond -e \"(ly : set - option SYMBOL VAL)\"").to_str0 ());
puts ("\n");
printf (_ ("Use help as SYMBOL to get online help.").to_str0 ());
"@end table\n"
"\n"
"This function is useful to call from the command line: @code{lilypond -e\n"
- "\"(ly:set - option 'midi-debug #t)\"}.\n")
+ "\"(ly : set - option 'midi-debug #t)\"}.\n")
{
if (val == SCM_UNDEFINED)
val = SCM_BOOL_T;
{
bool br = to_boolean (elem->get_property ("breakable"));
Axis_group_interface::add_element (br ? command_column_ : musical_column_, elem);
-
}
}
if (!elem->get_parent (Y_AXIS))
Score_engraver::get_output ()
{
Music_output *o = pscore_;
- ///FIXME WTF? pscore_ = 0;
+ ///FIXME WTF ? pscore_ = 0;
return o;
}
gi.grob_);
}
}
-
}
ADD_TRANSLATOR (Score_engraver,
return systems;
}
-
void
Score::set_music (SCM music, SCM parser)
{
m->origin ()->error (_ ("Error found in this music expression. Ignoring it"));
this->error_found_ = this->error_found_ || to_boolean (m->get_property ("error-found"));
-
}
if (this->error_found_)
this->music_ = SCM_EOL;
else
this->music_ = music;
-
}
SCM
if (!scol_ && scripts_.size () > 1)
{
scol_ = make_item ("ScriptColumn", SCM_EOL);
-
}
if (scol_)
Script_column::add_staff_sided (scol_, scripts_[i]);
scripts_.clear ();
}
-
}
ADD_TRANSLATOR (Script_column_engraver,
last = g;
}
-
}
while (flip (&d) != DOWN);
}
Side_position_interface::set_axis (p, Y_AXIS);
-
}
void
Rod rod;
rod.item_drul_[LEFT] = l;
- rod.item_drul_[RIGHT]= r;
+ rod.item_drul_[RIGHT] = r;
rod.distance_ = li[RIGHT] - ri[LEFT] + padding;
this grob doesn't cause a constraint. We look further until we
find one that does.
*/
-
}
}
me->add_dependency (i);
}
-
ADD_INTERFACE (Separating_group_spanner, "separation-spanner-interface",
"A spanner that calculates spacing constraints (\"rods\") "
"using the @code{separation-item-interface} grobs in @code{elements}.",
Pointer_group_interface::add_grob (last_spacings_.note_spacings_[i],
ly_symbol2scm ("right-items"),
break_item_);
-
}
else if (last_spacings_.staff_spacing_)
{
if (musical_item_)
Pointer_group_interface::add_grob (sp, ly_symbol2scm ("right-items"),
musical_item_);
-
}
if (!current_spacings_.is_empty ())
return last_grob;
}
-
ADD_INTERFACE (Separation_item, "separation-item-interface",
"Item that computes widths to generate spacing rods. "
"This is done in concert with @ref{separation-spanner-interface}.",
iter_->quit ();
}
-
void
Sequential_iterator::derived_mark () const
{
return general_side_position (me, a, false);
}
-
Real
directed_round (Real f, Direction d)
{
{
Real p = Staff_symbol_referencer::get_position (me);
Real rp = directed_round (p, d);
- Real rad = Staff_symbol_referencer::staff_radius (me) *2;
+ Real rad = Staff_symbol_referencer::staff_radius (me) * 2;
int ip = int (rp);
Grob *head = me->get_parent (X_AXIS);
Grob *common = me->common_refpoint (st, Y_AXIS);
Interval staff_size = st->extent (common, Y_AXIS);
- Real diff = d*staff_size[d] + padding - d* (o + iv[-d]);
- o += (d* (diff >? 0));
+ Real diff = d*staff_size[d] + padding - d * (o + iv[-d]);
+ o += (d * (diff >? 0));
}
return scm_make_real (o);
Simple_spacer::set_active_states ()
{
/* float comparison is safe, since force is only copied. */
- for (int i = 0; i <springs_.size (); i++)
+ for (int i = 0; i < springs_.size (); i++)
if (springs_[i].is_active_
&& springs_[i].block_force_ >= force_)
{
if (scm_to_double (p) > 9999)
break_satisfy = break_satisfy && ! (i == 0 || i == sz -1);
}
-
}
positions->satisfies_constraints_
Simultaneous_music_iterator::derived_substitute (Context *f, Context *t)
{
for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
- unsmob_iterator (scm_car (s))-> substitute_outlet (f, t);
+ unsmob_iterator (scm_car (s))->substitute_outlet (f, t);
}
void
if (!w.is_empty ()
&& w.length () > EPS
- && d* (my_height - stick_out) < 0)
+ && d * (my_height - stick_out) < 0)
{
Interval e1 (line->elem (i).width_[LEFT], extent[LEFT]);
Interval e3 (extent[RIGHT], line->elem (i).width_[RIGHT]);
if (!e1.is_empty () && e1.length () > EPS)
line->insert (Skyline_entry (e1, my_height), i);
}
-
}
}
void
-merge_skyline (Array<Skyline_entry> * a1,
+merge_skyline (Array<Skyline_entry> *a1,
Array<Skyline_entry> const &a2,
Direction dir)
{
{
width_ = i;
height_ = r;
-
}
void
beat_slash_ = 0;
}
-
ADD_TRANSLATOR (Slash_repeat_engraver,
/* descr */ "Make beat repeats.",
/* creats*/ "RepeatSlash",
{
Offset z = (avoid[i] - x0);
Offset p (dot_product (z, dz_unit),
- d* dot_product (z, dz_perp));
+ d * dot_product (z, dz_perp));
if (!curve_xext.contains (p[X_AXIS]))
continue;
continue;
Encompass_info inf (state.get_encompass_info (encompasses[i]));
- Real y = state.dir_ * ((state.dir_ * inf.head_) >? (state.dir_ *inf.stem_));
+ Real y = state.dir_ * ((state.dir_ * inf.head_) >? (state.dir_ * inf.stem_));
avoid.push (Offset (inf.x_, y + state.dir_ * state.parameters_.free_head_distance_));
}
index_ = -1;
};
-
void
Slur_configuration::score_encompass (Slur_score_state const &state)
{
Real closest
= state.dir_ * (state.dir_ * state.encompass_infos_[j].get_point (state.dir_)
- >? state.dir_ *line_y);
+ >? state.dir_ * line_y);
Real d = fabs (closest - y);
convex_head_distances.push (d);
Item *as_item = dynamic_cast<Item *> (state.extra_encompass_infos_[j].grob_);
if ((as_item
&& as_item->get_column ()
- == state.extremes_[d] .bound_->get_column ())
+ == state.extremes_[d].bound_->get_column ())
|| state.extra_encompass_infos_[j].extents_[X_AXIS].contains (attachment[d][X_AXIS]))
{
y = attachment[d][Y_AXIS];
void
Slur_engraver::set_melisma (bool m)
{
- context ()->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
+ context ()->set_property ("slurMelismaBusy", m ? SCM_BOOL_T : SCM_BOOL_F);
}
void
}
else if (inside == SCM_BOOL_F)
{
- Grob *slur = slurs_.size ()?slurs_[0] : 0;
+ Grob *slur = slurs_.size () ? slurs_[0] : 0;
slur = (end_slurs_.size () && !slur)
? end_slurs_[0] : slur;
void
Slur_performer::set_melisma (bool ml)
{
- context ()->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+ context ()->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T : SCM_BOOL_F);
}
void
return ei;
}
-
Drul_array<Bound_info>
Slur_score_state::get_bound_info () const
{
}
}
while (flip (&d) != LEFT);
+
return extremes;
}
if (extremes_[d].note_column_)
{
end_ys[d] = dir_
- * ((dir_ * (base_attachments_[d][Y_AXIS] + parameters_.region_size_* dir_))
+ * ((dir_ * (base_attachments_[d][Y_AXIS] + parameters_.region_size_ * dir_))
>? (dir_ * (dir_ + extremes_[d].note_column_->extent (common_[Y_AXIS],
Y_AXIS)[dir_]))
>? (dir_ * base_attachments_[-d][Y_AXIS]));
.linear_combination (CENTER);
}
base_attachment[d] = Offset (x, y);
-
}
while (flip (&d) != LEFT);
Slur_score_state::generate_curves () const
{
Real r_0 = robust_scm2double (slur_->get_property ("ratio"), 0.33);
- Real h_inf = staff_space_ *scm_to_double (slur_->get_property ("height-limit"));
+ Real h_inf = staff_space_ * scm_to_double (slur_->get_property ("height-limit"));
for (int i = 0; i < configurations_.size (); i++)
configurations_[i]->generate_curve (*this, r_0, h_inf);
}
-
Link_array<Slur_configuration>
Slur_score_state::enumerate_attachments (Drul_array<Real> end_ys) const
{
for (int k = 0; k < 3; k++)
{
- Direction hdir = Direction (k /2 - 1);
+ Direction hdir = Direction (k / 2 - 1);
/*
Only take bound into account if small slur starts
yext[dir_] = z[Y_AXIS] + dir_ * thickness_ * 1.0;
Interval xext (-1, 1);
- xext = xext * (thickness_*2) + z[X_AXIS];
+ xext = xext * (thickness_ * 2) + z[X_AXIS];
Extra_collision_info info (small_slur,
k - 1.0,
xext,
Spaceable_grob::add_rod (Grob *me, Grob *p, Real d)
{
// printf ("rod %lf\n", d);
- if (isinf(d) || d < 0)
+ if (isinf (d) || d < 0)
{
programming_error ("Weird rod");
}
{
spacing_ = make_spanner ("SpacingSpanner", SCM_EOL);
spacing_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-
}
}
{
starter = starter <? m;
playing_durations_.insert (now_durations_[i]);
-
}
}
now_durations_.clear ();
stopped_durations_.push (playing_durations_.get ());
}
-
ADD_TRANSLATOR (Spacing_engraver,
/* descr */ "make a SpacingSpanner and do bookkeeping of shortest starting and playing notes ",
/* creats*/ "SpacingSpanner",
dists[d] = dists[d] >? fixed_space;
}
-
}
}
while (flip (&d) != LEFT);
/*
sloppy with typnig left/right-neighbors should take list, but paper-column found instead.
*/
- SCM ln = cols[i] ->get_property ("left-neighbors");
+ SCM ln = cols[i]->get_property ("left-neighbors");
if (!scm_is_pair (ln) && i)
{
cols[i]->set_property ("left-neighbors", scm_cons (cols[i - 1]->self_scm (), SCM_EOL));
}
- SCM rn = cols[i] ->get_property ("right-neighbors");
+ SCM rn = cols[i]->get_property ("right-neighbors");
if (!scm_is_pair (rn) && i < cols.size () - 1)
{
cols[i]->set_property ("right-neighbors", scm_cons (cols[i + 1]->self_scm (), SCM_EOL));
compound_note_space = compound_note_space + space;
compound_fixed_note_space = compound_fixed_note_space + fixed;
wish_count++;
-
}
}
pointer munging.
*/
- assert (spacing_grob-> get_column () == l);
+ assert (spacing_grob->get_column () == l);
Staff_spacing::get_spacing_params (spacing_grob,
&space, &fixed_space);
*/
Real log = log_2 (shortest);
k -= log;
- Rational compdur = d.main_part_ + d.grace_part_ /Rational (3);
+ Rational compdur = d.main_part_ + d.grace_part_ / Rational (3);
*expand_only = false;
return (log_2 (compdur) + k) * incr;
Moment *dt = unsmob_moment (rc->get_property ("measure-length"));
if (dt)
{
- delta_t = delta_t <? *dt;
+ delta_t = delta_t <? * dt;
/*
The following is an extra safety measure, such that
the length of a mmrest event doesn't cause havoc.
*/
- shortest_playing_len = shortest_playing_len <? *dt;
+ shortest_playing_len = shortest_playing_len <? * dt;
}
}
Real dist = 0.0;
&& to_boolean (get_property ("connectArpeggios")))
{
span_arpeggio_ = make_item ("Arpeggio", SCM_EOL);
-
}
}
spanbar_ = make_item ("SpanBar", SCM_EOL);
spanbar_->set_parent (bars_[0], X_AXIS);
-
}
}
}
span_events_[STOP] = 0;
span_events_[START] = 0;
-
}
bool
#include <math.h>
-#include <libc-extension.hh>
+#include < libc - extension.hh>
#include "warn.hh"
#include "paper-column.hh"
broken_intos_.push (span);
}
}
- while ((flip (&d))!= LEFT);
+ while ((flip (&d)) != LEFT);
}
else
{
break_points.insert (left, 0);
break_points.push (right);
- for (int i =1; i < break_points.size (); i++)
+ for (int i = 1; i < break_points.size (); i++)
{
Drul_array<Item *> bounds;
bounds[LEFT] = break_points[i - 1];
if (!bounds[d]->get_system ())
bounds[d] = bounds[d]->find_prebroken_piece (- d);
}
- while ((flip (&d))!= LEFT);
+ while ((flip (&d)) != LEFT);
if (!bounds[LEFT] || ! bounds[RIGHT])
{
: Grob (s, key)
{
break_index_ = 0;
- spanned_drul_[LEFT]= 0;
- spanned_drul_[RIGHT]= 0;
+ spanned_drul_[LEFT] = 0;
+ spanned_drul_[RIGHT] = 0;
Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("spanner-interface"));
}
Real l = spanned_drul_[LEFT]->relative_coordinate (0, X_AXIS);
Real r = spanned_drul_[RIGHT]->relative_coordinate (0, X_AXIS);
- if (r< l)
+ if (r < l)
programming_error ("spanner with negative length");
return r - l;
do
if (spanned_drul_[d])
scm_gc_mark (spanned_drul_[d]->self_scm ());
- while (flip (&d) != LEFT);
+ while (flip (&d) != LEFT)
+ ;
for (int i = broken_intos_.size (); i--;)
scm_gc_mark (broken_intos_[i]->self_scm ());
Spring_smob::Spring_smob ()
{
distance_ = 0.;
- strength_ =1.0;
+ strength_ = 1.0;
expand_only_b_ = false;
other_ = 0;
}
Staff_collecting_engraver::Staff_collecting_engraver ()
{
-
}
void
for (SCM t = g->get_property ("elements");
scm_is_pair (t); t = scm_cdr (t))
max_corr = max_corr >? next_note_correction (me, unsmob_grob (scm_car (t)), bar_size);
-
}
return max_corr;
span_ = make_spanner ("StaffSymbol", SCM_EOL);
span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-
}
}
s.grob_->set_property ("staff-symbol", span_->self_scm ());
}
-
ADD_TRANSLATOR (Staff_symbol_engraver,
/* descr */ "Create the constellation of five (default) "
"staff lines.",
if (init)
{
int k = scm_ilength (get_property ("stringTunings"));
- if (k>= 0)
+ if (k >= 0)
span_->set_property ("line-count", scm_int2num (k));
}
}
int l = Staff_symbol::line_count (me);
- Real height = (l - 1) * staff_space (me) /2;
+ Real height = (l - 1) * staff_space (me) / 2;
Stencil a
= Lookup::horizontal_line (span_points
-me->relative_coordinate (common, X_AXIS),
SCM lt_pair = me->get_property ("ledger-line-thickness");
Offset z = robust_scm2offset (lt_pair, Offset (1.0, 0.1));
- return z[X_AXIS] * get_line_thickness (me) + z[Y_AXIS]* staff_space (me);
+ return z[X_AXIS] * get_line_thickness (me) + z[Y_AXIS] * staff_space (me);
}
ADD_INTERFACE (Staff_symbol, "staff-symbol-interface",
Stanza_number_align_engraver::Stanza_number_align_engraver ()
{
-
}
void
text_ = make_item ("StanzaNumber", SCM_EOL);
text_->set_property ("text", stanza);
-
}
}
// todo: margins
Direction d = get_direction (me);
- if (d && d * head_positions (me)[get_direction (me)] >= se*d)
+ if (d && d * head_positions (me)[get_direction (me)] >= se * d)
me->warning (_ ("Weird stem size; check for narrow beams"));
me->set_property ("stem-end-position", scm_make_real (se));
}
}
while (flip (&d) != DOWN);
-
}
return exthead;
}
if (dir && dir * hp[dir] >= 0)
{
SCM sshorten = me->get_property ("stem-shorten");
- SCM scm_shorten = scm_is_pair (sshorten) ?
- robust_list_ref ((duration_log (me) - 2) >? 0, sshorten): SCM_EOL;
+ SCM scm_shorten = scm_is_pair (sshorten)
+ ? robust_list_ref ((duration_log (me) - 2) >? 0, sshorten) : SCM_EOL;
Real shorten = 2* robust_scm2double (scm_shorten, 0);
/* On boundary: shorten only half */
= me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
Box b = Box (Interval (-stem_width / 2, stem_width / 2),
- Interval (stem_y[DOWN]*half_space, stem_y[UP]*half_space));
+ Interval (stem_y[DOWN] * half_space, stem_y[UP] * half_space));
Stencil ss = Lookup::round_filled_box (b, blot);
mol.add_stencil (ss);
if (!get_beam (me) && abs (duration_log (me)) > 2)
{
Stencil fl = flag (me);
- fl.translate_axis (stem_y[d]*half_space - d * blot / 2, Y_AXIS);
+ fl.translate_axis (stem_y[d] * half_space - d * blot / 2, Y_AXIS);
fl.translate_axis (stem_width / 2, X_AXIS);
mol.add_stencil (fl);
}
#include "lookup.hh"
#include "stencil.hh"
-
/*
TODO: naming add/combine.
*/
Stencil *q = unsmob_stencil (new_s);
q->translate_axis (real_amount, Axis (scm_to_int (axis)));
return new_s;
-
}
LY_DEFINE (ly_translate_stencil, "ly:stencil-translate",
a.arg1 = arg1;
Offset o = ly_scm2offset (offset);
- interpret_stencil_expression (expr, stencil_interpret_in_scm, (void *) &a, o);
+ interpret_stencil_expression (expr, stencil_interpret_in_scm, (void *) & a, o);
return SCM_UNSPECIFIED;
}
#include <math.h>
-#include <libc-extension.hh> // isinf
+#include < libc - extension.hh> // isinf
#include "input-smob.hh"
#include "font-metric.hh"
fl.fonts_ = SCM_EOL;
interpret_stencil_expression (expr, &find_font_function,
- (void *) &fl, Offset (0, 0));
+ (void *) & fl, Offset (0, 0));
return fl.fonts_;
}
String_number_engraver::String_number_engraver ()
{
-
}
/*
ly_symbol2string (delim_name).to_str0 ());
delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-
}
}
void
if (delim_)
{
delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
-
}
}
return true;
}
-
ADD_TRANSLATOR (Tempo_performer, "", "",
"metronome-change-event",
"", "", "");
"A scheme markup text, see @usermanref{Text-markup}.",
"text baseline-skip word-space");
-
}
}
while (flip (&d) != LEFT);
+
do
{
- if (d* span_points[d] > d * edge[-d].extent (X_AXIS)[d])
+ if (d * span_points[d] > d * edge[-d].extent (X_AXIS)[d])
{
edge_line[d].translate_axis (span_points[d], X_AXIS);
m.add_stencil (edge_line[d]);
read_header ();
read_params ();
read_char_metrics ();
-
}
static const Real
font family and face byte probably aren't. So we don't read them. */
info_.coding_scheme = header_length > 2
? get_bcpl_string () : "unspecified";
-
}
/* Although TFM files are only usable by TeX if they have at least seven
for (Char_code i = 2; i <= header_.param_word_count; i++)
info_.parameters[i - 1] = get_U32_fix_scaled ();
-
}
/* Read every character in the TFM file, storing the result in the
#define GET_CHAR_DIMEN(d) \
if (d##_index != 0) \
{ \
- input_.seek_str0 (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; \
#define KERN_FLAG 128
void
-Tex_font_metric_reader::read_lig_kern_program (Array<Tfm_ligature>* ligatures, Array<Tfm_kern>* kerns)
+Tex_font_metric_reader::read_lig_kern_program (Array<Tfm_ligature> *ligatures, Array<Tfm_kern> *kerns)
{
bool end_b;
input_.set_pos (old_pos);
kerns->push (kern_element);
-
}
else
{
ligature_element.character = next_char;
ligature_element.ligature = remainder;
ligatures->push (ligature_element);
-
}
}
while (!end_b);
-
}
Real d = -depth_;
Real point_constant = 1 PT;
- return Box (Interval (0, width_* point_constant),
+ return Box (Interval (0, width_ * point_constant),
Interval ((d <? height_) * point_constant,
(d >? height_) * point_constant));
}
{
context ()->set_property ("tieMelismaBusy",
ly_bool2scm (heads_to_tie_.size ()));
-
}
void
heads_to_tie_.clear ();
}
- for (int i = 0; i< ties_.size (); i++)
+ for (int i = 0; i < ties_.size (); i++)
{
typeset_tie (ties_[i]);
}
index_set_cell (her->get_property ("head-pair"), LEFT, new_head_drul[LEFT]->self_scm ());
index_set_cell (her->get_property ("head-pair"), RIGHT, new_head_drul[RIGHT]->self_scm ());
-
}
ADD_TRANSLATOR (Tie_engraver,
{
context ()->set_property ("tieMelismaBusy",
ly_bool2scm (heads_to_tie_.size ()));
-
}
void
Real
Tie::get_position (Grob *me)
{
- Direction d = head (me, LEFT) ? LEFT:RIGHT;
+ Direction d = head (me, LEFT) ? LEFT : RIGHT;
return Staff_symbol_referencer::get_position (head (me, d));
}
Direction
Tie::get_default_dir (Grob *me)
{
- 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;
+ 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)
{
if (get_grob_direction (sl) == UP
This correction is due te the shape of the black note head.
*/
if (Rhythmic_head::duration_log (l) == 2)
- where += dir* 0.2;
+ where += dir * 0.2;
left_x = l->extent (l, X_AXIS).linear_combination (where)
+ x_gap_f;
}
if (Note_head::has_interface (l) && Rhythmic_head::get_dots (l))
{
Grob *dots = Rhythmic_head::get_dots (l);
- if (fabs (staff_space * Staff_symbol_referencer::get_position (dots) /2
+ if (fabs (staff_space * Staff_symbol_referencer::get_position (dots) / 2
- ypos) < 0.5)
{
ypos += 0.5 * dir;
audio_ = new Audio_time_signature (b, o);
Audio_element_info info (audio_, 0);
announce_element (info);
-
}
}
Timing_translator::Timing_translator ()
{
-
}
Moment
void
Translator::process_music ()
{
-
}
Translator::Translator ()
Global_context *
Translator::get_global_context () const
{
- return daddy_context_ ->get_global_context ();
+ return daddy_context_->get_global_context ();
}
Score_context *
void
Translator::derived_mark () const
{
-
}
if (is_number_pair (fl))
flare[d] += ss * scm_to_double (index_get_cell (fl, d));
if (is_number_pair (eh))
- height[d] += -dir * ss *scm_to_double (index_get_cell (eh, d));
+ height[d] += -dir * ss * scm_to_double (index_get_cell (eh, d));
if (is_number_pair (sp))
- shorten[d] += ss *scm_to_double (index_get_cell (sp, d));
+ shorten[d] += ss * scm_to_double (index_get_cell (sp, d));
}
while (flip (&d) != LEFT);
Direction d = LEFT;
do
{
- straight_corners[d] += -d * shorten[d] /length * dz;
+ straight_corners[d] += -d * shorten[d] / length * dz;
}
while (flip (&d) != LEFT);
Use outer non-rest columns to determine slope
*/
int l = 0;
- while (l <columns.size () && Note_column::has_rests (columns[l]))
+ while (l < columns.size () && Note_column::has_rests (columns[l]))
l++;
int r = columns.size ()- 1;
/*
Slope.
*/
- Real factor = columns.size () > 1 ? 1/ (x1 - x0) : 1.0;
+ Real factor = columns.size () > 1 ? 1 / (x1 - x0) : 1.0;
for (int i = 0; i < columns.size (); i++)
{
}
// padding
- *offset += scm_to_double (me->get_property ("padding")) *dir;
+ *offset += scm_to_double (me->get_property ("padding")) * dir;
/*
horizontal brackets should not collide with staff lines.
*offset *= 0.5 * ss;
}
-
}
/*
for (int i = columns.size (); i--;)
{
Grob *s = Note_column::get_stem (columns[i]);
- Grob *b = s ? Stem::get_beam (s): 0;
+ Grob *b = s ? Stem::get_beam (s) : 0;
if (b)
me->add_dependency (b);
}
add_bound_item (dynamic_cast<Spanner *> (me), n);
}
-
-
ADD_INTERFACE (Tuplet_bracket,
"tuplet-bracket-interface",
"A bracket with a number in the middle, used for tuplets.",
* Compensate optical illusion regarding vertical position of left
* and right endings due to curved shape.
*/
- Real ypos_correction = -0.1*staff_space * sign (interval);
- Real interval_correction = 0.2*staff_space * sign (interval);
- Real corrected_interval = interval*staff_space + interval_correction;
+ Real ypos_correction = -0.1 * staff_space * sign (interval);
+ Real interval_correction = 0.2 * staff_space * sign (interval);
+ Real corrected_interval = interval * staff_space + interval_correction;
/*
* middle curve of flexa shape
Bezier top_curve = curve, bottom_curve = curve;
for (int i = 0; i < 4; i++)
{
- Real curve_thickness = 0.33 * ((3 - i)*left_height + i*right_height);
+ Real curve_thickness = 0.33 * ((3 - i) * left_height + i * right_height);
top_curve.control_[i] += Offset (0, 0.5 * curve_thickness);
bottom_curve.control_[i] -= Offset (0, 0.5 * curve_thickness);
}
* the left end of the bezier curve.
*/
Box left_edge_box (Interval (0, line_thickness),
- Interval (-0.5*left_height, +0.5*left_height));
+ Interval (-0.5 * left_height, +0.5 * left_height));
Stencil left_edge = Lookup::filled_box (left_edge_box);
stencil.add_stencil (left_edge);
Box right_edge_box (Interval (-line_thickness, 0),
- Interval (-0.5*right_height, +0.5*right_height));
+ Interval (-0.5 * right_height, +0.5 * right_height));
Stencil right_edge = Lookup::filled_box (right_edge_box);
right_edge.translate_axis (width, X_AXIS);
right_edge.translate_axis (corrected_interval / 2.0, Y_AXIS);
return Stencil ();
}
Interval x_extent = Interval (0, join_thickness);
- Interval y_extent = (delta_pitch > 0) ?
- Interval (0, delta_pitch * 0.5 * staff_space) : // ascending join
+ Interval y_extent = (delta_pitch > 0)
+ ? Interval (0, delta_pitch * 0.5 * staff_space) : // ascending join
Interval (delta_pitch * 0.5 * staff_space, 0); // descending join
Box join_box (x_extent, y_extent);
return Lookup::round_filled_box (join_box, blotdiameter);
* flexa_width.)
*/
Real staff_space = Staff_symbol_referencer::staff_space (me);
- Real flexa_width = robust_scm2double (me->get_property ("flexa-width"), 2) *staff_space;
+ Real flexa_width = robust_scm2double (me->get_property ("flexa-width"), 2) * staff_space;
out
- = Lookup::blank (Box (Interval (0, 0.5*flexa_width), Interval (0, 0)));
+ = Lookup::blank (Box (Interval (0, 0.5 * flexa_width), Interval (0, 0)));
}
else if (!String::compare (glyph_name, "flexa"))
{
const char *cs = str.to_str0 ();
no_vertical_end
- |= (strcmp (cs, ":|")!= 0 && strcmp (cs, "|:")!= 0 && strcmp (cs, "|.")!= 0
- && strcmp (cs, ":|:")!= 0 && strcmp (cs, ".|")!= 0);
+ |= (strcmp (cs, ":|") != 0 && strcmp (cs, "|:") != 0 && strcmp (cs, "|.") != 0
+ && strcmp (cs, ":|:") != 0 && strcmp (cs, ".|") != 0);
Output_def *layout = me->get_layout ();
Real half_space = 0.5;
SCM start_string_;
bool staff_eligible ();
-
};
Volta_engraver::Volta_engraver ()
Item *ci = dynamic_cast<Item *> (cc);
volta_span_->set_bound (LEFT, ci);
}
-
}
/*