Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom Revisited #305

Closed
baconpaul opened this issue Jan 15, 2019 · 11 comments · Fixed by #841
Closed

Zoom Revisited #305

baconpaul opened this issue Jan 15, 2019 · 11 comments · Fixed by #841
Labels
UI Issues related to UI look&feel
Milestone

Comments

@baconpaul
Copy link
Collaborator

So now we are getting bugs squashed and linux building and scalable assets, the most requested feature is zoom. I did a sorta-hack version of zoom in the audio unit and that's in the builds now, but we want a zoom which works all hosts all platforms so I plan to rip out and re-implement the audio unit zoom. I'm going to use this ticket as a place to store notes to myself. I'm also going to tag this for the 1.6 milestone. And, when the time comes, I think I will need help on windows.

Right now we have

  • Zoom working in fixed increments in the AU
  • On the mac all hosts we use 2x assets if they are available to give us a retina display and scale

So we know that we can resize (in some cases) and we can scale properly in vstgui. Good.

So my plan of attach is

  • Move the about button over and put a little widget on the bottom for drag
  • when people drag it, rescale the window appropriately
  • inform the host that the window has resized
  • set the scale

If the drag-to-resize proves to hard I may also just do fixed sizes. I note that Roli Equator has drag to resize but the Arturia V6 collection instead has click scale to resize. So step one above might be "replace the about button with a menu button which contains about and zoom". I'll see as I go.

As far as informing hosts of resize here's my prelim notes to self.

  • AU doesn't seem to have an API but all the hosts seem perfectly fine if you send a clean NSWindow setSize message
  • VST2 has a member audioeffectx::sizeWindow which requests the host resize. I think to use it you have to respond positively to the canDo message "sizeWindow"
  • VST3 has a method "sizeWindow" which similarly responds to the canDo message "sizeWindow" but also seems to have a method resizeView; not sure which is from the host and do the host.

Also this article seems to have loads of useful information.

I'll probably take a swing at some code on Thursday. If any of you read this and have things to add about how to code it up, please add them to this issue.

Finally the way I code it should work on windows if we can get the resources; but how to get this plethora of bitmap resources into the windows build is far trickier. Once I get it working reliably on mac I will probably need some help there.

@baconpaul baconpaul added the UI Issues related to UI look&feel label Jan 15, 2019
@baconpaul baconpaul added this to the 1.6 milestone Jan 15, 2019
@kurasu
Copy link
Collaborator

kurasu commented Jan 15, 2019

VST3 has a IPlugViewContentScaleSupport interface with the following method

typedef float ScaleFactor;
virtual tresult PLUGIN_API setContentScaleFactor (ScaleFactor factor) = 0;

For VST2, Presonus has added some extensions which are also used by some other hosts, which you can get http://www.presonussoftware.com/en_US/index.php?id=developer.

@baconpaul
Copy link
Collaborator Author

Thank you. Very useful! It seems AUV2 doesn't have that build in but I'm still looking.

@kurasu
Copy link
Collaborator

kurasu commented Jan 15, 2019

I think on macOS you just ask the OS directly if you want retina or not.

@baconpaul
Copy link
Collaborator Author

Oh yeah that’s there. I was more thinking I don’t see how auv2 tells the host it is resizing other than just whacking the size of the nsframe (which is how zoom works now)

@baconpaul
Copy link
Collaborator Author

Alright I'm going to start my path here. I've decided to go the 'menu' route rather than the 'drag' route for now, so am adding that, then changing the way I deal with vector assets, then doing a cleaner zoom in vst2 and au, then vst3 is my rough plan.

I won't add each diff and PR to this issue but will make a suite of issues I will tag "path to zoom" as I go.

@ScyllaHide
Copy link

im running VST2 x64 still (Ableton will soon update i hope) on windows 10 x64, but is there a reason the zoom value is not saved?

i set zoom to 150% and close the plugin window and open it, the zoom is back on 100% again.

i didnt wanted to open a new issue for that, maybe its already in the works?

@baconpaul
Copy link
Collaborator Author

What version are you running? I fixed that a week or so ago. Can you let us know the version from menu / about? Or try with the 16beta5?

If you are trying with 16beta5 then that’s a bug we can look at sure!

Thanks so much

@ScyllaHide
Copy link

ableton was somehow still loading the old version from 18.2, now it works. (thats really annoying in ableton, it doesnt show you two dlls, but it rather keeps the first one for you to load - grrrrr)

thank you so much for fixing this! (16beta5!)

@baconpaul
Copy link
Collaborator Author

You are welcome! Thanks for confirming

It doesn’t stick beteeen sessions. That is if you close and restart abelton everything goes back to 100%. I’m still debating how to solve that.

@ScyllaHide
Copy link

yeah i just noticed that too.

so when you remove surge from ableton in the same session and re-add it, the zoom level is also reset.
I am happy with that for now, thanks for adressing. 👍

i am wondering is there a setting save file? or where are settings saved for surge?

@baconpaul
Copy link
Collaborator Author

Yes that is in beta5. Set zoom to 125 then do menu / zoom / set 125 as default zoom and every surge forever will be 125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Issues related to UI look&feel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants