/* * Sailfin: a Jellyfin client written using Qt * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET * OVERWRITTEN AT SOME POINT! * * If there is a bug in this file, please fix the code generator used to generate this file found in * core/openapigenerator.d. * * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that * file with a newer file if needed instead of manually updating the files. */ #include namespace Jellyfin { namespace DTO { MediaStream::MediaStream() {} MediaStream::MediaStream(const MediaStream &other) : m_codec(other.m_codec), m_codecTag(other.m_codecTag), m_language(other.m_language), m_colorRange(other.m_colorRange), m_colorSpace(other.m_colorSpace), m_colorTransfer(other.m_colorTransfer), m_colorPrimaries(other.m_colorPrimaries), m_comment(other.m_comment), m_timeBase(other.m_timeBase), m_codecTimeBase(other.m_codecTimeBase), m_title(other.m_title), m_videoRange(other.m_videoRange), m_localizedUndefined(other.m_localizedUndefined), m_localizedDefault(other.m_localizedDefault), m_localizedForced(other.m_localizedForced), m_displayTitle(other.m_displayTitle), m_nalLengthSize(other.m_nalLengthSize), m_isInterlaced(other.m_isInterlaced), m_isAVC(other.m_isAVC), m_channelLayout(other.m_channelLayout), m_bitRate(other.m_bitRate), m_bitDepth(other.m_bitDepth), m_refFrames(other.m_refFrames), m_packetLength(other.m_packetLength), m_channels(other.m_channels), m_sampleRate(other.m_sampleRate), m_isDefault(other.m_isDefault), m_isForced(other.m_isForced), m_height(other.m_height), m_width(other.m_width), m_averageFrameRate(other.m_averageFrameRate), m_realFrameRate(other.m_realFrameRate), m_profile(other.m_profile), m_type(other.m_type), m_aspectRatio(other.m_aspectRatio), m_index(other.m_index), m_score(other.m_score), m_isExternal(other.m_isExternal), m_deliveryMethod(other.m_deliveryMethod), m_deliveryUrl(other.m_deliveryUrl), m_isExternalUrl(other.m_isExternalUrl), m_isTextSubtitleStream(other.m_isTextSubtitleStream), m_supportsExternalStream(other.m_supportsExternalStream), m_path(other.m_path), m_pixelFormat(other.m_pixelFormat), m_level(other.m_level), m_isAnamorphic(other.m_isAnamorphic){} MediaStream MediaStream::fromJson(QJsonObject source) { MediaStream instance; instance.setFromJson(source); return instance; } void MediaStream::setFromJson(QJsonObject source) { m_codec = Jellyfin::Support::fromJsonValue(source["Codec"]); m_codecTag = Jellyfin::Support::fromJsonValue(source["CodecTag"]); m_language = Jellyfin::Support::fromJsonValue(source["Language"]); m_colorRange = Jellyfin::Support::fromJsonValue(source["ColorRange"]); m_colorSpace = Jellyfin::Support::fromJsonValue(source["ColorSpace"]); m_colorTransfer = Jellyfin::Support::fromJsonValue(source["ColorTransfer"]); m_colorPrimaries = Jellyfin::Support::fromJsonValue(source["ColorPrimaries"]); m_comment = Jellyfin::Support::fromJsonValue(source["Comment"]); m_timeBase = Jellyfin::Support::fromJsonValue(source["TimeBase"]); m_codecTimeBase = Jellyfin::Support::fromJsonValue(source["CodecTimeBase"]); m_title = Jellyfin::Support::fromJsonValue(source["Title"]); m_videoRange = Jellyfin::Support::fromJsonValue(source["VideoRange"]); m_localizedUndefined = Jellyfin::Support::fromJsonValue(source["localizedUndefined"]); m_localizedDefault = Jellyfin::Support::fromJsonValue(source["localizedDefault"]); m_localizedForced = Jellyfin::Support::fromJsonValue(source["localizedForced"]); m_displayTitle = Jellyfin::Support::fromJsonValue(source["DisplayTitle"]); m_nalLengthSize = Jellyfin::Support::fromJsonValue(source["NalLengthSize"]); m_isInterlaced = Jellyfin::Support::fromJsonValue(source["IsInterlaced"]); m_isAVC = Jellyfin::Support::fromJsonValue(source["IsAVC"]); m_channelLayout = Jellyfin::Support::fromJsonValue(source["ChannelLayout"]); m_bitRate = Jellyfin::Support::fromJsonValue(source["BitRate"]); m_bitDepth = Jellyfin::Support::fromJsonValue(source["BitDepth"]); m_refFrames = Jellyfin::Support::fromJsonValue(source["RefFrames"]); m_packetLength = Jellyfin::Support::fromJsonValue(source["PacketLength"]); m_channels = Jellyfin::Support::fromJsonValue(source["Channels"]); m_sampleRate = Jellyfin::Support::fromJsonValue(source["SampleRate"]); m_isDefault = Jellyfin::Support::fromJsonValue(source["IsDefault"]); m_isForced = Jellyfin::Support::fromJsonValue(source["IsForced"]); m_height = Jellyfin::Support::fromJsonValue(source["Height"]); m_width = Jellyfin::Support::fromJsonValue(source["Width"]); m_averageFrameRate = Jellyfin::Support::fromJsonValue(source["AverageFrameRate"]); m_realFrameRate = Jellyfin::Support::fromJsonValue(source["RealFrameRate"]); m_profile = Jellyfin::Support::fromJsonValue(source["Profile"]); m_type = Jellyfin::Support::fromJsonValue(source["Type"]); m_aspectRatio = Jellyfin::Support::fromJsonValue(source["AspectRatio"]); m_index = Jellyfin::Support::fromJsonValue(source["Index"]); m_score = Jellyfin::Support::fromJsonValue(source["Score"]); m_isExternal = Jellyfin::Support::fromJsonValue(source["IsExternal"]); m_deliveryMethod = Jellyfin::Support::fromJsonValue(source["DeliveryMethod"]); m_deliveryUrl = Jellyfin::Support::fromJsonValue(source["DeliveryUrl"]); m_isExternalUrl = Jellyfin::Support::fromJsonValue(source["IsExternalUrl"]); m_isTextSubtitleStream = Jellyfin::Support::fromJsonValue(source["IsTextSubtitleStream"]); m_supportsExternalStream = Jellyfin::Support::fromJsonValue(source["SupportsExternalStream"]); m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_pixelFormat = Jellyfin::Support::fromJsonValue(source["PixelFormat"]); m_level = Jellyfin::Support::fromJsonValue(source["Level"]); m_isAnamorphic = Jellyfin::Support::fromJsonValue(source["IsAnamorphic"]); } QJsonObject MediaStream::toJson() { QJsonObject result; result["Codec"] = Jellyfin::Support::toJsonValue(m_codec); result["CodecTag"] = Jellyfin::Support::toJsonValue(m_codecTag); result["Language"] = Jellyfin::Support::toJsonValue(m_language); result["ColorRange"] = Jellyfin::Support::toJsonValue(m_colorRange); result["ColorSpace"] = Jellyfin::Support::toJsonValue(m_colorSpace); result["ColorTransfer"] = Jellyfin::Support::toJsonValue(m_colorTransfer); result["ColorPrimaries"] = Jellyfin::Support::toJsonValue(m_colorPrimaries); result["Comment"] = Jellyfin::Support::toJsonValue(m_comment); result["TimeBase"] = Jellyfin::Support::toJsonValue(m_timeBase); result["CodecTimeBase"] = Jellyfin::Support::toJsonValue(m_codecTimeBase); result["Title"] = Jellyfin::Support::toJsonValue(m_title); result["VideoRange"] = Jellyfin::Support::toJsonValue(m_videoRange); result["localizedUndefined"] = Jellyfin::Support::toJsonValue(m_localizedUndefined); result["localizedDefault"] = Jellyfin::Support::toJsonValue(m_localizedDefault); result["localizedForced"] = Jellyfin::Support::toJsonValue(m_localizedForced); result["DisplayTitle"] = Jellyfin::Support::toJsonValue(m_displayTitle); result["NalLengthSize"] = Jellyfin::Support::toJsonValue(m_nalLengthSize); result["IsInterlaced"] = Jellyfin::Support::toJsonValue(m_isInterlaced); result["IsAVC"] = Jellyfin::Support::toJsonValue(m_isAVC); result["ChannelLayout"] = Jellyfin::Support::toJsonValue(m_channelLayout); result["BitRate"] = Jellyfin::Support::toJsonValue(m_bitRate); result["BitDepth"] = Jellyfin::Support::toJsonValue(m_bitDepth); result["RefFrames"] = Jellyfin::Support::toJsonValue(m_refFrames); result["PacketLength"] = Jellyfin::Support::toJsonValue(m_packetLength); result["Channels"] = Jellyfin::Support::toJsonValue(m_channels); result["SampleRate"] = Jellyfin::Support::toJsonValue(m_sampleRate); result["IsDefault"] = Jellyfin::Support::toJsonValue(m_isDefault); result["IsForced"] = Jellyfin::Support::toJsonValue(m_isForced); result["Height"] = Jellyfin::Support::toJsonValue(m_height); result["Width"] = Jellyfin::Support::toJsonValue(m_width); result["AverageFrameRate"] = Jellyfin::Support::toJsonValue(m_averageFrameRate); result["RealFrameRate"] = Jellyfin::Support::toJsonValue(m_realFrameRate); result["Profile"] = Jellyfin::Support::toJsonValue(m_profile); result["Type"] = Jellyfin::Support::toJsonValue(m_type); result["AspectRatio"] = Jellyfin::Support::toJsonValue(m_aspectRatio); result["Index"] = Jellyfin::Support::toJsonValue(m_index); result["Score"] = Jellyfin::Support::toJsonValue(m_score); result["IsExternal"] = Jellyfin::Support::toJsonValue(m_isExternal); result["DeliveryMethod"] = Jellyfin::Support::toJsonValue(m_deliveryMethod); result["DeliveryUrl"] = Jellyfin::Support::toJsonValue(m_deliveryUrl); result["IsExternalUrl"] = Jellyfin::Support::toJsonValue(m_isExternalUrl); result["IsTextSubtitleStream"] = Jellyfin::Support::toJsonValue(m_isTextSubtitleStream); result["SupportsExternalStream"] = Jellyfin::Support::toJsonValue(m_supportsExternalStream); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["PixelFormat"] = Jellyfin::Support::toJsonValue(m_pixelFormat); result["Level"] = Jellyfin::Support::toJsonValue(m_level); result["IsAnamorphic"] = Jellyfin::Support::toJsonValue(m_isAnamorphic); return result; } QString MediaStream::codec() const { return m_codec; } void MediaStream::setCodec(QString newCodec) { m_codec = newCodec; } QString MediaStream::codecTag() const { return m_codecTag; } void MediaStream::setCodecTag(QString newCodecTag) { m_codecTag = newCodecTag; } QString MediaStream::language() const { return m_language; } void MediaStream::setLanguage(QString newLanguage) { m_language = newLanguage; } QString MediaStream::colorRange() const { return m_colorRange; } void MediaStream::setColorRange(QString newColorRange) { m_colorRange = newColorRange; } QString MediaStream::colorSpace() const { return m_colorSpace; } void MediaStream::setColorSpace(QString newColorSpace) { m_colorSpace = newColorSpace; } QString MediaStream::colorTransfer() const { return m_colorTransfer; } void MediaStream::setColorTransfer(QString newColorTransfer) { m_colorTransfer = newColorTransfer; } QString MediaStream::colorPrimaries() const { return m_colorPrimaries; } void MediaStream::setColorPrimaries(QString newColorPrimaries) { m_colorPrimaries = newColorPrimaries; } QString MediaStream::comment() const { return m_comment; } void MediaStream::setComment(QString newComment) { m_comment = newComment; } QString MediaStream::timeBase() const { return m_timeBase; } void MediaStream::setTimeBase(QString newTimeBase) { m_timeBase = newTimeBase; } QString MediaStream::codecTimeBase() const { return m_codecTimeBase; } void MediaStream::setCodecTimeBase(QString newCodecTimeBase) { m_codecTimeBase = newCodecTimeBase; } QString MediaStream::title() const { return m_title; } void MediaStream::setTitle(QString newTitle) { m_title = newTitle; } QString MediaStream::videoRange() const { return m_videoRange; } void MediaStream::setVideoRange(QString newVideoRange) { m_videoRange = newVideoRange; } QString MediaStream::localizedUndefined() const { return m_localizedUndefined; } void MediaStream::setLocalizedUndefined(QString newLocalizedUndefined) { m_localizedUndefined = newLocalizedUndefined; } QString MediaStream::localizedDefault() const { return m_localizedDefault; } void MediaStream::setLocalizedDefault(QString newLocalizedDefault) { m_localizedDefault = newLocalizedDefault; } QString MediaStream::localizedForced() const { return m_localizedForced; } void MediaStream::setLocalizedForced(QString newLocalizedForced) { m_localizedForced = newLocalizedForced; } QString MediaStream::displayTitle() const { return m_displayTitle; } void MediaStream::setDisplayTitle(QString newDisplayTitle) { m_displayTitle = newDisplayTitle; } QString MediaStream::nalLengthSize() const { return m_nalLengthSize; } void MediaStream::setNalLengthSize(QString newNalLengthSize) { m_nalLengthSize = newNalLengthSize; } bool MediaStream::isInterlaced() const { return m_isInterlaced; } void MediaStream::setIsInterlaced(bool newIsInterlaced) { m_isInterlaced = newIsInterlaced; } bool MediaStream::isAVC() const { return m_isAVC; } void MediaStream::setIsAVC(bool newIsAVC) { m_isAVC = newIsAVC; } QString MediaStream::channelLayout() const { return m_channelLayout; } void MediaStream::setChannelLayout(QString newChannelLayout) { m_channelLayout = newChannelLayout; } qint32 MediaStream::bitRate() const { return m_bitRate; } void MediaStream::setBitRate(qint32 newBitRate) { m_bitRate = newBitRate; } qint32 MediaStream::bitDepth() const { return m_bitDepth; } void MediaStream::setBitDepth(qint32 newBitDepth) { m_bitDepth = newBitDepth; } qint32 MediaStream::refFrames() const { return m_refFrames; } void MediaStream::setRefFrames(qint32 newRefFrames) { m_refFrames = newRefFrames; } qint32 MediaStream::packetLength() const { return m_packetLength; } void MediaStream::setPacketLength(qint32 newPacketLength) { m_packetLength = newPacketLength; } qint32 MediaStream::channels() const { return m_channels; } void MediaStream::setChannels(qint32 newChannels) { m_channels = newChannels; } qint32 MediaStream::sampleRate() const { return m_sampleRate; } void MediaStream::setSampleRate(qint32 newSampleRate) { m_sampleRate = newSampleRate; } bool MediaStream::isDefault() const { return m_isDefault; } void MediaStream::setIsDefault(bool newIsDefault) { m_isDefault = newIsDefault; } bool MediaStream::isForced() const { return m_isForced; } void MediaStream::setIsForced(bool newIsForced) { m_isForced = newIsForced; } qint32 MediaStream::height() const { return m_height; } void MediaStream::setHeight(qint32 newHeight) { m_height = newHeight; } qint32 MediaStream::width() const { return m_width; } void MediaStream::setWidth(qint32 newWidth) { m_width = newWidth; } float MediaStream::averageFrameRate() const { return m_averageFrameRate; } void MediaStream::setAverageFrameRate(float newAverageFrameRate) { m_averageFrameRate = newAverageFrameRate; } float MediaStream::realFrameRate() const { return m_realFrameRate; } void MediaStream::setRealFrameRate(float newRealFrameRate) { m_realFrameRate = newRealFrameRate; } QString MediaStream::profile() const { return m_profile; } void MediaStream::setProfile(QString newProfile) { m_profile = newProfile; } MediaStreamType MediaStream::type() const { return m_type; } void MediaStream::setType(MediaStreamType newType) { m_type = newType; } QString MediaStream::aspectRatio() const { return m_aspectRatio; } void MediaStream::setAspectRatio(QString newAspectRatio) { m_aspectRatio = newAspectRatio; } qint32 MediaStream::index() const { return m_index; } void MediaStream::setIndex(qint32 newIndex) { m_index = newIndex; } qint32 MediaStream::score() const { return m_score; } void MediaStream::setScore(qint32 newScore) { m_score = newScore; } bool MediaStream::isExternal() const { return m_isExternal; } void MediaStream::setIsExternal(bool newIsExternal) { m_isExternal = newIsExternal; } SubtitleDeliveryMethod MediaStream::deliveryMethod() const { return m_deliveryMethod; } void MediaStream::setDeliveryMethod(SubtitleDeliveryMethod newDeliveryMethod) { m_deliveryMethod = newDeliveryMethod; } QString MediaStream::deliveryUrl() const { return m_deliveryUrl; } void MediaStream::setDeliveryUrl(QString newDeliveryUrl) { m_deliveryUrl = newDeliveryUrl; } bool MediaStream::isExternalUrl() const { return m_isExternalUrl; } void MediaStream::setIsExternalUrl(bool newIsExternalUrl) { m_isExternalUrl = newIsExternalUrl; } bool MediaStream::isTextSubtitleStream() const { return m_isTextSubtitleStream; } void MediaStream::setIsTextSubtitleStream(bool newIsTextSubtitleStream) { m_isTextSubtitleStream = newIsTextSubtitleStream; } bool MediaStream::supportsExternalStream() const { return m_supportsExternalStream; } void MediaStream::setSupportsExternalStream(bool newSupportsExternalStream) { m_supportsExternalStream = newSupportsExternalStream; } QString MediaStream::path() const { return m_path; } void MediaStream::setPath(QString newPath) { m_path = newPath; } QString MediaStream::pixelFormat() const { return m_pixelFormat; } void MediaStream::setPixelFormat(QString newPixelFormat) { m_pixelFormat = newPixelFormat; } double MediaStream::level() const { return m_level; } void MediaStream::setLevel(double newLevel) { m_level = newLevel; } bool MediaStream::isAnamorphic() const { return m_isAnamorphic; } void MediaStream::setIsAnamorphic(bool newIsAnamorphic) { m_isAnamorphic = newIsAnamorphic; } } // NS DTO namespace Support { using MediaStream = Jellyfin::DTO::MediaStream; template <> MediaStream fromJsonValue(const QJsonValue &source) { if (!source.isObject()) throw new ParseException("Expected JSON Object"); return MediaStream::fromJson(source.toObject()); } } // NS Jellyfin } // NS DTO