From f16fb6bb5feac1f29840b1510545c2f40582a14c Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sun, 6 Feb 2011 03:09:59 +0000 Subject: [PATCH] Add fix convert and downmix audio providers. Originally committed to SVN as r5302. --- aegisub/libmedia/Makefile | 2 ++ aegisub/libmedia/audio/convert.cpp | 9 +++++++-- aegisub/libmedia/audio/convert.h | 9 +++++++-- aegisub/libmedia/audio/downmix.cpp | 7 ++++++- aegisub/libmedia/audio/downmix.h | 7 ++++++- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/aegisub/libmedia/Makefile b/aegisub/libmedia/Makefile index dbdb4cd81..3a32a4d2c 100644 --- a/aegisub/libmedia/Makefile +++ b/aegisub/libmedia/Makefile @@ -25,6 +25,8 @@ endif SRC = \ common/video_frame.cpp \ + audio/downmix.cpp \ + audio/convert.cpp \ $(SRC_OPT) HEADERS = \ diff --git a/aegisub/libmedia/audio/convert.cpp b/aegisub/libmedia/audio/convert.cpp index e08df165d..435921449 100644 --- a/aegisub/libmedia/audio/convert.cpp +++ b/aegisub/libmedia/audio/convert.cpp @@ -37,10 +37,12 @@ #include "config.h" #include "aegisub_endian.h" -#include "audio_provider_convert.h" -#include "audio_provider_downmix.h" +#include "convert.h" +#include "downmix.h" +namespace media { + /// @brief Constructor /// @param src /// @@ -218,3 +220,6 @@ AudioProvider *CreateConvertAudioProvider(AudioProvider *source_provider) { return provider; } + +} // namespace + diff --git a/aegisub/libmedia/audio/convert.h b/aegisub/libmedia/audio/convert.h index 79b3e2ef8..d66c6d9c8 100644 --- a/aegisub/libmedia/audio/convert.h +++ b/aegisub/libmedia/audio/convert.h @@ -34,12 +34,14 @@ /// @ingroup audio_input /// -#include "include/aegisub/audio_provider.h" +#include "libmedia/audio.h" #ifndef AGI_PRE #include #endif +namespace media { + /// DOCME /// @class ConvertAudioProvider /// @brief DOCME @@ -64,7 +66,10 @@ public: void GetAudio(void *buf, int64_t start, int64_t count) const; - wxString GetFilename() const { return source->GetFilename(); } + std::string GetFilename() const { return source->GetFilename(); } }; AudioProvider *CreateConvertAudioProvider(AudioProvider *source_provider); + +} // namespace + diff --git a/aegisub/libmedia/audio/downmix.cpp b/aegisub/libmedia/audio/downmix.cpp index a8c277e95..9c2ac6614 100644 --- a/aegisub/libmedia/audio/downmix.cpp +++ b/aegisub/libmedia/audio/downmix.cpp @@ -39,9 +39,11 @@ // Headers #include "config.h" -#include "audio_provider_downmix.h" +#include "downmix.h" +namespace media { + /// @brief Constructor /// @param source /// @@ -123,3 +125,6 @@ void DownmixingAudioProvider::GetAudio(void *buf, int64_t start, int64_t count) // Done downmixing, free the work buffer delete[] tmp; } + +} // namespace + diff --git a/aegisub/libmedia/audio/downmix.h b/aegisub/libmedia/audio/downmix.h index af79d316d..88fe3d6a7 100644 --- a/aegisub/libmedia/audio/downmix.h +++ b/aegisub/libmedia/audio/downmix.h @@ -34,12 +34,14 @@ /// @ingroup audio_input /// -#include "include/aegisub/audio_provider.h" +#include "libmedia/audio.h" #ifndef AGI_PRE #include #endif +namespace media { + /// DOCME /// @class DownmixingAudioProvider /// @brief DOCME @@ -59,3 +61,6 @@ public: void GetAudio(void *buf, int64_t start, int64_t count) const; }; + +} // namespace +