COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 04-26-2016, 04:31 AM   #1
jack461
Human being with feelings
 
jack461's Avatar
 
Join Date: Nov 2013
Location: France
Posts: 181
Default And the best way to stop a plugin is...

Hi !

In fact, I don't know what is the best way to stop a plugin. (Yes, I know, it seems strange to ask how to stop a plugin while everybody is struggling to have theirs work, but...)

I have in my code some tests that determine something is going wrong (such as a damaged memory zone). I need at least to stop the plugin. It's better if I can signal something to the user.

I have tried using C "assert()", but it seems to break everything, including the host, with no explanation. I have tried to search through the forum, but found nothing on the subject.

Can someone help me finding a gentle way to stop my plugin, without breaking the current host session ? Many thanks !

Jack.
jack461 is offline   Reply With Quote
Old 04-26-2016, 05:06 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by jack461 View Post

I have in my code some tests that determine something is going wrong (such as a damaged memory zone).
Wouldn't it be better to just fix the code instead of trying to detect if it corrupts the memory during run time...? (I am assuming you are working on a "normal" plugin, not something like a plugin that allows executing arbitrary code entered by the user etc...)

Anyway if you really need something for this, how about a member flag variable in the plugin that is checked at the beginning of the audio processing function to determine if the audio processing should proceed or not? The GUI could also check that flag and if it is set, it would attempt to show a message box or some other kind of message.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 04-26-2016, 05:36 AM   #3
jack461
Human being with feelings
 
jack461's Avatar
 
Join Date: Nov 2013
Location: France
Posts: 181
Default

Xenakios, thanks for your answer.

Yes, it is always better to debug the code rather than stop it. But...

Quote:
Originally Posted by Xenakios View Post
(I am assuming you are working on a "normal" plugin, not something like a plugin that allows executing arbitrary code entered by the user etc...)
I am working on a plugin that offers a graphical Audio/DSP language, which is compiled on the fly and executed in a kind of sandbox, but there always some unexpected possibility that the execution crashed things out of the box. I had cases where some checksum shows that some data in the plugin had been altered. So yes, and at least in the long debugging phase, I need to display/log on disk some data, and stop the plugin - since I'm not sure that switching to a mode where it does nothing is safe enough... I hope my problem is better explained now.
jack461 is offline   Reply With Quote
Old 04-26-2016, 06:51 AM   #4
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

You can't really "stop" the execution of the plugin's functions, it's up to the host application to do that and there really isn't any standard way to tell the host to do so. And even if there was, there would certainly be hosts that would just ignore all that and happily continue calling the plugin functions.

If you want full control over everything, making your own DAW/host is the way to go...
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 04-26-2016, 08:40 AM   #5
jack461
Human being with feelings
 
jack461's Avatar
 
Join Date: Nov 2013
Location: France
Posts: 181
Default

Quote:
Originally Posted by Xenakios View Post
You can't really "stop" the execution of the plugin's functions, it's up to the host application to do that and there really isn't any standard way to tell the host to do so. And even if there was, there would certainly be hosts that would just ignore all that and happily continue calling the plugin functions.

If you want full control over everything, making your own DAW/host is the way to go...
Thanks for your answer, which helps me to stop looking for the "STOP" button :-)

So, yes, all this is true. I guess I will use the long way of trying to find the best compromise.
jack461 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.