Debian Codegraph @

libqnapi/src/movieinfo/movieinfo.h

raw symbols SCIP
1 /*****************************************************************************
2 ** QNapi
3 ** Copyright (C) 2008-2017 Piotr KrzemiƄski <[email protected]>
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 file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12 **
13 *****************************************************************************/
14
15 #ifndef MOVIEINFO_H
16 #define MOVIEINFO_H
17
18 #include <QMetaType>
19 #include <QObject>
20
21 class MovieInfo {
22 private:
23 int width_;
24 int height_;
25 double frameRate_;
26 double durationSecs_;
27
28 public:
29 MovieInfo(const int& width, const int& height, const double& frameRate,
30 const double& durationSecs)
31 : width_(width),
32 height_(height),
33 frameRate_(frameRate),
34 durationSecs_(durationSecs) {}
35
36 MovieInfo() : width_(0), height_(0), frameRate_(0.0), durationSecs_(0.0) {}
37
38 virtual ~MovieInfo() {}
39
40 int width() const { return width_; }
41 int height() const { return height_; }
42 double frameRate() const { return frameRate_; }
43 double durationSecs() const { return durationSecs_; }
44
45 const MovieInfo setWidth(const int& width) const {
46 return MovieInfo(width, height_, frameRate_, durationSecs_);
47 }
48 const MovieInfo setHeight(const int& height) const {
49 return MovieInfo(width_, height, frameRate_, durationSecs_);
50 }
51 const MovieInfo setFrameRate(const double& frameRate) const {
52 return MovieInfo(width_, height_, frameRate, durationSecs_);
53 }
54 const MovieInfo setDurationSecs(const double& durationSecs) const {
55 return MovieInfo(width_, height_, frameRate_, durationSecs);
56 }
57 };
58
59 Q_DECLARE_METATYPE(MovieInfo);
60
61 #endif