DriverHeaven.net

 
Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   DriverHeaven.net > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > General Discussion


Reply
 
LinkBack Thread Tools
Old Aug 8, 2008, 12:49 PM   #1
DriverHeaven Junior Member
 
Join Date: Jan 2006
Posts: 28
Rep Power: 0
zaboomafoo is on a distinguished road

kSlider.set_buttons - how to use it?

I am trying to add custom images to the kSlider. It doesn't seem to work for me. Here is what I have:


Code:
kSlider chFader;
chFader.set_bitmaps(mf.load_image("fader_line1_256.bmp"),mf.load_image("fader_knob1_256.bmp"));
create_vslider(chFader[i], FADER_ID + i, tmp, FADER_MIN_VALUE, 0, 10, 360, CHWIDTH, 50);
Slider still shows with the default images. I can see that it does something with my images, since it resizes the slider to the size of my image (ignores height parameter).

What is missing? Any ideas?

Regards,
Frank
zaboomafoo is offline   Reply With Quote


Old Aug 8, 2008, 01:14 PM   #2
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Did you attach your skin to your .kxl file?

i.e.
copy /b MyPlugin.kxl + Myskin.kxs
Russ is offline   Reply With Quote
Old Aug 8, 2008, 01:23 PM   #3
DriverHeaven Junior Member
 
Join Date: Jan 2006
Posts: 28
Rep Power: 0
zaboomafoo is on a distinguished road

Yes, I did. I am using some other images form the skin for eKnob classes, no problems.

As I said, I can see that slider is actually resized to the size of my background image. So slider is reading my image and taking the dimensions from there, but it is not showing the images.

Regards,
Frank
zaboomafoo is offline   Reply With Quote
Old Aug 8, 2008, 03:40 PM   #4
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Sorry, I have not tried to skin kSlider as of yet, so I am not sure what the correct method is with that.

I just did a quick test myself and the only way I could get it to use any of my images was to set_bitmaps after create_vslider, which is opposite of what the readme says to do, and it did not seem to draw right, so I do not know.

<edit>
Oops, my background image size was slightly off, which caused the drawing problem. Now the above works for me (but it is still opposite of what the readme says).
</edit>

Last edited by Russ; Aug 8, 2008 at 04:07 PM.
Russ is offline   Reply With Quote
Old Aug 8, 2008, 05:42 PM   #5
DriverHeaven Junior Member
 
Join Date: Jan 2006
Posts: 28
Rep Power: 0
zaboomafoo is on a distinguished road

thanks!

I moved set_bitmaps call after create and now I have something. I also have problem with the background drawing, not sure why.

What was your problem with the background? For me it first dowsn't show background, only the thumb image and as I move it background is dispayed all messed up.

Still this is progress it might be something with my image, have to play with it.

Thanks again!

Regards,
Frank
zaboomafoo is offline   Reply With Quote
Old Aug 8, 2008, 06:55 PM   #6
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Yeah, that is the same thing it was doing for me. I accidentally cropped it one pixel to small on each side. The size that worked is the size used in the create_vslider call (well actually I used create_hslider (since I used the demo plugin for testing), but same difference).

i.e.
170 x 30 slider background image using (straight from the demo plugin):
create_hslider(level_1, VOL1_ID, "Left", 0x0, 0x7fffffff, 55, 35, 170, 30);

If you create the slider (at the size you want) without the skin, and click on it so its highlighted, and then take a screen shot, you can use the selection rectangle to figure out where it should be cropped (area should include the selection rectangle), and it will also give you the correct location for the track slot thing, and any tick marks etc.

BTW: If you want something to be transparent use white (RGB: 255,255,255).

Last edited by Russ; Aug 8, 2008 at 09:33 PM.
Russ is offline   Reply With Quote
Old Aug 8, 2008, 08:40 PM   #7
DriverHeaven Junior Member
 
Join Date: Jan 2006
Posts: 28
Rep Power: 0
zaboomafoo is on a distinguished road

I have it working now, however there are some problems.

Let me summarize (for future generations ):

- set_bitmaps(...) needs to be called after create_Xslider(...)
- size of the background image has to match exactly the size in the create_Xslider call

Issues:

- white background is treated as transparent, however it did not work for me, it gets messed up
- too narrow background images produce weird problems. make them at least 30 pixels wide
- there is some flickering when the fader is moved

- main issue is that you need to click close to the middle of the thumb to move it properly. it seems that there is still the default windows slider beneath the image and if you click outside the invisible thumb, you get "jumping" movements.

bottom line is that it works. I did not yet try it with the kFader class, not sure if it will work with the label and text field, have to try that.

Thanks Russ for the help!

Regards,
Frank
zaboomafoo is offline   Reply With Quote
Old Aug 8, 2008, 09:06 PM   #8
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Quote:
Originally Posted by zaboomafoo View Post
- white background is treated as transparent, however it did not work for me, it gets messed up
You probably do not want to make any part of the slider background image transparent, as we do not know what the dialog is using for it's clipping area, nor what method the slider uses to draw (i.e. how it erases the background, etc). However making parts of the thumb transparent worked OK for me.

As for the other issues, I really didn't notice, but I made my thumb control with the same exact dimensions as the non-skinned version, and the size of the slider was at least 30 pixels, etc, so that is probably why (I pretty much just used a different color scheme).

In any case, thanks for sharing your results, hopefully it will help someone else.
Russ is offline   Reply With Quote
Old Aug 8, 2008, 10:34 PM   #9
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,884
Rep Power: 48
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Those "skinned" kslider/kfader controls are too buggy. (all known issues btw)
Best to avoid them. None of the better plugins use them AFAIK.
Lex Nahumury is offline   Reply With Quote
Old Aug 9, 2008, 01:07 AM   #10
DriverHeaven Junior Member
 
Join Date: Jan 2006
Posts: 28
Rep Power: 0
zaboomafoo is on a distinguished road

Quote:
Originally Posted by Lex Nahumury View Post
Those "skinned" kslider/kfader controls are too buggy. (all known issues btw)
Best to avoid them. None of the better plugins use them AFAIK.
At this stage, I am trying to concentrate on the main functions of this plugin, and not developing some custom controls. That is why I used the built in classes. Later on I might develop my own controls.

I noticed that most of the "better" plugins have their own custom controls. It would be nice if they shared the source code for those controls. In SDK I found eKnob class, which works fine for me (with minor mods). So far I could not find any replacement for skinned fader.

I guess it would make sense to bring all those custom controls into SDK - what is the point of having a SDK with buggy and unfinished controls?

I apologise if this was already duscussed earlier, I searched the forum and could not find any reference to skinned slider / fader.

Regards,
Frank

Last edited by zaboomafoo; Aug 9, 2008 at 01:16 AM.
zaboomafoo is offline   Reply With Quote
Old Aug 9, 2008, 01:46 PM   #11
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,884
Rep Power: 48
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Quote:
Originally Posted by zaboomafoo View Post
At this stage, I am trying to concentrate on the main functions of this plugin, and not developing some custom controls. That is why I used the built in classes.
Of course. Good approache. Personaly I would use a non skinned GUI in that stage.
(less code, less bugs etc) No knob control though.
Quote:
Originally Posted by zaboomafoo View Post
I noticed that most of the "better" plugins have their own custom controls. It would be nice if they shared the source code for those controls.
That's unlikely to happen for all diff. kinds of reasons.
(a well known phenomena on MS platform)
Quote:
Originally Posted by zaboomafoo View Post
So far I could not find any replacement for skinned fader.
Correct, there isn't any.
Quote:
Originally Posted by zaboomafoo View Post
what is the point of having a SDK with buggy and unfinished controls?
Well, in all fairness, it's not that bad.
Most common controls (slider,button,checkbox,combo, static etc.) are provided in kxgui
and they work fine.
Remember there is no Knob or dial control in MFC/win32 either.
The 'skinning' features in kxgui are far from perfect and must be seen as a bonus.

Keep in mind the nature of kX project.
One can not expect kX to provide and maintain a full-blown GUI framework
for just a few potential interested coders.
If you have finished some custom control you wish to contribute to kX I'm sure it will be
appreciated
Quote:
Originally Posted by zaboomafoo View Post
I apologise if this was already duscussed earlier, I searched the forum and could not find any reference to skinned slider / fader.
No need to apologise. There's relative little info for coders.
Most info can be found in the DSP section, that's were the (very small) group of kX coders usualy hang out.
Best to post/look there.

Last edited by Lex Nahumury; Aug 9, 2008 at 01:58 PM. Reason: corr.
Lex Nahumury is offline   Reply With Quote
Old Aug 9, 2008, 03:38 PM   #12
DriverHeaven Junior Member
 
Join Date: Jan 2006
Posts: 28
Rep Power: 0
zaboomafoo is on a distinguished road

Quote:
Well, in all fairness, it's not that bad.
I am not complaining, please don't get me wrong. KX project is a great thing and I really like. it is a great way to learn more about DSP. If I could only get the latest versions for w2k (I know that is not going to happen ). I am stuck with 3838 on w2k.

Regards,
Frank
zaboomafoo is offline   Reply With Quote
Old Aug 9, 2008, 05:03 PM   #13
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,884
Rep Power: 48
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Quote:
Originally Posted by zaboomafoo View Post
I am not complaining,..
I know. I'm just trying to explain why things are the way they are.
Quote:
Originally Posted by zaboomafoo View Post
KX project is a great thing and I really like. it is a great way to learn more about DSP. If I could only get the latest versions for w2k (I know that is not going to happen ). I am stuck with 3838 on
Well, apart from the latest 24-bit changes (for 10k2 only) I hardly see any advantage, especially if you are into kX DSP programming. So it might not be as bad as you think.
Lex Nahumury is offline   Reply With Quote
Reply

Bookmarks

Thread Tools