[beast: 14/29] BSE: convert enum type MusicalTuningType to enum class MusicalTuning
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 14/29] BSE: convert enum type MusicalTuningType to enum class MusicalTuning
- Date: Mon, 21 Mar 2016 15:13:08 +0000 (UTC)
commit a462ad67414cc128a437a9bef350c55daebef1ad
Author: Tim Janik <timj gnu org>
Date: Sat Jan 30 01:40:33 2016 +0100
BSE: convert enum type MusicalTuningType to enum class MusicalTuning
Signed-off-by: Tim Janik <timj gnu org>
bse/bseapi.idl | 166 +++++++++++++++++++++++-----------------------
bse/bsecxxmodule.cc | 2 +-
bse/bsecxxmodule.hh | 2 +-
bse/bseitem.cc | 2 +-
bse/bseitem.hh | 2 +-
bse/bsemathsignal.cc | 4 +-
bse/bsemathsignal.hh | 4 +-
bse/bsemididecoder.cc | 2 +-
bse/bsemididecoder.hh | 4 +-
bse/bsemidifile.hh | 2 +-
bse/bsenote.cc | 12 ++--
bse/bsenote.hh | 12 ++--
bse/bseserver.cc | 12 ++--
bse/bseserver.hh | 12 ++--
bse/bsesong.cc | 4 +-
bse/bsesong.hh | 6 +-
bse/bsesource.cc | 2 +-
bse/bsesource.hh | 2 +-
bse/tests/misctests.cc | 16 ++--
plugins/bsesequencer.cc | 2 +-
plugins/davorgan.cc | 2 +-
21 files changed, 136 insertions(+), 136 deletions(-)
---
diff --git a/bse/bseapi.idl b/bse/bseapi.idl
index ed079cd..bdda050 100644
--- a/bse/bseapi.idl
+++ b/bse/bseapi.idl
@@ -275,80 +275,80 @@ enum MidiSignalType {
};
// For musical tunings, see: http://en.wikipedia.org/wiki/Musical_tuning
-enum MusicalTuningType {
+enum MusicalTuning {
// Equal Temperament: http://en.wikipedia.org/wiki/Equal_temperament
- MUSICAL_TUNING_12_TET = Enum (1, _("12 Tone Equal Temperament"), //
http://en.wikipedia.org/wiki/Equal_temperament
- _("The most common tuning system for modern Western music, "
- "is the twelve-tone equal temperament, abbreviated as 12-TET, "
- "which divides the octave into 12 equal parts.")),
- MUSICAL_TUNING_7_TET = Enum (_("7 Tone Equal Temperament"), //
http://en.wikipedia.org/wiki/Equal_temperament
- _("A fairly common tuning system is the seven-tone equal
temperament tuning system, "
- "abbreviated as 7-TET. It divides the octave into 7 equal parts
using 171 cent steps.")),
- MUSICAL_TUNING_5_TET = Enum (_("5 Tone Equal Temperament"), //
http://en.wikipedia.org/wiki/Equal_temperament
- _("A fairly common tuning system is the five-tone equal
temperament tuning system, "
- "abbreviated as 5-TET. It divides the octave into 5 equal parts
using 240 cent steps.")),
+ OD_12_TET = Enum (1, _("12 Tone Equal Temperament"), //
http://en.wikipedia.org/wiki/Equal_temperament
+ _("The most common tuning system for modern Western music, "
+ "is the twelve-tone equal temperament, abbreviated as 12-TET, "
+ "which divides the octave into 12 equal parts.")),
+ OD_7_TET = Enum (_("7 Tone Equal Temperament"), //
http://en.wikipedia.org/wiki/Equal_temperament
+ _("A fairly common tuning system is the seven-tone equal temperament tuning
system, "
+ "abbreviated as 7-TET. It divides the octave into 7 equal parts using 171
cent steps.")),
+ OD_5_TET = Enum (_("5 Tone Equal Temperament"), //
http://en.wikipedia.org/wiki/Equal_temperament
+ _("A fairly common tuning system is the five-tone equal temperament tuning
system, "
+ "abbreviated as 5-TET. It divides the octave into 5 equal parts using 240
cent steps.")),
// Rational Intonation: http://en.wikipedia.org/wiki/Just_intonation
- MUSICAL_TUNING_DIATONIC_SCALE = Enum (_("Diatonic Scale"), //
http://en.wikipedia.org/wiki/Diatonic_scale
- _("In music theory, a diatonic scale (also: heptatonia prima) is
a seven-note "
- "musical scale comprising five whole-tone and two half-tone
steps. "
- "The half tones are maximally separated, so between two
half-tone steps "
- "there are either two or three whole tones, repeating per
octave.")), // Werckmeister I
- MUSICAL_TUNING_INDIAN_SCALE = Enum (_("Indian Scale"), //
http://en.wikipedia.org/wiki/Just_intonation#Indian_scales
- _("Diatonic scale used in Indian music with wolf interval at Dha,
close to 3/2")),
- MUSICAL_TUNING_PYTHAGOREAN_TUNING= Enum (_("Pythagorean Tuning"), //
http://en.wikipedia.org/wiki/Pythagorean_tuning
- _("Pythagorean tuning is the oldest way of tuning the 12-note
chromatic scale, "
- "in which the frequency relationships of all intervals are
based on the ratio 3:2. "
- "Its discovery is generally credited to Pythagoras.")),
- MUSICAL_TUNING_PENTATONIC_5_LIMIT= Enum (_("Pentatonic 5-limit"), //
http://en.wikipedia.org/wiki/Pentatonic_scale
- _("Pentatonic scales are used in modern jazz and pop/rock
contexts "
- "because they work exceedingly well over several chords
diatonic "
- "to the same key, often better than the parent scale.")),
- MUSICAL_TUNING_PENTATONIC_BLUES = Enum (_("Pentatonic Blues"), //
http://en.wikipedia.org/wiki/Pentatonic_scale
- _("The blues scale is the minor pentatonic with an additional
augmented fourth, "
- "which is referred to as the \"blues note\".")),
- MUSICAL_TUNING_PENTATONIC_GOGO = Enum (_("Pentatonic Gogo"), //
http://en.wikipedia.org/wiki/Pentatonic_scale
- _("The Pentatonic Gogo scale is an anhemitonic pentatonic scale
used to tune the "
- "instruments of the Gogo people of Tanzania.")),
+ DIATONIC_SCALE = Enum (_("Diatonic Scale"), //
http://en.wikipedia.org/wiki/Diatonic_scale
+ _("In music theory, a diatonic scale (also: heptatonia prima) is a seven-note "
+ "musical scale comprising five whole-tone and two half-tone steps. "
+ "The half tones are maximally separated, so between two half-tone steps "
+ "there are either two or three whole tones, repeating per octave.")), //
Werckmeister I
+ INDIAN_SCALE = Enum (_("Indian Scale"), //
http://en.wikipedia.org/wiki/Just_intonation#Indian_scales
+ _("Diatonic scale used in Indian music with wolf interval at Dha, close to
3/2")),
+ PYTHAGOREAN_TUNING = Enum (_("Pythagorean Tuning"), //
http://en.wikipedia.org/wiki/Pythagorean_tuning
+ _("Pythagorean tuning is the oldest way of tuning the 12-note chromatic scale, "
+ "in which the frequency relationships of all intervals are based on the ratio
3:2. "
+ "Its discovery is generally credited to Pythagoras.")),
+ PENTATONIC_5_LIMIT = Enum (_("Pentatonic 5-limit"), //
http://en.wikipedia.org/wiki/Pentatonic_scale
+ _("Pentatonic scales are used in modern jazz and pop/rock contexts "
+ "because they work exceedingly well over several chords diatonic "
+ "to the same key, often better than the parent scale.")),
+ PENTATONIC_BLUES = Enum (_("Pentatonic Blues"), //
http://en.wikipedia.org/wiki/Pentatonic_scale
+ _("The blues scale is the minor pentatonic with an additional augmented fourth,
"
+ "which is referred to as the \"blues note\".")),
+ PENTATONIC_GOGO = Enum (_("Pentatonic Gogo"), //
http://en.wikipedia.org/wiki/Pentatonic_scale
+ _("The Pentatonic Gogo scale is an anhemitonic pentatonic scale used to tune
the "
+ "instruments of the Gogo people of Tanzania.")),
// Meantone Temperament: http://en.wikipedia.org/wiki/Meantone_temperament
- MUSICAL_TUNING_QUARTER_COMMA_MEANTONE = Enum (_("Quarter-Comma Meantone"), //
http://en.wikipedia.org/wiki/Quarter-comma_meantone
- _("Quarter-comma meantone was the most common meantone
temperament in the "
- "sixteenth and seventeenth centuries and sometimes used
later.")), // Werckmeister II
- MUSICAL_TUNING_SILBERMANN_SORGE = Enum (_("Silbermann-Sorge Temperament"), //
http://de.wikipedia.org/wiki/Silbermann-Sorge-Temperatur
- _("The Silbermann-Sorge temperament is a meantone temperament
used for "
- "Baroque era organs by Gottfried Silbermann.")),
+ QUARTER_COMMA_MEANTONE = Enum (_("Quarter-Comma Meantone"), //
http://en.wikipedia.org/wiki/Quarter-comma_meantone
+ _("Quarter-comma meantone was the most common meantone temperament in the "
+ "sixteenth and seventeenth centuries and sometimes used later.")), //
Werckmeister II
+ SILBERMANN_SORGE = Enum (_("Silbermann-Sorge Temperament"), //
http://de.wikipedia.org/wiki/Silbermann-Sorge-Temperatur
+ _("The Silbermann-Sorge temperament is a meantone temperament used for "
+ "Baroque era organs by Gottfried Silbermann.")),
// Well Temperament: http://en.wikipedia.org/wiki/Well_temperament
- MUSICAL_TUNING_WERCKMEISTER_3 = Enum (_("Werckmeister III"), //
http://en.wikipedia.org/wiki/Werckmeister_temperament
- _("This tuning uses mostly pure (perfect) fifths, as in
Pythagorean tuning, but each "
- "of the fifths C-G, G-D, D-A and B-F# is made smaller, i.e.
tempered by 1/4 comma. "
- "Werckmeister designated this tuning as particularly suited for
playing chromatic music.")),
- MUSICAL_TUNING_WERCKMEISTER_4 = Enum (_("Werckmeister IV"), //
http://en.wikipedia.org/wiki/Werckmeister_temperament
- _("In this tuning the fifths C-G, D-A, E-B, F#-C#, and Bb-F are
tempered narrow by 1/3 comma, "
- "and the fifths G#-D# and Eb-Bb are widened by 1/3 comma. The
other fifths are pure. "
- "Most of its intervals are close to sixth-comma meantone. "
- "Werckmeister designed this tuning for playing mainly diatonic
music.")),
- MUSICAL_TUNING_WERCKMEISTER_5 = Enum (_("Werckmeister V"), //
http://en.wikipedia.org/wiki/Werckmeister_temperament
- _("In this tuning the fifths D-A, A-E, F#-C#, C#-G#, and F-C are
narrowed by 1/4 comma, "
- "and the fifth G#-D# is widened by 1/4 comma. The other fifths
are pure. "
- "This temperament is closer to equal temperament than
Werckmeister III or IV.")),
- MUSICAL_TUNING_WERCKMEISTER_6 = Enum (_("Werckmeister VI"), //
http://en.wikipedia.org/wiki/Werckmeister_temperament
- _("This tuning is also known as Septenarius tuning is based on a
division of the monochord "
- "length into 196 = 7 * 7 * 4 parts. "
- "The resulting scale has rational frequency relationships, but
in practice involves pure "
- "and impure sounding fifths. "
- "Werckmeister described the Septenarius as a \"temperament
which has nothing at all to do "
- "with the divisions of the comma, nevertheless in practice so
correct that one can be really "
- "satisfied with it\".")),
- MUSICAL_TUNING_KIRNBERGER_3 = Enum (_("Kirnberger III"), //
http://en.wikipedia.org/wiki/Johann_Philipp_Kirnberger_temperament
- _("Kirnberger's method of compensating for and closing the circle
of fifths is to split the \"wolf\" "
- "interval known to those who have used meantone temperaments
between four fifths instead, "
- "allowing for four 1/4-comma wolves to take their place. "
- "1/4-comma wolves are used extensively in meantone and are much
easier to tune and to listen to. "
- "Therefore, only one third remains pure (between C and E).")),
- MUSICAL_TUNING_YOUNG = Enum (_("Young Temperament"), //
http://en.wikipedia.org/wiki/Young_temperament
- _("Thomas Young devised a form of musical tuning to make the
harmony most perfect in those keys which "
- "are the most frequently used (give better major thirds in
those keys), but to not have any unplayable keys. "
- "This is attempted by tuning upwards from C a sequence of six
pure fourths, "
- "as well as six equally imperfect fifths.")),
+ WERCKMEISTER_3 = Enum (_("Werckmeister III"), //
http://en.wikipedia.org/wiki/Werckmeister_temperament
+ _("This tuning uses mostly pure (perfect) fifths, as in Pythagorean tuning, but
each "
+ "of the fifths C-G, G-D, D-A and B-F# is made smaller, i.e. tempered by 1/4
comma. "
+ "Werckmeister designated this tuning as particularly suited for playing
chromatic music.")),
+ WERCKMEISTER_4 = Enum (_("Werckmeister IV"), //
http://en.wikipedia.org/wiki/Werckmeister_temperament
+ _("In this tuning the fifths C-G, D-A, E-B, F#-C#, and Bb-F are tempered narrow
by 1/3 comma, "
+ "and the fifths G#-D# and Eb-Bb are widened by 1/3 comma. The other fifths
are pure. "
+ "Most of its intervals are close to sixth-comma meantone. "
+ "Werckmeister designed this tuning for playing mainly diatonic music.")),
+ WERCKMEISTER_5 = Enum (_("Werckmeister V"), //
http://en.wikipedia.org/wiki/Werckmeister_temperament
+ _("In this tuning the fifths D-A, A-E, F#-C#, C#-G#, and F-C are narrowed by
1/4 comma, "
+ "and the fifth G#-D# is widened by 1/4 comma. The other fifths are pure. "
+ "This temperament is closer to equal temperament than Werckmeister III or
IV.")),
+ WERCKMEISTER_6 = Enum (_("Werckmeister VI"), //
http://en.wikipedia.org/wiki/Werckmeister_temperament
+ _("This tuning is also known as Septenarius tuning is based on a division of
the monochord "
+ "length into 196 = 7 * 7 * 4 parts. "
+ "The resulting scale has rational frequency relationships, but in practice
involves pure "
+ "and impure sounding fifths. "
+ "Werckmeister described the Septenarius as a \"temperament which has nothing
at all to do "
+ "with the divisions of the comma, nevertheless in practice so correct that
one can be really "
+ "satisfied with it\".")),
+ KIRNBERGER_3 = Enum (_("Kirnberger III"), //
http://en.wikipedia.org/wiki/Johann_Philipp_Kirnberger_temperament
+ _("Kirnberger's method of compensating for and closing the circle of fifths is
to split the \"wolf\" "
+ "interval known to those who have used meantone temperaments between four
fifths instead, "
+ "allowing for four 1/4-comma wolves to take their place. "
+ "1/4-comma wolves are used extensively in meantone and are much easier to
tune and to listen to. "
+ "Therefore, only one third remains pure (between C and E).")),
+ YOUNG = Enum (_("Young Temperament"), //
http://en.wikipedia.org/wiki/Young_temperament
+ _("Thomas Young devised a form of musical tuning to make the harmony most
perfect in those keys which "
+ "are the most frequently used (give better major thirds in those keys), but
to not have any unplayable keys. "
+ "This is attempted by tuning upwards from C a sequence of six pure fourths, "
+ "as well as six equally imperfect fifths.")),
};
// == Bse Constants ==
@@ -441,7 +441,7 @@ record SongTiming {
/// A note description provides all needed details about a specific note. "
record NoteDescription
{
- MusicalTuningType musical_tuning;
+ MusicalTuning musical_tuning;
int32 note = Range ("Note", "", ":readwrite:note");
int32 octave = Range ("Octave", "", ":readwrite:octave");
float64 freq = Range ("Frequency", "", ":readwrite:freq");
@@ -762,12 +762,12 @@ interface Song : SNet {
float64 bpm = Range (_("BPM"), _("Beats per minute"), STANDARD ":scale", MIN_BPM, MAX_BPM,
10, 120);
};
group _("Tuning") {
- MusicalTuningType musical_tuning = Enum (_("Musical Tuning"),
- _("The tuning system which specifies the tones or pitches to be
used. "
- "Due to the psychoacoustic properties of tones, various pitch
combinations can "
- "sound \"natural\" or \"pleasing\" when used in combination,
the musical "
- "tuning system defines the number and spacing of frequency
values applied."),
- STANDARD ":unprepared");
+ MusicalTuning musical_tuning = Enum (_("Musical Tuning"),
+ _("The tuning system which specifies the tones or pitches to be
used. "
+ "Due to the psychoacoustic properties of tones, various pitch
combinations can "
+ "sound \"natural\" or \"pleasing\" when used in combination, the
musical "
+ "tuning system defines the number and spacing of frequency values
applied."),
+ STANDARD ":unprepared");
};
};
@@ -887,17 +887,17 @@ interface Server : Object {
SampleFileInfo sample_file_info (String file_name); ///< Load sample file info from file.
/// Describe a note, providing information about its octave, semitone, frequency, etc.
- NoteDescription note_describe (MusicalTuningType musical_tuning, int32 note, int32 fine_tune);
+ NoteDescription note_describe (MusicalTuning musical_tuning, int32 note, int32 fine_tune);
// Describe a note, given its frequency.
- NoteDescription note_describe_from_freq (MusicalTuningType musical_tuning, float64 freq);
+ NoteDescription note_describe_from_freq (MusicalTuning musical_tuning, float64 freq);
/// Describe a note, given its semitone, octave and fine tune.
- NoteDescription note_construct (MusicalTuningType musical_tuning, int32 semitone, int32 octave, int32
fine_tune);
+ NoteDescription note_construct (MusicalTuning musical_tuning, int32 semitone, int32 octave, int32
fine_tune);
/// Describe a note, given its name and octave offset.
- NoteDescription note_from_string (MusicalTuningType musical_tuning, String name);
+ NoteDescription note_from_string (MusicalTuning musical_tuning, String name);
/// Retrieve the note of a certain frequency.
- int32 note_from_freq (MusicalTuningType musical_tuning, float64 frequency);
+ int32 note_from_freq (MusicalTuning musical_tuning, float64 frequency);
/// Retrieve the frequency of a certain note.
- float64 note_to_freq (MusicalTuningType musical_tuning, int32 note, int32 fine_tune);
+ float64 note_to_freq (MusicalTuning musical_tuning, int32 note, int32 fine_tune);
// *** Old Janitor ***
// void trigger_action (String action); ///< Trigger an installed user action of this janitor.
diff --git a/bse/bsecxxmodule.cc b/bse/bsecxxmodule.cc
index 9f1f37f..2b0f901 100644
--- a/bse/bsecxxmodule.cc
+++ b/bse/bsecxxmodule.cc
@@ -411,7 +411,7 @@ Effect::max_block_size() const
return BSE_STREAM_MAX_VALUES;
}
-Bse::MusicalTuningType
+Bse::MusicalTuning
Effect::current_musical_tuning() const
{
BseSource *source = cast (const_cast <Effect*> (this));
diff --git a/bse/bsecxxmodule.hh b/bse/bsecxxmodule.hh
index 60af66b..26cbaea 100644
--- a/bse/bsecxxmodule.hh
+++ b/bse/bsecxxmodule.hh
@@ -145,7 +145,7 @@ protected:
uint block_size () const;
uint max_block_size () const;
public: /* FIXME: make this protected as soon as the modules have their own current_musical_tuning()
accessor */
- Bse::MusicalTuningType current_musical_tuning () const;
+ Bse::MusicalTuning current_musical_tuning () const;
};
/* implement Bse::Effect and Bse::SynthesisModule methods */
#define BSE_EFFECT_INTEGRATE_MODULE(ObjectType,ModuleType,ParamType) \
diff --git a/bse/bseitem.cc b/bse/bseitem.cc
index c04cbd4..6a0f964 100644
--- a/bse/bseitem.cc
+++ b/bse/bseitem.cc
@@ -697,7 +697,7 @@ bse_item_has_ancestor (BseItem *item,
* The musical tuning depends on project wide settings that may change after
* this funciton has been called, so the result should be used with caution.
*/
-Bse::MusicalTuningType
+Bse::MusicalTuning
bse_item_current_musical_tuning (BseItem *self)
{
assert_return (BSE_IS_ITEM (self), Bse::MusicalTuning::OD_12_TET);
diff --git a/bse/bseitem.hh b/bse/bseitem.hh
index 33113a1..c2db71c 100644
--- a/bse/bseitem.hh
+++ b/bse/bseitem.hh
@@ -143,7 +143,7 @@ void bse_item_push_undo_storage (BseItem *self,
/* convenience */
#define bse_item_set bse_item_set_undoable
#define bse_item_get g_object_get
-Bse::MusicalTuningType bse_item_current_musical_tuning (BseItem *self);
+Bse::MusicalTuning bse_item_current_musical_tuning (BseItem *self);
G_END_DECLS
diff --git a/bse/bsemathsignal.cc b/bse/bsemathsignal.cc
index 33a7ad8..64f84c8 100644
--- a/bse/bsemathsignal.cc
+++ b/bse/bsemathsignal.cc
@@ -587,7 +587,7 @@ static const double semitone_table265_young_temperament[132 + 1 + 132] = {
};
const double*
-bse_semitone_table_from_tuning (Bse::MusicalTuningType musical_tuning)
+bse_semitone_table_from_tuning (Bse::MusicalTuning musical_tuning)
{
switch (musical_tuning)
{
@@ -634,7 +634,7 @@ bse_semitone_table_from_tuning (Bse::MusicalTuningType musical_tuning)
}
double
-bse_transpose_factor (Bse::MusicalTuningType musical_tuning, int index /* [-132..+132] */)
+bse_transpose_factor (Bse::MusicalTuning musical_tuning, int index /* [-132..+132] */)
{
const double *table = bse_semitone_table_from_tuning (musical_tuning);
return table[CLAMP (index, -132, +132)];
diff --git a/bse/bsemathsignal.hh b/bse/bsemathsignal.hh
index b58b914..67e2ed0 100644
--- a/bse/bsemathsignal.hh
+++ b/bse/bsemathsignal.hh
@@ -378,8 +378,8 @@ static inline double bse_saturate_branching (double value,
double limit) G_GNUC_CONST;
/* --- semitone factors (for +-11 octaves) --- */
-const double* bse_semitone_table_from_tuning (Bse::MusicalTuningType musical_tuning); /* returns
[-132..+132] */
-double bse_transpose_factor (Bse::MusicalTuningType musical_tuning, int index /*
[-132..+132] */);
+const double* bse_semitone_table_from_tuning (Bse::MusicalTuning musical_tuning); /* returns [-132..+132] */
+double bse_transpose_factor (Bse::MusicalTuning musical_tuning, int index /* [-132..+132]
*/);
/* --- cents (1/100th of a semitone) --- */
diff --git a/bse/bsemididecoder.cc b/bse/bsemididecoder.cc
index f70a938..2f6ad53 100644
--- a/bse/bsemididecoder.cc
+++ b/bse/bsemididecoder.cc
@@ -11,7 +11,7 @@ static void bse_midi_decoder_construct_event (BseMidiDecoder *self);
/* --- function --- */
BseMidiDecoder*
-bse_midi_decoder_new (gboolean auto_queue, gboolean smf_support, Bse::MusicalTuningType musical_tuning)
+bse_midi_decoder_new (gboolean auto_queue, gboolean smf_support, Bse::MusicalTuning musical_tuning)
{
BseMidiDecoder *self;
diff --git a/bse/bsemididecoder.hh b/bse/bsemididecoder.hh
index 8e29b4b..dc6a928 100644
--- a/bse/bsemididecoder.hh
+++ b/bse/bsemididecoder.hh
@@ -22,7 +22,7 @@ typedef enum {
struct BseMidiDecoder {
SfiRing *events; /* BseMidiEvent* */
/* configuration */
- Bse::MusicalTuningType musical_tuning;
+ Bse::MusicalTuning musical_tuning;
uint auto_queue : 1;
uint smf_support : 1;
/*< private >*/
@@ -42,7 +42,7 @@ struct BseMidiDecoder {
/* --- API --- */
BseMidiDecoder* bse_midi_decoder_new (gboolean auto_queue,
gboolean smf_support,
- Bse::MusicalTuningType musical_tuning);
+ Bse::MusicalTuning musical_tuning);
void bse_midi_decoder_destroy (BseMidiDecoder *self);
void bse_midi_decoder_push_data (BseMidiDecoder *self,
uint n_bytes,
diff --git a/bse/bsemidifile.hh b/bse/bsemidifile.hh
index fb32aff..e7dd091 100644
--- a/bse/bsemidifile.hh
+++ b/bse/bsemidifile.hh
@@ -11,7 +11,7 @@ typedef struct {
BseMidiEvent **events;
} BseMidiFileTrack;
typedef struct {
- Bse::MusicalTuningType musical_tuning;
+ Bse::MusicalTuning musical_tuning;
guint tpqn; /* ticks-per-quarter-note */
gfloat tpqn_rate;
/* signature */
diff --git a/bse/bsenote.cc b/bse/bsenote.cc
index 34c1bd0..cf422aa 100644
--- a/bse/bsenote.cc
+++ b/bse/bsenote.cc
@@ -15,7 +15,7 @@ bse_note_from_string (const String ¬e_string)
}
Bse::NoteDescription
-bse_note_description (Bse::MusicalTuningType musical_tuning, int note, int finetune)
+bse_note_description (Bse::MusicalTuning musical_tuning, int note, int finetune)
{
Bse::NoteDescription info;
info.musical_tuning = musical_tuning;
@@ -54,7 +54,7 @@ struct FreqCmp {
} // Anon
int
-bse_note_from_freq (Bse::MusicalTuningType musical_tuning, double freq)
+bse_note_from_freq (Bse::MusicalTuning musical_tuning, double freq)
{
freq /= BSE_KAMMER_FREQUENCY;
const double *table = bse_semitone_table_from_tuning (musical_tuning);
@@ -87,7 +87,7 @@ bse_note_from_freq (Bse::MusicalTuningType musical_tuning, double freq)
}
int
-bse_note_from_freq_bounded (Bse::MusicalTuningType musical_tuning, double freq)
+bse_note_from_freq_bounded (Bse::MusicalTuning musical_tuning, double freq)
{
int note = bse_note_from_freq (musical_tuning, freq);
if (note != BSE_NOTE_VOID)
@@ -97,7 +97,7 @@ bse_note_from_freq_bounded (Bse::MusicalTuningType musical_tuning, double freq)
}
int
-bse_note_fine_tune_from_note_freq (Bse::MusicalTuningType musical_tuning, int note, double freq)
+bse_note_fine_tune_from_note_freq (Bse::MusicalTuning musical_tuning, int note, double freq)
{
double semitone_factor = bse_transpose_factor (musical_tuning, CLAMP (note, BSE_MIN_NOTE, BSE_MAX_NOTE) -
SFI_KAMMER_NOTE);
freq /= BSE_KAMMER_FREQUENCY * semitone_factor;
@@ -108,7 +108,7 @@ bse_note_fine_tune_from_note_freq (Bse::MusicalTuningType musical_tuning, int no
}
double
-bse_note_to_freq (Bse::MusicalTuningType musical_tuning, int note)
+bse_note_to_freq (Bse::MusicalTuning musical_tuning, int note)
{
if (note < BSE_MIN_NOTE || note > BSE_MAX_NOTE)
return 0.0;
@@ -117,7 +117,7 @@ bse_note_to_freq (Bse::MusicalTuningType musical_tuning, int note)
}
double
-bse_note_to_tuned_freq (Bse::MusicalTuningType musical_tuning, int note, int fine_tune)
+bse_note_to_tuned_freq (Bse::MusicalTuning musical_tuning, int note, int fine_tune)
{
if (note < BSE_MIN_NOTE || note > BSE_MAX_NOTE)
return 0.0;
diff --git a/bse/bsenote.hh b/bse/bsenote.hh
index a09383c..ed31592 100644
--- a/bse/bsenote.hh
+++ b/bse/bsenote.hh
@@ -48,13 +48,13 @@ G_BEGIN_DECLS
#define BSE_NOTE_OCTAVE_DOWN(n) (BSE_NOTE_SHIFT ((n), -12))
// Internals, use Bse::Server API instead
-int bse_note_from_freq (Bse::MusicalTuningType musical_tuning, double freq);
-int bse_note_from_freq_bounded (Bse::MusicalTuningType musical_tuning, double freq);
-int bse_note_fine_tune_from_note_freq (Bse::MusicalTuningType musical_tuning, int note, double freq);
-double bse_note_to_freq (Bse::MusicalTuningType musical_tuning, int note);
-double bse_note_to_tuned_freq (Bse::MusicalTuningType musical_tuning, int note, int fine_tune);
+int bse_note_from_freq (Bse::MusicalTuning musical_tuning, double freq);
+int bse_note_from_freq_bounded (Bse::MusicalTuning musical_tuning, double freq);
+int bse_note_fine_tune_from_note_freq (Bse::MusicalTuning musical_tuning, int note, double freq);
+double bse_note_to_freq (Bse::MusicalTuning musical_tuning, int note);
+double bse_note_to_tuned_freq (Bse::MusicalTuning musical_tuning, int note, int fine_tune);
-Bse::NoteDescription bse_note_description (Bse::MusicalTuningType musical_tuning, int note, int finetune);
+Bse::NoteDescription bse_note_description (Bse::MusicalTuning musical_tuning, int note, int finetune);
int bse_note_from_string (const String ¬e_string);
diff --git a/bse/bseserver.cc b/bse/bseserver.cc
index 8bd7171..8164f8e 100644
--- a/bse/bseserver.cc
+++ b/bse/bseserver.cc
@@ -1572,40 +1572,40 @@ ServerImpl::sample_file_info (const String &filename)
}
NoteDescription
-ServerImpl::note_describe_from_freq (MusicalTuningType musical_tuning, double freq)
+ServerImpl::note_describe_from_freq (MusicalTuning musical_tuning, double freq)
{
const int note = bse_note_from_freq (musical_tuning, freq);
return bse_note_description (musical_tuning, note, 0);
}
NoteDescription
-ServerImpl::note_describe (MusicalTuningType musical_tuning, int note, int fine_tune)
+ServerImpl::note_describe (MusicalTuning musical_tuning, int note, int fine_tune)
{
return bse_note_description (musical_tuning, note, fine_tune);
}
NoteDescription
-ServerImpl::note_construct (MusicalTuningType musical_tuning, int semitone, int octave, int fine_tune)
+ServerImpl::note_construct (MusicalTuning musical_tuning, int semitone, int octave, int fine_tune)
{
const int note = BSE_NOTE_GENERIC (octave, semitone);
return bse_note_description (musical_tuning, note, fine_tune);
}
NoteDescription
-ServerImpl::note_from_string (MusicalTuningType musical_tuning, const String &name)
+ServerImpl::note_from_string (MusicalTuning musical_tuning, const String &name)
{
const int note = bse_note_from_string (name);
return bse_note_description (musical_tuning, note, 0);
}
int
-ServerImpl::note_from_freq (MusicalTuningType musical_tuning, double frequency)
+ServerImpl::note_from_freq (MusicalTuning musical_tuning, double frequency)
{
return bse_note_from_freq (musical_tuning, frequency);
}
double
-ServerImpl::note_to_freq (MusicalTuningType musical_tuning, int note, int fine_tune)
+ServerImpl::note_to_freq (MusicalTuning musical_tuning, int note, int fine_tune)
{
const Bse::NoteDescription info = bse_note_description (musical_tuning, note, fine_tune);
return info.name.empty() ? 0 : info.freq;
diff --git a/bse/bseserver.hh b/bse/bseserver.hh
index 08bd464..56f2236 100644
--- a/bse/bseserver.hh
+++ b/bse/bseserver.hh
@@ -132,12 +132,12 @@ public:
virtual AuxData find_module_type (const String &module_type) override;
virtual Icon module_type_icon (const String &module_type) override;
virtual SampleFileInfo sample_file_info (const String &filename) override;
- virtual NoteDescription note_describe_from_freq (MusicalTuningType musical_tuning, double freq) override;
- virtual NoteDescription note_describe (MusicalTuningType musical_tuning, int note, int fine_tune)
override;
- virtual NoteDescription note_construct (MusicalTuningType musical_tuning, int semitone, int octave, int
fine_tune) override;
- virtual NoteDescription note_from_string (MusicalTuningType musical_tuning, const String &name) override;
- virtual int note_from_freq (MusicalTuningType musical_tuning, double frequency) override;
- virtual double note_to_freq (MusicalTuningType musical_tuning, int note, int fine_tune)
override;
+ virtual NoteDescription note_describe_from_freq (MusicalTuning musical_tuning, double freq) override;
+ virtual NoteDescription note_describe (MusicalTuning musical_tuning, int note, int fine_tune) override;
+ virtual NoteDescription note_construct (MusicalTuning musical_tuning, int semitone, int octave, int
fine_tune) override;
+ virtual NoteDescription note_from_string (MusicalTuning musical_tuning, const String &name) override;
+ virtual int note_from_freq (MusicalTuning musical_tuning, double frequency) override;
+ virtual double note_to_freq (MusicalTuning musical_tuning, int note, int fine_tune) override;
void send_user_message (const UserMessage &umsg);
static void register_source_module (const String &type, const String &title, const String &tags,
const uint8 *pixstream);
static ServerImpl& instance ();
diff --git a/bse/bsesong.cc b/bse/bsesong.cc
index 9398fb8..c55b7b4 100644
--- a/bse/bsesong.cc
+++ b/bse/bsesong.cc
@@ -935,7 +935,7 @@ SongImpl::bpm (double val)
}
}
-MusicalTuningType
+MusicalTuning
SongImpl::musical_tuning () const
{
BseSong *self = const_cast<SongImpl*> (this)->as<BseSong*>();
@@ -943,7 +943,7 @@ SongImpl::musical_tuning () const
}
void
-SongImpl::musical_tuning (MusicalTuningType tuning)
+SongImpl::musical_tuning (MusicalTuning tuning)
{
BseSong *self = as<BseSong*>();
if (!BSE_SOURCE_PREPARED (self) && self->musical_tuning != tuning)
diff --git a/bse/bsesong.hh b/bse/bsesong.hh
index 2b8de24..dc8899b 100644
--- a/bse/bsesong.hh
+++ b/bse/bsesong.hh
@@ -27,7 +27,7 @@ struct BseSong : BseSNet {
guint numerator;
guint denominator;
float bpm;
- Bse::MusicalTuningType musical_tuning;
+ Bse::MusicalTuning musical_tuning;
SfiRing *parts; /* of type BsePart* */
SfiRing *busses; /* of type BseBus* */
BseBus *solo_bus;
@@ -77,8 +77,8 @@ public:
explicit SongImpl (BseObject*);
virtual double bpm () const override;
virtual void bpm (double val) override;
- virtual MusicalTuningType musical_tuning () const override;
- virtual void musical_tuning (MusicalTuningType tuning) override;
+ virtual MusicalTuning musical_tuning () const override;
+ virtual void musical_tuning (MusicalTuning tuning) override;
virtual SongTiming get_timing (int tick);
virtual TrackIfaceP find_any_track_for_part (PartIface &part) override;
virtual BusIfaceP create_bus () override;
diff --git a/bse/bsesource.cc b/bse/bsesource.cc
index d1e4347..a6dbe69 100644
--- a/bse/bsesource.cc
+++ b/bse/bsesource.cc
@@ -1909,7 +1909,7 @@ bse_source_class_base_init (BseSourceClass *klass)
klass->automation_properties = NULL;
}
-Bse::MusicalTuningType
+Bse::MusicalTuning
bse_source_prepared_musical_tuning (BseSource *source)
{
assert_return (BSE_IS_SOURCE (source), Bse::MusicalTuning::OD_12_TET);
diff --git a/bse/bsesource.hh b/bse/bsesource.hh
index c4be358..26139d5 100644
--- a/bse/bsesource.hh
+++ b/bse/bsesource.hh
@@ -215,7 +215,7 @@ void bse_source_update_modules (BseSource *source,
BseTrans *trans);
void bse_source_clear_ichannels (BseSource *source);
void bse_source_clear_ochannels (BseSource *source);
-Bse::MusicalTuningType bse_source_prepared_musical_tuning (BseSource *source);
+Bse::MusicalTuning bse_source_prepared_musical_tuning (BseSource *source);
/* automation */
typedef struct {
diff --git a/bse/tests/misctests.cc b/bse/tests/misctests.cc
index 8bb370c..31f3d0e 100644
--- a/bse/tests/misctests.cc
+++ b/bse/tests/misctests.cc
@@ -55,7 +55,7 @@ check_equal_tempered_tuning (void)
}
static void
-check_tuning_monotony (Bse::MusicalTuningType musical_tuning)
+check_tuning_monotony (Bse::MusicalTuning musical_tuning)
{
const double *table = bse_semitone_table_from_tuning (musical_tuning); /* returns [-132..+132] */
for (int i = -132; i <= +132; i++)
@@ -69,7 +69,7 @@ check_tuning_monotony (Bse::MusicalTuningType musical_tuning)
}
static void
-check_freq_vs_notes (Bse::MusicalTuningType musical_tuning)
+check_freq_vs_notes (Bse::MusicalTuning musical_tuning)
{
/* check freq/note mapping */
for (int j = BSE_MIN_NOTE; j <= BSE_MAX_NOTE; j++)
@@ -133,19 +133,19 @@ main (gint argc,
check_cent_tune();
check_cent_tune_fast();
check_equal_tempered_tuning();
- Bse::MusicalTuningType last_tuning = Bse::MusicalTuning::YOUNG;
+ const int64 last_tuning = int (Bse::MusicalTuning::YOUNG);
/* check last tuning value by asserting defaulting behavior of succeding values */
- TCMP (bse_semitone_table_from_tuning (Bse::MusicalTuningType (last_tuning + 1)),
+ TCMP (bse_semitone_table_from_tuning (Bse::MusicalTuning (last_tuning + 1)),
==,
- bse_semitone_table_from_tuning (Bse::MusicalTuningType (0)));
+ bse_semitone_table_from_tuning (Bse::MusicalTuning (0)));
/* check monotonic musical tuning systems */
- for (int j = Bse::MusicalTuning::OD_12_TET; j <= last_tuning; j++)
+ for (int j = int (Bse::MusicalTuning::OD_12_TET); j <= last_tuning; j++)
{
- Bse::MusicalTuningType musical_tuning = Bse::MusicalTuningType (j);
+ Bse::MusicalTuning musical_tuning = Bse::MusicalTuning (j);
check_tuning_monotony (musical_tuning);
check_freq_vs_notes (musical_tuning);
TPASS ("Tuning System: %s\n",
- Rapicorn::Aida::enum_info<Bse::MusicalTuningType>().find_value (musical_tuning).ident);
+ Rapicorn::Aida::enum_info<Bse::MusicalTuning>().find_value (musical_tuning).ident);
}
return 0;
diff --git a/plugins/bsesequencer.cc b/plugins/bsesequencer.cc
index 3ba9c4c..ddf695e 100644
--- a/plugins/bsesequencer.cc
+++ b/plugins/bsesequencer.cc
@@ -194,7 +194,7 @@ bse_sequencer_get_property (BseSequencer *seq,
}
static gfloat*
-freq_values_from_seq (Bse::MusicalTuningType musical_tuning, BseNoteSequence *sdata, int transpose)
+freq_values_from_seq (Bse::MusicalTuning musical_tuning, BseNoteSequence *sdata, int transpose)
{
gfloat *v = g_new (gfloat, bse_note_sequence_length (sdata));
guint i;
diff --git a/plugins/davorgan.cc b/plugins/davorgan.cc
index 872c3a7..b77d654 100644
--- a/plugins/davorgan.cc
+++ b/plugins/davorgan.cc
@@ -86,7 +86,7 @@ class Organ : public OrganBase {
};
/* FIXME: get rid of this as soon as the modules have their own current_musical_tuning() accessor */
struct Properties : public OrganProperties {
- Bse::MusicalTuningType current_musical_tuning;
+ Bse::MusicalTuning current_musical_tuning;
Properties (Organ *organ) :
OrganProperties (organ),
current_musical_tuning (organ->current_musical_tuning())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]