1
/****************************************************************************
2
* Copyright (C) 2014 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
* This library is free software; you can redistribute it and/or *
6
* modify it under the terms of the GNU Lesser General Public *
7
* License as published by the Free Software Foundation; either *
8
* version 2.1 of the License, or (at your option) any later version. *
10
* This library is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13
* Lesser General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
***************************************************************************/
18
#ifndef VIDEORESOLUTION_H
19
#define VIDEORESOLUTION_H
21
#include <QtCore/QAbstractListModel>
22
#include <QtCore/QSize>
23
#include "../typedefs.h"
29
///@struct VideoResolution Equivalent of "640x480"
30
class LIB_EXPORT VideoResolution : public QAbstractListModel {
32
//Only VideoDevice can add validated rates
33
friend class VideoDevice;
36
VideoResolution(const QString& size, VideoChannel* chan);
37
explicit VideoResolution();
40
const QString name() const;
41
const QList<VideoRate*> validRates() const;
42
int relativeIndex() const;
43
VideoRate* activeRate();
44
bool setActiveRate(VideoRate* rate);
45
bool setActiveRate(int index);
51
void setWidth(int width);
52
void setHeight(int height);
55
QVariant data ( const QModelIndex& index, int role = Qt::DisplayRole ) const;
56
int rowCount ( const QModelIndex& parent = QModelIndex() ) const;
57
Qt::ItemFlags flags ( const QModelIndex& index ) const;
58
virtual bool setData ( const QModelIndex& index, const QVariant &value, int role) ;
64
QList<VideoRate*> m_lValidRates;
65
VideoRate* m_pCurrentRate;
66
VideoChannel* m_pChannel;