footage combobox returns streams rather than footage
This commit is contained in:
@@ -25,6 +25,13 @@ AudioStream::AudioStream()
|
||||
set_type(kAudio);
|
||||
}
|
||||
|
||||
QString AudioStream::description()
|
||||
{
|
||||
return QCoreApplication::translate("Stream", "%1: Audio - %2 Channels, %3Hz").arg(QString::number(index()),
|
||||
QString::number(channels()),
|
||||
QString::number(sample_rate()));
|
||||
}
|
||||
|
||||
const int &AudioStream::channels()
|
||||
{
|
||||
return channels_;
|
||||
|
||||
@@ -32,6 +32,8 @@ class AudioStream : public Stream
|
||||
public:
|
||||
AudioStream();
|
||||
|
||||
virtual QString description() override;
|
||||
|
||||
const int& channels();
|
||||
void set_channels(const int& channels);
|
||||
|
||||
|
||||
@@ -91,6 +91,11 @@ StreamPtr Footage::stream(int index)
|
||||
return streams_.at(index);
|
||||
}
|
||||
|
||||
const QList<StreamPtr> &Footage::streams()
|
||||
{
|
||||
return streams_;
|
||||
}
|
||||
|
||||
int Footage::stream_count()
|
||||
{
|
||||
return streams_.size();
|
||||
|
||||
@@ -174,6 +174,11 @@ public:
|
||||
*/
|
||||
StreamPtr stream(int index);
|
||||
|
||||
/**
|
||||
* @brief Returns a list of the streams in this Footage
|
||||
*/
|
||||
const QList<StreamPtr>& streams();
|
||||
|
||||
/**
|
||||
* @brief Retrieve total number of streams in this Footage file
|
||||
*/
|
||||
|
||||
@@ -25,6 +25,13 @@ ImageStream::ImageStream()
|
||||
set_type(kImage);
|
||||
}
|
||||
|
||||
QString ImageStream::description()
|
||||
{
|
||||
return QCoreApplication::translate("Stream", "%1: Image - %2x%3").arg(QString::number(index()),
|
||||
QString::number(width()),
|
||||
QString::number(height()));
|
||||
}
|
||||
|
||||
const int &ImageStream::width()
|
||||
{
|
||||
return width_;
|
||||
|
||||
@@ -31,6 +31,8 @@ class ImageStream : public Stream
|
||||
public:
|
||||
ImageStream();
|
||||
|
||||
virtual QString description() override;
|
||||
|
||||
const int& width();
|
||||
void set_width(const int& width);
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "stream.h"
|
||||
|
||||
#include "ui/icons/icons.h"
|
||||
|
||||
Stream::Stream() :
|
||||
footage_(nullptr),
|
||||
type_(kUnknown)
|
||||
@@ -31,6 +33,11 @@ Stream::~Stream()
|
||||
{
|
||||
}
|
||||
|
||||
QString Stream::description()
|
||||
{
|
||||
return QCoreApplication::translate("Stream", "%1: Unknown").arg(index());
|
||||
}
|
||||
|
||||
const Stream::Type &Stream::type()
|
||||
{
|
||||
return type_;
|
||||
@@ -80,3 +87,19 @@ void Stream::set_duration(const int64_t &duration)
|
||||
{
|
||||
duration_ = duration;
|
||||
}
|
||||
|
||||
QIcon Stream::IconFromType(const Stream::Type &type)
|
||||
{
|
||||
switch (type) {
|
||||
case Stream::kVideo:
|
||||
return olive::icon::Video;
|
||||
case Stream::kImage:
|
||||
return olive::icon::Image;
|
||||
case Stream::kAudio:
|
||||
return olive::icon::Audio;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#define STREAM_H
|
||||
|
||||
#include <memory>
|
||||
#include <QCoreApplication>
|
||||
#include <QString>
|
||||
|
||||
#include "common/rational.h"
|
||||
|
||||
@@ -59,6 +61,8 @@ public:
|
||||
*/
|
||||
virtual ~Stream();
|
||||
|
||||
virtual QString description();
|
||||
|
||||
const Type& type();
|
||||
void set_type(const Type& type);
|
||||
|
||||
@@ -74,6 +78,8 @@ public:
|
||||
const int64_t& duration() const;
|
||||
void set_duration(const int64_t& duration);
|
||||
|
||||
static QIcon IconFromType(const Type& type);
|
||||
|
||||
private:
|
||||
Footage* footage_;
|
||||
|
||||
|
||||
@@ -24,3 +24,10 @@ VideoStream::VideoStream()
|
||||
{
|
||||
set_type(kVideo);
|
||||
}
|
||||
|
||||
QString VideoStream::description()
|
||||
{
|
||||
return QCoreApplication::translate("Stream", "%1: Video - %2x%3").arg(QString::number(index()),
|
||||
QString::number(width()),
|
||||
QString::number(height()));
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ class VideoStream : public ImageStream
|
||||
{
|
||||
public:
|
||||
VideoStream();
|
||||
|
||||
virtual QString description() override;
|
||||
};
|
||||
|
||||
using VideoStreamPtr = std::shared_ptr<VideoStream>;
|
||||
|
||||
Reference in New Issue
Block a user