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:
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user