OSDN Git Service

Shut up some warnings when detecting VapourSynth registry path.
[x264-launcher/x264-launcher.git] / src / model_clipInfo.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program 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
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #pragma once
23
24 #include "model_clipInfo.h"
25
26 #include <QPair>
27
28 ClipInfo::ClipInfo(const quint32 &count, const quint32 &width, const quint32 &height, const quint32 &numerator, const quint32 &denominator)
29 {
30         m_frameCount    = count;
31         m_frameSize_wid = width;
32         m_frameSize_hei = height;
33         m_frameRate_num = numerator;
34         m_frameRate_den = denominator;
35 }
36
37 void ClipInfo::reset(void)
38 {
39         m_frameCount = m_frameSize_wid = m_frameSize_hei = m_frameRate_num = m_frameRate_den = 0;
40 }
41
42 const quint32 &ClipInfo::getFrameCount(void) const
43 {
44         return m_frameCount;
45 }
46
47 QPair<quint32, quint32> ClipInfo::getFrameSize(void) const
48 {
49         return qMakePair(m_frameSize_wid, m_frameSize_hei);
50 }
51
52 QPair<quint32, quint32> ClipInfo::getFrameRate(void) const
53 {
54         return qMakePair(m_frameRate_num, m_frameRate_den);
55 }
56
57 void ClipInfo::setFrameCount(const quint32 &count)
58 {
59         m_frameCount = count;
60 }
61
62 void ClipInfo::setFrameSize(const quint32 &width, const quint32 &height)
63 {
64         m_frameSize_wid = width;
65         m_frameSize_hei = height;
66 }
67
68 void ClipInfo::setFrameRate(const quint32 &numerator, const quint32 &denominator)
69 {
70         m_frameRate_num = numerator;
71         m_frameRate_den = denominator;
72 }