aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2011-04-20 08:23:44 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2011-04-20 08:23:44 +0000
commit7c2636bf64774b5a39d768a37a872b834bfec914 (patch)
treece6011e5edd185c97f06549ac8f4fe7efc70f04f
parent2478e4959f08b82e9a3baa949d6fcf0833948a98 (diff)
downloadusdx-7c2636bf64774b5a39d768a37a872b834bfec914.tar.gz
usdx-7c2636bf64774b5a39d768a37a872b834bfec914.tar.xz
usdx-7c2636bf64774b5a39d768a37a872b834bfec914.zip
Fix: Shift+Space sometimes plays more than 1 note.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2824 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--Game/Code/Screens/UScreenEditSub.pas55
1 files changed, 8 insertions, 47 deletions
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas
index fc2f9364..39ddbf68 100644
--- a/Game/Code/Screens/UScreenEditSub.pas
+++ b/Game/Code/Screens/UScreenEditSub.pas
@@ -1015,8 +1015,10 @@ begin
PlayOneNote := false;
MidiTime := USTime.GetTime;
MidiStart := GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start);
- MidiStop := GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Dlugosc);
+ MidiStop := MidiStart + GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Dlugosc);
LastClick := Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start-1;
+ MidiOut.PutShort($91, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Ton + 60, 127);
+ MidiLastNote := AktNuta[CP];
end
else if SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL then
@@ -1026,7 +1028,7 @@ begin
PlayOneNoteMidi := true;
MidiTime := USTime.GetTime;
MidiStart := GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start);
- MidiStop := GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Dlugosc);
+ MidiStop := MidiStart + GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Dlugosc);
PlaySentence := false;
PlayOneNote := true;
@@ -1038,6 +1040,8 @@ begin
Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Dlugosc));
Music.Play;
LastClick := Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start-1;
+ MidiOut.PutShort($91, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Ton + 60, 127);
+ MidiLastNote := AktNuta[CP];
end
Else
@@ -1053,8 +1057,8 @@ begin
Music.MoveTo(GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start));
PlayStopTime := (GetTimeFromBeat(
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start +
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Dlugosc));
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start +
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Dlugosc));
Music.Play;
LastClick := Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start-1;
end;
@@ -3234,27 +3238,6 @@ begin
Music.Stop;
PlayOneNote := false;
end;
-
- // click
- if (Click) and (PlaySentence) then
- begin
- AktBeat := Floor(GetMidBeat(Music.Position - AktSong.GAP / 1000));
- Text[TextDebug].Text := IntToStr(AktBeat);
- if AktBeat <> LastClick then
- begin
- for beat := LastClick+1 to AktBeat do
- begin
- for Pet := 0 to Czesci[CP].Czesc[Czesci[CP].Akt].HighNut do
- begin
- if (Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet].Start = beat) then
- begin
- Music.PlayClick;
- LastClick := beat;
- end;
- end;
- end; //for beat
- end;
- end; // click
end; // if PlayOneNote
// midi music
@@ -3267,28 +3250,6 @@ begin
MidiOut.PutShort($81, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[MidiLastNote].Ton + 60, 127);
PlayOneNoteMidi := false;
end;
-
- // click
- AktBeat := Floor(GetMidBeat(MidiPos - AktSong.GAP / 1000));
- Text[TextDebug].Text := IntToStr(AktBeat);
-
- if AktBeat <> LastClick then
- begin
- for beat := LastClick+1 to AktBeat do
- begin
- for Pet := 0 to Czesci[CP].Czesc[Czesci[CP].Akt].HighNut do
- begin
- if (Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet].Start = beat) then
- begin
- LastClick := beat;
- if Pet > 0 then
- MidiOut.PutShort($81, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet-1].Ton + 60, 127);
- MidiOut.PutShort($91, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet].Ton + 60, 127);
- MidiLastNote := Pet;
- end;
- end;
- end; //for beat
- end;
end; // if PlayOneNoteMidi
Text[TextSentence].Text := 'Line: ' + IntToStr(Czesci[CP].Akt + 1) + '/' + IntToStr(Czesci[CP].Ilosc);