Hey gang. Took a break for a few days... On July 28, 2010 09:10:32 pm Tim E. Real wrote: > Although slider thumb track size is known, extra unknown space > above and below the slider trough may make our custom marker > positions not precisely accurate. Talk about whack-a-mole, gtk 2.20 has functions to determine those exact spaces. However I don't have 2.20 on my one-year-old distro. So I feel they're too new to use always, but I can put some #ifdef 's in there to take advantage of them if available.
> However, if we're lucky, we may be able to keep page snaps by > intercepting keyboard page up/dn and forcing the sliders to their > very own page stops. > I hope there's a way to intercept the KB. > Some toolkits let you give the application or window first crack > at KB events before passing them on. Yes, of course, that was easy. In envy24control.c connect all of the vscale slider objects to a single key handler: // Let us handle the page up/down snapping. gtk_signal_connect(GTK_OBJECT(vscale), "key-press-event", GTK_SIGNAL_FUNC(slider_key_handler), 0 ); The slider_key_handler() does all the rest of the work. In the handler, gtk passes you the object which called it. Perfect. Unlike QT, which sort of frowns upon that ("breaks modularity") and requires you to ask what the object was. I've got my handler done. Works just fine. That is, I've got slider page up/down snaps, with no markers needed! Just one problem: For the ADC sliders, the top dB value is +18.5dB. Therefore if we just 'blindly' move the slider 12 steps to the next 6dB positions, we get +12.5, +6.5, +0.5 dB etc. That '.5' offset, all the way up and down the scale, is not good. So my next step is to use the ALSA dB functions (_ask_dB) to 'ask' what the corresponding integer values are for +18.0, +12.0, +6.0, +0.0 etc. and these will then be the correct positions to set our page stops. I'm pretty sure, if I can finish this, it will be all you (we) wanted originally, and more. Niels do you have a new release or repo I can work with rather than the original release, which may be too outdated to patch against by now? Thanks. Tim. _______________________________________________ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev