diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2006-03-09 14:34:33 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2006-03-09 14:34:33 +0000 |
commit | 450b54a7c21f1e7fa98249fe6b3ac4c98966f163 (patch) | |
tree | cf8cc4abbe85bc0285f957472cd5d59c5d0a9a3e /test | |
parent | 16aa9b1f769721380ce6dca3e52fa65bf92e84ad (diff) |
adapted to PD version 0.40
better handler flexibility and argument checking
added Zmolnigs counter example
svn path=/trunk/externals/clr/; revision=4663
Diffstat (limited to 'test')
-rw-r--r-- | test/AssemblyInfo.cs | 58 | ||||
-rw-r--r-- | test/test-help.pd | 59 | ||||
-rw-r--r-- | test/test.cs | 93 | ||||
-rw-r--r-- | test/test.csproj | 105 |
4 files changed, 315 insertions, 0 deletions
diff --git a/test/AssemblyInfo.cs b/test/AssemblyInfo.cs new file mode 100644 index 0000000..8783853 --- /dev/null +++ b/test/AssemblyInfo.cs @@ -0,0 +1,58 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// Allgemeine Informationen über eine Assembly werden über folgende Attribute +// gesteuert. Ändern Sie diese Attributswerte, um die Informationen zu modifizieren, +// die mit einer Assembly verknüpft sind. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Versionsinformationen für eine Assembly bestehen aus folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte oder die standardmäßige Revision und Buildnummer +// mit '*' angeben: + +[assembly: AssemblyVersion("1.0.*")] + +// +// Um die Assembly zu signieren, müssen Sie einen Schlüssel angeben. Weitere Informationen +// über die Assemblysignierung finden Sie in der Microsoft .NET Framework-Dokumentation. +// +// Mit den folgenden Attributen können Sie festlegen, welcher Schlüssel für die Signierung verwendet wird. +// +// Hinweise: +// (*) Wenn kein Schlüssel angegeben ist, wird die Assembly nicht signiert. +// (*) KeyName verweist auf einen Schlüssel, der im CSP (Crypto Service +// Provider) auf Ihrem Computer installiert wurde. KeyFile verweist auf eine Datei, die einen +// Schlüssel enthält. +// (*) Wenn die Werte für KeyFile und KeyName angegeben werden, +// werden folgende Vorgänge ausgeführt: +// (1) Wenn KeyName im CSP gefunden wird, wird dieser Schlüssel verwendet. +// (2) Wenn KeyName nicht vorhanden ist und KeyFile vorhanden ist, +// wird der Schlüssel in KeyFile im CSP installiert und verwendet. +// (*) Um eine KeyFile zu erstellen, können Sie das Programm sn.exe (Strong Name) verwenden. +// Wenn KeyFile angegeben wird, muss der Pfad von KeyFile +// relativ zum Projektausgabeverzeichnis sein: +// %Project Directory%\obj\<configuration>. Wenn sich KeyFile z.B. +// im Projektverzeichnis befindet, geben Sie das AssemblyKeyFile-Attribut +// wie folgt an: [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Das verzögern der Signierung ist eine erweiterte Option. Weitere Informationen finden Sie in der +// Microsoft .NET Framework-Dokumentation. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/test/test-help.pd b/test/test-help.pd new file mode 100644 index 0000000..ca7d7eb --- /dev/null +++ b/test/test-help.pd @@ -0,0 +1,59 @@ +#N canvas 617 153 850 617 12; +#X floatatom 125 51 5 0 0 0 - - -; +#X symbolatom 320 81 10 0 0 0 - - -; +#X msg 536 45 msg one 2 three; +#X obj 22 24 loadbang; +#X floatatom 213 26 5 0 0 0 - - -; +#X msg 213 52 1 \$1 3; +#X msg 318 14 symbol abc; +#X msg 328 42 symbol d3f; +#X obj 21 54 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 535 82 set 1 7 8; +#X msg 533 135 list; +#X msg 532 164 list 1; +#X msg 533 193 list abc; +#X msg 528 251 list s e c o n d; +#X obj 152 495 print OUT; +#X floatatom 530 321 5 0 0 0 - - -; +#X floatatom 229 112 5 0 0 0 - - -; +#X msg 228 136 send \$1 b c; +#X obj 407 497 print RECV1; +#X obj 406 463 r receiver; +#X obj 554 465 r receiver2; +#X obj 555 499 print RECV2; +#X floatatom 526 362 5 0 0 0 - - -; +#X symbolatom 578 364 10 0 0 0 - - -; +#X text 585 318 passive - bang to see; +#X text 676 366 active; +#X msg 526 386 1 2 3; +#X floatatom 528 275 5 0 0 0 - - -; +#X msg 589 386 turalu; +#X msg 578 274 heyho; +#X obj 151 443 test a b 5; +#X connect 0 0 30 0; +#X connect 1 0 30 0; +#X connect 2 0 30 0; +#X connect 3 0 8 0; +#X connect 4 0 5 0; +#X connect 5 0 30 0; +#X connect 6 0 1 0; +#X connect 7 0 1 0; +#X connect 8 0 30 0; +#X connect 9 0 30 0; +#X connect 10 0 30 0; +#X connect 11 0 30 0; +#X connect 12 0 30 0; +#X connect 13 0 30 1; +#X connect 15 0 30 2; +#X connect 16 0 17 0; +#X connect 17 0 30 0; +#X connect 19 0 18 0; +#X connect 20 0 21 0; +#X connect 22 0 30 3; +#X connect 23 0 30 3; +#X connect 26 0 30 3; +#X connect 27 0 30 1; +#X connect 28 0 30 3; +#X connect 29 0 30 1; +#X connect 30 0 14 0; diff --git a/test/test.cs b/test/test.cs new file mode 100644 index 0000000..cfde7c6 --- /dev/null +++ b/test/test.cs @@ -0,0 +1,93 @@ +using System; + +public class test: + PureData.External +{ + PureData.Atom[] args; + + float farg; + + public test(PureData.AtomList args) + { + Post("Test.ctor "+args.ToString()); + + // that's the way to store args (don't just copy an AtomList instance!!) + this.args = (PureData.Atom[])args; + + // AddInlet(s_list,new PureData.Symbol("list2")); + AddInlet(); + AddInlet(ref farg); + AddInlet(); + AddOutletBang(); + } + + // this function MUST exist + // returns void or ClassType + private static ClassType Setup(test obj) + { + AddMethod(0,new Method(obj.MyBang)); + AddMethod(0,new MethodFloat(obj.MyFloat)); + AddMethod(0,new MethodSymbol(obj.MySymbol)); + AddMethod(0,new MethodList(obj.MyList)); + AddMethod(0,"set",new MethodAnything(obj.MySet)); + AddMethod(0,"send",new MethodAnything(obj.MySend)); + AddMethod(0,new MethodAnything(obj.MyAnything)); + AddMethod(1,new MethodFloat(obj.MyFloat1)); + AddMethod(1,new MethodAnything(obj.MyAny1)); + + Post("Test.Main"); + return ClassType.Default; + } + + protected virtual void MyBang() + { + Post("Test-BANG "+farg.ToString()); + Outlet(0); + } + + protected virtual void MyFloat(float f) + { + Post("Test-FLOAT "+f.ToString()); + Outlet(0,f); + } + + protected virtual void MyFloat1(float f) + { + Post("Test-FLOAT1 "+f.ToString()); + } + + protected virtual void MyAny1(int ix,PureData.Symbol s,PureData.AtomList l) + { + Post(ix.ToString()+": Test-ANY1 "+l.ToString()); + } + + protected virtual void MySymbol(PureData.Symbol s) + { + Post("Test-SYMBOL "+s.ToString()); + Outlet(0,s); + } + + protected virtual void MyList(PureData.AtomList l) + { + Post("Test-LIST "+l.ToString()); + Outlet(0,l); + } + + protected virtual void MySet(int ix,PureData.Symbol s,PureData.AtomList l) + { + Post("Test-SET "+l.ToString()); + Outlet(0,new PureData.Symbol("set"),l); + } + + protected virtual void MySend(int ix,PureData.Symbol s,PureData.AtomList l) + { + Send(new PureData.Symbol("receiver"),l); + Send(new PureData.Symbol("receiver2"),(PureData.Atom[])l); + } + + protected virtual void MyAnything(int ix,PureData.Symbol s,PureData.AtomList l) + { + Post(ix.ToString()+": Test-("+s.ToString()+") "+l.ToString()); + Outlet(0,s,l); + } +} diff --git a/test/test.csproj b/test/test.csproj new file mode 100644 index 0000000..d4f4e7d --- /dev/null +++ b/test/test.csproj @@ -0,0 +1,105 @@ +<VisualStudioProject> + <CSHARP + ProjectType = "Local" + ProductVersion = "7.10.3077" + SchemaVersion = "2.0" + ProjectGuid = "{6CED2448-6407-4AF7-95B6-932D8118AF3D}" + > + <Build> + <Settings + ApplicationIcon = "" + AssemblyKeyContainerName = "" + AssemblyName = "Test" + AssemblyOriginatorKeyFile = "" + DefaultClientScript = "JScript" + DefaultHTMLPageLayout = "Grid" + DefaultTargetSchema = "IE50" + DelaySign = "false" + OutputType = "Library" + PreBuildEvent = "" + PostBuildEvent = "" + RootNamespace = "Test" + RunPostBuildEvent = "OnBuildSuccess" + StartupObject = "" + > + <Config + Name = "Debug" + AllowUnsafeBlocks = "false" + BaseAddress = "285212672" + CheckForOverflowUnderflow = "false" + ConfigurationOverrideFile = "" + DefineConstants = "DEBUG;TRACE" + DocumentationFile = "" + DebugSymbols = "true" + FileAlignment = "4096" + IncrementalBuild = "false" + NoStdLib = "false" + NoWarn = "" + Optimize = "false" + OutputPath = "bin\Debug\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "4" + /> + <Config + Name = "Release" + AllowUnsafeBlocks = "false" + BaseAddress = "285212672" + CheckForOverflowUnderflow = "false" + ConfigurationOverrideFile = "" + DefineConstants = "TRACE" + DocumentationFile = "" + DebugSymbols = "false" + FileAlignment = "4096" + IncrementalBuild = "false" + NoStdLib = "false" + NoWarn = "" + Optimize = "true" + OutputPath = "bin\Release\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "4" + /> + </Settings> + <References> + <Reference + Name = "System" + AssemblyName = "System" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" + /> + <Reference + Name = "System.Data" + AssemblyName = "System.Data" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" + /> + <Reference + Name = "System.XML" + AssemblyName = "System.XML" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" + /> + <Reference + Name = "PureData" + Project = "{0015D5E7-B0FB-4F06-B334-225447D1F992}" + Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" + /> + </References> + </Build> + <Files> + <Include> + <File + RelPath = "AssemblyInfo.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "test.cs" + SubType = "Code" + BuildAction = "Compile" + /> + </Include> + </Files> + </CSHARP> +</VisualStudioProject> + |