1 #ifndef ADM_qtScript_VideoProperties
2 #define ADM_qtScript_VideoProperties
3 
4 #include <vector>
5 #include <QtCore/QString>
6 
7 #include "QtScriptObject.h"
8 #include "AudioProperties.h"
9 
10 namespace ADM_qtScript
11 {
12 	/** \brief The VideoFileProperties %class holds the properties of a video file.
13 	 */
14 	class VideoFileProperties : public QtScriptObject
15 	{
16 		Q_OBJECT
17 
18 	private:
19 		_VIDEOS *_video;
20 
21 		std::vector<AudioProperties*> _audioProps;
22 		uint32_t _duration, _frameRate;
23 		uint32_t _height, _width;
24 		uint32_t _parHeight, _parWidth;
25 		QString _fourCC, _name;
26 
27 		QScriptValue getAudioProperties();
28 		QScriptValue getAudioProperties(int audioIndex);
29 		QScriptValue getDuration(void);
30 		QScriptValue getFourCC(void);
31 		QScriptValue getFrameRate(void);
32 		QScriptValue getHeight(void);
33 		QScriptValue getName(void);
34 		QScriptValue getParHeight(void);
35 		QScriptValue getParWidth(void);
36 		QScriptValue getWidth(void);
37 		void initialiseAudioProperties();
38 
39 	public:
40 		/** \cond */
41 		VideoFileProperties(IEditor* editor, _VIDEOS* video);
42 		~VideoFileProperties();
43 		/** \endcond */
44 
45 		/** \brief Gets extended information about the video file's audio tracks.
46 		 *
47 		 * \return Returns an array of AudioProperties objects if a video is open in the editor and contains at least one audio track; otherwise, null.
48 		 */
49 		Q_PROPERTY(QScriptValue /*% AudioProperties[] %*/ audioProperties READ getAudioProperties);
50 
51 		/** \brief Returns the duration (in milliseconds) of the video.
52 		 */
53 		Q_PROPERTY(QScriptValue /*% Number %*/ duration READ getDuration);
54 
55 		/** \brief Returns the four character code that identifies the video format.
56 		 */
57 		Q_PROPERTY(QScriptValue /*% Number %*/ fourCC READ getFourCC);
58 
59 		/** \brief Returns the video frame rate in frames per thousand seconds.
60 		 */
61 		Q_PROPERTY(QScriptValue /*% Number %*/ frameRate READ getFrameRate);
62 
63 		/** \brief Returns the height of the video in pixels.
64 		 */
65 		Q_PROPERTY(QScriptValue /*% Number %*/ height READ getHeight);
66 
67 		/** \brief Returns the name of the video file.
68 		 */
69 		Q_PROPERTY(QScriptValue /*% String %*/ name READ getName);
70 
71 		/** \brief Returns the height term of the video's Pixel Aspect Ratio.
72 		 */
73 		Q_PROPERTY(QScriptValue /*% Number %*/ parHeight READ getParHeight);
74 
75 		/** \brief Returns the width term of the video's Pixel Aspect Ratio.
76 		 */
77 		Q_PROPERTY(QScriptValue /*% Number %*/ parWidth READ getParWidth);
78 
79 		/** \brief Returns the width of the video in pixels.
80 		 */
81 		Q_PROPERTY(QScriptValue /*% Number %*/ width READ getWidth);
82 	};
83 }
84 
85 #endif
86