Exemple #1
0
 /// <summary>
 /// Disconnects 2 nodes based on the <typeparamref name="DSPConnection"/> handle.
 /// </summary>
 /// <param name="connection">The handle specifying the connection between 2 nodes</param>
 public void Disconnect(DSPConnection connection)
 {
     AssertSameGraphAsConnection(connection);
     QueueCommand(new DisconnectByHandleCommand
     {
         m_Type       = DSPCommandType.DisconnectByHandle,
         m_Graph      = m_Graph,
         m_Handle     = m_Handle,
         m_Connection = connection.Handle,
     });
 }
Exemple #2
0
 /// <summary>
 /// Retains the same attenuation value till the specified DSPClock time is reached
 /// </summary>
 /// <param name="connection">The DSPConnection on which the attenuation is retained</param>
 /// <param name="dspClock">The DSPClock time upto which attenuation value is kept unchanged</param>
 public void SustainAttenuation(DSPConnection connection, long dspClock)
 {
     AssertSameGraphAsConnection(connection);
     QueueCommand(new SustainAttenuationCommand
     {
         m_Type       = DSPCommandType.SustainAttenuation,
         m_Graph      = m_Graph,
         m_Handle     = m_Handle,
         m_Connection = connection.Handle,
         m_DSPClock   = (ulong)dspClock,
     });
 }
Exemple #3
0
 /// <summary>
 /// Used to add attenuation value to a DSPConnection
 /// </summary>
 /// <param name="connection">DSPConnection to which attenuation is applied</param>
 /// <param name="dspClock">Specifies the DSPClock time at which the attenuation value takes effect</param>
 /// <param name="value">Attenuation value to be applied</param>
 public void AddAttenuationKey(DSPConnection connection, long dspClock, float value)
 {
     AssertSameGraphAsConnection(connection);
     QueueCommand(new AddAttenuationKeyCommand
     {
         m_Type       = DSPCommandType.AddAttenuationKey,
         m_Graph      = m_Graph,
         m_Handle     = m_Handle,
         m_Connection = connection.Handle,
         m_Dimension  = 1,
         m_Value0     = value,
         m_DSPClock   = (ulong)dspClock,
     });
 }
Exemple #4
0
 /// <summary>
 /// Sets the attenuation of a connection. Attenuation will be applied when the samples are routed to the next node through the associated connection
 /// </summary>
 /// <param name="connection">DSPConnection on which the attenuation is set</param>
 /// <param name="value">Float value of the attenuation</param>
 /// <param name="interpolationLength">UInt specifying the interpolation length</param>
 public void SetAttenuation(DSPConnection connection, float value, int interpolationLength = 0)
 {
     AssertSameGraphAsConnection(connection);
     QueueCommand(new SetAttenuationCommand
     {
         m_Type                = DSPCommandType.SetAttenuation,
         m_Graph               = m_Graph,
         m_Handle              = m_Handle,
         m_Connection          = connection.Handle,
         m_Dimension           = 1,
         m_Value0              = value,
         m_InterpolationLength = (uint)interpolationLength,
     });
 }
Exemple #5
0
 public void AddAttenuationKey(DSPConnection connection, long dspClock, float *value, byte dimension)
 {
     AssertSameGraphAsConnection(connection);
     ValidateDimension(dimension);
     QueueCommand(new AddAttenuationKeyBufferCommand
     {
         m_Type       = DSPCommandType.AddAttenuationKeyBuffer,
         m_Graph      = m_Graph,
         m_Handle     = m_Handle,
         m_Connection = connection.Handle,
         m_Dimension  = dimension,
         m_Values     = value,
         m_DSPClock   = (ulong)dspClock,
     });
 }
Exemple #6
0
 public void SetAttenuation(DSPConnection connection, float *value, byte dimension, int interpolationLength = 0)
 {
     AssertSameGraphAsConnection(connection);
     ValidateDimension(dimension);
     QueueCommand(new SetAttenuationBufferCommand
     {
         m_Type                = DSPCommandType.SetAttenuationBuffer,
         m_Graph               = m_Graph,
         m_Handle              = m_Handle,
         m_Connection          = connection.Handle,
         m_Dimension           = dimension,
         m_Values              = value,
         m_InterpolationLength = (uint)interpolationLength,
     });
 }
Exemple #7
0
        /// <summary>
        /// Connects 2 nodes
        /// </summary>
        /// <remarks>
        /// It is also necessary to ensure that the formats of the ports of both source and target are the same.
        /// </remarks>
        /// <param name="source">The source node for the connection</param>
        /// <param name="outputPort">The index of the source's output port </param>
        /// <param name="destination">The destination node for the connection</param>
        /// <param name="inputPort">The index of the destination's input port</param>
        /// <returns>Returns a DSPConnection object</returns>
        public DSPConnection Connect(DSPNode source, int outputPort, DSPNode destination, int inputPort)
        {
            AssertSameGraph(source.Graph, "The block and output node passed must be from the same parent DSPGraph");
            AssertSameGraph(destination.Graph, "The block and input node passed must be from the same parent DSPGraph");

            var connection = new DSPConnection
            {
                Graph  = m_Graph.Handle,
                Handle = m_Graph.AllocateHandle(),
            };

            QueueCommand(new ConnectCommand
            {
                m_Type        = DSPCommandType.Connect,
                m_Graph       = m_Graph,
                m_Handle      = m_Handle,
                m_Connection  = connection.Handle,
                m_Source      = source.Handle,
                m_OutputPort  = outputPort,
                m_Destination = destination.Handle,
                m_InputPort   = inputPort,
            });
            return(connection);
        }
Exemple #8
0
 private void AssertSameGraphAsConnection(DSPConnection connection)
 {
     AssertSameGraph(connection.Graph, "The block and connection passed must be from the same parent DSPGraph");
 }