Author Topic: Sound volume slider would be mega cool  (Read 9831 times)

Offline eye2eye

  • Newbies
  • *
  • Posts: 11
  • Karma: +0/-0
Sound volume slider would be mega cool
« on: December 11, 2021, 01:06:32 PM »
hi devs,

would it be possible to implement a volume slider for sound in the gui,
maybe in a status bar at the bottom of the game window with some
other infos like fps or so?
if this is not possible perhaps right from the toolbar at the upper menubar?

why?
most of the time i have several progs open, like a browser with tv or radio in the backround
most of these sources require a quite loud volume level, running
fbn at the same time the game sound is then too loud and i have to
reduce the volume level but then i can't hear the other source any more

such a feature would be really cool...

e2e

Offline dink

  • Administrator
  • *****
  • Posts: 5172
  • Karma: +465/-1
  • pie? I nearly bought one!
Re: Sound volume slider would be mega cool
« Reply #1 on: December 11, 2021, 04:32:30 PM »
I like the idea, in fact, i wanted to do this a few years ago but I'm not too good at ui programming.
Do you know of another app. with opensource that has a volume slider or knob on the menu bar, so I can get ideas?

Offline eye2eye

  • Newbies
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Sound volume slider would be mega cool
« Reply #2 on: December 12, 2021, 07:59:14 AM »
yep,

most of the emus have such a slider either in game window or in some options menu.
Since a slider is a standard control (at least in windows coding environments) you can
place it everywhere, i often use it e.g. in vb/vba:

https://sourceforge.net/projects/vice-emu/


https://sourceforge.net/projects/deniseemu/


https://github.com/bsnes-emu/bsnes


want more?

Offline dink

  • Administrator
  • *****
  • Posts: 5172
  • Karma: +465/-1
  • pie? I nearly bought one!
Re: Sound volume slider would be mega cool
« Reply #3 on: December 12, 2021, 09:16:06 AM »
I was hoping to put it in the menu bar at the top of the screen, unfortunately putting it there is going to be quite difficult (I can't find how to do it).  Do you know of any like that?

best regards,
- dink

Offline eye2eye

  • Newbies
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Sound volume slider would be mega cool
« Reply #4 on: December 12, 2021, 04:34:56 PM »
mhmm,

i think i got your problem. i tried several coding environments.
controls are behind (z-order) the command bar.



i'll check further apps how they did it. at the moment i
know several apps with additional controls in the bar
but not opensource. maybe i'll find one with source...

e2e

Offline dink

  • Administrator
  • *****
  • Posts: 5172
  • Karma: +465/-1
  • pie? I nearly bought one!
Re: Sound volume slider would be mega cool
« Reply #5 on: December 13, 2021, 01:00:39 AM »
thanks for looking into this :)

As sort of a last resort, I came up with this idea..
It might seem kinda shoddy, but it would be really easy to impl. (given my ui experience, this would be perfect, too)..
How about a submenu under the audio menu with entries from 0 - 100%, in steps of 10 or 20 or something like that?  It would look similar to the autofire rate submenu.

Alternately, I have a sorta-dreamy version of the audio slider (probably just as difficult as getting it on the menu bar, maybe?):
some sort of slider that alpha-fades in when mousing over the top-left of the game window.

The last idea involves impl. the shoddy idea for now until we come up with something more nice.

Just throwing these out there..

best regards,
- dink
« Last Edit: December 13, 2021, 01:02:00 AM by dink »

Offline eye2eye

  • Newbies
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Sound volume slider would be mega cool
« Reply #6 on: December 13, 2021, 03:34:16 PM »
thx for your commitment,

i guess for a quick and simple, first shot implementation, your suggestion with the
command tree and a volume branch with 6 (mute, 20%, 40%, 60%, 80% and max) steps
is ok.
although not pro like it would solve the task at first shot.
whatever realization is taken at the end it should be a cross-platform one, i.e. on
win, mac and linux/android practicable.

whenever i have time i take a look at apps gui structure. all i found out so far is that
those with command bar and controls mixed use coding frameworks like qt or
new xaml-stuff from visual studio sometimes combined with 3rd party controls stuff.
as far as i understood the coding principles in fbneo for cross-platform compatibility
it should be simple and lightweight so 3rd party stuff must not be used.

i'll stay tuned for it but it may take a while until I have found a solution for the task.

nevertheless the fbn community is big, maybe someone with better in-depth knowledge
of the controls stuff can help.
so far i have only coded gui with standard controls and i have no knowledge of mac
or unix coding except scripting stuff...

e2e
« Last Edit: December 14, 2021, 09:03:46 AM by eye2eye »

Offline eye2eye

  • Newbies
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Sound volume slider would be mega cool
« Reply #7 on: December 14, 2021, 03:36:27 AM »
just wonderful

thx a lot...

Offline dink

  • Administrator
  • *****
  • Posts: 5172
  • Karma: +465/-1
  • pie? I nearly bought one!
Re: Sound volume slider would be mega cool
« Reply #8 on: December 14, 2021, 09:18:29 AM »
welcome buddy, I did it in steps of 10 so it matches the alt + / alt - keys.

There is a little issue, the volume level below 100 w/dsound doesn't match that of xaudio2, it would be nice to get them at least somewhat the same :)

best regards,
- dink
« Last Edit: December 14, 2021, 09:22:05 AM by dink »

Offline eye2eye

  • Newbies
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Sound volume slider would be mega cool
« Reply #9 on: December 22, 2021, 06:33:23 PM »
I'm still on the topic...

after several hours and about 250 lines of code (winapi in c code without any ui-designer,
to get it compiled with gcc) i have only this simple common controls slider so far (i call it busllshit slider).



now i learned the hard way, why everybody is using ui-frameworks to design their forms with control stuff.
winapi ui generating is not the right way for 21st century coding.


e.g. this here is done in about 25 code lines (c#)


https://www.grapecity.com/componentone/docs/win/online-ribbon/statusbar.html

e2e

Offline dink

  • Administrator
  • *****
  • Posts: 5172
  • Karma: +465/-1
  • pie? I nearly bought one!
Re: Sound volume slider would be mega cool
« Reply #10 on: December 22, 2021, 08:10:22 PM »
blitter and ui code, the 2 things that really haunt my reality..

good luck :)

Offline eye2eye

  • Newbies
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Sound volume slider would be mega cool
« Reply #11 on: December 28, 2021, 05:06:54 PM »
i'm getting nuts,

(sorry have to take bigger font size, my eyes are already so square
by staring at the code for hours and hours otherwise can't read/write)

although i'm a few steps further, always something is not working...
oh lord - i'm so bad at coding, i admire you devs so much...



first i lost several days by trying to subclass or modifying the command menu
(i.e. reducing width, making transparent or integrating the sound tool in the bar)
in order to get rid of the z-order-problem, which all didn't work.

now with my new approach using seperate child-window-objects for the sound symbol and
the vertical slider on first sight it looks good but there are so many possible actions
on the parent window that either i see the kids but they do not reposition
correctly while sizing or moving the parent or they are moving correctly but they are
behind the parent or flickering like crazy...
when i use SetWindowPos(g_hVolWnd, HWND_TOP... to stabilize this, the parent
loses focus and gets inactive...setting back the focus to the parent the sound stuff disappears
and is again behind the parent and so on and so on...

at the moment i think with my limited knowledge of ui coding in combination with the
old common controls sh** in winapi it is not possible to carry out the job.

which brings me to my findings:
- a status bar or any other additional tools in the y-axis should be avoided since a pixel-line
in the vertical is far too valuable to be wasted by such..any futher options should be implemented
on the right side as an additional window or as a new child-window in the main center.
- any modern looking ui should be carried out by modern ui-additions like qt, wxwidgets, gltk+,
fltk, ultimate and such - 2 main criteria might be crossplatform and/or open source.

i will see, what i'm doing with the rest of my holidays, can't spend all day long with coding...

last famous words: jordan mechner (ya all know, the one from pop) in his bio:
"programming is a young kids business..."
« Last Edit: December 28, 2021, 05:34:01 PM by eye2eye »

Offline dink

  • Administrator
  • *****
  • Posts: 5172
  • Karma: +465/-1
  • pie? I nearly bought one!
Re: Sound volume slider would be mega cool
« Reply #12 on: December 28, 2021, 05:28:57 PM »
It looks nice, but don't wear yourself out - if things get too complicated remember - the one we have in the menu works just nicely!

best regards,
- dink