|
02-11-2017, 07:58 AM
|
#1
|
Human being with feelings
Join Date: Aug 2013
Posts: 236
|
Process for activation/deactivation
Can I check if the plugin is activated ?
For example in Reaper near plugin list is a checkbox for activation/deactivation, can to check the state of this from plugin ?
I test void OnActivate(bool active) with no success.
|
|
|
02-11-2017, 02:22 PM
|
#2
|
Human being with feelings
Join Date: Dec 2015
Posts: 331
|
Quote:
Originally Posted by SaschArt
I test void OnActivate(bool active) with no success.
|
Not sure exactly what you want to do, but OnActivate is of return type void, so it's not a test. The comments make it clear it's not for what you think it's for, and the default, essentially null implementation is not overriden:
Code:
// Not usually needed ... Reset is called on activate regardless of whether this is implemented.
// Also different hosts have different interpretations of "activate".
// Implementations should set a mutex lock like in the no-op!
virtual void OnActivate(bool active) { TRACE; IMutexLock lock(this); }
|
|
|
05-21-2020, 05:32 AM
|
#3
|
Human being with feelings
Join Date: Aug 2013
Posts: 236
|
I didn't say that OnActivate() returns a Boolean variable or another!
I asked if it is called when the user presses the bypass/activate button from host.
There is a function called when the plugin is bypass from host? Or if I can check the status of the active/bypass plugin.
|
|
|
05-21-2020, 03:03 PM
|
#4
|
Human being with feelings
Join Date: Apr 2018
Posts: 396
|
Quote:
Originally Posted by SaschArt
I didn't say that OnActivate() returns a Boolean variable or another!
I asked if it is called when the user presses the bypass/activate button from host.
There is a function called when the plugin is bypass from host? Or if I can check the status of the active/bypass plugin.
|
Not sure if there is a function to return the status - you may have to roll your own - check for “mIsBypassed”.
|
|
|
05-22-2020, 01:20 AM
|
#5
|
Human being with feelings
Join Date: Aug 2013
Posts: 236
|
There it's a function bool GetIsBypassed() { return mIsBypassed; } but don't works, allways return false.
|
|
|
05-24-2020, 08:03 AM
|
#6
|
Human being with feelings
Join Date: Mar 2016
Posts: 70
|
Quote:
Originally Posted by SaschArt
There it's a function bool GetIsBypassed() { return mIsBypassed; } but don't works, allways return false.
|
I don't understand why there are these functions that don't work. It creates confusion.
|
|
|
05-25-2020, 09:23 AM
|
#7
|
Human being with feelings
Join Date: Apr 2018
Posts: 396
|
Quote:
Originally Posted by TonyGlover
I don't understand why there are these functions that don't work. It creates confusion.
|
It's not on purpose! iPlug has been around a long time and has been tweaked by many people along the way - some things got fixed while others get messed up in the process. I have found lines commented out for no apparent reason that prevented things from working. Someone likely did that to fix something else or maybe to temporarily disable it while testing, etc., and never put it back, IDK.
You have to think of iPlug as a good place to start - not necessarily as a finished product. I have found the members here very helpful in getting through the issues.
|
|
|
05-28-2020, 10:15 AM
|
#8
|
Human being with feelings
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
|
seems like mIsBypassed was only ever set for AUv2 and VST3 in iPlug1 and effSetBypass was not implemented for VST2
|
|
|
05-29-2020, 01:43 AM
|
#9
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Do note that the VST2 host will also need to support this, e.g. I don't think REAPER does.
|
|
|
07-06-2020, 02:10 PM
|
#10
|
Human being with feelings
Join Date: Aug 2013
Posts: 236
|
There are situations where it is necessary to know when the plugin is bypassed.
There are plugins that have solved the problem, they also works on Reaper.
How can this be done?
I only see the solution by implementing an additional timer that does not depend by graphics. Timer in controls is enable only when the graphical interface is open.
With this timer I can check if ProcessDoubleReplacing is called
|
|
|
07-09-2020, 01:16 PM
|
#11
|
Human being with feelings
Join Date: Mar 2016
Posts: 70
|
Quote:
Originally Posted by olilarkin
seems like mIsBypassed was only ever set for AUv2 and VST3 in iPlug1 and effSetBypass was not implemented for VST2
|
A lot of VST2 based plugins can do that. It's an IPlug lack not VST 2.
All instruments can do this, if not, notes remain on hold if they are closed when the plugin is bypassed and are played on activation.
So there is a solution for VST 2, but we don't know it.
|
|
|
07-10-2020, 02:35 AM
|
#12
|
Human being with feelings
Join Date: Aug 2013
Posts: 236
|
This can be a solution:
In plugin h file:
Code:
class VSTCLASS : public IPlug {
public:
.............
static DWORD WINAPI threadProc(LPVOID innerThread) {
VSTCLASS *pThis = reinterpret_cast<VSTCLASS*>(innerThread);
while(pThis->thread_process) {
if (pThis->process_on)
pThis->process_on=false;
else {
//BYPASSED
}
Sleep(100);
}
exit(0);
}
.............
private:
bool process_on;
HANDLE hThread; DWORD ThreadID;
In cpp file:
Code:
CTOR
.............
hThread=CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadProc, (void*)this, 0, &ThreadID);
..............
void VSTCLASS::OnClose() {
thread_process=false;
DWORD dwExitCode;
GetExitCodeThread(hThread, &dwExitCode);
ExitThread(dwExitCode);
}
void VSTCLASS::ProcessDoubleReplacing
..............
process_on=true;
..............
This code works but have only a problem, when close the plugin, the DAW is closed too. I can't find a solution to stop the thread without stopping the whole program. Maybe someone knows how to do it...
Also a code for OSX would be good to do.
Last edited by SaschArt; 07-10-2020 at 02:46 AM.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:58 PM.
|