OSDN Git Service

サウンドファイルの相対ファイル対応
authorh677 <h677>
Sun, 27 Jul 2008 16:43:49 +0000 (16:43 +0000)
committerh677 <h677>
Sun, 27 Jul 2008 16:43:49 +0000 (16:43 +0000)
Option.pas

index d9102d6..83c6bda 100644 (file)
@@ -1325,13 +1325,19 @@ begin
 end;
 
 procedure TOptionDialog.SoundPlayButtonClick(Sender: TObject);
+var
+    s : String;
 begin
-       if not FileExists(SoundFileEdit.Text) then begin
+    s := SoundFileEdit.Text;
+    if (AnsiPos('.\', s) = 1) then begin
+        s := GikoSys.Setting.GetAppDir + Copy(s, 2, Length(s));
+    end;
+       if not FileExists(s) then begin
                MsgBox(Handle, '\91\8dÝ\82µ\82È\82¢\83t\83@\83C\83\8b\82Å\82·', '\83G\83\89\81[', MB_ICONSTOP or MB_OK);
                SoundFileEdit.Text := '';
                Exit;
        end;
-       if not sndPlaySound(PChar(SoundFileEdit.Text), SND_ASYNC or SND_NOSTOP) then begin
+       if not sndPlaySound(PChar(s), SND_ASYNC or SND_NOSTOP) then begin
                sndPlaySound(nil, SND_ASYNC);
        end;
 end;