Skip to content

Commit

Permalink
refactor: #13 keeping codes clean.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroxpepe committed Mar 17, 2022
1 parent 6a62f70 commit 1d3462c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
18 changes: 9 additions & 9 deletions MidiPlayer.FluidSynth/Synth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,13 @@ static Multi() {
}

///////////////////////////////////////////////////////////////////////////////////////////
// static Properties [noun, noun phrase, adjective]
// internal static Properties [noun, noun phrase, adjective]

public static List<Track> List {
internal static List<Track> List {
get => _trackMap.Select(x => x.Value).ToList();
}

public static StandardMidiFile StandardMidiFile {
internal static StandardMidiFile StandardMidiFile {
get => _standardMidiFile;
set {
_standardMidiFile = value;
Expand All @@ -368,33 +368,33 @@ public static StandardMidiFile StandardMidiFile {
}

///////////////////////////////////////////////////////////////////////////////////////////
// public static Methods [verb, verb phrases]
// internal static Methods [verb, verb phrases]

/// <summary>
/// NOTE_ON = 144
/// </summary>
public static void ApplyNoteOn(int channel) {
internal static void ApplyNoteOn(int channel) {
_trackMap.Where(x => x.Value.Channel == channel).ToList().ForEach(x => x.Value.Sounds = true);
}

/// <summary>
/// NOTE_OFF = 128
/// </summary>
public static void ApplyNoteOff(int channel) {
internal static void ApplyNoteOff(int channel) {
_trackMap.Where(x => x.Value.Channel == channel).ToList().ForEach(x => x.Value.Sounds = false);
}

/// <summary>
/// PROGRAM_CHANGE = 192
/// </summary>
public static void ApplyProgramChange(int channel, int program) {
internal static void ApplyProgramChange(int channel, int program) {
_trackMap.Where(x => x.Value.Channel == channel).ToList().ForEach(x => x.Value.Program = program);
}

/// <summary>
/// CONTROL_CHANGE = 176
/// </summary>
public static void ApplyControlChange(int channel, int control, int value) {
internal static void ApplyControlChange(int channel, int control, int value) {
// BANK_SELECT_MSB = 0 [-- drums: 127 --]
// _type: 176, _control: 0, _value: 127
// BANK_SELECT_LSB = 32
Expand Down Expand Up @@ -428,7 +428,7 @@ public static void ApplyControlChange(int channel, int control, int value) {
/// <summary>
/// get a trak by index.
/// </summary>
public static Track GetBy(int index) {
internal static Track GetBy(int index) {
var track = _trackMap[index];
return track;
}
Expand Down
6 changes: 3 additions & 3 deletions MidiPlayer.SoundFont/SoundFont .cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ public string GetVoice(int bank, int prog) {
class Voice {

///////////////////////////////////////////////////////////////////////////////////////////
// Properties [noun, noun phrase, adjective]
// internal Properties [noun, noun phrase, adjective]

public int Prog {
internal int Prog {
get; set;
}

public string Name {
internal string Name {
get; set;
}
}
Expand Down
7 changes: 5 additions & 2 deletions MidiPlayer/Conf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ public class Conf {
static Json _json = null;

///////////////////////////////////////////////////////////////////////////////////////////////
// static Properties [noun, noun phrase, adjective]
// internal static Properties [noun, noun phrase, adjective]

public static bool Ready {
internal static bool Ready {
get => !(_json is null);
}

///////////////////////////////////////////////////////////////////////////////////////////////
// public static Properties [noun, noun phrase, adjective]

public static App Value {
get {
if (_json is null) {
Expand Down

0 comments on commit 1d3462c

Please sign in to comment.