Create track ports with the proper names.
This commit is contained in:
parent
ed813d0c03
commit
77ac8a2c8e
|
@ -108,26 +108,6 @@ Track::Track ( int X, int Y, int W, int H, const char *L ) :
|
|||
|
||||
labeltype( FL_NO_LABEL );
|
||||
|
||||
{
|
||||
char pname[40];
|
||||
static int no = 0, ni = 0;
|
||||
|
||||
snprintf( pname, sizeof( pname ), "out-%d", no++ );
|
||||
|
||||
output.push_back( Port( strdup( pname ), Port::Output ) );
|
||||
|
||||
snprintf( pname, sizeof( pname ), "in-%d", ni++ );
|
||||
|
||||
input.push_back( Port( strdup( pname ), Port::Input ) );
|
||||
|
||||
snprintf( pname, sizeof( pname ), "in-%d", ni++ );
|
||||
|
||||
input.push_back( Port( strdup( pname ), Port::Input ) );
|
||||
|
||||
}
|
||||
|
||||
playback_ds = new Playback_DS( this, engine->frame_rate(), engine->nframes(), 1 );
|
||||
record_ds = new Record_DS( this, engine->frame_rate(), engine->nframes(), 2 );
|
||||
|
||||
Fl_Group::size( w(), height() );
|
||||
|
||||
|
@ -227,6 +207,13 @@ Track::Track ( int X, int Y, int W, int H, const char *L ) :
|
|||
if ( L )
|
||||
name( L );
|
||||
|
||||
/* FIXME: should be configurable, but where? */
|
||||
create_outputs( 2 );
|
||||
create_inputs( 2 );
|
||||
|
||||
playback_ds = new Playback_DS( this, engine->frame_rate(), engine->nframes(), output.size() );
|
||||
record_ds = new Record_DS( this, engine->frame_rate(), engine->nframes(), input.size() );
|
||||
|
||||
log_create();
|
||||
}
|
||||
|
||||
|
@ -318,6 +305,39 @@ Track::add_control( Sequence *t )
|
|||
/* Engine */
|
||||
/**********/
|
||||
|
||||
bool
|
||||
Track::create_outputs ( int n )
|
||||
{
|
||||
char pname[256];
|
||||
|
||||
for ( int i = 0; i < n; ++i )
|
||||
{
|
||||
snprintf( pname, sizeof( pname ), "%s/out-%d", name(), i + 1 );
|
||||
output.push_back( Port( strdup( pname ), Port::Output ) );
|
||||
}
|
||||
|
||||
/* FIXME: bogus */
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
Track::create_inputs ( int n )
|
||||
{
|
||||
char pname[256];
|
||||
|
||||
for ( int i = 0; i < n; ++i )
|
||||
{
|
||||
snprintf( pname, sizeof( pname ), "%s/in-%d", name(), i + 1 );
|
||||
input.push_back( Port( strdup( pname ), Port::Input ) );
|
||||
}
|
||||
|
||||
/* FIXME: bogus */
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* THREAD: RT */
|
||||
nframes_t
|
||||
Track::process ( nframes_t nframes )
|
||||
|
|
|
@ -69,6 +69,9 @@ private:
|
|||
|
||||
Region *_capture; /* capture region */
|
||||
|
||||
bool create_outputs ( int n );
|
||||
bool create_inputs ( int n );
|
||||
|
||||
public:
|
||||
|
||||
Fl_Input * name_field;
|
||||
|
|
|
@ -79,7 +79,6 @@ buffer_interleave_one_channel_and_mix ( sample_t *dst, sample_t *src, int channe
|
|||
void
|
||||
buffer_deinterleave_one_channel ( sample_t *dst, sample_t *src, int channel, int channels, nframes_t nframes )
|
||||
{
|
||||
nframes *= channels;
|
||||
src += channel;
|
||||
|
||||
while ( nframes-- )
|
||||
|
|
Loading…
Reference in New Issue