• Home
  • Reviews
  • Articles
  • News
  • Tools
  • GamingHeaven
  • Forums
  • Network
 

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

Notices

Reply
 
LinkBack Thread Tools
Old Aug 15, 2005, 08:01 PM   #1
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

mixy 4x2 update

latest mixy 4x2 version is: v022

Hello,
i just finished adding mono mix option to my little mixer and i wanted to let you guys now,

u can get it here
http://www.geocities.com/picacioiu/
direct link is
http://www.geocities.com/picacioiu/mixy4x2v020_3538.bin

I hope that starting a new thread does not disturb you too much,

And 1 question, what should i change to make it work with 3538i (i didnt tested it yet with 3538i)

Last edited by townkat; Aug 17, 2005 at 03:34 PM.
townkat is offline   Reply With Quote
Old Aug 15, 2005, 08:10 PM   #2
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

You should not have to change anything for 3538i. You should only need to recompile it with updated SDK from 3538i.
Russ is offline   Reply With Quote
Old Aug 15, 2005, 08:11 PM   #3
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

uhh, so fast ,

thnx alot
townkat is offline   Reply With Quote
Old Aug 15, 2005, 08:27 PM   #4
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

Your welcome.

BTW: I had not had a chance to check out this plugin as of yet. The version that comes with 3538i is the first chance I have had to even look at at. I just thought that I would say that it looks nice. I look forward to trying it out.
Russ is offline   Reply With Quote
Old Aug 16, 2005, 01:26 PM   #5
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

mixy 4x2 v021

- compiled now for 3538i

u can get it here
http://www.geocities.com/picacioiu/
direct link is
http://www.geocities.com/picacioiu/m...v021_3538i.bin

cya

ps. i am trying to use the method i've seen in info plugin for mixy edit boxes (saving strings), if anyone can help with a short explanation of how is info string saving working i apreciate that alot,
thnx

Last edited by townkat; Aug 16, 2005 at 02:05 PM.
townkat is offline   Reply With Quote
Old Aug 16, 2005, 02:51 PM   #6
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

Hmm, I get the "invalid plugin libary" error when trying to register the new 3538i version.
Russ is offline   Reply With Quote
Old Aug 16, 2005, 03:12 PM   #7
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

try now, it was an upload problem, the file was 1kb only
townkat is offline   Reply With Quote
Old Aug 16, 2005, 03:21 PM   #8
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

Ok, that worked.
Russ is offline   Reply With Quote
Old Aug 16, 2005, 03:30 PM   #9
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

glad to hear that and sorry for the problem

cya
townkat is offline   Reply With Quote
Old Aug 16, 2005, 03:43 PM   #10
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

As for the string thing:
The save_plugin_settings and load_plugin_settings functions are called whenever the plugin is loaded or saved, etc. A kSettings object is passed by reference through the function for you to use.
You need only to specify where in the registry to save (use the plugin name for global plugin settings, or use pgm_id for per plugin (i.e. per instance) settings), the name of the value, and the string itself.

The info plugin's source code pretty much shows you exactly how to do it.
i.e.
cfg.write(section,"info_text",str_param);

In the above, "cfg" is the kSettings object from the load/save function's parameters.
"section" is where in the registry (under HKEY_CURRENT_USER\Software\kX) the value will be saved to (the info plugin uses the pgm_id to save settings on a per plugin basis).
The "info_text" is the name of the key/value.
str_param is the char[] that contains your string.

To save multiple strings, you would use the same section, but change the other 2 parameters to represent the name value and the string value, etc.

Does this help?

Last edited by Russ; Aug 16, 2005 at 04:14 PM. Reason: typo
Russ is offline   Reply With Quote
Old Aug 16, 2005, 06:50 PM   #11
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

when i try to add this:
virtual int save_plugin_settings(kSettings &);
in my mixy.h i get the folowing error

Creating library Debug/demo.lib and object Debug/demo.exp
simple.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall iMixyPlugin::save_plugin_settings(class kSettings &)" (?save_plugin_settings@iMixyPlugin@@UAEHAAVkSettin gs@@@Z)
Debug/demo.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

i mention that my programming skills are some low,
thnx
townkat is offline   Reply With Quote
Old Aug 16, 2005, 08:08 PM   #12
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

...using the 3538i SDK?

It sounds like you forgot to add the implementation of the function(s) to mixy.cpp.

i.e.
Code:
// add the following to the iMixyPlugin class definition in mixy.h
/*----------------------------------------------------*/
virtual int save_plugin_settings(kSettings &);
virtual int load_plugin_settings(kSettings &);
/*----------------------------------------------------*/

// add the following to mixy.cpp
/*----------------------------------------------------*/
int iMixyPlugin::save_plugin_settings(kSettings &cfg)
{
	// add your save code here
	return 0;
}

int iMixyPlugin::load_plugin_settings(kSettings &cfg)
{
	// add your load code here
	return 0;
}
/*----------------------------------------------------*/
Russ is offline   Reply With Quote
Old Aug 17, 2005, 02:20 AM   #13
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

that works, i am stuck here now

i have 5 edit boxes named edit[5]

int iMixyPlugin::save_plugin_settings(kSettings &cfg)
{

if(pgm_id>0)
{
char key_name[32];
char kname[10];
CString chnames;
sprintf(key_name,"pgm_%d",pgm_id);

for (int i=0; i<5; i++)
{
plugin->edit[i]->GetWindowText(chnames);
}

plugin->edit[i]->GetWindowText(chnames); does not work anymore,
i had this line in void iMixyPluginDlg::on_destroy() and it was workin,
i also tryed with edit[i]->GetWindowText(chnames); and same problem

thnx

Last edited by townkat; Aug 17, 2005 at 02:44 AM.
townkat is offline   Reply With Quote
Old Aug 17, 2005, 05:06 AM   #14
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

ok, its almost done now

is there any way to use edit[i]->GetWindowText(
in
int iMixyPlugin::save_plugin_settings(;
?

i am using now
ON_CONTROL(EN_UPDATE,MIXY_PLG_EDIT,
and i create edit boxes with MIXY_PLG_EDIT parameter but this disadvantage me because i want to create edit boxes in a for loop and MIXY_PLG_EDIT[5] array is not posible

thnx
townkat is offline   Reply With Quote
Old Aug 17, 2005, 07:01 AM   #15
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: from the edge of the deep green sea
Posts: 2,207
Max M. is on a distinguished road

i suppose you have declared edit[5] as a member of iMixyPluginDlg class and probaly as private member (and that's the right way).
So... the edits cannot be accessed from anywhere except iMixyPluginDlg itself.

>plugin->edit[i]->GetWindowText(chnames);

could not ever work since "plugin" is a pointer to iKXPlugin (the base of your iMixyPlugin class) and it does not even know what that "edit[?]" is. More over, "plugin" itself is not a member of iMixyPlugin (probably you mean "cp" instead)
....
Well, there're many ways to access iMixyPluginDlg's edit[i] from within iMixyPlugin
(like ((iMixyPluginDlg*) cp)->edit[i]->GetWindowText(...; // only if edit[] declared as public)
However more classical way could be something like:
1. implement some kind of "GetTextOfEdits(int i, char* text, ..) function in iMixyPluginDlg
2. get text with ((iMixyPluginDlg*) cp)->GetTextOfEdits(bla-bla-bla)
3. etc. (could be better)

I think you really need some C++ book (e.g. "classes, class members and class members access")

Last edited by Max M.; Aug 17, 2005 at 07:29 AM.
Max M. is offline   Reply With Quote
Old Aug 17, 2005, 07:13 AM   #16
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: from the edge of the deep green sea
Posts: 2,207
Max M. is on a distinguished road

ah, and btw. even that way i mentioned above is wrong. Plugin (iMixyPlugin) can receive load/save_plugin_settings when Plugin's Window (iMixyPluginDlg) does not exist at all, (user may never open it or it is already closed). So in most situations you cannot get the text of "edits" from within
save_plugin_settings because there're no "edits" at this moment.
(E.g. you need a differrent way to save that text. Probably something like: when text is changed, iMixyPluginDlg immediately lets iMixyPlugin to know that new text value, so that iMixyPlugin can store these strings on its own and save them at any time.... something like... just somewhat similar to plugin's "parameters" implementation)

Last edited by Max M.; Aug 17, 2005 at 07:27 AM.
Max M. is offline   Reply With Quote
Old Aug 17, 2005, 10:18 AM   #17
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

thnx max,

i have the folowing code now

void iMixyPluginDlg::editor_change(void)
{
CString tmp;

for (int i=0; i<5; i++)
{
edit[i]->GetWindowText(tmp);
strncpy(plugin->str_param[i],tmp,sizeof(plugin->str_param[i]));
}
}

something is wrong because i only have edit box 1 working, the rest do not load the saved data.
townkat is offline   Reply With Quote
Old Aug 17, 2005, 10:28 AM   #18
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

You would need seperate events for each Edit control, and seperate variables (or an array) to store the text from each edit control.

i.e.
Code:
BEGIN_MESSAGE_MAP(iMixyPluginDlg, CKXPluginGUI)
	// 1 for each edit control
	ON_CONTROL(EN_UPDATE, EDITCTRL1, edit1_changed)
	ON_CONTROL(EN_UPDATE, EDITCTRL2, edit2_changed)
	ON_CONTROL(EN_UPDATE, EDITCTRL3, edit3_changed)
	ON_CONTROL(EN_UPDATE, EDITCTRL4, edit4_changed)
	ON_CONTROL(EN_UPDATE, EDITCTRL5, edit5_changed)
END_MESSAGE_MAP()

void iMixyPluginDlg::edit1_changed(void)
{
	CString tmp;	
	edit[0]->GetWindowText(tmp);
	strncpy(plugin->str_param[0],tmp,sizeof(plugin->str_param[0]));
}

void iMixyPluginDlg::edit2_changed(void)
{
	CString tmp;	
	edit[1]->GetWindowText(tmp);
	strncpy(plugin->str_param[1],tmp,sizeof(plugin->str_param[1]));
}

// etc, and str_param would have to be an array to hold 5 char[256] elements
Additionally, you do not need to get the text from all the edit controls, only the one that changed, so you do not need the loops (i changed the above code to reflect that).

Last edited by Russ; Aug 17, 2005 at 10:52 AM.
Russ is offline   Reply With Quote
Old Aug 17, 2005, 10:53 AM   #19
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

iuhuu,

Thnx alot Russ and Max M.,

mixy 4x2 v022

- edit boxes behaviour improved, now saving with dsp setings save.

u can get it here
http://www.geocities.com/picacioiu/
direct link is
http://www.geocities.com/picacioiu/m...v022_3538i.bin (rename to .kxl)

i belive thats all i can do with edit boxes behaviour, i would also like to be able to save the strings to presets , if anyone have idea how to do that let me know pls.
townkat is offline   Reply With Quote
Old Aug 17, 2005, 10:56 AM   #20
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

look at the time of your edit russ and my post , i understanded the idea before your edit but the example is great anyway

thnx again,

cya
townkat is offline   Reply With Quote
Old Aug 17, 2005, 11:14 AM   #21
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

I Just gave it a quick test, and it works good

As for saving strings with presets, I cannot think of anyway to do it at the moment. You could use a similar method as above, only saving the preset text using the plugin name instead of pgm_id, but unfortunatly there is no virtual function for saving the presets where you could do such a thing.
Russ is offline   Reply With Quote
Old Aug 17, 2005, 11:29 AM   #22
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

its just stranged that they are now saving when u save dsp setings..

thnx for testing

cya
townkat is offline   Reply With Quote
Old Aug 17, 2005, 11:41 AM   #23
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

Quote:
Originally Posted by townkat
its just stranged that they are now saving when u save dsp setings..
I am not sure what you mean. That is what it is supposed to do (i.e. it is the reason for those functions). When you quit kX Mixer/restart the computer/save a config, you would want it to remember your settings (including your labels), right?
Russ is offline   Reply With Quote
Old Aug 17, 2005, 01:14 PM   #24
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: from the edge of the deep green sea
Posts: 2,207
Max M. is on a distinguished road

>You would need seperate events for each Edit control
>...

btw., that can be probably hacked with ON_CONTROL_RANGE
Code:
BEGIN_MESSAGE_MAP(iMixyPluginDlg, CKXPluginGUI)
	// 1 for all edit controls
	ON_CONTROL_RANGE(EN_UPDATE, EDITCTRL1, EDITCTRL5, edit_changed)
END_MESSAGE_MAP()

// it could be only one! ;)
void iMixyPluginDlg::edit_changed(UINT nID)
{
	CString tmp;
	UINT i = nID - EDITCTRL1;
	edit[i]->GetWindowText(tmp);
	strncpy(plugin->str_param[i], tmp, sizeof(plugin->str_param[i]));
}

// i've not checked it though...
Max M. is offline   Reply With Quote
Old Aug 17, 2005, 03:54 PM   #25
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

thnx max , plugin crashes if i use that method

russ

kx dsp window have in its right up corner two butons, 1 for load settings, and one for save setting. If i change the content of mixy edit boxes and i save with that button and then i clear the dsp wondow and i load the saved settings the data is back ok. So the edit box data can be saved with save setting but not with presets.

cya
townkat is offline   Reply With Quote
Old Aug 17, 2005, 04:14 PM   #26
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

Quote:
Originally Posted by townkat
kx dsp window have in its right up corner two butons, 1 for load settings, and one for save setting. If i change the content of mixy edit boxes and i save with that button and then i clear the dsp wondow and i load the saved settings the data is back ok. So the edit box data can be saved with save setting but not with presets.
Right, that is the purpose of those functions. The same thing happens if you quit kX Mixer, the settings get auto-saved to the registry, and loaded the next time kX Mixer is started.

Presets are a different thing, and as I stated previously, I do not know of any way (at least not any simple way... you could always ditch the whole kX preset thing and create your own) to store strings with presets.
Russ is offline   Reply With Quote
Old Aug 17, 2005, 04:20 PM   #27
DriverHeaven Lover
 
Join Date: Sep 2003
Location: Romania
Posts: 123
townkat is on a distinguished road

ok, i totaly agree
thnx again
townkat is offline   Reply With Quote
Old Aug 17, 2005, 05:47 PM   #28
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,104
Russ has a spectacular aura aboutRuss has a spectacular aura aboutRuss has a spectacular aura about

I can think of a hack way to store the string with the preset (aside from making your own). If you limit the max text to a "x" number of characters, and then create a "x" number of dummy parameters for each edit control, you can store each character as an integer (by it's unicode value or whatever). It would definitley be a hack, but it should work.
Russ is offline   Reply With Quote
</