diff --git a/aegisub/libmedia/Makefile b/aegisub/libmedia/Makefile index 3a32a4d2c..38d5f9226 100644 --- a/aegisub/libmedia/Makefile +++ b/aegisub/libmedia/Makefile @@ -27,6 +27,8 @@ SRC = \ common/video_frame.cpp \ audio/downmix.cpp \ audio/convert.cpp \ + audio/dummy_audio.cpp \ + audio/pcm.cpp \ $(SRC_OPT) HEADERS = \ diff --git a/aegisub/libmedia/audio/dummy_audio.cpp b/aegisub/libmedia/audio/dummy_audio.cpp index d02e74b4d..501b6c20b 100644 --- a/aegisub/libmedia/audio/dummy_audio.cpp +++ b/aegisub/libmedia/audio/dummy_audio.cpp @@ -36,8 +36,7 @@ #include "config.h" -#include "audio_provider_dummy.h" -#include "utils.h" +#include "dummy_audio.h" namespace media { diff --git a/aegisub/libmedia/audio/dummy_audio.h b/aegisub/libmedia/audio/dummy_audio.h index 9b6a4c318..0f40d8ed5 100644 --- a/aegisub/libmedia/audio/dummy_audio.h +++ b/aegisub/libmedia/audio/dummy_audio.h @@ -34,7 +34,7 @@ /// @ingroup audio_input /// -#include "include/aegisub/audio_provider.h" +#include "libmedia/audio.h" namespace media { diff --git a/aegisub/libmedia/audio/pcm.cpp b/aegisub/libmedia/audio/pcm.cpp index e748b87dd..c0637ec58 100644 --- a/aegisub/libmedia/audio/pcm.cpp +++ b/aegisub/libmedia/audio/pcm.cpp @@ -46,17 +46,14 @@ #include #endif -#include -#include -#include #endif #include #include "aegisub_endian.h" -#include "audio_provider_pcm.h" -#include "compat.h" -#include "utils.h" +#include "pcm.h" +//#include "compat.h" +//#include "utils.h" namespace media { @@ -64,7 +61,7 @@ namespace media { /// @brief DOCME /// @param filename /// -PCMAudioProvider::PCMAudioProvider(const wxString &filename) +PCMAudioProvider::PCMAudioProvider(const std::string &filename) { #ifdef _WIN32 file_handle = CreateFile( @@ -103,10 +100,10 @@ PCMAudioProvider::PCMAudioProvider(const wxString &filename) #else - file_handle = open(filename.mb_str(*wxConvFileName), O_RDONLY); + file_handle = open(filename.c_str(), O_RDONLY); if (file_handle == -1) { - throw agi::FileNotFoundError(STD_STR(filename)); + throw agi::FileNotFoundError(filename); } struct stat filestats; @@ -330,7 +327,7 @@ public: /// @brief DOCME /// @param _filename /// - RiffWavPCMAudioProvider(const wxString &_filename) + RiffWavPCMAudioProvider(const std::string &_filename) : PCMAudioProvider(_filename) { filename = _filename; @@ -520,7 +517,7 @@ public: /// @brief DOCME /// @param _filename /// - Wave64AudioProvider(const wxString &_filename) + Wave64AudioProvider(const std::string &_filename) : PCMAudioProvider(_filename) { filename = _filename; @@ -614,7 +611,7 @@ public: /// @brief DOCME /// @param filename /// -AudioProvider *CreatePCMAudioProvider(const wxString &filename) +AudioProvider *CreatePCMAudioProvider(const std::string &filename) { std::string msg; try { diff --git a/aegisub/libmedia/audio/pcm.h b/aegisub/libmedia/audio/pcm.h index bbf9ef767..1732b4f60 100644 --- a/aegisub/libmedia/audio/pcm.h +++ b/aegisub/libmedia/audio/pcm.h @@ -36,16 +36,13 @@ #ifndef AGI_PRE #include - -#include -#include #endif #ifdef _WIN32 #include #endif -#include "include/aegisub/audio_provider.h" +#include "libmedia/audio.h" namespace media { @@ -81,7 +78,7 @@ private: #endif protected: - PCMAudioProvider(const wxString &filename); // Create base object and open the file mapping + PCMAudioProvider(const std::string &filename); // Create base object and open the file mapping virtual ~PCMAudioProvider(); // Closes the file mapping char * EnsureRangeAccessible(int64_t range_start, int64_t range_length) const; // Ensure that the given range of bytes are accessible in the file mapping and return a pointer to the first byte of the requested range @@ -114,7 +111,7 @@ public: }; // Construct the right PCM audio provider (if any) for the file -AudioProvider *CreatePCMAudioProvider(const wxString &filename); +AudioProvider *CreatePCMAudioProvider(const std::string &filename); } // namespace