| 1203 | } |
| 1204 | |
| 1205 | bool |
| 1206 | ReadNode::knobChanged(KnobI* k, |
| 1207 | ValueChangedReasonEnum reason, |
| 1208 | ViewSpec view, |
| 1209 | double time, |
| 1210 | bool originatedFromMainThread) |
| 1211 | { |
| 1212 | bool ret = true; |
| 1213 | |
| 1214 | if ( ( k == _imp->inputFileKnob.lock().get() ) && (reason != eValueChangedReasonTimeChanged) ) { |
| 1215 | |
| 1216 | NodePtr hasMaster = getNode()->getMasterNode(); |
| 1217 | if (hasMaster) { |
| 1218 | // Unslave all knobs since we are going to remove some and recreate others |
| 1219 | unslaveAllKnobs(); |
| 1220 | } |
| 1221 | if (_imp->creatingReadNode) { |
| 1222 | NodePtr p = getEmbeddedReader(); |
| 1223 | if (p) { |
| 1224 | p->getEffectInstance()->knobChanged(k, reason, view, time, originatedFromMainThread); |
| 1225 | } |
| 1226 | |
| 1227 | return false; |
| 1228 | } |
| 1229 | try { |
| 1230 | _imp->refreshPluginSelectorKnob(); |
| 1231 | } catch (const std::exception& e) { |
| 1232 | setPersistentMessage( eMessageTypeError, e.what() ); |
| 1233 | } |
| 1234 | |
| 1235 | KnobFilePtr fileKnob = _imp->inputFileKnob.lock(); |
| 1236 | assert(fileKnob); |
| 1237 | std::string filename = fileKnob->getValue(); |
| 1238 | try { |
| 1239 | _imp->createReadNode( false, filename, NodeSerializationPtr() ); |
| 1240 | } catch (const std::exception& e) { |
| 1241 | setPersistentMessage( eMessageTypeError, e.what() ); |
| 1242 | } |
| 1243 | if (hasMaster) { |
| 1244 | slaveAllKnobs(hasMaster->getEffectInstance().get(), false); |
| 1245 | } |
| 1246 | } else if ( k == _imp->pluginSelectorKnob.lock().get() ) { |
| 1247 | KnobStringPtr pluginIDKnob = _imp->pluginIDStringKnob.lock(); |
| 1248 | std::string entry = _imp->pluginSelectorKnob.lock()->getActiveEntry().id; |
| 1249 | if ( entry == pluginIDKnob->getValue() ) { |
| 1250 | return false; |
| 1251 | } |
| 1252 | |
| 1253 | if (entry == "Default") { |
| 1254 | entry.clear(); |
| 1255 | } |
| 1256 | |
| 1257 | pluginIDKnob->setValue(entry); |
| 1258 | |
| 1259 | KnobFilePtr fileKnob = _imp->inputFileKnob.lock(); |
| 1260 | assert(fileKnob); |
| 1261 | std::string filename = fileKnob->getValue(); |
| 1262 |
nothing calls this directly
no test coverage detected