created StreamID object

Intended as a more robust solution than mapping to the Stream* pointer, this
will map directly to the file and its index regardless of the Stream* pointer.
This commit is contained in:
itsmattkc
2019-12-06 13:29:09 +11:00
parent f719ac027a
commit ffdd56c582
2 changed files with 25 additions and 0 deletions
+12
View File
@@ -20,6 +20,7 @@
#include "stream.h"
#include "footage.h"
#include "ui/icons/icons.h"
Stream::Stream() :
@@ -114,3 +115,14 @@ QIcon Stream::IconFromType(const Stream::Type &type)
return QIcon();
}
StreamID Stream::ToID() const
{
return StreamID(footage_->filename(), index_);
}
StreamID::StreamID(const QString &filename, const int &stream_index) :
filename_(filename),
stream_index_(stream_index)
{
}
+13
View File
@@ -29,6 +29,17 @@
class Footage;
class StreamID {
public:
StreamID(const QString& filename, const int& stream_index);
private:
QString filename_;
int stream_index_;
};
/**
* @brief A base class for keeping metadata about a media stream.
*
@@ -84,6 +95,8 @@ public:
static QIcon IconFromType(const Type& type);
StreamID ToID() const;
private:
Footage* footage_;