HiDPI and uidescription?

A User Interface Toolkit mainly for Audio Plug-Ins (VST, AudioUnit, etc).
howardantares
Posts: 77
Joined: Tue Jun 21, 2016 1:46 pm

HiDPI and uidescription?

Postby howardantares » Mon Jul 31, 2017 2:10 pm

How do I make my plug-in support HiDPI, when using the UIDescription object to define my views via xml? I had assumed I'd simply provide two bitmaps, one at loDPI and one at hiDPI, and put the bitmap names of each into the xml, but I don't see any field that supports that idea. The only thing I've found related to hiDPI so far is the requirement to set CFrame::setZoom(), but even that does not have any description about how/when to use it, or how it relates to the bitmaps we provide. Is there any documentation on this?

howardantares
Posts: 77
Joined: Tue Jun 21, 2016 1:46 pm

Re: HiDPI and uidescription?

Postby howardantares » Mon Jul 31, 2017 2:28 pm

I see that the ZoomTest example shows multiple bitmap names that appear to handle this. But there is no explanation about what to use for regular displays versus hidpi displays. The bitmaps all appear to be 72 pixels per inch, but come in three sizes, with no explanation as to which one is for hidpi, or how to best make them. Do we make the hidpi images first, at twice the size, then, simply scale them down for the normal dpi images? Why three image sizes? Can someone enlighten me or point me to specifics on how this is intended to be used?

Arne Scheffler
Posts: 126
Joined: Mon Jun 20, 2016 7:53 am

Re: HiDPI and uidescription?

Postby Arne Scheffler » Tue Aug 01, 2017 8:45 am

Hi Howard,
Bitmap HiDPI support is as follows:
The default Bitmap for a scale factor of 1 is just normally named like "MyBitmap.png". For this example we say the bitmap has the size 100x100 pixel. Now if you want to support a scale factor of 2 you create a bitmap with the size of 200x200 pixel and name it "MyBitmap#2.0x.png".
You add both bitmaps to your xml file and that's it. The backend automatically uses the correct bitmap depending on the scale factor.

Cheers
Arne

howardantares
Posts: 77
Joined: Tue Jun 21, 2016 1:46 pm

Re: HiDPI and uidescription?

Postby howardantares » Tue Aug 01, 2017 9:01 pm

Excellent! Thanks!

howardantares
Posts: 77
Joined: Tue Jun 21, 2016 1:46 pm

Re: HiDPI and uidescription?

Postby howardantares » Tue Aug 08, 2017 9:27 pm

Ok, that's working now, but I notice that the COptionMenu doesn't scale when the rest of the GUI scales. It maintains the system setting (at least on the Mac), so the text is really small when I run on a hi-res monitor. Is there any way around this? I am using a menu item to turn on or off the hi-res feature of our plug-in, so if I can respond to that with some call to fix up the menus as well, that would help. (For our dialogs, I suppose I'll have to write two of them, in different sizes.)

Or should I leave dialogs and menus alone, since the fonts used are set by the user at the system level, and are their responsibility to set so that they can read it on their own monitor?

Arne Scheffler
Posts: 126
Joined: Mon Jun 20, 2016 7:53 am

Re: HiDPI and uidescription?

Postby Arne Scheffler » Fri Aug 11, 2017 9:27 am

I'm not really sure I understand you here. If you don't change the scale of the CFrame on Mac, you get the native one. So if your editor is on a HiDPI screen, it get's a scale of 2 automatically. Then the popup menus are also correctly scaled.
If you change the scale via CFrame::setZoom() programmatically then yes the popup menu won't scale with it.
And what are your dialogs ? Are these views set via CFrame::setModalView() ? Then you don't have to anything.

howardantares
Posts: 77
Joined: Tue Jun 21, 2016 1:46 pm

Re: HiDPI and uidescription?

Postby howardantares » Fri Aug 11, 2017 8:23 pm

I don't see this behavior. I have to call setZoom (or setZoomFactor()) myself, at least in Cubase 9.0.0.85 on the Mac. Perhaps it is because I have dual monitors, and it always detects the one with normal dpi (regardless of which monitor I have my main menu bar attached to)? How can I run a test such where one monitor is normal dpi and one is hi dpi and get the results you describe?

howardantares
Posts: 77
Joined: Tue Jun 21, 2016 1:46 pm

Re: HiDPI and uidescription?

Postby howardantares » Fri Aug 11, 2017 8:45 pm

Updated to 9.0.20. Same behavior. Cubase comes up very small on my big monitor, and my plug-in comes up in normal (small) size, with tiny menus and dialogs. I thought maybe selecting Zoom from the main menus would fix it, but that only performs a "maximize" on the window, and doesn't increase the sizes of any of the components or menus.

Arne Scheffler
Posts: 126
Joined: Mon Jun 20, 2016 7:53 am

Re: HiDPI and uidescription?

Postby Arne Scheffler » Sun Aug 13, 2017 5:01 pm

Maybe you have set the flag "Open in Low Resolution" in the Finder Info of the Cubase app ?

howardantares
Posts: 77
Joined: Tue Jun 21, 2016 1:46 pm

Re: HiDPI and uidescription?

Postby howardantares » Mon Aug 14, 2017 2:17 pm

I don't see any such option in the Get Info screen for Cubase. And looking at some recent posts, hi-dpi mode does not appear to be supported on Mac in Cubase 9. If it is, it's certainly not working here (in 9.0.20.209), and I don't see any way to turn it on.

It's not working in Studio One 3, either, but I see some steps outlined on their forums for resetting the preferences to get that option to show up. I will try that.
[EDIT] High-DPI mode only works on Windows for Studio One 3.


Return to “VSTGUI”

Who is online

Users browsing this forum: No registered users and 1 guest