Commit 324204b5a41141b7faeebaf0acfebd4bb75e97a8
1 parent
5c750607
Properties working
Showing
4 changed files
with
10 additions
and
17 deletions
openbr/openbr_plugin.cpp
| ... | ... | @@ -763,11 +763,18 @@ void Object::setProperty(const QString &name, QVariant value) |
| 763 | 763 | if (value.isNull()) value = true; |
| 764 | 764 | else if (value == "false") value = false; |
| 765 | 765 | else if (value == "true") value = true; |
| 766 | + } else if (type.startsWith("br::") /* Pray to science it's safe to assume these are enums */) { | |
| 767 | + bool ok; | |
| 768 | + int enumIndex = value.toInt(&ok); | |
| 769 | + if (ok) { | |
| 770 | + QMetaEnum metaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator(type.toStdString().c_str())); | |
| 771 | + value = metaEnum.value(enumIndex); | |
| 772 | + } | |
| 766 | 773 | } |
| 767 | 774 | |
| 768 | 775 | if (!QObject::setProperty(qPrintable(name), value) && !type.isEmpty()) |
| 769 | - qFatal("Failed to set %s::%s to: %s", | |
| 770 | - metaObject()->className(), qPrintable(name), qPrintable(value.toString())); | |
| 776 | + qFatal("Failed to set %s %s::%s to: %s", | |
| 777 | + qPrintable(type), metaObject()->className(), qPrintable(name), qPrintable(value.toString())); | |
| 771 | 778 | } |
| 772 | 779 | |
| 773 | 780 | QStringList Object::parse(const QString &string, char split) | ... | ... |
openbr/plugins/openbr_internal.h
| ... | ... | @@ -264,8 +264,7 @@ public: |
| 264 | 264 | QString name = metaObject()->className(); |
| 265 | 265 | |
| 266 | 266 | name.replace("Transform",""); |
| 267 | - name += "(["; | |
| 268 | - name += "],"; | |
| 267 | + name += "([],"; | |
| 269 | 268 | |
| 270 | 269 | QStringList parameters; |
| 271 | 270 | |
| ... | ... | @@ -278,11 +277,8 @@ public: |
| 278 | 277 | name += parameters.join(","); |
| 279 | 278 | |
| 280 | 279 | name += ")"; |
| 281 | - | |
| 282 | 280 | name.replace("br::",""); |
| 283 | 281 | |
| 284 | - qDebug() << name; | |
| 285 | - | |
| 286 | 282 | CompositeTransform * output = dynamic_cast<CompositeTransform *>(Transform::make(name, NULL)); |
| 287 | 283 | |
| 288 | 284 | if (output == NULL) | ... | ... |
openbr/plugins/quality.cpp
openbr/plugins/stream.cpp
| ... | ... | @@ -253,8 +253,6 @@ public: |
| 253 | 253 | |
| 254 | 254 | bool getNextTemplate(Template & output) |
| 255 | 255 | { |
| 256 | - qDebug() << "Next as video"; | |
| 257 | - | |
| 258 | 256 | if (!isOpen()) { |
| 259 | 257 | qDebug("video source is not open"); |
| 260 | 258 | return false; |
| ... | ... | @@ -1060,8 +1058,6 @@ public: |
| 1060 | 1058 | if (src.empty()) |
| 1061 | 1059 | return; |
| 1062 | 1060 | |
| 1063 | - qDebug() << "Reading with mode:" << readMode; | |
| 1064 | - | |
| 1065 | 1061 | bool res = readStage->dataSource.open(src,br::Idiocy::DistributeFrames); |
| 1066 | 1062 | if (!res) { |
| 1067 | 1063 | qDebug("stream failed to open %s", qPrintable(dst[0].file.name)); |
| ... | ... | @@ -1210,8 +1206,6 @@ public: |
| 1210 | 1206 | // And the collection stage points to the read stage, because this is |
| 1211 | 1207 | // a ring buffer. |
| 1212 | 1208 | collectionStage->nextStage = readStage; |
| 1213 | - | |
| 1214 | - qDebug() << "Init Readmode:" << readMode; | |
| 1215 | 1209 | } |
| 1216 | 1210 | |
| 1217 | 1211 | DirectStreamTransform() |
| ... | ... | @@ -1329,7 +1323,6 @@ public: |
| 1329 | 1323 | basis.activeFrames = this->activeFrames; |
| 1330 | 1324 | basis.readMode = this->readMode; |
| 1331 | 1325 | |
| 1332 | - qDebug() << basis.readMode; | |
| 1333 | 1326 | // We need at least a CompositeTransform * to acess transform's children. |
| 1334 | 1327 | CompositeTransform * downcast = dynamic_cast<CompositeTransform *> (transform); |
| 1335 | 1328 | ... | ... |