summaryrefslogtreecommitdiff
path: root/src/lib/piece_audio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/piece_audio.h')
-rw-r--r--src/lib/piece_audio.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/lib/piece_audio.h b/src/lib/piece_audio.h
new file mode 100644
index 000000000..a6f345f3e
--- /dev/null
+++ b/src/lib/piece_audio.h
@@ -0,0 +1,60 @@
+/*
+ Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#ifndef DCPOMATIC_PIECE_AUDIO_H
+#define DCPOMATIC_PIECE_AUDIO_H
+
+
+/** @file src/lib/piece_audio.h
+ * @brief PieceAudio class.
+ */
+
+
+#include "audio_buffers.h"
+#include "types.h"
+
+
+class AudioStream;
+
+
+/** @class PieceAudio
+ * @brief A block of audio from a Piece, with a timestamp as a frame within that piece.
+ */
+class PieceAudio
+{
+public:
+ PieceAudio ()
+ : audio (new AudioBuffers(0, 0))
+ {}
+
+ PieceAudio (std::shared_ptr<AudioStream> s, std::shared_ptr<const AudioBuffers> a, Frame f)
+ : stream (s)
+ , audio (a)
+ , frame (f)
+ {}
+
+ std::shared_ptr<AudioStream> stream;
+ std::shared_ptr<const AudioBuffers> audio;
+ Frame frame = 0;
+};
+
+
+#endif