cmux

Capsim Block Documentation

Short Description

This star ACTIVELY selects one input data channel to send to its output.

Top
States
Num Type Name Initial Value Description
0 int inbufs
1 int outbufs
Top

Declarations


 

	int i,j;
	int buffer_id;



Top

Initialization Code



 

	if((inbufs = NO_INPUT_BUFFERS()) < 2
		|| (outbufs = NO_OUTPUT_BUFFERS()) < 1) {
		fprintf(stdout,"cmux: i/o buffers connect problem\n");
		return(1);
	}




Top

Main Code



 


	for(i=MIN_AVAIL(); i>0; i--) {
		for(j=0; j 0 && buffer_id < inbufs) {
			for(j=0; j
    
Top

Wrapup Code



 





Top

License



/*  Capsim (r) Text Mode Kernel (TMK) Star Library (Blocks)
    Copyright (C) 1989-2017  Silicon DSP Corporation

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    http://www.silicondsp.com
    Silicon DSP  Corporation
    Las Vegas, Nevada
*/


Top

Description



 

/* cmux.s */
/**********************************************************************
			cmux()
***********************************************************************
This star ACTIVELY selects one input data channel to send to its output.
Input channel 0 is always the control port;  its input stream of
numbers selects which input data channel to route to the output.
The number N of input data channels is arbitrary (>= 1).
In the event that the control port sample does not correspond to an
attached input buffer number (i.e. 1-N), a zero sample is output.
Since the control buffer is (float), rounding is used to generate an
integer buffer number.
Note: ALL input buffers are incremented (it_in) at each time,
whether their sample is chosen for output or not.
Auto-fanout is supported.
There are no parameters.

cmux


This star ACTIVELY selects one input data channel to send to its output.
Input channel 0 is always the control port;  its input stream of
numbers selects which input data channel to route to the output.
The number N of input data channels is arbitrary (>= 1).
In the event that the control port sample does not correspond to an
attached input buffer number (i.e. 1-N), a zero sample is output.
Since the control buffer is (float), rounding is used to generate an
integer buffer number.
Note: ALL input buffers are incremented (it_in) at each time,
whether their sample is chosen for output or not.
Auto-fanout is supported.
There are no parameters.


Programmer: L.J. Faber
Date: April, 1988.

*/