TEST_F(ControllerEngineTest, scriptSetValue) { ScopedTemporaryFile script(makeTemporaryFile( "setValue = function() { engine.setValue('[Channel1]', 'co', 1.0); }\n")); cEngine->evaluate(script->fileName()); EXPECT_FALSE(cEngine->hasErrors(script->fileName())); ControlObject *co = new ControlObject(ConfigKey("[Channel1]", "co")); co->set(0.0); execute("setValue"); EXPECT_DOUBLE_EQ(co->get(), 1.0); delete co; }
void WWaveformViewer::dragEnterEvent(QDragEnterEvent * event) { // Accept the enter event if the thing is a filepath. if (event->mimeData()->hasUrls() && event->mimeData()->urls().size() > 0) { ControlObject *pPlayCO = ControlObject::getControl( ConfigKey(m_pGroup, "play")); // Accept if the Deck isn't playing or the settings allow to interupt a playing deck if (pPlayCO && (!pPlayCO->get() || m_pConfig->getValueString(ConfigKey("[Controls]","AllowTrackLoadToPlayingDeck")).toInt())) { event->acceptProposedAction(); } else { event->ignore(); } } }