Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
mediastream.h
Go to the documentation of this file.
1/* * Sailfin: a Jellyfin client written using Qt
2 * Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#ifndef JELLYFIN_VIEWMODEL_MEDIASTREAM_H
19#define JELLYFIN_VIEWMODEL_MEDIASTREAM_H
20
21#include <QObject>
22#include <QScopedPointer>
23
24#include "../dto/mediastream.h"
25
26namespace Jellyfin {
27namespace ViewModel {
28
29class MediaStream : public QObject {
30 Q_OBJECT
31public:
32 explicit MediaStream(QSharedPointer<DTO::MediaStream> data, QObject *parent = nullptr);
33
34 Q_PROPERTY(QString codec READ codec NOTIFY codecChanged)
35 Q_PROPERTY(QString codecTag READ codecTag NOTIFY codecTagChanged)
36 Q_PROPERTY(QString language READ language NOTIFY languageChanged)
37 Q_PROPERTY(QString colorRange READ colorRange NOTIFY colorRangeChanged)
38 Q_PROPERTY(QString colorSpace READ colorSpace NOTIFY colorSpaceChanged)
39 Q_PROPERTY(QString colorTransfer READ colorTransfer NOTIFY colorTransferChanged)
40 Q_PROPERTY(QString colorPrimaries READ colorPrimaries NOTIFY colorPrimariesChanged)
41 Q_PROPERTY(QString comment READ comment NOTIFY commentChanged);
42 Q_PROPERTY(QString timeBase READ timeBase NOTIFY timeBaseChanged);
43 Q_PROPERTY(QString title READ title NOTIFY titleChanged);
44 Q_PROPERTY(QString videoRange READ videoRange NOTIFY videoRangeChanged);
48 Q_PROPERTY(QString displayTitle READ displayTitle NOTIFY displayTitleChanged);
49 Q_PROPERTY(QString nalLengthSize READ nalLengthSize NOTIFY nalLengthSizeChanged);
50 Q_PROPERTY(bool interlaced READ interlaced NOTIFY interlacedChanged)
51 Q_PROPERTY(bool avc READ avc NOTIFY avcChanged)
52 Q_PROPERTY(QString channelLayout READ channelLayout NOTIFY channelLayoutChanged)
53 Q_PROPERTY(qint32 bitRate READ bitRate NOTIFY bitRateChanged)
54 Q_PROPERTY(qint32 bitDepth READ bitDepth NOTIFY bitDepthChanged)
55 Q_PROPERTY(qint32 refFrames READ refFrames NOTIFY refFramesChanged)
56 Q_PROPERTY(qint32 packetLength READ packetLength NOTIFY packetLengthChanged)
57 Q_PROPERTY(qint32 channels READ channels NOTIFY channelsChanged)
58 Q_PROPERTY(qint32 sampleRate READ sampleRate NOTIFY sampleRateChanged)
59 Q_PROPERTY(bool isDefault READ isDefault NOTIFY isDefaultChanged)
60 Q_PROPERTY(bool forced READ forced NOTIFY forcedChanged)
61 Q_PROPERTY(qint32 width READ width NOTIFY widthChanged)
62 Q_PROPERTY(qint32 height READ height NOTIFY heightChanged)
64 Q_PROPERTY(float realFrameRate READ realFrameRate NOTIFY realFrameRateChanged)
65 Q_PROPERTY(QString profile READ profile NOTIFY profileChanged)
66 Q_PROPERTY(Jellyfin::DTO::MediaStreamTypeClass::Value type READ type NOTIFY typeChanged)
67 Q_PROPERTY(QString aspectRatio READ aspectRatio NOTIFY aspectRatioChanged)
68 Q_PROPERTY(qint32 index READ index NOTIFY indexChanged)
69
70
71 QString codec() const { return m_data->codec(); }
72 QString codecTag() const { return m_data->codecTag(); }
73 QString language() const { return m_data->language(); }
74 QString colorRange() const { return m_data->colorRange(); }
75 QString colorSpace() const { return m_data->colorSpace(); }
76 QString colorTransfer() const { return m_data->colorTransfer(); }
77 QString colorPrimaries() const { return m_data->colorPrimaries(); }
78 QString comment() const { return m_data->comment(); }
79 QString timeBase() const { return m_data->timeBase(); }
80 QString title() const { return m_data->title(); }
81 QString videoRange() const { return m_data->videoRange(); }
82 QString localizedUndefined() const { return m_data->localizedUndefined(); }
83 QString localizedDefault() const { return m_data->localizedDefault(); }
84 QString localizedForced() const { return m_data->localizedForced(); }
85 QString displayTitle() const { return m_data->displayTitle(); }
86 QString nalLengthSize() const { return m_data->nalLengthSize(); }
87 bool interlaced() const { return m_data->isInterlaced(); }
88 bool avc() const { return m_data->isAVC().value_or(false); }
89 QString channelLayout() const { return m_data->channelLayout(); }
90 qint32 bitRate() const { return m_data->bitRate().value_or(-1); }
91 qint32 bitDepth() const { return m_data->bitDepth().value_or(-1); }
92 qint32 refFrames() const { return m_data->refFrames().value_or(-1); }
93 qint32 packetLength() const { return m_data->packetLength().value_or(-1); }
94 qint32 channels() const { return m_data->channels().value_or(-1); }
95 qint32 sampleRate() const { return m_data->sampleRate().value_or(-1); }
96 bool isDefault() const { return m_data->isDefault(); }
97 bool forced() const { return m_data->isForced(); }
98 qint32 width() const { return m_data->width().value_or(-1); }
99 qint32 height() const { return m_data->height().value_or(-1); }
100 float averageFrameRate() const { return m_data->averageFrameRate().value_or(-1.0); }
101 float realFrameRate() const { return m_data->realFrameRate().value_or(-1.0); }
102 QString profile() const { return m_data->profile(); }
103 DTO::MediaStreamType type() const { return m_data->type(); }
104 QString aspectRatio() const { return m_data->aspectRatio(); }
105 qint32 index() const { return m_data->index(); }
106
107
108signals:
109 void codecChanged(const QString &newCodec);
110 void codecTagChanged(const QString &newCodecTag);
111 void languageChanged(const QString &newLanguage);
112 void colorRangeChanged(const QString &newColorRange);
113 void colorSpaceChanged(const QString &newColorSpace);
114 void colorTransferChanged(const QString &newColorTransfer);
115 void colorPrimariesChanged(const QString &newColorPrimaries);
116 void commentChanged(const QString &newComment);
117 void timeBaseChanged(const QString &newTimeBase);
118 void titleChanged(const QString &newTitle);
119 void videoRangeChanged(const QString &newVideoRanged);
120 void localizedUndefinedChanged(const QString &newLocalizedUndefined);
121 void localizedDefaultChanged(const QString &newLocalizedDefault);
122 void localizedForcedChanged(const QString &newLocalizedForced);
123 void displayTitleChanged(const QString &newDisplayTitle);
124 void nalLengthSizeChanged(const QString &newNalLengthSize);
125 void interlacedChanged(bool newInterlaced);
126 void avcChanged(bool newAVC);
127 void channelLayoutChanged(const QString &newChannelLayout);
128 void bitRateChanged(qint32 newBitRate);
129 void bitDepthChanged(qint32 newBitDepth);
130 void refFramesChanged(qint32 newRefFrames);
131 void packetLengthChanged(qint32 newPacketLength);
132 void channelsChanged(qint32 newChannels);
133 void sampleRateChanged(qint32 newSampleRate);
134 void isDefaultChanged(bool newIsDefault);
135 void forcedChanged(bool newForced);
136 void heightChanged(qint32 newHeight);
137 void widthChanged(qint32 newWidth);
138 void averageFrameRateChanged(float newAverageFrameRate);
139 void realFrameRateChanged(float newRealFrameRate);
140 void profileChanged(const QString &newProfile);
142 void aspectRatioChanged(const QString &newAspectRatio);
143 void indexChanged(qint32 newIndex);
144
145private:
146 QSharedPointer<DTO::MediaStream> m_data;
147};
148
149
150} // ViewModel
151} // Jellyfin
152
153#endif // JELLYFIN_VIEWMODEL_MEDIASTREAM_H
Definition mediastreamtype.h:46
Value
Definition mediastreamtype.h:49
Definition mediastream.h:29
void localizedForcedChanged(const QString &newLocalizedForced)
void interlacedChanged(bool newInterlaced)
void forcedChanged(bool newForced)
qint32 packetLength() const
Definition mediastream.h:93
QString profile() const
Definition mediastream.h:102
void videoRangeChanged(const QString &newVideoRanged)
float realFrameRate
Definition mediastream.h:64
void channelLayoutChanged(const QString &newChannelLayout)
void sampleRateChanged(qint32 newSampleRate)
QString aspectRatio
Definition mediastream.h:67
void bitDepthChanged(qint32 newBitDepth)
void codecChanged(const QString &newCodec)
QString channelLayout() const
Definition mediastream.h:89
QString videoRange() const
Definition mediastream.h:81
void nalLengthSizeChanged(const QString &newNalLengthSize)
qint32 height() const
Definition mediastream.h:99
QString aspectRatio() const
Definition mediastream.h:104
QString localizedDefault
Definition mediastream.h:46
void commentChanged(const QString &newComment)
QString profile
Definition mediastream.h:65
qint32 refFrames() const
Definition mediastream.h:92
QString title() const
Definition mediastream.h:80
void colorPrimariesChanged(const QString &newColorPrimaries)
void isDefaultChanged(bool newIsDefault)
QString localizedUndefined() const
Definition mediastream.h:82
void localizedUndefinedChanged(const QString &newLocalizedUndefined)
QString colorRange
Definition mediastream.h:37
qint32 width
Definition mediastream.h:61
void displayTitleChanged(const QString &newDisplayTitle)
qint32 bitRate() const
Definition mediastream.h:90
void aspectRatioChanged(const QString &newAspectRatio)
bool interlaced
Definition mediastream.h:50
void refFramesChanged(qint32 newRefFrames)
QString timeBase
Definition mediastream.h:42
QString codecTag
Definition mediastream.h:35
QString timeBase() const
Definition mediastream.h:79
QString colorPrimaries
Definition mediastream.h:40
QString displayTitle() const
Definition mediastream.h:85
bool avc
Definition mediastream.h:51
QString colorRange() const
Definition mediastream.h:74
bool forced() const
Definition mediastream.h:97
void bitRateChanged(qint32 newBitRate)
qint32 bitDepth
Definition mediastream.h:54
bool interlaced() const
Definition mediastream.h:87
QString localizedForced() const
Definition mediastream.h:84
QString displayTitle
Definition mediastream.h:48
void indexChanged(qint32 newIndex)
qint32 sampleRate() const
Definition mediastream.h:95
QString videoRange
Definition mediastream.h:44
qint32 refFrames
Definition mediastream.h:55
float averageFrameRate
Definition mediastream.h:63
bool avc() const
Definition mediastream.h:88
void codecTagChanged(const QString &newCodecTag)
void packetLengthChanged(qint32 newPacketLength)
void channelsChanged(qint32 newChannels)
qint32 channels
Definition mediastream.h:57
qint32 index
Definition mediastream.h:68
QString codec
Definition mediastream.h:34
QString colorSpace
Definition mediastream.h:38
qint32 bitDepth() const
Definition mediastream.h:91
qint32 bitRate
Definition mediastream.h:53
QString colorSpace() const
Definition mediastream.h:75
qint32 packetLength
Definition mediastream.h:56
QString language
Definition mediastream.h:36
void titleChanged(const QString &newTitle)
QString language() const
Definition mediastream.h:73
qint32 channels() const
Definition mediastream.h:94
void profileChanged(const QString &newProfile)
void timeBaseChanged(const QString &newTimeBase)
QString colorPrimaries() const
Definition mediastream.h:77
QString localizedForced
Definition mediastream.h:47
void colorRangeChanged(const QString &newColorRange)
Jellyfin::DTO::MediaStreamTypeClass::Value type
Definition mediastream.h:66
float averageFrameRate() const
Definition mediastream.h:100
QString localizedDefault() const
Definition mediastream.h:83
DTO::MediaStreamType type() const
Definition mediastream.h:103
qint32 width() const
Definition mediastream.h:98
void widthChanged(qint32 newWidth)
bool isDefault() const
Definition mediastream.h:96
QString colorTransfer() const
Definition mediastream.h:76
qint32 sampleRate
Definition mediastream.h:58
QString localizedUndefined
Definition mediastream.h:45
void heightChanged(qint32 newHeight)
QString title
Definition mediastream.h:43
bool forced
Definition mediastream.h:60
QString nalLengthSize
Definition mediastream.h:49
QString nalLengthSize() const
Definition mediastream.h:86
bool isDefault
Definition mediastream.h:59
QString colorTransfer
Definition mediastream.h:39
QString comment
Definition mediastream.h:41
QString codecTag() const
Definition mediastream.h:72
float realFrameRate() const
Definition mediastream.h:101
void languageChanged(const QString &newLanguage)
QString comment() const
Definition mediastream.h:78
void colorSpaceChanged(const QString &newColorSpace)
void localizedDefaultChanged(const QString &newLocalizedDefault)
void realFrameRateChanged(float newRealFrameRate)
qint32 height
Definition mediastream.h:62
void typeChanged(const Jellyfin::DTO::MediaStreamTypeClass::Value newType)
MediaStream(QSharedPointer< DTO::MediaStream > data, QObject *parent=nullptr)
Definition mediastream.cpp:25
QString channelLayout
Definition mediastream.h:52
qint32 index() const
Definition mediastream.h:105
void averageFrameRateChanged(float newAverageFrameRate)
void colorTransferChanged(const QString &newColorTransfer)