|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
graphic gui elements in effect plugins
hello,
the kx diver provides some graphic gui elements to skin plugins. the sdk folder contains code examples: /efx_tube, /efx_reverb, /fx_dynamica, /fx_skin. 1. i tried changing the background image/ window buttons by manipulate the files in /fx_skin, pack to myplugin.rar, rename to myplugin.kxs and bring it together with "copy /b myplugin.kxl + myplugin.kxs myplugin_skinned.kxl" - works. http://freenet-homepage.de/stylish-s...in_skinned.jpg 2. then i tried to give a slider a different look with the lines (/fx_skin/readme.txt): myslider.SetBitmaps( mf.load_image("path-to-your-slider-image"), mf.load_image("path-to-your-slider-thumb-image"), mf.load_image("path-to-your-slider-thumb-image"), mf.load_image("path-to-your-slider-thumb-image")); btw. "SetBitmaps" should be "setbitmaps" otherwise compiler error. after compiling without error i had no changes (no pics) in myplugin. why? 3. next i tried the the eknob from "dynamica". linked eknob.cpp & eknob.h with fx_demo and some code changes brought a grey point in myplugin, i think it was the knob, but it showed no reaction on mouse movement. 4. last i tried implement tiger m.`s bitmap gui elements. while linking e.g. CMKnob.cpp & CMKnob.h with fx_demo the compiler outputs some errors: warning C4273: .. inconsistent dll linkage. dllexport assumed. error C2491: .. definition of dllimport static data member not allowed 5. there are some undocumented gui elements in /h/gui/.. like kKnob.h (klogo.h, kindicator.h..) was that ever used? primarily i need a good looking knob on a bitmap background. therefore tiger m.`s CMKnob with bitmap loading loop is the most flexible choice, but also the trickiest one. I would be grateful for some suggestions stylus Last edited by stylus02; Dec 2, 2009 at 03:47 PM. |
|
|
|
|
|
#2 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
I don't use kX GUI and it has been ages since I did but IIRC;
2. You have to call CKXPluginGUI::init() in your plugDlg::init() prior to using SetBitmaps/mf.load_image stuff. 5. kKnob is just an abstract class. Not implemented. I have never tried klogo or kindicator. As for the rest of your questions; If your new to C++/VS/MFC, why don't you try to use the efx_tube project as a "template" for your own plugin? |
|
|
|
|
|
#3 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
Regarding 2:
It seems that (contrary to what the readme says,) set_bitmaps needs to be done after create_vslider. See the following thread: http://www.hardwareheaven.com/general-...s-how-use.html |
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
thanks guys. lex, hopefully tiger´s sources work properly with 3545 sdk. i`ll go more into it to get it run. russ, thanks for the tread. i was searching for such treads but this forum really big.
|
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
have packed together my workspace. it contains tiger´s tube- files placed in demo workspace. the linker can`t resolve some externals:
tube.cpp Linking... Creating library Release/tube.lib and object Release/tube.exp tube.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CMKnob::~CMKnob(void)" (__imp_??1CMKnob@@UAE@XZ) .. and so on and sofore.. Release/tube.dll : fatal error LNK1120: 9 unresolved externals Error executing link.exe. tube.dll - 10 error(s), 0 warning(s) http://freenet-homepage.de/stylish-stylus/demo_tube.zip have made a demo skin backdrop for kx modular (including knob- animation, "k1.bmp..k64.bmp"). design is based on emu`s first analog modular synth from 1973. here is a preview rendering: http://freenet-homepage.de/stylish-s...m_demoskin.jpg a perspective view: http://freenet-homepage.de/stylish-s...pective_07.jpg gui elements: http://freenet-homepage.de/stylish-s...moskin_bmp.zip maybe someone of you get run a knob on the backdrop, it plays no role which. if i had a working example, i could skin the kxm modules. kxm uses sliders only, for now knobs would be enough. (further i can imagine control lamps (on/off) for e.g. lfo- speed or switches for octaveswitch.) what do you think? Last edited by stylus02; Dec 4, 2009 at 03:05 PM. |
|
|
|
|
|
#6 | |
|
HH's curmudgeon
|
Re: graphic gui elements in effect plugins
The demo skin jpg looks great.
__________________
Quote:
No trees were harmed in the production of this message.
However, an extremely large number of electrons were rather annoyed. |
|
|
|
|
|
|
#7 | |
|
h/h member-shmember
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69 ![]() ![]() ![]() ![]() ![]() ![]() |
Îòâåò: graphic gui elements in effect plugins
Quote:
P.S. Ah, and (sure) add the CMKnob.cpp to your project (as i see it's not there)
__________________
Last edited by Max M.; Dec 4, 2009 at 03:19 PM. |
|
|
|
|
|
|
#8 |
|
h/h member-shmember
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69 ![]() ![]() ![]() ![]() ![]() ![]() |
Îòâåò: graphic gui elements in effect plugins
(p.p.s)
In other words: In the SDK, the "efx" widgets are compiled as a separate dll (kxefx.dll), so the "efx" plugins do not include these (CMKnob.cpp etc.) files directly. Your plugin could also use the kxefx.dll, but the SDK does not include corresponding import library (i.e. kxefx.lib). You need to either re-build the kxefx.dll (to get kxefx.lib) or (less complicated) put its code (i.e. those cpp files) right into your plugin dll.
__________________
Last edited by Max M.; Dec 4, 2009 at 04:04 PM. Reason: e.g.i.e.e.g.i.e.ehhrrgggh |
|
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: Îòâåò: graphic gui elements in effect plugins
Quote:
|
|
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
can`t get my knob pics in kxl. instead of these are tubedrive original knob pics in it. the bitmap loading code:
//valid filenames k1.bmp, k2.bmp, k3.bmp etc. for(i=0;i<FRAMES;i++){ sprintf(filename, "k%d.bmp", i+1); bitmaps[i] = mf.load_image(filename); } sprintf(filename, "k%d.bmp", i+1); writes incrementing filenames to filename char array k1.bmp, k2.bmp, k3.bmp etc. isn`t it? where the comiler is looking for the pics? the pics are in my working dir. |
|
|
|
|
|
#11 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
The pics should be part of your skin (i.e. zipped up with the rest of the skin components (kxskin.ini, etc)).
i.e. Your .KXS file should contain: kxskini.ini k1.bmp k2.bmp ... |
|
|
|
|
|
#12 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
BTW: EFX_TUBEDRIVE uses a separate (i.e. it is not merged with the .KXL) skin (kxefx.kxs) which is placed in the kX program directory (in older versions of kX, it was placed in the system32 directory (IIRC)). If you are going to use that method, then make sure you put your skin file there.
Personally I use the other method. i.e. Delete the following: Code:
TCHAR tmp_str[MAX_PATH];
efx_skin.get_full_skin_path(_T("kxefx.kxs"),tmp_str);
efx_skin.set_skin(tmp_str);
mf.attach_skin(&efx_skin);
efx_skin.attach_skin(kxmixer_skin);
efx_skin.set_attach_priority(1);
e.g. copy /b MyPlugin.kxl + Myskin.kxs |
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
packed the knob bmp`s together in myskin.kxs. used the copy command. works. i left in the skin attach in my code and only changed the skin name.
(by cutting it out the knob wasn´t showed anymore) btw there is still a frame over my background. it seems it is from standard skin. http://freenet-homepage.de/stylish-s...nastyframe.jpg edit: i had set- as- comment following line: grpbox.hide();//hide useless GUI elements now the frame is hide. Last edited by stylus02; Dec 4, 2009 at 09:46 PM. |
|
|
|
|
|
#14 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
You have to either hide those elements, or skin them.
i.e. (to hide (see kxpluginui.h for the names of the default items, etc)) grpbox.hide(); b_mute.hide(); b_reset.hide(); b_bypass.hide(); etc. |
|
|
|
|
|
#15 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
BTW: kX resizes the dialog to fit the card info stuff... You probably do not want that behavior.
To disable that, change the following: create_dialog(plugin_name(fuzz), 250, 120); to: create_dialog(plugin_name(fuzz), 250, 120, -1, KXFX_NO_RESIZE); |
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
last thing for today.. when i minimize myplugin and bring it up again the knob is hided until i do click and move the mouse in the knob area. (when i start the plugin first time the knob is there).
edit: this effect occures when the knob position is 0 (full left). also the first 2 ticks from mousemovement are not recognized from position 0, knob is not changing. the first 2 knob pics where missing in myskin.kxs. fixed Last edited by stylus02; Dec 4, 2009 at 10:47 PM. Reason: trying task |
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
this is what i have. the kxm demo- plugin is just a simple amplitude modulation with triangle lfo. go in with any audiosignal. following controls are active.
knob 01: mix knob 02: lfo rate lamp 01: input on/off switch : lfo on/off everything else is inactive. its just painting on the backdrop image. plugin: (3545) http://freenet-homepage.de/stylish-s...oskin_v1.0.jpg http://freenet-homepage.de/stylish-s...xmdemoskin.kxl complete workspace: (3545) http://freenet-homepage.de/stylish-s...oskin_v0.1.rar what i want to do next is: - skin the window controls: reset, bypass, mute. how are the filenames? - make a lfo lamp wich rises up and down with a lfo register. maybe the cmknob class (without mouse controls) can do that? i fear therefore i need your help again guys. Last edited by stylus02; Dec 9, 2009 at 03:15 PM. |
|
|
|
|
|
#18 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
nice skin!
|
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
thanks lex. rendering was done with 3d studio max 3.1.
|
|
|
|
|
|
#20 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
- skin the window controls: reset, bypass, mute. how are the filenames?
IIRC, you need to provide a custom 'kxskin.ini' with your skin. See kxskin.ini for details. - make a lfo lamp wich rises up and down with a lfo register. maybe the cmknob class (without mouse controls) can do that? Well, many ways to go but yep, you could try to modify that code. If there's no user input to the control you can simply remove all that stuff. Then you'll need a timer and treat it the same way we do with the peak meters. |
|
|
|
|
|
#21 |
|
HardwareHeaven Senior Member
Join Date: Jan 2004
Location: St. Cloud, MN
Posts: 492
Rep Power: 0 ![]() |
Re: graphic gui elements in effect plugins
Beautiful interface there; are you going to do that to the whole driver or just your plugin?
__________________
COMP: Dual Intel PIII 733 Mhz; GeForce 4 Ti 4600; 1.128 Gb RAM; SB0350 (Audigy 2 ZS Platnium) STEREO(I UPGRADED):Crown Audio K1 and K2 amplifiers (4000 watts at .1% THD ), JL 13w7 Subwoofer (6.5 CF) (2) 18" PR's, Klipsch SB-1's, some cement blocks for speaker stands...
|
|
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
everything is running. lfo- lamp, plugin controls added. positioning these control: bypass, reset, mute are not easy.. used the timer from "dynamica". readout a lfo register with get_dsp_register and push it to a label. bitmap position is set in "synchronize part" of sourcecode. the lamp is a cmknob member. have decreased timer intervall to 10ms ( i hope this is given in ms) for better results on higher lfo rates. upload workspace later after cleaning.
plugin: (3545) http://freenet-homepage.de/stylish-s...oskin_v1.0.kxl Quote:
)
Last edited by stylus02; Dec 10, 2009 at 04:16 PM. |
|
|
|
|
|
|
#23 |
|
HardwareHeaven Senior Member
Join Date: Jan 2004
Location: St. Cloud, MN
Posts: 492
Rep Power: 0 ![]() |
Re: graphic gui elements in effect plugins
when you say the 'modular' do you mean the dsp/ the dsp plugins?
__________________
COMP: Dual Intel PIII 733 Mhz; GeForce 4 Ti 4600; 1.128 Gb RAM; SB0350 (Audigy 2 ZS Platnium) STEREO(I UPGRADED):Crown Audio K1 and K2 amplifiers (4000 watts at .1% THD ), JL 13w7 Subwoofer (6.5 CF) (2) 18" PR's, Klipsch SB-1's, some cement blocks for speaker stands...
|
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
|
|
|
|
|
|
#25 |
|
HardwareHeaven Senior Member
Join Date: Jan 2004
Location: St. Cloud, MN
Posts: 492
Rep Power: 0 ![]() |
Re: graphic gui elements in effect plugins
ah gotcha, I dont really use the synthesizer functionality... but good luck
__________________
COMP: Dual Intel PIII 733 Mhz; GeForce 4 Ti 4600; 1.128 Gb RAM; SB0350 (Audigy 2 ZS Platnium) STEREO(I UPGRADED):Crown Audio K1 and K2 amplifiers (4000 watts at .1% THD ), JL 13w7 Subwoofer (6.5 CF) (2) 18" PR's, Klipsch SB-1's, some cement blocks for speaker stands...
|
|
|
|
|
|
#26 | |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
Quote:
![]() Normaly 50..100ms should be fast enough for such animations. (I use ~70ms for peak meters) SetTimer() is in msec. SetTimer Function () |
|
|
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
Quote:
|
|
|
|
|
|
|
#28 | |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
Quote:
That function is called every 10msec in your case, and I assume that's were all the redrawing stuff starts. |
|
|
|
|
|
|
|
|
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
Re: graphic gui elements in effect plugins
Quote:
void ikxmdemoskinPluginDlg::OnTimer(UINT) { dword tri; plugin->get_dsp_register(TRI1_P,&tri); //get lfo amplitude plugin->set_param(TRI, tri); //push it to label TRI } Last edited by stylus02; Dec 10, 2009 at 06:32 PM. |
|
|
|
|
|
|
#30 | |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
Re: graphic gui elements in effect plugins
Quote:
(you just took a little unneeded detour) onTimer -> set_param() -> sync() -> setpos() is the same as; onTimer -> setpos() In both cases setpos(), (which starts all the drawing stuff) is executed every 10msec. Look, on todays fast PCs those few extra CPU cycles don't matter, but it is always a good thing to write Lean & Mean code. |
|
|
|
|
![]() |
| Thread Tools | |
|
|