11#include " ClipTime.h"
2-
3- #include < QJSEngine>
42#include < QVariant>
53
64#include < opendspx/cliptime.h>
@@ -21,59 +19,9 @@ namespace dspx {
2119 int length;
2220 int clipStart;
2321 int clipLen;
24-
25- void setLengthUnchecked (int length_);
26- void setLength (int length_);
27- void setClipStartUnchecked (int clipStart_);
28- void setClipStart (int clipStart_);
29- void setClipLenUnchecked (int clipLen_);
30- void setClipLen (int clipLen_);
3122 };
3223
33- void ClipTimePrivate::setLengthUnchecked (int length_) {
34- Q_Q (ClipTime);
35- pModel->strategy ->setEntityProperty (handle, ModelStrategy::P_Length, length_);
36- }
37-
38- void ClipTimePrivate::setLength (int length_) {
39- Q_Q (ClipTime);
40- if (length_ < 0 ) {
41- if (auto engine = qjsEngine (q))
42- engine->throwError (QJSValue::RangeError, QStringLiteral (" Length must be greater than or equal to 0" ));
43- return ;
44- }
45- setLengthUnchecked (length_);
46- }
47-
48- void ClipTimePrivate::setClipStartUnchecked (int clipStart_) {
49- Q_Q (ClipTime);
50- pModel->strategy ->setEntityProperty (handle, ModelStrategy::P_ClipStart, clipStart_);
51- }
5224
53- void ClipTimePrivate::setClipStart (int clipStart_) {
54- Q_Q (ClipTime);
55- if (clipStart_ < 0 ) {
56- if (auto engine = qjsEngine (q))
57- engine->throwError (QJSValue::RangeError, QStringLiteral (" ClipStart must be greater than or equal to 0" ));
58- return ;
59- }
60- setClipStartUnchecked (clipStart_);
61- }
62-
63- void ClipTimePrivate::setClipLenUnchecked (int clipLen_) {
64- Q_Q (ClipTime);
65- pModel->strategy ->setEntityProperty (handle, ModelStrategy::P_ClipLength, clipLen_);
66- }
67-
68- void ClipTimePrivate::setClipLen (int clipLen_) {
69- Q_Q (ClipTime);
70- if (clipLen_ < 0 ) {
71- if (auto engine = qjsEngine (q))
72- engine->throwError (QJSValue::RangeError, QStringLiteral (" ClipLen must be greater than or equal to 0" ));
73- return ;
74- }
75- setClipLenUnchecked (clipLen_);
76- }
7725
7826 ClipTime::ClipTime (Handle handle, Model *model) : QObject(model), d_ptr(new ClipTimePrivate) {
7927 Q_D (ClipTime);
@@ -106,7 +54,7 @@ namespace dspx {
10654 void ClipTime::setLength (int length) {
10755 Q_D (ClipTime);
10856 Q_ASSERT (length >= 0 );
109- d->setLengthUnchecked ( length);
57+ d->pModel -> strategy -> setEntityProperty (d-> handle , ModelStrategy::P_Length, length);
11058 }
11159
11260 int ClipTime::clipStart () const {
@@ -117,7 +65,7 @@ namespace dspx {
11765 void ClipTime::setClipStart (int clipStart) {
11866 Q_D (ClipTime);
11967 Q_ASSERT (clipStart >= 0 );
120- d->setClipStartUnchecked ( clipStart);
68+ d->pModel -> strategy -> setEntityProperty (d-> handle , ModelStrategy::P_ClipStart, clipStart);
12169 }
12270
12371 int ClipTime::clipLen () const {
@@ -128,7 +76,7 @@ namespace dspx {
12876 void ClipTime::setClipLen (int clipLen) {
12977 Q_D (ClipTime);
13078 Q_ASSERT (clipLen >= 0 );
131- d->setClipLenUnchecked ( clipLen);
79+ d->pModel -> strategy -> setEntityProperty (d-> handle , ModelStrategy::P_ClipLength, clipLen);
13280 }
13381
13482 QDspx::ClipTime ClipTime::toQDspx () const {
0 commit comments