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 06-26-2019, 05:33 PM   #1
bozmillar
Human being with feelings
 
bozmillar's Avatar
 
Join Date: Sep 2009
Posts: 593
Default best way to know if audio engine is active?

Is there a good way to find out if the host's audio engine is active and sending a stream to the plugin? I guess an IsProcessing()?
__________________
http://www.bozdigitallabs.com
bozmillar is offline   Reply With Quote
Old 06-27-2019, 04:46 PM   #2
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 226
Default

Quote:
Originally Posted by bozmillar View Post
Is there a good way to find out if the host's audio engine is active and sending a stream to the plugin? I guess an IsProcessing()?
Don't know if this is what you're looking for but I use this to check for playback start/stop when I need to reset filters, etc.:

Code:
void SomePlugin::OnActivate(bool active)
{ 
	TRACE;  
	 IMutexLock lock(this);
 	if (GetHost() != kHostCubase)
 	{
		Reset();
 	}
}
(If you noticed it does not work in Cubase for some reason - actually causes it to lock up. Only DAW I've seen do that...)

As far as the plugin streaming data, IDK if there is any "IsProcessing()" call. Perhaps you could combine OnActivate with something in ProcessDoubleReplacing() to detect it.

BTW - Reaper seems to report OnActivate backwards. It returns "true" when playback is STOPPED and "false" when playback is started! Makes my head hurt! So the code above calls Reset() for either condition (doesn't check if "active" is true or false).

Last edited by Nonlinear; 06-27-2019 at 04:52 PM.
Nonlinear 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:33 PM.


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