Skip to content

Commit

Permalink
refactor: #1 keeping codes clean.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroxpepe committed Oct 17, 2022
1 parent 94162e7 commit 3b7ad66
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Meowziq/Core/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void ApplySequeNote(int start_tick, int beat_count, List<Span> span_list,
if (param.Seque.Range is not null) {
note_num = applyRange(target: new int[] { note_num }, range: param.Seque.Range)[0]; // TODO: applyRange の単音 ver
}
if (param.HasTextCharArray) { // TODO: 判定方法の改善
if (param.HasTextCharArray) {
char text = param.TextCharArray[I6beat_index.Idx];
if (param.Seque.Text.HasValue() && param.IsMatch(text)) {
int tick = start_tick + To16beatLength(index: I6beat_index.Idx);
Expand Down Expand Up @@ -188,7 +188,7 @@ int[] applyRange(int[] target, Range range) {
/// adds a Note to the Item object with the tick.
/// </summary>
void add(int tick, Note note) {
_note_item.Add(tick, note);
_note_item.Add(key: tick, value: note);
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion Meowziq/Core/Mixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static Fader AddFader {
return;
}
_current_fader_map[$"{value.Type}:{value.Name}"] = value;
_previous_fader_map[value.Type] = Fader.NoVaule(value.Type);
_previous_fader_map[value.Type] = Fader.NoVaule(type: value.Type);
_use = true; // Fader を追加された、つまり mixier.json が存在する
}
}
Expand Down
12 changes: 9 additions & 3 deletions Meowziq/Core/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,15 @@ public void Build(int tick, bool smf = false) {
// テンポ・曲名設定 FIXME: 全プレイヤーが設定しているが?
State.TempoAndName = (_song.Tempo, _song.Name);

// 初期設定
if (tick is 0) { // TODO: player.json の音色を設定
Mixer<T>.ApplyVaule(0, _midi_ch, Type, "intro", _program_num); // TODO: 必要? and "intro" ?
/// <summary>
/// adds initial parameters for Mixer object.
/// </summary>
/// <note>
/// sets instrument name in player.json.
/// </note>
if (tick is 0) {
string first_pattern_name = _song.AllSection.SelectMany(x => x.AllPattern).ToList().Where(x => x.Name is not "count").First().Name;
Mixer<T>.ApplyVaule(tick: 0, midi_ch: _midi_ch, type: Type, name: "intro", program_num: _program_num);
}

// Note データ作成のループ
Expand Down
2 changes: 1 addition & 1 deletion Meowziq/Value/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public class Seque {
// Constructor

public Seque() {
Text = string.Empty;
_text = string.Empty;
_stack = 3;
_use = false;
}
Expand Down

0 comments on commit 3b7ad66

Please sign in to comment.