Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding combo box to a standary node #9

Open
laserdave opened this issue Jun 27, 2018 · 0 comments
Open

Adding combo box to a standary node #9

laserdave opened this issue Jun 27, 2018 · 0 comments

Comments

@laserdave
Copy link

Hi there,
thanks for sharing this great project. I am using it like you said as a signal routing patcher for an osc/midi/dmx system for our band. I have sucsessfully added and expanded to it. However I have a couple of issues and I need help. To make things easier I have taken your original code and made a very minor change but I still have the same issue. I made a minor change to the Serialise function to enable me to save .nds with filename, its now a void function and return commented out. If I add a modified module with a combo box save and reload the nds file the app dies in .also how to I access combo box ie read or write entry.

    public void Deserialize(byte[] data)
    {
        using (var br = new BinaryReader(new MemoryStream(data)))
        {
            var ident = br.ReadString();
        //unable to read past end of file


       //modified node added combo box
   [Node("Value", "Input", "Basic", "Allows to output a simple value.",false,false, typeof(ComboBox))]
    public void InputValue(float inValue, out float outValue)
    {
        outValue = inValue;
    }


    public void Serialize(string fn)
    {

        using (BinaryWriter bw = new BinaryWriter(File.Open(fn, FileMode.Create)))

        {
            bw.Write("NodeSystemP"); //recognization string
            bw.Write(1000); //version
            bw.Write(graph.Nodes.Count);
            foreach (var node in graph.Nodes)
            {
                SerializeNode(bw, node);
            }
            bw.Write(graph.Connections.Count);
            foreach (var connection in graph.Connections)
            {
                bw.Write(connection.OutputNode.GUID);
                bw.Write(connection.OutputSocketName);

                bw.Write(connection.InputNode.GUID);
                bw.Write(connection.InputSocketName);
                bw.Write(0); //additional data size per connection
            }
            bw.Write(0); //additional data size per graph
            // return (bw.BaseStream as MemoryStream).ToArray();
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant