Coder Social home page Coder Social logo

Issues with mc2 mixer about ember-plus-sharp HOT 2 CLOSED

vashat avatar vashat commented on July 28, 2024
Issues with mc2 mixer

from ember-plus-sharp.

Comments (2)

vashat avatar vashat commented on July 28, 2024

Here's some test code I'm using to retrieve part of the tree statically:

`using System;
using System.Linq;
using System.Net.Sockets;
using System.Threading.Tasks;
using Lawo.EmberPlusSharp.Model;
using Lawo.EmberPlusSharp.S101;
using Lawo.Threading.Tasks;

internal class EmberTalk
{
public EmberTalk()
{
}

private static async Task<S101Client> ConnectAsync(string host, int port)
{
    // Create TCP connection
    var tcpClient = new TcpClient();
    await tcpClient.ConnectAsync(host, port);

    // Establish S101 protocol
    // S101 provides message packaging, CRC integrity checks and a keep-alive mechanism.
    var stream = tcpClient.GetStream();
    return new S101Client(tcpClient, stream.ReadAsync, stream.WriteAsync);
}

private static void WriteChildren(INode node, int depth)
{
    var indent = new string(' ', 2 * depth);

    foreach (var child in node.Children)
    {
        var childNode = child as INode;

        if (childNode != null)
        {
            Console.WriteLine("{0}Node {1}", indent, child.Identifier);
            WriteChildren(childNode, depth + 1);
        }
        else
        {
            var childParameter = child as IParameter;

            if (childParameter != null)
            {
                Console.WriteLine("{0}Parameter {1}: {2}", indent, child.Identifier, childParameter.Value);
            }
        }
    }
}

private sealed class McRoot : Root<McRoot>
{
    internal Mc Mc { get; private set; }
}

private sealed class Mc : FieldNode<Mc>
{
    internal Channels Channels { get; private set; }
}


private sealed class Channels : FieldNode<Channels>
{
    internal Inputs Inputs { get; private set; }
}

private sealed class Inputs : FieldNode<Inputs>
{
    [Element(Identifier = "VB 1")]
    internal Inputs vb1 { get; private set; }
}

private static void Main()
{
    AsyncPump.Run(
        async () =>
        {
            using (var client = await ConnectAsync("10.12.28.150", 9000))
            using (var consumer = await Consumer<McRoot>.CreateAsync(client))
            {

                WriteChildren(consumer.Root, 0);
            }
        });
}

}`

from ember-plus-sharp.

vashat avatar vashat commented on July 28, 2024

Nevermind I solved it, I had to use the correct identifiers to make it work like this:

` private sealed class McRoot : Root
{
[Element(Identifier = "_2")]
internal Channels Channels { get; private set; }
}

private sealed class Channels : FieldNode<Channels>
{
    [Element(Identifier = "_1")]
    internal Inputs Inputs { get; private set; }
}

private sealed class Inputs : FieldNode<Inputs>
{
    [Element(Identifier = "_1")]
    internal VB1 VB1 { get; private set; }
}

private sealed class VB1 : FieldNode<VB1>
{
    [Element(Identifier = "_400016b0")]
    internal Fader Fader { get; private set; }
}

private sealed class Fader : FieldNode<Fader>
{
    [Element(Identifier = "_400016b1")]
    internal IntegerParameter FaderLevel { get; private set; }
}

`
However getting the whole tree dynamically still doesn't work, but for my application statically is sufficient. So I'm closing this issue.

from ember-plus-sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.