Old 06-01-2008, 02:30 PM   #1
hereander
Human being with feelings
 
Join Date: Mar 2008
Posts: 100
Default saving and restoring csurf parameters

Hi!
I've almost finished my mcu-mod with the "where-am-i"-display and some other improvements (from my p.o.v ) especially for bcf2000 in mackie mode. The problem I have now is that I don't understand the mechanism of saving and restoring parameters for an instance of the controlsurface. can anyone explain this?

as far as i get it the parameters are sequentially stored in a string:
char *initConfigString
they are stored like:
sprintf(tmp,"%d %d %d %d",offs,size,indev,outdev);
lstrcpyn((char *)lParam, tmp,wParam);
and they are restored with parseParms from the array parms[4]

this means that there are only 4 params, all int < 10.

How can I store my own stuff in there (like a DWORD, boolean or other int's > 9)? wherever I try to add something to the string or the array i get stack overflows at runtime. ´(Run-Time Check Failure #2 - Stack around the variable 'parms' was corrupted.)

I hope is this is not too confusing...
hereander is offline   Reply With Quote
Old 06-03-2008, 01:29 AM   #2
hereander
Human being with feelings
 
Join Date: Mar 2008
Posts: 100
Default

Seems to be all different now in the new SDK. It took me long time to think about a way to handle tracks with their states. All obsolete now... dunno if I will merge that with the new code. More pointers, new classes, much more object oriented.

EDIT: parseParms is still the same, there were only the new flags added. I still don't know how to put something >9 in there... any help?

Last edited by hereander; 06-03-2008 at 01:48 AM.
hereander is offline   Reply With Quote
Old 06-10-2009, 03:45 AM   #3
Klinke
Human being with feelings
 
Klinke's Avatar
 
Join Date: Jul 2008
Location: Berlin / Germany
Posts: 832
Default

About what "new SDK" are you talking? The page with the downloadable Mini-SDK still say that the last update was one year ago.

And i don't see a problem with putting numbers > 9 into the parameters, but when you add additional parameters you must increase the corresponding arrays of course (Your problem looks like you want to write something in parms with an index out of bounds).
Klinke is offline   Reply With Quote
Old 06-10-2009, 03:41 PM   #4
hereander
Human being with feelings
 
Join Date: Mar 2008
Posts: 100
Default

Quote:
Originally Posted by Klinke View Post
About what "new SDK" are you talking? The page with the downloadable Mini-SDK still say that the last update was one year ago.
oh, i guess i meant "new api" which would mean a new sdk COULD be necessary (if it wasnt backward compatible)
obviously there is no new sdk but as i couldnt get the old stuff to work with version 3 i thought i should wait for one. seems like it was just the problem with TimeMap_timeToBeats that needs to be replaced, like you described in another thread.

Last edited by hereander; 06-10-2009 at 03:43 PM.
hereander is offline   Reply With Quote
Old 06-15-2009, 03:02 PM   #5
hereander
Human being with feelings
 
Join Date: Mar 2008
Posts: 100
Default

btw...
I just found that there IS a new SDK (9.june 09) on landoleet. Just had a quick look. It has more project oriented stuff of the api exposed and some minor changes in the mcu code (for example). anybody tried this allready?
hereander is offline   Reply With Quote
Old 06-17-2009, 02:00 PM   #6
Klinke
Human being with feelings
 
Klinke's Avatar
 
Join Date: Jul 2008
Location: Berlin / Germany
Posts: 832
Default

Thank you for this hint.
Klinke is offline   Reply With Quote
Old 06-17-2009, 04:16 PM   #7
hereander
Human being with feelings
 
Join Date: Mar 2008
Posts: 100
Default

I just merged my old code with the new sdk and it seem like there's something different with the tracks behaviour.
In my old plugin, in an empty project, i could do

MediaTrack *t=CSurf_TrackFromID(0,g_csurf_mcpmode);
color = *(DWORD*)GetSetMediaTrackInfo(t,"I_CUSTOMCOLOR",NU LL);

now in reaper 3 the second line causes a memory access violation.

EDIT: My stupid mistake. The function was not imported at all. i forgot IMPAPI(GetSetMediaTrackInfo)
sorry...

Last edited by hereander; 06-20-2009 at 09:21 AM.
hereander is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:55 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.