Jump to content

Recommended Posts

Posted

I like their design but the knobs aren't working as expected. If you click a knob and move the mouse to the left side of the control, the indicator goes the other way. Or you can replicate the behavior by just clicking the indicator of a know and the indicator will immediately shift position to the other side of the control. Is this how it's intended to work?

Posted

Hey, thanks Andreik,

So the knobs are controlled by the Y Axis of the mouse, which by memory should be the norm? but happy to be corrected!

I agree they can be a little smarter - at present the knobs will snap to a value on mouse down.  I was going to get it to only react only once you start dragging, but meh, good enough for this time of night!

Posted
  On 2/3/2024 at 2:33 PM, MattyD said:

Hey, thanks Andreik,

So the knobs are controlled by the Y Axis of the mouse, which by memory should be the norm? but happy to be corrected!

I agree they can be a little smarter - at present the knobs will snap to a value on mouse down.  I was going to get it to only react only once you start dragging, but meh, good enough for this time of night!

Expand  

It's fine, just wanted to be sure it's the intended behavior.

Posted
  On 2/3/2024 at 2:53 PM, argumentum said:

Could on mouse over be controlled by the wheel mouse ? < request :)

Expand  

Yeah, that sounds like a good idea!

The mouse wheel should be easy enough to implement - the hit-testing could be more difficult... The static control won't notify when a mouse moves over it, so I think I'd need to store the locations of every control. Then we'd check if anything matches when the wheel moves.

I'm not really sold on this approach though - just feels horribly inefficient.  If anyone has had a crack at hit-testing controls in the past I'm all ears!

But as a semi-solution we can totally do a: click on the control to select, then wheel to change though.

Posted (edited)
  On 2/4/2024 at 2:38 AM, argumentum said:

also, attend to HiDpi Scaling

Expand  

Ah, yep - looks like thats a problem. Thanks!

For those playing at home, the control should more or less only react while the mouse is within its bounds...
So if you drag a fader, the thumb should sit nicely under the mouse pointer.

Something is getting thrown when the scaling is not set at %100, so this obviously needs fixing.

Edited by MattyD
Posted

So a new file to address the issues previously mentioned -

  1. The scaling issue is hopefully now fixed!
  2. Knob controls will no longer snap to an absolute value on mouse down. They'll only start moving when you begin dragging on the Y-Axis
  3. The mouse wheel can now manupulate controls. - Click to select the control, then wheel to change the value.
    • Clicking away from a control should de-select it.
Posted (edited)

Thank you for sharing with us.

That's very nice work, congratulations.

It's nice to have more graphical elements, as an option to enrich the GUI.

The responsiveness of the knobs has improved a lot compared to the previous one . :thumbsup:

suggestions:

  Reveal hidden contents

 

Edited by ioa747

I know that I know nothing

Posted (edited)

Thanks heaps ioa - really appreaciate it :)

Yeah, certainly we need a way to set a value from outside the GUI.
I was going to try and see if I can get GuiCtrlSetData() to trigger something similar to what you've written, but I still need to do the groundwork to see if that's viable.

As for the other suggestion, I appreaciate where you're coming from. Pushing the left side of the control up works the same pulling the right side down... I think we do need to choose a direction though and stick with it - just from a usability standpoint.

If I cross the centre line while pulling upwards I probably don't want the control to reverse.. Or if I'm using a touch screen my finger might cover the entire control - each time i grab something it could seemingly behave differently (depending on if I'm a little bit left or right of center) .

 

Edited by MattyD
Posted (edited)
  On 2/5/2024 at 3:05 AM, MattyD said:

If I cross the centre line while pulling upwards I probably don't want the control to reverse..

Expand  

this was the first approach ... after that I went a little further

  Reveal hidden contents


more is to share the idea  :)

 

Edited by ioa747

I know that I know nothing

Posted (edited)

Ok so take 3...

there is little to no QA happening here so heads up!!

  1. Reversed the dragging diretion for the knob controls (so up is more, down is less).
     
  2. GuiCtrlSetData() now should work - Its not the most elegant solution, but hey, this whole project is kindof hacky anyway!
     
  3. added a _GUICtrlGDI_Destroy($iCtrlID) funtion for those crazy people who like to clean up after themselves.
     
  4. added _GUICtrlGDI_FwdMsg($iType, $sFunc) - Basically we're already handling $WM_COMMAND when we include the file. So if this is needed elsewhere, call _GUICtrlGDI_FwdMsg($WM_COMMAND, "myFunc").

Edit - I'm second guessing myself now...  Does anyone have any strong opinions as to which way the mouse wheel should work on the faders?

Edited by MattyD
Posted

Hi MattyD,

Love the approach, you've traded memory for low CPU making it smooth.

One note! I believe you may have a memory leak, you need to release the old bitmap object when you replace it with sendmessage().

Something like:

Local $vRet = _SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_BITMAP, $aBmps[$iValue])
If $vRet Then _WinAPI_DeleteObject($vRet)

Many thanks for sharing 👍

Posted
  On 2/8/2024 at 8:08 AM, Jardz said:

Hi MattyD,

Love the approach, you've traded memory for low CPU making it smooth.

One note! I believe you may have a memory leak, you need to release the old bitmap object when you replace it with sendmessage().

Something like:

Local $vRet = _SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_BITMAP, $aBmps[$iValue])
If $vRet Then _WinAPI_DeleteObject($vRet)

Many thanks for sharing 👍

Expand  

My pleasure - and thankyou kindly, :) you are indeed correct.

Posted

Thanks heaps ptrex, yeah why not!

As you may have guessed, this has actually sprung from working with that midi project -
Basically I had this vision mixer, but the audio controls were all tucked behind some menus on the device. So I "fixed" it by writing my own audio interface :)

This was going to be part of that project, but then I sortof got sidetracked...

In all honesty dB meters are probably not a bad idea too 👍 -  We probably couldn't use GuiCtrlSetData() on them the way I've implemented it though.  I've got an adlib function to check the dummy control's values, then update the associated static control if need be.  I would say this method would be too slow for the meters to show anything meaningful.  If you set the static control directly I'd imagine it could be workable though.

Posted (edited)
  On 2/9/2024 at 2:44 AM, argumentum said:

@MattyD, it would be good to have your 2 files in a ZIP file with a version or date in the name :) 

Expand  

Ask and thou shall recieve!

Just be aware the "versioning" should be treated very loosely.
I'm still treating this all as early development; so its just the same file that has been updated and re-uploaded on my side...

That being said, changes since last time:

  • We've now plugged that memory leak previously mentioned.
  • We're now disposing sets of bitmaps if we've destroyed all controls that reference them.
  • Reduced the adlib interval for updating controls. (GUICtrlSetData() should be more responsinve)

 

Edited by MattyD
Posted

hmm, new issue... when you move a control fast there may be a problem,

Say we do a quick sweep of a fader from 0 to 127: We check mousemove messages to see if theres a new value send, and if need be fire a SendToDummy. This doesn't nessecarily trigger on every vlaue between 0 & 127, but it can be pretty granular.

So this becomes an issue with GuiGetMessage() in a loop, there's that built-in delay to prevent CPU ramping.  In the space of one loop, you could've had, say, 10 mousemoves fire. If we're only reading values with GuiCtrlRead() when we process the GGM message, theres a good chance we're too late for the party.

In practice, you end up reading a few values along the way during a sweep, but then a bunch of "127"s as we process the backlog of messages.

I'm starting to think these dummy controls may be more trouble than they're worth!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...