/* * 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 { PlaybackInfoDto::PlaybackInfoDto() {} PlaybackInfoDto::PlaybackInfoDto(const PlaybackInfoDto &other) : m_userId(other.m_userId), m_maxStreamingBitrate(other.m_maxStreamingBitrate), m_startTimeTicks(other.m_startTimeTicks), m_audioStreamIndex(other.m_audioStreamIndex), m_subtitleStreamIndex(other.m_subtitleStreamIndex), m_maxAudioChannels(other.m_maxAudioChannels), m_mediaSourceId(other.m_mediaSourceId), m_liveStreamId(other.m_liveStreamId), m_deviceProfile(other.m_deviceProfile), m_enableDirectPlay(other.m_enableDirectPlay), m_enableDirectStream(other.m_enableDirectStream), m_enableTranscoding(other.m_enableTranscoding), m_allowVideoStreamCopy(other.m_allowVideoStreamCopy), m_allowAudioStreamCopy(other.m_allowAudioStreamCopy), m_autoOpenLiveStream(other.m_autoOpenLiveStream){} void PlaybackInfoDto::replaceData(PlaybackInfoDto &other) { m_userId = other.m_userId; m_maxStreamingBitrate = other.m_maxStreamingBitrate; m_startTimeTicks = other.m_startTimeTicks; m_audioStreamIndex = other.m_audioStreamIndex; m_subtitleStreamIndex = other.m_subtitleStreamIndex; m_maxAudioChannels = other.m_maxAudioChannels; m_mediaSourceId = other.m_mediaSourceId; m_liveStreamId = other.m_liveStreamId; m_deviceProfile = other.m_deviceProfile; m_enableDirectPlay = other.m_enableDirectPlay; m_enableDirectStream = other.m_enableDirectStream; m_enableTranscoding = other.m_enableTranscoding; m_allowVideoStreamCopy = other.m_allowVideoStreamCopy; m_allowAudioStreamCopy = other.m_allowAudioStreamCopy; m_autoOpenLiveStream = other.m_autoOpenLiveStream; } PlaybackInfoDto PlaybackInfoDto::fromJson(QJsonObject source) { PlaybackInfoDto instance; instance.setFromJson(source); return instance; } void PlaybackInfoDto::setFromJson(QJsonObject source) { m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); m_maxStreamingBitrate = Jellyfin::Support::fromJsonValue>(source["MaxStreamingBitrate"]); m_startTimeTicks = Jellyfin::Support::fromJsonValue>(source["StartTimeTicks"]); m_audioStreamIndex = Jellyfin::Support::fromJsonValue>(source["AudioStreamIndex"]); m_subtitleStreamIndex = Jellyfin::Support::fromJsonValue>(source["SubtitleStreamIndex"]); m_maxAudioChannels = Jellyfin::Support::fromJsonValue>(source["MaxAudioChannels"]); m_mediaSourceId = Jellyfin::Support::fromJsonValue(source["MediaSourceId"]); m_liveStreamId = Jellyfin::Support::fromJsonValue(source["LiveStreamId"]); m_deviceProfile = Jellyfin::Support::fromJsonValue>(source["DeviceProfile"]); m_enableDirectPlay = Jellyfin::Support::fromJsonValue>(source["EnableDirectPlay"]); m_enableDirectStream = Jellyfin::Support::fromJsonValue>(source["EnableDirectStream"]); m_enableTranscoding = Jellyfin::Support::fromJsonValue>(source["EnableTranscoding"]); m_allowVideoStreamCopy = Jellyfin::Support::fromJsonValue>(source["AllowVideoStreamCopy"]); m_allowAudioStreamCopy = Jellyfin::Support::fromJsonValue>(source["AllowAudioStreamCopy"]); m_autoOpenLiveStream = Jellyfin::Support::fromJsonValue>(source["AutoOpenLiveStream"]); } QJsonObject PlaybackInfoDto::toJson() const { QJsonObject result; if (!(m_userId.isNull())) { result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); } if (!(!m_maxStreamingBitrate.has_value())) { result["MaxStreamingBitrate"] = Jellyfin::Support::toJsonValue>(m_maxStreamingBitrate); } if (!(!m_startTimeTicks.has_value())) { result["StartTimeTicks"] = Jellyfin::Support::toJsonValue>(m_startTimeTicks); } if (!(!m_audioStreamIndex.has_value())) { result["AudioStreamIndex"] = Jellyfin::Support::toJsonValue>(m_audioStreamIndex); } if (!(!m_subtitleStreamIndex.has_value())) { result["SubtitleStreamIndex"] = Jellyfin::Support::toJsonValue>(m_subtitleStreamIndex); } if (!(!m_maxAudioChannels.has_value())) { result["MaxAudioChannels"] = Jellyfin::Support::toJsonValue>(m_maxAudioChannels); } if (!(m_mediaSourceId.isNull())) { result["MediaSourceId"] = Jellyfin::Support::toJsonValue(m_mediaSourceId); } if (!(m_liveStreamId.isNull())) { result["LiveStreamId"] = Jellyfin::Support::toJsonValue(m_liveStreamId); } result["DeviceProfile"] = Jellyfin::Support::toJsonValue>(m_deviceProfile); if (!(!m_enableDirectPlay.has_value())) { result["EnableDirectPlay"] = Jellyfin::Support::toJsonValue>(m_enableDirectPlay); } if (!(!m_enableDirectStream.has_value())) { result["EnableDirectStream"] = Jellyfin::Support::toJsonValue>(m_enableDirectStream); } if (!(!m_enableTranscoding.has_value())) { result["EnableTranscoding"] = Jellyfin::Support::toJsonValue>(m_enableTranscoding); } if (!(!m_allowVideoStreamCopy.has_value())) { result["AllowVideoStreamCopy"] = Jellyfin::Support::toJsonValue>(m_allowVideoStreamCopy); } if (!(!m_allowAudioStreamCopy.has_value())) { result["AllowAudioStreamCopy"] = Jellyfin::Support::toJsonValue>(m_allowAudioStreamCopy); } if (!(!m_autoOpenLiveStream.has_value())) { result["AutoOpenLiveStream"] = Jellyfin::Support::toJsonValue>(m_autoOpenLiveStream); } return result; } QString PlaybackInfoDto::userId() const { return m_userId; } void PlaybackInfoDto::setUserId(QString newUserId) { m_userId = newUserId; } bool PlaybackInfoDto::userIdNull() const { return m_userId.isNull(); } void PlaybackInfoDto::setUserIdNull() { m_userId.clear(); } std::optional PlaybackInfoDto::maxStreamingBitrate() const { return m_maxStreamingBitrate; } void PlaybackInfoDto::setMaxStreamingBitrate(std::optional newMaxStreamingBitrate) { m_maxStreamingBitrate = newMaxStreamingBitrate; } bool PlaybackInfoDto::maxStreamingBitrateNull() const { return !m_maxStreamingBitrate.has_value(); } void PlaybackInfoDto::setMaxStreamingBitrateNull() { m_maxStreamingBitrate = std::nullopt; } std::optional PlaybackInfoDto::startTimeTicks() const { return m_startTimeTicks; } void PlaybackInfoDto::setStartTimeTicks(std::optional newStartTimeTicks) { m_startTimeTicks = newStartTimeTicks; } bool PlaybackInfoDto::startTimeTicksNull() const { return !m_startTimeTicks.has_value(); } void PlaybackInfoDto::setStartTimeTicksNull() { m_startTimeTicks = std::nullopt; } std::optional PlaybackInfoDto::audioStreamIndex() const { return m_audioStreamIndex; } void PlaybackInfoDto::setAudioStreamIndex(std::optional newAudioStreamIndex) { m_audioStreamIndex = newAudioStreamIndex; } bool PlaybackInfoDto::audioStreamIndexNull() const { return !m_audioStreamIndex.has_value(); } void PlaybackInfoDto::setAudioStreamIndexNull() { m_audioStreamIndex = std::nullopt; } std::optional PlaybackInfoDto::subtitleStreamIndex() const { return m_subtitleStreamIndex; } void PlaybackInfoDto::setSubtitleStreamIndex(std::optional newSubtitleStreamIndex) { m_subtitleStreamIndex = newSubtitleStreamIndex; } bool PlaybackInfoDto::subtitleStreamIndexNull() const { return !m_subtitleStreamIndex.has_value(); } void PlaybackInfoDto::setSubtitleStreamIndexNull() { m_subtitleStreamIndex = std::nullopt; } std::optional PlaybackInfoDto::maxAudioChannels() const { return m_maxAudioChannels; } void PlaybackInfoDto::setMaxAudioChannels(std::optional newMaxAudioChannels) { m_maxAudioChannels = newMaxAudioChannels; } bool PlaybackInfoDto::maxAudioChannelsNull() const { return !m_maxAudioChannels.has_value(); } void PlaybackInfoDto::setMaxAudioChannelsNull() { m_maxAudioChannels = std::nullopt; } QString PlaybackInfoDto::mediaSourceId() const { return m_mediaSourceId; } void PlaybackInfoDto::setMediaSourceId(QString newMediaSourceId) { m_mediaSourceId = newMediaSourceId; } bool PlaybackInfoDto::mediaSourceIdNull() const { return m_mediaSourceId.isNull(); } void PlaybackInfoDto::setMediaSourceIdNull() { m_mediaSourceId.clear(); } QString PlaybackInfoDto::liveStreamId() const { return m_liveStreamId; } void PlaybackInfoDto::setLiveStreamId(QString newLiveStreamId) { m_liveStreamId = newLiveStreamId; } bool PlaybackInfoDto::liveStreamIdNull() const { return m_liveStreamId.isNull(); } void PlaybackInfoDto::setLiveStreamIdNull() { m_liveStreamId.clear(); } QSharedPointer PlaybackInfoDto::deviceProfile() const { return m_deviceProfile; } void PlaybackInfoDto::setDeviceProfile(QSharedPointer newDeviceProfile) { m_deviceProfile = newDeviceProfile; } std::optional PlaybackInfoDto::enableDirectPlay() const { return m_enableDirectPlay; } void PlaybackInfoDto::setEnableDirectPlay(std::optional newEnableDirectPlay) { m_enableDirectPlay = newEnableDirectPlay; } bool PlaybackInfoDto::enableDirectPlayNull() const { return !m_enableDirectPlay.has_value(); } void PlaybackInfoDto::setEnableDirectPlayNull() { m_enableDirectPlay = std::nullopt; } std::optional PlaybackInfoDto::enableDirectStream() const { return m_enableDirectStream; } void PlaybackInfoDto::setEnableDirectStream(std::optional newEnableDirectStream) { m_enableDirectStream = newEnableDirectStream; } bool PlaybackInfoDto::enableDirectStreamNull() const { return !m_enableDirectStream.has_value(); } void PlaybackInfoDto::setEnableDirectStreamNull() { m_enableDirectStream = std::nullopt; } std::optional PlaybackInfoDto::enableTranscoding() const { return m_enableTranscoding; } void PlaybackInfoDto::setEnableTranscoding(std::optional newEnableTranscoding) { m_enableTranscoding = newEnableTranscoding; } bool PlaybackInfoDto::enableTranscodingNull() const { return !m_enableTranscoding.has_value(); } void PlaybackInfoDto::setEnableTranscodingNull() { m_enableTranscoding = std::nullopt; } std::optional PlaybackInfoDto::allowVideoStreamCopy() const { return m_allowVideoStreamCopy; } void PlaybackInfoDto::setAllowVideoStreamCopy(std::optional newAllowVideoStreamCopy) { m_allowVideoStreamCopy = newAllowVideoStreamCopy; } bool PlaybackInfoDto::allowVideoStreamCopyNull() const { return !m_allowVideoStreamCopy.has_value(); } void PlaybackInfoDto::setAllowVideoStreamCopyNull() { m_allowVideoStreamCopy = std::nullopt; } std::optional PlaybackInfoDto::allowAudioStreamCopy() const { return m_allowAudioStreamCopy; } void PlaybackInfoDto::setAllowAudioStreamCopy(std::optional newAllowAudioStreamCopy) { m_allowAudioStreamCopy = newAllowAudioStreamCopy; } bool PlaybackInfoDto::allowAudioStreamCopyNull() const { return !m_allowAudioStreamCopy.has_value(); } void PlaybackInfoDto::setAllowAudioStreamCopyNull() { m_allowAudioStreamCopy = std::nullopt; } std::optional PlaybackInfoDto::autoOpenLiveStream() const { return m_autoOpenLiveStream; } void PlaybackInfoDto::setAutoOpenLiveStream(std::optional newAutoOpenLiveStream) { m_autoOpenLiveStream = newAutoOpenLiveStream; } bool PlaybackInfoDto::autoOpenLiveStreamNull() const { return !m_autoOpenLiveStream.has_value(); } void PlaybackInfoDto::setAutoOpenLiveStreamNull() { m_autoOpenLiveStream = std::nullopt; } } // NS DTO namespace Support { using PlaybackInfoDto = Jellyfin::DTO::PlaybackInfoDto; template <> PlaybackInfoDto fromJsonValue(const QJsonValue &source, convertType) { if (!source.isObject()) throw ParseException("Expected JSON Object"); return PlaybackInfoDto::fromJson(source.toObject()); } template<> QJsonValue toJsonValue(const PlaybackInfoDto &source, convertType) { return source.toJson(); } } // NS DTO } // NS Jellyfin