| 248 | } |
| 249 | |
| 250 | OfxStatus |
| 251 | OfxImageEffectInstance::vmessage(const char* msgtype, |
| 252 | const char* /*id*/, |
| 253 | const char* format, |
| 254 | va_list args) |
| 255 | { |
| 256 | assert(msgtype); |
| 257 | assert(format); |
| 258 | std::string message = string_format(format, args); |
| 259 | std::string type(msgtype); |
| 260 | OfxEffectInstancePtr effect = _ofxEffectInstance.lock(); |
| 261 | if (!effect) { |
| 262 | return kOfxStatFailed; |
| 263 | } |
| 264 | if (type == kOfxMessageLog) { |
| 265 | LogEntry::LogEntryColor c; |
| 266 | if (effect->getNode()->getColor(&c.r, &c.g, &c.b)) { |
| 267 | c.colorSet = true; |
| 268 | } |
| 269 | appPTR->writeToErrorLog_mt_safe(QString::fromUtf8( effect->getNode()->getLabel().c_str() ), QDateTime::currentDateTime(), |
| 270 | QString::fromUtf8( message.c_str() ), false, c); |
| 271 | } else if ( (type == kOfxMessageFatal) || (type == kOfxMessageError) ) { |
| 272 | effect->message(eMessageTypeError, message); |
| 273 | } else if (type == kOfxMessageWarning) { |
| 274 | effect->message(eMessageTypeWarning, message); |
| 275 | } else if (type == kOfxMessageMessage) { |
| 276 | effect->message(eMessageTypeInfo, message); |
| 277 | } else if (type == kOfxMessageQuestion) { |
| 278 | if ( effect->message(eMessageTypeQuestion, message) ) { |
| 279 | return kOfxStatReplyYes; |
| 280 | } else { |
| 281 | return kOfxStatReplyNo; |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | return kOfxStatReplyDefault; |
| 286 | } |
| 287 | |
| 288 | const std::vector<std::string>& |
| 289 | OfxImageEffectInstance::getUserCreatedPlanes() const |