2
* Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
4
* Author: Tuomo Penttinen <tp@herqq.org>
6
* This file is part of Herqq UPnP Av (HUPnPAv) library.
8
* Herqq UPnP Av is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
13
* Herqq UPnP Av is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>.
22
#include "htransportsettings.h"
24
#include <HUpnpAv/HPlayMode>
25
#include <HUpnpAv/HRecordQualityMode>
27
#include <QtCore/QString>
38
/*******************************************************************************
39
* HTransportSettingsPrivate
40
******************************************************************************/
41
class HTransportSettingsPrivate :
44
H_DISABLE_ASSIGN(HTransportSettingsPrivate)
48
HRecordQualityMode m_rQualityMode;
50
HTransportSettingsPrivate() :
51
m_playMode(), m_rQualityMode()
56
/*******************************************************************************
58
******************************************************************************/
59
HTransportSettings::HTransportSettings() :
60
h_ptr(new HTransportSettingsPrivate())
64
HTransportSettings::HTransportSettings(
65
const HPlayMode& pm, const HRecordQualityMode& rqm) :
66
h_ptr(new HTransportSettingsPrivate())
68
h_ptr->m_playMode = pm;
69
h_ptr->m_rQualityMode = rqm;
72
HTransportSettings::HTransportSettings(const HTransportSettings& other) :
75
Q_ASSERT(&other != this);
78
HTransportSettings& HTransportSettings::operator=(const HTransportSettings& other)
80
Q_ASSERT(&other != this);
85
HTransportSettings::~HTransportSettings()
89
bool HTransportSettings::isEmpty() const
91
return !h_ptr->m_playMode.isValid() && !h_ptr->m_rQualityMode.isValid();
94
const HPlayMode& HTransportSettings::playMode() const
96
return h_ptr->m_playMode;
99
HRecordQualityMode HTransportSettings::recordQualityMode() const
101
return h_ptr->m_rQualityMode;
104
void HTransportSettings::setPlayMode(const HPlayMode& arg)
106
h_ptr->m_playMode = arg;
109
void HTransportSettings::setRecordQualityMode(const HRecordQualityMode& arg)
111
h_ptr->m_rQualityMode = arg;
114
bool operator==(const HTransportSettings& obj1, const HTransportSettings& obj2)
116
return obj1.playMode() == obj2.playMode() &&
117
obj1.recordQualityMode() == obj2.recordQualityMode();