Page 1 of 1
Posted: 27 Jun 2013, 01:05
by oli_lab
I have a go with the SDK
I am totally newbie in C++ and VSE2012 !
I have this error with VSE 1012 while trying to compile the template module:
1>UserModule.obj : error LNK2019: symbole externe non résolu "void __cdecl CreateModule(void * &,char *,int,struct MasterInfo *,char *)" (?CreateModule@@YAXAEAPEAXPEADHPEAUMasterInfo@@1@Z) référencé dans la fonction Create
1>....buildsVisualStudio2012DebugTemplateModuleTemplateModule.usr-win64 : fatal error LNK1120: 1 externes non résolus
that would be great to have a tiny module with one datafield input and one output for the newbies to tinker...
compare to the script module, the SDK is way to difficult to play without a strong knowledge of C++ !
cheers.
Olivar
details of the VSE install :
Microsoft Visual Studio Express 2012 pour Windows Desktop
Version 11.0.60315.01 Update 2
Microsoft .NET Framework
Version 4.5.50709
Version installée : Desktop Express
Team Explorer pour Visual Studio 2012 05695-004-0030004-02486
Microsoft Team Explorer pour Visual Studio 2012
Visual Basic 2012 05695-004-0030004-02486
Microsoft Visual Basic 2012
Visual C++ 2012 05695-004-0030004-02486
Microsoft Visual C++ 2012
Visual C# 2012 05695-004-0030004-02486
Microsoft Visual C# 2012
Gestionnaire de package NuGet 2.0.30717.9005
Gestionnaire de packages NuGet dans Visual Studio. Pour plus d'informations sur NuGet, consultez
http://docs.nuget.org/.
SQL Server Data Tools 11.1.20828.01
Microsoft SQL Server Data Tools
Posted: 27 Jun 2013, 10:38
by martignasse
oups, seems like i forgot to update a function in the template module project
in TemplateModule.cpp file, line 59, the CreateModule function miss a parameter at the end :
Code: Select all
void CreateModule (void* &pModule, AinsiCharPtr optionalString, LongBool Flag, MasterInfo* pMasterInfo)
should be
Code: Select all
void CreateModule (void* &pModule, AinsiCharPtr optionalString, LongBool Flag, MasterInfo* pMasterInfo, AinsiCharPtr optionalContent)
for some simple example module, you can look at DelayArray or RollArray, how have only three params.
but yes, a complete "hello world" template module with only 1 parameter is a good idea, in fact it's what i have planned, but time is....short !
i'll finish it, but you can do it as an exercise

there are just three simple modifs to do in the TemplateModule.cpp file :
line 97 : change the param number to 1
line 113 to 125 : replace the commented block by this
Code: Select all
// Add all parameters declared in the module class, example :
// m_txtfExample
case 0:
pParamInfo->ParamType = ptTextField;
pParamInfo->Caption = "text";
pParamInfo->TextValue = "hello world";
pParamInfo->IsInput = TRUE;
pParamInfo->IsOutput = TRUE;
break;
and line 133 to 139: replace the commented block by this (the m_txtfExample is a parameter pointer allready declared in the include file)
Code: Select all
// Initialyse all events adress declared in your module class, Example :
// m_txtfExample
case 0:
m_txtfExample = pEvent;
break;
with that, you should have a one textfield param module with caption set to "text" and text value set to "hello world"
from here, you can look in other module code to see how to replace the textfield by a datafield or a datafader
anyway, i'll post a corrected package today (where i'll replace the texfield by a datafield)
hope it help
Posted: 27 Jun 2013, 11:46
by oli_lab
Thanx a lot,
I know what I'll do tonight until late !
cheers
Posted: 27 Jun 2013, 11:49
by oli_lab
could'nt wait tonight ! its working fine now : the pandora's box is open !
Posted: 27 Jun 2013, 12:37
by martignasse
cool,
one important thing when trying to survive with all this c++ crap :
remember than apart from the language syntax and all the glue code, the sdk structure is very similar to what you do in an usine script
the 'essential' stuff
Code: Select all
moduleInfos :
description and infos about the module content and behavior
paramInfo :
some infos to define each params (paramIndex go from 0 to moduleInfo->NumberOfParams - 1)
setEventAdress :
for each params usine create, we store his handle for future use (paramIndex same as above)
callback :
when an action is performed to the param, we are informed here (paramIndex same as above)
possibly use some param handle to do some stuff
process :
executed in sync withe usine audio block (only if moduleInfo->DontProcess isn't set to FALSE)
possibly use some param handle to do some stuff
happy coding
Posted: 27 Jun 2013, 13:29
by bsork
Would it be a good idea to add a very simple example where all the stuff concerning graphics, mouse, chunks etc is removed?
Since the new script engine (so far) is rather slow, I reckon a lot of users would like to go the SDK route, but opening the template with all it's new stuff can be rather intimidating and confusing.
Posted: 27 Jun 2013, 13:46
by martignasse
yes, good idea, i know we have to make the transition from script as easy as possible
but the purpose of the template module is actually to prepare all these methods for the user.
so, maybe the solution is a hello world module, with the minimum to make a functional module able to replace a script module
Posted: 27 Jun 2013, 19:02
by oli_lab
yes, I vote for a ScriptDK !
an easy entry point to SDK for simple tasks !
Posted: 28 Jun 2013, 08:31
by bsork
BTW, while we're on the subject of simplifying things, I think it would be a good idea to split the header files up, moving all the stuff concerning device drivers and plugsins to separate files.
Posted: 28 Jun 2013, 10:09
by martignasse
bsork wrote:BTW, while we're on the subject of simplifying things, I think it would be a good idea to split the header files up, moving all the stuff concerning device drivers and plugsins to separate files.
can you elaborate please. i can't figure it
i vaguely see about separating the basic stuff from the very specific one, but what do you mean by 'split the header files up' ?
is it to split the UsineDefinitions.h into more than one file ?
or the UserModule.h ?
Posted: 28 Jun 2013, 11:26
by bsork
I'm at work and I don't remember what is where. I'll be more specific when I've had the time to look through the files.
Posted: 28 Jun 2013, 11:46
by oli_lab
Tada !
I think I understood few things thru trial and error, mostly errors...
here is my first user module :
incrementor
I plan to use it to interface manual square generators (aka rotary encoders) with Usine.
Posted: 28 Jun 2013, 18:21
by bsork
@martignasse:
I was thinking of separating out the stuff I guess is only of use for the special kinds of ModuleTypes like mtDeviceAudio and mtPluginLister, but maybe I've misunderstood what parts of the SDK can be used where and when.
Posted: 02 Jul 2013, 14:25
by martignasse
bsork wrote:I was thinking of separating out the stuff I guess is only of use for the special kinds of ModuleTypes like mtDeviceAudio and mtPluginLister, but maybe I've misunderstood what parts of the SDK can be used where and when.
ok, i see what you mean, but it's not really applicable (nightmare to maintain, consistency problems...)
the strong idea with the Hollyhock SDK is that the UserModuleBase object wrap all you need to make any kind of module and you pick what you need for your use case.
it's clearly a C++ object oriented approach and differ from what is done in plain C
but we have room for simplification and improvement

the next SDK release will have a basic template ready for simple modules (TemplateModuleSimple) in addition of the current one.
Posted: 03 Jul 2013, 15:43
by oli_lab
Oh ! I've done my assignment :
Hello World !
Cheers
olivar
Posted: 03 Jul 2013, 16:35
by martignasse
Congratulations
welcome in the SDK world
but be careful, if you love it, you'll see the "tentacular" side of it

Posted: 05 Jul 2013, 13:27
by nay-seven
@Oli_lab:
there's an old user module ( DisplayNumber.usr-win32) in the hollyhock version of your Incrementor add-on
Posted: 06 Jul 2013, 00:42
by oli_lab
fuzzy logic
Posted: 06 Jul 2013, 21:32
by oli_lab
@Nay : I updated the file.
Posted: 06 Jul 2013, 22:17
by nay-seven
ok, thanks Oli_Lab, i will test it