From 15dab81b917111b0d9959ccd13d7689edd99cc75 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sun, 6 Feb 2011 18:48:42 +0000 Subject: [PATCH] Fix ram audio provider (this stubs out a few lines used for progress updating. Originally committed to SVN as r5307. --- aegisub/libmedia/Makefile | 1 + aegisub/libmedia/cache/audio_ram.cpp | 24 ++++++++++++++---------- aegisub/libmedia/cache/audio_ram.h | 5 ++++- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/aegisub/libmedia/Makefile b/aegisub/libmedia/Makefile index 38d5f9226..9f09586f8 100644 --- a/aegisub/libmedia/Makefile +++ b/aegisub/libmedia/Makefile @@ -29,6 +29,7 @@ SRC = \ audio/convert.cpp \ audio/dummy_audio.cpp \ audio/pcm.cpp \ + cache/audio_ram.cpp \ $(SRC_OPT) HEADERS = \ diff --git a/aegisub/libmedia/cache/audio_ram.cpp b/aegisub/libmedia/cache/audio_ram.cpp index dc2986850..448fe3d3d 100644 --- a/aegisub/libmedia/cache/audio_ram.cpp +++ b/aegisub/libmedia/cache/audio_ram.cpp @@ -36,12 +36,13 @@ #include "config.h" -#include "audio_provider_ram.h" -#include "dialog_progress.h" -#include "frame_main.h" -#include "main.h" -#include "utils.h" +#include "audio_ram.h" +//#include "dialog_progress.h" +//#include "frame_main.h" +//#include "main.h" +//#include "utils.h" +namespace media { /// DOCME #define CacheBits ((22)) @@ -86,16 +87,17 @@ RAMAudioProvider::RAMAudioProvider(AudioProvider *src) { filename = source->GetFilename(); // Start progress +//XXX fixme: volatile bool canceled = false; - DialogProgress *progress = new DialogProgress(AegisubApp::Get()->frame,_("Load audio"),&canceled,_("Reading into RAM"),0,source->GetNumSamples()); - progress->Show(); - progress->SetProgress(0,1); +// DialogProgress *progress = new DialogProgress(AegisubApp::Get()->frame,_("Load audio"),&canceled,_("Reading into RAM"),0,source->GetNumSamples()); +// progress->Show(); +// progress->SetProgress(0,1); // Read cache int readsize = CacheBlockSize / source->GetBytesPerSample(); for (int i=0;iGetAudio((char*)blockcache[i],i*readsize, i == blockcount-1 ? (source->GetNumSamples() - i*readsize) : readsize); - progress->SetProgress(i,blockcount-1); +// progress->SetProgress(i,blockcount-1); } // Clean up progress @@ -103,7 +105,7 @@ RAMAudioProvider::RAMAudioProvider(AudioProvider *src) { Clear(); throw agi::UserCancelException("Audio loading cancelled by user"); } - progress->Destroy(); +// progress->Destroy(); } /// @brief Destructor @@ -173,3 +175,5 @@ void RAMAudioProvider::GetAudio(void *buf, int64_t start, int64_t count) const { } } } + +} // namespace media diff --git a/aegisub/libmedia/cache/audio_ram.h b/aegisub/libmedia/cache/audio_ram.h index efba843ae..6fec9b981 100644 --- a/aegisub/libmedia/cache/audio_ram.h +++ b/aegisub/libmedia/cache/audio_ram.h @@ -34,8 +34,9 @@ /// @ingroup audio_input /// -#include "include/aegisub/audio_provider.h" +#include "libmedia/audio.h" +namespace media { /// DOCME /// @class RAMAudioProvider /// @brief DOCME @@ -60,3 +61,5 @@ public: bool AreSamplesNativeEndian() const { return samples_native_endian; } void GetAudio(void *buf, int64_t start, int64_t count) const; }; + +} // namespace media