HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

Go Back   HardwareHeaven.com > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > Effects and the DSP


Reply
 
Thread Tools
Old Dec 2, 2009, 03:30 PM   #1
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

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
__________________
http://kxm.dyndns.org

Last edited by stylus02; Dec 2, 2009 at 03:47 PM.
stylus02 is offline   Reply With Quote


Old Dec 3, 2009, 02:06 AM   #2
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

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?
Lex Nahumury is offline   Reply With Quote
Old Dec 3, 2009, 10:49 AM   #3
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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
Russ is offline   Reply With Quote
Old Dec 3, 2009, 03:19 PM Threadstarter Thread Starter   #4
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

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.
__________________
http://kxm.dyndns.org
stylus02 is offline   Reply With Quote
Old Dec 4, 2009, 02:30 PM Threadstarter Thread Starter   #5
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

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?
__________________
http://kxm.dyndns.org

Last edited by stylus02; Dec 4, 2009 at 03:05 PM.
stylus02 is offline   Reply With Quote
Old Dec 4, 2009, 02:33 PM   #6
HH's curmudgeon
 
Tyrsonswood's Avatar
 
Join Date: Mar 2008
Location: Rustbelt, Ohio
Posts: 10,714
Rep Power: 389
Tyrsonswood is godlike in his statusTyrsonswood is godlike in his statusTyrsonswood is godlike in his statusTyrsonswood is godlike in his statusTyrsonswood is godlike in his statusTyrsonswood is godlike in his statusTyrsonswood is godlike in his statusTyrsonswood is godlike in his statusTyrsonswood is godlike in his statusTyrsonswood is godlike in his statusTyrsonswood is godlike in his status
System Specs

Gold Member
Re: graphic gui elements in effect plugins

The demo skin jpg looks great.
__________________
Quote:
Only after the last tree has been cut down. Only after the last fish has been caught. Only after the last river has been poisoned. Only then will you realize that money cannot be eaten.
Cree Nation Tribal Prophecy

No trees were harmed in the production of this message.
However, an extremely large number of electrons were rather annoyed.
Tyrsonswood is online now   Reply With Quote
Old Dec 4, 2009, 03:10 PM   #7
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

Îòâåò: graphic gui elements in effect plugins

Quote:
tube.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CMKnob::~CMKnob(void)" (__imp_??1CMKnob@@UAE@XZ)
if i'm not mistaken this is because the CMKnob is declared with kCLASS_TYPE macro which expands to __declspec(dllimport) (so the linker expects CMKnob functions to be implemented elsewhere but not in your dll (where they actually are)). I.e. just remove kCLASS_TYPE from CMKnob.h.

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.
Max M. is offline   Reply With Quote
Old Dec 4, 2009, 03:34 PM   #8
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

Îòâåò: 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
Max M. is offline   Reply With Quote
Old Dec 4, 2009, 03:40 PM Threadstarter Thread Starter   #9
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

Re: Îòâåò: graphic gui elements in effect plugins

Quote:
Originally Posted by Max M. View Post
if i'm not mistaken this is because the CMKnob is declared with kCLASS_TYPE macro which expands to __declspec(dllimport) (so the linker expects CMKnob functions to be implemented elsewhere but not in your dll (where they actually are)). I.e. just remove kCLASS_TYPE from CMKnob.h.

P.S. Ah, and (sure) add the CMKnob.cpp to your project (as i see it's not there)
yes, now it compiles, great. removed all "kCLASS_TYPE" declarations in header files from h/gui/efx.. and added .cpp files from /fx_efx to project sources. and i have something running!
__________________
http://kxm.dyndns.org
stylus02 is offline   Reply With Quote
Old Dec 4, 2009, 05:13 PM Threadstarter Thread Starter   #10
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

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.
__________________
http://kxm.dyndns.org
stylus02 is offline   Reply With Quote
Old Dec 4, 2009, 08:09 PM   #11
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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
...
Russ is offline   Reply With Quote
Old Dec 4, 2009, 08:44 PM   #12
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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);
...and just merge your skin with your .KXL after compiling.

e.g.
copy /b MyPlugin.kxl + Myskin.kxs
Russ is offline   Reply With Quote
Old Dec 4, 2009, 09:25 PM Threadstarter Thread Starter   #13
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

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.
__________________
http://kxm.dyndns.org

Last edited by stylus02; Dec 4, 2009 at 09:46 PM.
stylus02 is offline   Reply With Quote
Old Dec 4, 2009, 09:39 PM   #14
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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.
Russ is offline   Reply With Quote
Old Dec 4, 2009, 09:52 PM   #15
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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);
Russ is offline   Reply With Quote
Old Dec 4, 2009, 10:09 PM Threadstarter Thread Starter   #16
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

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
__________________
http://kxm.dyndns.org

Last edited by stylus02; Dec 4, 2009 at 10:47 PM. Reason: trying task
stylus02 is offline   Reply With Quote
Old Dec 9, 2009, 03:01 PM Threadstarter Thread Starter   #17
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

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.
__________________
http://kxm.dyndns.org

Last edited by stylus02; Dec 9, 2009 at 03:15 PM.
stylus02 is offline   Reply With Quote
Old Dec 9, 2009, 03:15 PM   #18
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Re: graphic gui elements in effect plugins

nice skin!
Lex Nahumury is offline   Reply With Quote
Old Dec 9, 2009, 03:25 PM Threadstarter Thread Starter   #19
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

Re: graphic gui elements in effect plugins

Quote:
Originally Posted by Lex Nahumury View Post
nice skin!
thanks lex. rendering was done with 3d studio max 3.1.
__________________
http://kxm.dyndns.org
stylus02 is offline   Reply With Quote
Old Dec 9, 2009, 03:46 PM   #20
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

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.
Lex Nahumury is offline   Reply With Quote
Old Dec 10, 2009, 03:37 PM   #21
HardwareHeaven Senior Member
 
Join Date: Jan 2004
Location: St. Cloud, MN
Posts: 492
Rep Power: 0
Chester01 is on a distinguished road

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...
Chester01 is offline   Reply With Quote
Old Dec 10, 2009, 04:09 PM Threadstarter Thread Starter   #22
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

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:
Originally Posted by Chester01 View Post
Beautiful interface there; are you going to do that to the whole driver or just your plugin?
i want skin the kx modular. the whole driver, you mean the mixer? no, this would be a lot of work. (the modular is hard enough )
__________________
http://kxm.dyndns.org

Last edited by stylus02; Dec 10, 2009 at 04:16 PM.
stylus02 is offline   Reply With Quote
Old Dec 10, 2009, 04:37 PM   #23
HardwareHeaven Senior Member
 
Join Date: Jan 2004
Location: St. Cloud, MN
Posts: 492
Rep Power: 0
Chester01 is on a distinguished road

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...
Chester01 is offline   Reply With Quote
Old Dec 10, 2009, 04:40 PM Threadstarter Thread Starter   #24
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

Re: graphic gui elements in effect plugins

i mean this beast.

http://www.hardwareheaven.com/effects-...ystem-1-a.html
__________________
http://kxm.dyndns.org
stylus02 is offline   Reply With Quote
Old Dec 10, 2009, 04:51 PM   #25
HardwareHeaven Senior Member
 
Join Date: Jan 2004
Location: St. Cloud, MN
Posts: 492
Rep Power: 0
Chester01 is on a distinguished road

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...
Chester01 is offline   Reply With Quote
Old Dec 10, 2009, 04:56 PM   #26
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Re: graphic gui elements in effect plugins

Quote:
have decreased timer intervall to 10ms ( i hope this is given in ms)
Are you sure you need 10ms timer?
Normaly 50..100ms should be fast enough for such animations.
(I use ~70ms for peak meters)

SetTimer() is in msec.
SetTimer Function ()
Lex Nahumury is offline   Reply With Quote
Old Dec 10, 2009, 05:12 PM Threadstarter Thread Starter   #27
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

Re: graphic gui elements in effect plugins

Quote:
Originally Posted by Lex Nahumury View Post
Are you sure you need 10ms timer?
Normaly 50..100ms should be fast enough for such animations.
(I use ~70ms for peak meters)

SetTimer() is in msec.
SetTimer Function ()
mmm.. maybe 10ms are to short. a liquid animation should have 25 frames per second. 1000ms/ 25frames = 40ms would be enough. how delicate is a timer call in our situation?
__________________
http://kxm.dyndns.org
stylus02 is offline   Reply With Quote
Old Dec 10, 2009, 05:23 PM   #28
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Re: graphic gui elements in effect plugins

Quote:
how delicate is a timer call in our situation?
Not sure what you mean with "delicate" but if you mean CPU cycles then it depends on what you do in your on_timer() callback isn't it?
That function is called every 10msec in your case, and I assume that's were all the redrawing stuff starts.
Lex Nahumury is offline   Reply With Quote
Old Dec 10, 2009, 05:32 PM Threadstarter Thread Starter   #29
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

Re: graphic gui elements in effect plugins

Quote:
Originally Posted by Lex Nahumury View Post
Not sure what you mean with "delicate" but if you mean CPU cycles then it depends on what you do in your on_timer() callback isn't it?
That function is called every 10msec in your case, and I assume that's were all the redrawing stuff starts.
i mean such things like update grafics and sound with possible dropouts while moving windows, playing flash- movies in a webbrowser and so on. i only readout the dsp register and push it to a plugin->set_param(). SetPos() is done outside the ontimer() call in sync().

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
}
__________________
http://kxm.dyndns.org

Last edited by stylus02; Dec 10, 2009 at 06:32 PM.
stylus02 is offline   Reply With Quote
Old Dec 11, 2009, 06:34 AM   #30
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Re: graphic gui elements in effect plugins

Quote:
Originally Posted by stylus02 View Post
I.... only readout the dsp register and push it to a plugin->set_param(). SetPos() is done outside the ontimer() call in sync().
But that is the same as calling SetPos() directly from onTimer()!
(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.
Lex Nahumury is offline   Reply With Quote
Reply

Thread Tools