Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Müller <nexyon@gmail.com>2021-08-30 23:36:02 +0300
committerJörg Müller <nexyon@gmail.com>2021-09-18 22:45:33 +0300
commitbdbc7e12a02e15ad7265dfc1ac21fb6d0016308f (patch)
treee9b967deb25f77eef348786f5cd22524eef0ec20 /extern/audaspace/include/file/File.h
parent970c928f27106b26ec7cf6afa2316c60384ab4f1 (diff)
Audaspace: added audio file streams functionality.
On the blender side this commit fixes importing video files with audio and video streams that do not share the same start time and duration. Differential Revision: https://developer.blender.org/D12353
Diffstat (limited to 'extern/audaspace/include/file/File.h')
-rw-r--r--extern/audaspace/include/file/File.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/extern/audaspace/include/file/File.h b/extern/audaspace/include/file/File.h
index 24745a757e8..ac490acba38 100644
--- a/extern/audaspace/include/file/File.h
+++ b/extern/audaspace/include/file/File.h
@@ -23,9 +23,11 @@
*/
#include "ISound.h"
+#include "FileInfo.h"
#include <string>
#include <memory>
+#include <vector>
AUD_NAMESPACE_BEGIN
@@ -48,6 +50,14 @@ private:
*/
std::shared_ptr<Buffer> m_buffer;
+ /**
+ * The index of the stream within the file if it contains multiple.
+ * The first audio stream in the file has index 0 and the index increments by one
+ * for every other audio stream in the file. Other types of streams in the file
+ * do not count.
+ */
+ int m_stream;
+
// delete copy constructor and operator=
File(const File&) = delete;
File& operator=(const File&) = delete;
@@ -57,16 +67,25 @@ public:
* Creates a new sound.
* The file is read from the file system using the given path.
* \param filename The sound file path.
+ * \param stream The index of the audio stream within the file if it contains multiple audio streams.
*/
- File(std::string filename);
+ File(std::string filename, int stream = 0);
/**
* Creates a new sound.
* The file is read from memory using the supplied buffer.
* \param buffer The buffer to read from.
* \param size The size of the buffer.
+ * \param stream The index of the audio stream within the file if it contains multiple audio streams.
+ */
+ File(const data_t* buffer, int size, int stream = 0);
+
+ /**
+ * Queries the streams of the file.
+ * \return A vector with as many streams as there are in the file.
+ * \exception Exception Thrown if the file specified cannot be read.
*/
- File(const data_t* buffer, int size);
+ std::vector<StreamInfo> queryStreams();
virtual std::shared_ptr<IReader> createReader();
};