From: h677 Date: Sun, 27 Jul 2008 16:43:49 +0000 (+0000) Subject: サウンドファイルの相対ファイル対応 X-Git-Tag: v1_64_1_820~154 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=ae9c5bf018f04b0699cfa145035b3e49432725c4;p=gikonavigoeson%2Fgikonavi.git サウンドファイルの相対ファイル対応 --- diff --git a/Option.pas b/Option.pas index d9102d6..83c6bda 100644 --- a/Option.pas +++ b/Option.pas @@ -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, '‘¶Ý‚µ‚È‚¢ƒtƒ@ƒCƒ‹‚Å‚·', 'ƒGƒ‰[', 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;