hi all
1. How to test user module in visual c++? how to trace variables etc ... I never work with dll's... its impossible to make module testing it like this: compile, copy to usine, restart usine, test in patch just to look at one variable state.
2. how to send data to ArrayOut?
for (i = 0; i < 8; i++) {
pPrototype->PArrayOut->DATA = tab;
}
it's good way to do that? it's not work ....
testing module
-
martignasse
- Site Admin
- Posts: 611
- Location: Lyon, FRANCE
- Contact:
Hi nelson
Normally, compile, copy to usine, restart usine should let you see your module and use it. After that, the simplest way to trace values is to look what you have on the module pin. For intermediate or internal values, module with panel who write the concerned value seems to be the way.
You're nearly good (assuming you do this in the Process methode), but did you tell usine the length of the pArrayOut array, like this ?
tested and working for me, tell me if you want i upload an example project on the wiki.
a+
What do you mean by 'to test user module' ?nelson wrote:1. How to test user module in visual c++? how to trace variables etc ... I never work with dll's... its impossible to make module testing it like this: compile, copy to usine, restart usine, test in patch just to look at one variable state.
Normally, compile, copy to usine, restart usine should let you see your module and use it. After that, the simplest way to trace values is to look what you have on the module pin. For intermediate or internal values, module with panel who write the concerned value seems to be the way.
2. how to send data to ArrayOut?
for (i = 0; i < 8; i++) {
pPrototype->PArrayOut->DATA = tab;
}
it's good way to do that? it's not work ....
You're nearly good (assuming you do this in the Process methode), but did you tell usine the length of the pArrayOut array, like this ?
Code: Select all
void Process (void* pModule) {
// make convenient pointer to the module
TArrayTest* pArrayTest = ((TArrayTest*)pModule);
// used for loop
int i;
// test to fill the array
pArrayTest->PArrayOut->len = 8;
for (i = 0; i < pArrayTest->PArrayOut->len; i++) {
pArrayTest->PArrayOut->DATA[i] = i;
}
}a+
Martin FLEURENT - Usine Developer - SDK maintainer
-
LevraiBernardo
- Site Admin
- Posts: 110
- Contact:
To test a value, here is the way I do :
#include <sstream>
then, in the function, create a stream string and a string formatting the message :
std::ostringstream Oss;
std::string msg;
Go on filling the stream with a message containing the var value, then make it a string :
Oss << "m_var value :" << m_var;
msg = Oss.str();
To finish, show a modal window with the message :
MessageBox(NULL,msg.data(), TEXT("Title of the window"), MB_OK );
(One window can contain several values : Oss << "m_var1 value :" << m_var1 << "m_var2 value :" << m_var2 ... No matter the var type this way.)
#include <sstream>
then, in the function, create a stream string and a string formatting the message :
std::ostringstream Oss;
std::string msg;
Go on filling the stream with a message containing the var value, then make it a string :
Oss << "m_var value :" << m_var;
msg = Oss.str();
To finish, show a modal window with the message :
MessageBox(NULL,msg.data(), TEXT("Title of the window"), MB_OK );
(One window can contain several values : Oss << "m_var1 value :" << m_var1 << "m_var2 value :" << m_var2 ... No matter the var type this way.)
-
martignasse
- Site Admin
- Posts: 611
- Location: Lyon, FRANCE
- Contact:
hi LevraiBernardo,
and thanks for the trick,
You can also debug your module with some VC++ breakpoints.
Short version :
To do that, there is some infos to add to the Project properties panel.
in 'Configuration properties->debug->command ' add the path to the UsineMain.exe (not the Usine.exe, but UsineMain.exe)
example : 'E:AudioUsine Pro StandAlone 4.22dFilesUsineMain.exe'
and in the 'build event->Post-build event->command line' add a shell command to copy the generated .usr file in the usine folder
example : 'xcopy /e /i /y "$(OutDir)$(ProjectName)_D.usr" "E:AudioUsine Pro StandAlone 4.22dFilesModulesUserExamples"'
like that, when you start debug your module (F5), VC++ automatically copy it in the usine module folder and start usine.
make sure usine has the autoload option to on in the setup panel, and make a workspace that use your module, save it.
and if you place breakpoint in your module code, you can inspect the code execution at runtime.
to finish the debug session, simply close usine and you are back in VC++
PS : I began a wiki page on this chapter
http://www.sensomusic.com/wiki/doku.php?id=sdk:cpp_area:how_to:debug
and thanks for the trick,
just to let you know, next version will have trace functions to write directly in the usine console.To finish, show a modal window with the message :
MessageBox(NULL,msg.data(), TEXT("Title of the window"), MB_OK );
You can also debug your module with some VC++ breakpoints.
Short version :
To do that, there is some infos to add to the Project properties panel.
in 'Configuration properties->debug->command ' add the path to the UsineMain.exe (not the Usine.exe, but UsineMain.exe)
example : 'E:AudioUsine Pro StandAlone 4.22dFilesUsineMain.exe'
and in the 'build event->Post-build event->command line' add a shell command to copy the generated .usr file in the usine folder
example : 'xcopy /e /i /y "$(OutDir)$(ProjectName)_D.usr" "E:AudioUsine Pro StandAlone 4.22dFilesModulesUserExamples"'
like that, when you start debug your module (F5), VC++ automatically copy it in the usine module folder and start usine.
make sure usine has the autoload option to on in the setup panel, and make a workspace that use your module, save it.
and if you place breakpoint in your module code, you can inspect the code execution at runtime.
to finish the debug session, simply close usine and you are back in VC++
PS : I began a wiki page on this chapter
http://www.sensomusic.com/wiki/doku.php?id=sdk:cpp_area:how_to:debug
Martin FLEURENT - Usine Developer - SDK maintainer
-
LevraiBernardo
- Site Admin
- Posts: 110
- Contact:
Yeah !
It works great, and it's much more efficient than my "french" cooking.
Thanx a lot, Mister Tignasse.
See you !
It works great, and it's much more efficient than my "french" cooking.
Thanx a lot, Mister Tignasse.
See you !
-
martignasse
- Site Admin
- Posts: 611
- Location: Lyon, FRANCE
- Contact:
well, thanks to Senso, has he give me the trick 
Martin FLEURENT - Usine Developer - SDK maintainer
Who is online
Users browsing this forum: No registered users and 59 guests
