From d5a42097ff7d355eee606ccadf7090beebe7299e Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Sat, 23 Jun 2007 06:46:42 +0000 Subject: [PATCH] Fixed loading of avisynth scripts as audio Originally committed to SVN as r1296. --- aegisub/audio_provider_avs.cpp | 16 +++++++++++++--- aegisub/changelog.txt | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/aegisub/audio_provider_avs.cpp b/aegisub/audio_provider_avs.cpp index 5a5313b52..0b27a5b1f 100644 --- a/aegisub/audio_provider_avs.cpp +++ b/aegisub/audio_provider_avs.cpp @@ -119,9 +119,19 @@ void AvisynthAudioProvider::OpenAVSAudio() { wxMutexLocker lock(AviSynthMutex); try { - const char * argnames[3] = { 0, "video", "audio" }; - AVSValue args[3] = { env->SaveString(filename.mb_str(wxConvLocal)), false, true }; - script = env->Invoke("DirectShowSource", AVSValue(args,3),argnames); + // Include + if (filename.EndsWith(_T(".avs"))) { + wxFileName fn(filename); + char *fname = env->SaveString(fn.GetShortPath().mb_str(wxConvLocal)); + script = env->Invoke("Import", fname); + } + + // Use DirectShowSource + else { + const char * argnames[3] = { 0, "video", "audio" }; + AVSValue args[3] = { env->SaveString(filename.mb_str(wxConvLocal)), false, true }; + script = env->Invoke("DirectShowSource", AVSValue(args,3),argnames); + } LoadFromClip(script); diff --git a/aegisub/changelog.txt b/aegisub/changelog.txt index 1547ad3cd..a4221c397 100644 --- a/aegisub/changelog.txt +++ b/aegisub/changelog.txt @@ -52,6 +52,7 @@ Please visit http://aegisub.net to download latest version o Added option to disable automatic grabbing of times from selected lines on the audio display. Also, it will never pick the times from 0:00:00.00 -> 0:00:00.00 lines. (AMZ) o Moved karaoke syllable text in audio display to the top instead of bottom, since it often covered important information in spectrum mode (jfs) o Misc. changes and bugfixes in karaoke mode. Using the syllable splitter should be easier now. (jfs) + o Fixed loading of Avisynth Scripts as audio. (AMZ) - Changes to Audio Spectrum: (jfs) o The calculated FFT data are now cached, so things should be faster o Actual signal power is now more accurately represented