Multiple filters in plugin

AfterShot Pro Plugins
Hansi
Posts: 28
Joined: Sat May 09, 2015 11:06 am
operating_system: Linux
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte Gaming 7 Z97
processor: i4790
ram: 32GB
Video Card: Asus Nvidia GTX 970
Hard_Drive_Capacity: 8TB
Monitor/Display Make & Model: Dell U2410, HP 25", Samsung 28" 4K
Corel programs: Aftershot Pro 2

Multiple filters in plugin

Post by Hansi »

Hi,

I'm trying to load more than 1 filter in a plugin but no matter what I do Aftershot pro 2 coredump.
The only working example I know of is the Mix v3 by Ferdinand Paris.
The reason I want do this is to be able to fix the Sharpen plugin by Spoilerhead.

Theis is the output from Aftershort

Registering AfterShot plugin... "BibbleBuiltin"
Registering AfterShot plugin... "Equalizer"
Registering AfterShot plugin... "BlackAndWhite"
Registering AfterShot plugin... "MySharpen"
"MySharpen" : "LlorensFilter" : Successfully loaded.
Fatal: Filter name collision
Filter name collision
Aborted (core dumped)

This is the code running in registerFilters():

bool MySharpenPlugin::registerFilters()
{
bool bSuccess = true;

LlorensFilter *pLlorensFilter = new LlorensFilter(m_hub, m_groupId);
if (pLlorensFilter != NULL && !m_hub->addFilter(pLlorensFilter, PluginHub::Tail, QString())) {
qDebug() << this->name() << ": " << pLlorensFilter->name() << ": Failed to load.";
bSuccess = false;
} else
qDebug() << this->name() << ": " << pLlorensFilter->name() << ": Successfully loaded.";

USMFilter *pUSMFilter = new USMFilter(m_hub, m_groupId);
if (pUSMFilter != NULL && !m_hub->addFilter(pUSMFilter, PluginHub::After, QString(pLlorensFilter->name()))) {
qDebug() << this->name() << ": " << pUSMFilter->name() << ": Failed to load.";
bSuccess = false;
} else
qDebug() << this->name() << ": " << pUSMFilter->name() << ": Successfully loaded.";
/*
WaveletFilter *pWaveletFilter = new WaveletFilter(m_hub, m_groupId);
if (pWaveletFilter != NULL && !m_hub->addFilter(pWaveletFilter, PluginHub::Before, QString("RgbToLab"))) {
qDebug() << this->name() << ": " << pWaveletFilter->name() << ": Failed to load.";
bSuccess = false;
}
*/
if (bSuccess == true) {
qDebug() << this->name() << ": All filters loaded successfully";
} else {
if (pLlorensFilter != NULL)
delete pLlorensFilter;
if (pUSMFilter != NULL)
delete pUSMFilter;
/* if (pWaveletFilter != NULL)
delete pWaveletFilter;
*/ }

return bSuccess;
}

Any idea of what I'm doing wrong?
Hansi
Posts: 28
Joined: Sat May 09, 2015 11:06 am
operating_system: Linux
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte Gaming 7 Z97
processor: i4790
ram: 32GB
Video Card: Asus Nvidia GTX 970
Hard_Drive_Capacity: 8TB
Monitor/Display Make & Model: Dell U2410, HP 25", Samsung 28" 4K
Corel programs: Aftershot Pro 2

Re: Multiple filters in plugin

Post by Hansi »

Solved myself...

There must be something in AfterShot called USMFilter so when I changed from USMFilter to AbbasFilter the filter was loaded.
It would be nice with a reserved words list :)

Now I just have to figure out how big a change it will bring to Spoilerheads plugin...