aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Screens/UScreenEditSub.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-19 11:44:10 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-19 11:44:10 +0000
commit62c82114318ed04ce42617fa9ce2e179834dbda4 (patch)
tree65bf831fa62613baa778fd1413b3c0220fe951fb /Game/Code/Screens/UScreenEditSub.pas
parent433a1b7339e2bf96f3b0bb4c98b8c799c6540027 (diff)
downloadusdx-62c82114318ed04ce42617fa9ce2e179834dbda4.tar.gz
usdx-62c82114318ed04ce42617fa9ce2e179834dbda4.tar.xz
usdx-62c82114318ed04ce42617fa9ce2e179834dbda4.zip
added UCommon ( in classes ) for lazarus...
common functions needed for lazarus ( and others ) can be put in here. also this now compiles on lazarus.. ( dosnt link yet... but I dont get any critical compiler errors ) tested to compile in my delphi, and basic functionality is fine. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@395 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Screens/UScreenEditSub.pas')
-rw-r--r--Game/Code/Screens/UScreenEditSub.pas12
1 files changed, 10 insertions, 2 deletions
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas
index 7184b0b6..3843fbf4 100644
--- a/Game/Code/Screens/UScreenEditSub.pas
+++ b/Game/Code/Screens/UScreenEditSub.pas
@@ -1169,11 +1169,12 @@ begin
Exit;
end
else begin
+ {$IFDEF UseMIDIPort}
MidiOut := TMidiOutput.Create(nil);
if Ini.Debug = 1 then
MidiOut.ProductName := 'Microsoft GS Wavetable SW Synth'; // for my kxproject without midi table
MidiOut.Open;
-
+ {$ENDIF}
Text[TextTitle].Text := AktSong.Title;
Text[TextArtist].Text := AktSong.Artist;
Text[TextMp3].Text := AktSong.Mp3;
@@ -1224,11 +1225,13 @@ begin
if PlaySentenceMidi then begin
MidiPos := USTime.GetTime - MidiTime + MidiStart;
+ {$IFDEF UseMIDIPort}
// stop the music
if (MidiPos > MidiStop) then begin
MidiOut.PutShort($81, Czesci[0].Czesc[Czesci[0].Akt].Nuta[MidiLastNote].Ton + 60, 127);
PlaySentenceMidi := false;
end;
+ {$ENDIF}
// click
AktBeat := Floor(GetMidBeat(MidiPos - AktSong.GAP / 1000));
@@ -1236,13 +1239,16 @@ begin
if AktBeat <> LastClick then begin
for Pet := 0 to Czesci[0].Czesc[Czesci[0].Akt].HighNut do
- if (Czesci[0].Czesc[Czesci[0].Akt].Nuta[Pet].Start = AktBeat) then begin
+ if (Czesci[0].Czesc[Czesci[0].Akt].Nuta[Pet].Start = AktBeat) then
+ begin
+ {$IFDEF UseMIDIPort}
LastClick := AktBeat;
if Pet > 0 then
MidiOut.PutShort($81, Czesci[0].Czesc[Czesci[0].Akt].Nuta[Pet-1].Ton + 60, 127);
MidiOut.PutShort($91, Czesci[0].Czesc[Czesci[0].Akt].Nuta[Pet].Ton + 60, 127);
MidiLastNote := Pet;
+ {$ENDIF}
end;
end;
@@ -1312,8 +1318,10 @@ end;
procedure TScreenEditSub.onHide;
begin
+ {$IFDEF UseMIDIPort}
MidiOut.Close;
MidiOut.Free;
+ {$ENDIF}
//Music.SetVolume(100);
end;