steps

0 views
Skip to first unread message

tom jacobs

unread,
Nov 12, 2006, 8:26:56 PM11/12/06
to bluetu...@googlegroups.com
Liah..
So step 4 was huge and distracting with a windows introduction.  When I started learning windows programming not that long ago, a lot of it was just looking at existing working code, not understanding it and just monkey-see-monkey-do copying it, and removing various things in it to see what broke, and thus what those things were doing. Yay.
I think I'll abstract that DC/SelectObject/BitBlt stuff away soon so we don't have to deal with it, because we shouldn't have to look at it. I just haven't done this yet.
It's kinda good to be able to see what's going on underneath, but in this case we don't need to.
Oh-- In the existing slider-slot drawing code you can see that I'm reusing the same DC for many bitmap draws. You can do that, but needn't. So if we abstracted it all you'd just create a new DC, select the bitmap into it, bitblt, and delete the DC, and that'd be the DrawBitmap call. So you'd create/destroy a DC for each bitmap draw. Annnnnyway. You can make the abstracted DrawBitmap call if you want, or just copy the DC making code that's there already into your own drawing code, which would be just below it.

So anyway, once you have a crack and at steps 1 - 4, here's a good solid aim-list for going forward:

5) Get the volume knob to appear, _anywhere_ on the top panel. Doesn't matter where.

6) Get it to appear at 0% on the slider-slot.

7) Add a 'volume' variable to the main class and get the knob to appear in the right spot on the slider according to what that that 0 - 100 volume variable is currently set to. ( set it to a few different things on different runs to test ).

8) Then we gotta make that volume variable change to the correct volume when you click on the slider-slot. So you gotta handle the WM_MOUSEDOWN message on the toppanel, make it set that volume variable. ( and then re-draw the toppanel section to have the volume knob reflect this )

9) And then do that same thing but make that happen for the duration that the mouse button is held down, so they can drag the volume. This would be done by having that code (or a call to it) in a WM_MOUSEMOVE message response, under an if( mouseButton is down ) condition. (See the BlueTunes 1 code for how I get that mouseButton is down variable, and I can show you.)

10) Then we simply have that same code call SetVolume( volume ) or something, and we're done! Working volume control!

Remember, completely fine working volume code is in bluetunes 1. (It's just hard to see where it is :-) ) Use as much of it as you want to, the more used means less work needed, hopefully.

If you have ideas on how to make the volume control better UI-wise, that's always cool. I think its pretty good in BT1. Better than a lot of volume controls I've seen. Some of them shit me.

Oh, if you can't get BT1 to compile, (fordy was having troubles) download it and install it from http://bluetunes.sourceforge.net to see how it is / what we're aiming for.

Enjoy (do!),
--
Tom.
Reply all
Reply to author
Forward
0 new messages