From f2d465bcb54954339a651b50994ff45367892e3e Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 6 Apr 1998 23:30:32 +0000 Subject: [PATCH] lilypond-0.1.54 --- .dstreamrc | 2 +- lily/include/key.hh | 31 +++++++++++++++++-------------- lily/key.cc | 37 +++++++++++++++++++++++++++++++++++-- 3 files changed, 53 insertions(+), 17 deletions(-) diff --git a/.dstreamrc b/.dstreamrc index d016c2b727..da36d7d722 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -57,7 +57,7 @@ Paper_score 1 Paper_def 1 Performer 1 Performer_group_performer 1 -Request 1 +Request 0 Request_iterator 1 Rest_collision 1 Rest_collision_engraver 1 diff --git a/lily/include/key.hh b/lily/include/key.hh index 4a68fa8148..da03799193 100644 --- a/lily/include/key.hh +++ b/lily/include/key.hh @@ -14,26 +14,29 @@ class Octave_key { public: - Array accidental_i_arr_; - - Octave_key(); - void set (int i, int acc); - int acc (int i) const { return accidental_i_arr_[i]; } + Array accidental_i_arr_; + void clear (); + Octave_key(); + void set (int i, int acc); + int acc (int i) const { return accidental_i_arr_[i]; } + void print () const; }; /// administration of accidentals class Key { - /** for each octave a key. Has to be private since octave 0 isn't member 0. - */ - Array octaves; + /** for each octave a key. Has to be private since octave 0 isn't member 0. + */ + Array octaves; public: - bool multi_octave_b_; - - Octave_key&oct (int); - void set (int name, int acc); - void set (int oct, int name, int acc); - Key(); + bool multi_octave_b_; + + void clear (); + Octave_key&oct (int); + void set (int name, int acc); + void set (int oct, int name, int acc); + Key(); + void print () const; }; #endif // KEY_HH diff --git a/lily/key.cc b/lily/key.cc index 1a7892d4b1..56a6278cfa 100644 --- a/lily/key.cc +++ b/lily/key.cc @@ -10,15 +10,32 @@ */ #include "key.hh" +#include "debug.hh" const int OCTAVES=14; // ugh.. const int ZEROOCTAVE=7; + +void +Octave_key::print () const +{ + for (int i= 0; i < 7 ; i++) + DOUT << "note " << i << " acc: " << accidental_i_arr_[i] << "\n"; +} + + + Octave_key::Octave_key() { accidental_i_arr_.set_size (7); + clear (); +} + +void +Octave_key::clear () +{ for (int i= 0; i < 7 ; i++) - accidental_i_arr_[i] = 0; + accidental_i_arr_[i] = 0; } Key::Key() @@ -51,5 +68,21 @@ void Key::set (int n, int a) { for (int i= 0; i < OCTAVES ; i++) - octaves[i].set (n,a); + octaves[i].set (n,a); +} +void +Key::clear () +{ + for (int i= 0; i < OCTAVES ; i++) + octaves[i].clear (); +} +void +Key::print () const +{ + for (int i= 0; i < OCTAVES ; i++) + { + DOUT << "octave " << i - ZEROOCTAVE << " Octave_key { "; + octaves[i].print (); + DOUT << "}\n"; + } } -- 2.11.4.GIT