1 #ifndef ADM_qtScript_SegmentCollectionPrototype 2 #define ADM_qtScript_SegmentCollectionPrototype 3 4 #include "QtScriptObject.h" 5 6 namespace ADM_qtScript 7 { 8 /** \brief The SegmentCollection %class represents a collection of Segment objects 9 * that can be individually accessed by index. 10 */ 11 class SegmentCollectionPrototype /*% SegmentCollection %*/: public QtScriptObject 12 { 13 Q_OBJECT 14 15 private: 16 IEditor* _editor; 17 QScriptValue getLength(); 18 QScriptValue getTotalDuration(void); 19 20 public: 21 /** \cond */ 22 SegmentCollectionPrototype(QObject* parent, IEditor* editor); 23 /** \endcond */ 24 25 /** \brief Returns the number of Segment objects in the collection. 26 */ 27 Q_PROPERTY(QScriptValue /*% Number %*/ length READ getLength()); 28 29 /** \brief Returns the total time (in milliseconds) of all video segments in the collection. 30 */ 31 Q_PROPERTY(QScriptValue /*% Number %*/ totalDuration READ getTotalDuration()); 32 33 /** \brief Appends a segment of video to the end of the currently open video. 34 * 35 * The segment starting at the specified time (in milliseconds) and for the specified duration (in milliseconds) is sourced from the first open video unless a video index is specified. 36 * 37 * \return Returns the index of the newly added Segment in the collection. 38 */ 39 Q_INVOKABLE QScriptValue /*% Number %*/ add(QScriptValue /*% Number %*/ startTime, QScriptValue /*% Number %*/ duration, QScriptValue /*% Number %*/ videoIndex = 0); 40 41 /** \brief Removes all Segment objects from the collection. 42 */ 43 Q_INVOKABLE void clear(); 44 45 /** \brief Gets the Segment object at the specified index. 46 */ 47 ; /*% Segment operator[](Number i); %*/ 48 }; 49 } 50 #endif 51