Update of /cvsroot/pure-data/externals/clr/Counter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29449/clr/Counter
Modified Files: Counter.cs Counter.csproj Log Message: implemented class-based method management very fast native-to-managed transition most of the logic transferred to the CLR side
Index: Counter.csproj =================================================================== RCS file: /cvsroot/pure-data/externals/clr/Counter/Counter.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Counter.csproj 7 Mar 2006 13:18:31 -0000 1.1 --- Counter.csproj 18 Apr 2006 01:38:07 -0000 1.2 *************** *** 1,105 **** ! <VisualStudioProject> ! <CSHARP ! ProjectType = "Local" ! ProductVersion = "7.10.3077" ! SchemaVersion = "2.0" ! ProjectGuid = "{8CFEFB15-2A72-45B5-BC99-3BAFFB2B27C3}" ! > ! <Build> ! <Settings ! ApplicationIcon = "" ! AssemblyKeyContainerName = "" ! AssemblyName = "Counter" ! AssemblyOriginatorKeyFile = "" ! DefaultClientScript = "JScript" ! DefaultHTMLPageLayout = "Grid" ! DefaultTargetSchema = "IE50" ! DelaySign = "false" ! OutputType = "Library" ! PreBuildEvent = "" ! PostBuildEvent = "" ! RootNamespace = "Counter" ! 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 = "Counter.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! </Include> ! </Files> ! </CSHARP> ! </VisualStudioProject> ! --- 1,107 ---- ! <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> ! <PropertyGroup> ! <ProjectType>Local</ProjectType> ! <ProductVersion>8.0.50727</ProductVersion> ! <SchemaVersion>2.0</SchemaVersion> ! <ProjectGuid>{8CFEFB15-2A72-45B5-BC99-3BAFFB2B27C3}</ProjectGuid> ! <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> ! <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> ! <ApplicationIcon> ! </ApplicationIcon> ! <AssemblyKeyContainerName> ! </AssemblyKeyContainerName> ! <AssemblyName>Counter</AssemblyName> ! <AssemblyOriginatorKeyFile> ! </AssemblyOriginatorKeyFile> ! <DefaultClientScript>JScript</DefaultClientScript> ! <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> ! <DefaultTargetSchema>IE50</DefaultTargetSchema> ! <DelaySign>false</DelaySign> ! <OutputType>Library</OutputType> ! <RootNamespace>Counter</RootNamespace> ! <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> ! <StartupObject> ! </StartupObject> ! <FileUpgradeFlags> ! </FileUpgradeFlags> ! <UpgradeBackupLocation> ! </UpgradeBackupLocation> ! </PropertyGroup> ! <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> ! <OutputPath>bin\Debug</OutputPath> ! <AllowUnsafeBlocks>false</AllowUnsafeBlocks> ! <BaseAddress>285212672</BaseAddress> ! <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> ! <ConfigurationOverrideFile> ! </ConfigurationOverrideFile> ! <DefineConstants>DEBUG;TRACE</DefineConstants> ! <DocumentationFile> ! </DocumentationFile> ! <DebugSymbols>true</DebugSymbols> ! <FileAlignment>4096</FileAlignment> ! <NoStdLib>false</NoStdLib> ! <NoWarn> ! </NoWarn> ! <Optimize>false</Optimize> ! <RegisterForComInterop>false</RegisterForComInterop> ! <RemoveIntegerChecks>false</RemoveIntegerChecks> ! <TreatWarningsAsErrors>false</TreatWarningsAsErrors> ! <WarningLevel>4</WarningLevel> ! <DebugType>full</DebugType> ! <ErrorReport>prompt</ErrorReport> ! </PropertyGroup> ! <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> ! <OutputPath>bin\Debug</OutputPath> ! <AllowUnsafeBlocks>false</AllowUnsafeBlocks> ! <BaseAddress>285212672</BaseAddress> ! <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> ! <ConfigurationOverrideFile> ! </ConfigurationOverrideFile> ! <DefineConstants>DEBUG;TRACE</DefineConstants> ! <DocumentationFile> ! </DocumentationFile> ! <DebugSymbols>false</DebugSymbols> ! <FileAlignment>4096</FileAlignment> ! <NoStdLib>false</NoStdLib> ! <NoWarn> ! </NoWarn> ! <Optimize>true</Optimize> ! <RegisterForComInterop>false</RegisterForComInterop> ! <RemoveIntegerChecks>false</RemoveIntegerChecks> ! <TreatWarningsAsErrors>false</TreatWarningsAsErrors> ! <WarningLevel>4</WarningLevel> ! <DebugType>none</DebugType> ! <ErrorReport>prompt</ErrorReport> ! </PropertyGroup> ! <ItemGroup> ! <Reference Include="System"> ! <Name>System</Name> ! </Reference> ! <Reference Include="System.Data"> ! <Name>System.Data</Name> ! </Reference> ! <Reference Include="System.XML"> ! <Name>System.XML</Name> ! </Reference> ! <ProjectReference Include="..\PureData\PureData.csproj"> ! <Name>PureData</Name> ! <Project>{0015D5E7-B0FB-4F06-B334-225447D1F992}</Project> ! <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> ! </ProjectReference> ! </ItemGroup> ! <ItemGroup> ! <Compile Include="AssemblyInfo.cs"> ! <SubType>Code</SubType> ! </Compile> ! <Compile Include="Counter.cs"> ! <SubType>Code</SubType> ! </Compile> ! </ItemGroup> ! <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> ! <PropertyGroup> ! <PreBuildEvent> ! </PreBuildEvent> ! <PostBuildEvent> ! </PostBuildEvent> ! </PropertyGroup> ! </Project> \ No newline at end of file
Index: Counter.cs =================================================================== RCS file: /cvsroot/pure-data/externals/clr/Counter/Counter.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Counter.cs 9 Mar 2006 14:34:33 -0000 1.6 --- Counter.cs 18 Apr 2006 01:38:07 -0000 1.7 *************** *** 1,3 **** --- 1,4 ---- using System; + using PureData;
/// <summary> *************** *** 5,21 **** /// </summary> public class Counter: ! PureData.External { int i_count,i_down,i_up; float step;
! public Counter(PureData.AtomList args) { ! this.step = args.Count >= 3?(float)args[2]:1;
! float f2 = args.Count >= 2?(float)args[1]:0; ! float f1 = args.Count >= 1?(float)args[0]:0;
! if(args.Count < 2) f2 = f1;
this.i_down = (int)((f1<f2)?f1:f2); --- 6,24 ---- /// </summary> public class Counter: ! External { int i_count,i_down,i_up; float step;
! public Counter() { } ! ! public Counter(Atom[] args) { ! this.step = args.Length >= 3?(float)args[2]:1;
! float f2 = args.Length >= 2?(float)args[1]:0; ! float f1 = args.Length >= 1?(float)args[0]:0;
! if(args.Length < 2) f2 = f1;
this.i_down = (int)((f1<f2)?f1:f2); *************** *** 24,28 **** this.i_count = this.i_down;
! AddInlet(_list,new PureData.Symbol("bound")); AddInlet(ref step);
--- 27,31 ---- this.i_count = this.i_down;
! AddInlet(_list,new Symbol("bound")); AddInlet(ref step);
*************** *** 34,45 **** private static void Setup(Counter obj) { ! AddMethod(0,new Method(obj.Bang)); ! AddMethod(0,"reset",new Method(obj.Reset)); ! AddMethod(0,"set",new MethodFloat(obj.Set)); ! AddMethod(0,"bound",new MethodList(obj.Bound)); }
protected void Bang() { float f = this.i_count; int step = (int)this.step; --- 37,49 ---- private static void Setup(Counter obj) { ! AddMethod(obj.Bang); ! AddMethod(0,"reset",obj.Reset); ! AddMethod(0,"set",obj.Set); ! AddMethod(0,"bound",obj.Bound); }
protected void Bang() { + float f = this.i_count; int step = (int)this.step; *************** *** 57,61 **** }
! Outlet(0,f); }
--- 61,65 ---- }
! Outlet(0,f); }
*************** *** 70,74 **** }
! protected void Bound(PureData.AtomList args) { float f1 = (float)args[0]; --- 74,78 ---- }
! protected void Bound(Atom[] args) { float f1 = (float)args[0]; *************** *** 78,81 **** this.i_up = (int)((f1>f2)?f1:f2); } - } --- 82,84 ----