const Result EnviApplication::findDataSourcesOnDisk() { File dataSourcesFolder (getEnviSourcesDir()); if (dataSourcesFolder.isDirectory()) { _INF("Data sources directory set to: "+dataSourcesFolder.getFullPathName()); Array <File> sourceXmls; const int ret = dataSourcesFolder.findChildFiles (sourceXmls, File::findFiles, false, "*.xml"); if (ret > 0) { for (int i=0; i<sourceXmls.size(); i++) { if (createInstance (sourceXmls[i]) == nullptr) { continue; } } return (Result::ok()); } else { return (Result::fail ("Found 0 sources in sources directory: "+dataSourcesFolder.getFullPathName())); } } else { return (Result::fail (dataSourcesFolder.getFullPathName() + " is not a directory, can't initialize any sources")); } }
EnviDataSource *EnviApplication::createInstance(const File &sourceState) { ScopedPointer <XmlElement> xml(XmlDocument::parse (sourceState)); if (xml) { ValueTree instanceState = ValueTree::fromXml (*xml); if (instanceState.isValid()) { _INF(sourceState.getFileName()+" looks like a valid data source defintion."); return (createInstance (instanceState)); } else { _WRN(sourceState.getFileName()+" is an invalid data source definition (not XML)."); return (nullptr); } } else { _WRN(sourceState.getFileName()+" can't be parsed as a XML file."); } return (nullptr); }
void CtrlrUpdateManager::run() { #ifdef LINUX return; #endif _INF("Running update check"); sendChangeMessage(); ScopedPointer <XmlElement> xml(getUpdateData()); if (xml) { _DBG("--------------------------------------------------------------"); _DBG(xml->createDocument(String::empty)); _DBG("--------------------------------------------------------------"); if (xml->getBoolAttribute("update")) { /* new version */ triggerAsyncUpdate(); return; } } sendChangeMessage(); }
void EnviApplication::timerCallback(int timerId) { EnviDataSource *ds = dataSources[timerId - ENVI_TIMER_OFFSET]; if (ds) { if (ds->isDisabled()) { _INF("Timer triggered for data source \""+ds->getName()+"\". Source is disabled"); return; } Result res = ds->startSource(); if (!res.wasOk()) { _WRN("Timer trigger for data source \""+ds->getName()+"\", execute failed ["+res.getErrorMessage()+"]"); } } }
void CtrlrPanel::notify (const String ¬ification, CtrlrNotificationCallback *callback, const CtrlrNotificationType ctrlrNotificationType) { if (luaPanelMessageHandlerCbk && !luaPanelMessageHandlerCbk.wasObjectDeleted()) { if (luaPanelMessageHandlerCbk->isValid()) { getCtrlrLuaManager().getMethodManager().call (luaPanelMessageHandlerCbk, notification, ctrlrNotificationType); } } if (getEditor()) { getEditor()->notify (notification, callback, ctrlrNotificationType); } else { _INF (notification); } }
void CtrlrPanel::dumpComparatorTables() { _INF ("\n----------------- Comparator tables dump"); _INF (midiInputThread.getInputComparator().dumpTables()); _INF ("\n----------------- Comparator tables dump\n"); }