-
Notifications
You must be signed in to change notification settings - Fork 404
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
Linux: Inactive buttons #544
Comments
Thanks. Very specific and also very odd. Appreciate the detail. |
confirmed here |
@rghvdberg a few controls (mute, solo, unipolar, relative, and link) use Oh and now reading the code, I know the bug. CSwitchControl draws the background with a command that looks like That So I think the fix for now is in CSwitchControl add
and update CScalableBitmap comment only to point at the change we made here too. Good luck! |
oh and I haven't tested this or anything. This is just from looking at the code to write a guide on how it hangs together. So bug may be something else. |
this may or may not be a clue I ran Waveform9 and Reaper from the shell and when Surge loads in either DAW this error message appears...
could those be the missing images? |
bmp00110.png = IDB_OSCSWITCH |
I think that any bitmap drawn with CSwitchControl::draw() doesn't show up. |
I've tried this CSwitchControl.cpp
output
am I on to something ? never mind :-) |
OK so crack debugging @rghvdberg the bitmaps have size 0x0 and have size 0x0 only on linux The reason for this is because CScalableBitmap subclasses VSTGUI::CBitmap. On win and mac the parent constructor The reason anything works though is because CSwitchControl and only CSwitchControl reads the height of an image from the bitmap. Compare CHSwitch2::draw (which uses the member variable heightOfOneImage which is set on construction) to CSwitchControl (which uses pBackground->getHeight() if is_itype is false). And is_itype is always false. OK so now we know the problem. We either need to
The second seemed smart. Just override getHeight in CScalableBitmap and blammo fixxo. But getHeight is not virtual in cbitmap so nope. If we want to make CScableBitmap respond to get height we need to construct the base class properly. So lets explore #1 a bit. The "is_itype" means it is a two state button and the top half of the image is off and the bottom half of the image is on. This matches what we see in the mute button image. So that translation is just moving half way down the image when it is on.
But the image takes up the entire rect into which it draws, so our constructor knows how big it is. This leads me to the easiest approach
The other path is harder, which is make CScalableBitmap pass a proper thing to its base class. To do that
becomes
and test and sweep. That is in some sense "more correct" but it is also a way bigger change. I would approve the first PR with the simpler approach in a heartbeat if it works. Hope that helps! |
…#588) Solo, Mute, and other CSwitchControl buttons were inactive on Linux because CScalableBitmap returns size 0,0 for all bitmaps on Linux. This diff doesn't solve that problem but accommodates it by making CSwitchControl work like the other switch controls; using a constructor specified size (in this case the size of the view rectangle) to determine how much to translate the switching image. This makes solo, mute, and others work on Linux. Closes surge-synthesizer#544 by making those buttons inactive. Former-commit-id: a2a858c26719c32a55904661ee9b7ca12eefdc66 [formerly 40e18d1] Former-commit-id: 40ef5151482e5843a0503ce5d2fb87d0a0d19eaa Former-commit-id: df1b0bc9beb018eb159d39e1000c085d465c2378
the KEYTRACK and RETRIGGER buttons in the Oscillator section do not change colours, either to yellow or back to black, if clicked in Linux
they do appear to be active though
same for the red M and S buttons in the Scene section
the green Filter buttons just below however are functional
The text was updated successfully, but these errors were encountered: