better output for effect path loading (#652)

* better output for effect path loading

* effectengine: error when no efx available


Former-commit-id: 7724e56850ef9f9a703fb41e82baf88e5534f492
This commit is contained in:
redPanther 2016-05-24 22:14:45 +02:00 committed by brindosch
parent 0940872870
commit 06afe06774
1 changed files with 16 additions and 11 deletions

View File

@ -35,23 +35,28 @@ EffectEngine::EffectEngine(Hyperion * hyperion, const Json::Value & jsonEffectCo
{
const std::string & path = paths[i].asString();
QDir directory(QString::fromStdString(path));
if (!directory.exists())
if (directory.exists())
{
std::cerr << "EFFECTENGINE ERROR: Effect directory can not be loaded: " << path << std::endl;
continue;
}
QStringList filenames = directory.entryList(QStringList() << "*.json", QDir::Files, QDir::Name | QDir::IgnoreCase);
foreach (const QString & filename, filenames)
{
EffectDefinition def;
if (loadEffectDefinition(path, filename.toStdString(), def))
int efxCount = 0;
QStringList filenames = directory.entryList(QStringList() << "*.json", QDir::Files, QDir::Name | QDir::IgnoreCase);
foreach (const QString & filename, filenames)
{
_availableEffects.push_back(def);
EffectDefinition def;
if (loadEffectDefinition(path, filename.toStdString(), def))
{
_availableEffects.push_back(def);
efxCount++;
}
}
std::cerr << "EFFECTENGINE INFO: " << efxCount << " effects loaded from directory " << path << std::endl;
}
}
if (_availableEffects.size() == 0)
{
std::cerr << "EFFECTENGINE ERROR: no effects found, check your effect directories" << std::endl;
}
// initialize the python interpreter
std::cout << "EFFECTENGINE INFO: Initializing Python interpreter" << std::endl;
Effect::registerHyperionExtensionModule();