summaryrefslogtreecommitdiff
path: root/src/lib/stream.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-20 19:30:04 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-20 19:30:04 +0100
commit58f53485bb112896a9446771acfa2abe0a528cec (patch)
treef34f14aa40f8ce0854f104fbabccd4f756bafd3d /src/lib/stream.h
parent6e8e4f7ae9a9ae243a1b7d9e17f6b6cacae277b3 (diff)
Try to clean up stream handling wrt audio channel counts.
Diffstat (limited to 'src/lib/stream.h')
-rw-r--r--src/lib/stream.h57
1 files changed, 50 insertions, 7 deletions
diff --git a/src/lib/stream.h b/src/lib/stream.h
index 764c03d79..2db63c620 100644
--- a/src/lib/stream.h
+++ b/src/lib/stream.h
@@ -20,20 +20,63 @@
#ifndef DVDOMATIC_STREAM_H
#define DVDOMATIC_STREAM_H
-struct Stream
+class Stream
{
public:
- Stream (std::string t);
+ Stream ()
+ : _id (-1)
+ {}
Stream (std::string n, int i)
- : name (n)
- , id (i)
+ : _name (n)
+ , _id (i)
{}
- std::string to_string () const;
+ virtual std::string to_string () const = 0;
- std::string name;
- int id;
+ std::string name () const {
+ return _name;
+ }
+
+ int id () const {
+ return _id;
+ }
+
+protected:
+ std::string _name;
+ int _id;
+};
+
+struct AudioStream : public Stream
+{
+public:
+ AudioStream (std::string t);
+
+ AudioStream (std::string n, int i, int c)
+ : Stream (n, i)
+ , _channels (c)
+ {}
+
+ std::string to_string () const;
+
+ int channels () const {
+ return _channels;
+ }
+
+private:
+ int _channels;
+};
+
+class SubtitleStream : public Stream
+{
+public:
+ SubtitleStream (std::string t);
+
+ SubtitleStream (std::string n, int i)
+ : Stream (n, i)
+ {}
+
+ std::string to_string () const;
};
#endif