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 07-06-2024, 07:20 AM   #1
FelixMagi
Human being with feelings
 
FelixMagi's Avatar
 
Join Date: Mar 2016
Posts: 103
Default How to check if the graphics is active?

How to check if the graphics is active? If it's not active, the Draw() function is not called and that creates me problems.

Here's what I tried without success:
Code:
  draw_active=GetGUI() ? true:false; // on plugin class 
  void OnGUIOpen() { draw_active=true; } // do not works on all the DAW's
  void OnGUIClose() { draw_active=false; }
  draw_active=mPlug->GetGUI() ? true:false; // on a control
FelixMagi is offline   Reply With Quote
Old 07-06-2024, 11:03 PM   #2
FelixMagi
Human being with feelings
 
FelixMagi's Avatar
 
Join Date: Mar 2016
Posts: 103
Default

Does anyone know how to do it?
FelixMagi is offline   Reply With Quote
Old 07-07-2024, 04:05 AM   #3
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,682
Default

I'm not really sure what "active" means, but setting a flag in OnGUIOpen() seems promising to me, as it would at least tell you that the window is open, and the GUI timer is running, etc.

In my IPlug fork OnGUIOpen() is called from the plugin format implementation (e.g. IPlugCLAP.cpp), and I don't think the host can skip it (unless it doesn't create/open the GUI at all). I do seem to remember adding OnGUIOpen() support to AU a while back.
Tale is offline   Reply With Quote
Old 07-08-2024, 03:18 AM   #4
FelixMagi
Human being with feelings
 
FelixMagi's Avatar
 
Join Date: Mar 2016
Posts: 103
Default

"active" for me means Draw() function is called at 24fps

At some DAW's when the plugin window is closed, the OnGUIClose() is not called but the GUI is no longer active (Draw() is no longer called)

Last edited by FelixMagi; 07-08-2024 at 06:24 AM.
FelixMagi is offline   Reply With Quote
Old 07-08-2024, 11:31 PM   #5
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,682
Default

I guess it will stop updating the GUI if the window currently isn't visible, e.g. because it's behind other windows. But in this case the GUI is still open, so it would make sense that OnGUIClose() hasn't been called.

Anyway, what are you trying to do?
Tale is offline   Reply With Quote
Old 07-09-2024, 08:04 AM   #6
FelixMagi
Human being with feelings
 
FelixMagi's Avatar
 
Join Date: Mar 2016
Posts: 103
Default

That's the explanation but it doesn't help me. I need to know when window is visible.
FelixMagi 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.