Make mute and solo buttons work.
This commit is contained in:
parent
6b40c32ce8
commit
d87b35c4e0
|
@ -213,11 +213,9 @@ Playback_DS::process ( nframes_t nframes )
|
|||
/* FIXME: we need to resync somehow */
|
||||
}
|
||||
|
||||
/* /\* testing. *\/ */
|
||||
/* FILE *fp = fopen( "testing.au", "a" ); */
|
||||
/* fwrite( buf, block_size, 1, fp ); */
|
||||
/* fclose( fp ); */
|
||||
|
||||
/* TODO: figure out a way to stop IO while muted without losing sync */
|
||||
if ( _th->mute() || ( Track::soloing() && ! _th->solo() ) )
|
||||
buffer_fill_with_silence( (sample_t*)buf, nframes );
|
||||
}
|
||||
|
||||
block_processed();
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include "../FL/Fl_Sometimes_Input.H"
|
||||
#include <FL/fl_ask.H>
|
||||
|
||||
int Track::_soloing = 0;
|
||||
|
||||
void
|
||||
Track::cb_input_field ( Fl_Widget *w, void *v )
|
||||
{
|
||||
|
@ -57,14 +59,26 @@ void
|
|||
Track::cb_button ( Fl_Widget *w )
|
||||
{
|
||||
|
||||
printf( "FIXME: inform mixer here\n" );
|
||||
if ( w == record_button )
|
||||
{
|
||||
/* FIXME: wrong place for this! */
|
||||
if ( record_button->value() )
|
||||
record_ds->start( transport->frame );
|
||||
|
||||
/* /\* FIXME: wrong place for this! *\/ */
|
||||
/* if ( record_button->value() ) */
|
||||
/* record_ds->start( transport->frame ); */
|
||||
/* else */
|
||||
/* record_ds->stop( transport->frame ); */
|
||||
|
||||
}
|
||||
if ( w == mute_button )
|
||||
{
|
||||
|
||||
}
|
||||
if ( w == solo_button )
|
||||
{
|
||||
if ( solo_button->value() )
|
||||
++_soloing;
|
||||
else
|
||||
record_ds->stop( transport->frame );
|
||||
--_soloing;
|
||||
}
|
||||
else
|
||||
if ( w == take_menu )
|
||||
|
|
|
@ -54,9 +54,11 @@ public:
|
|||
Track ( const char *L, int channels=1 );
|
||||
~Track ( );
|
||||
|
||||
static bool soloing ( void ) { return _soloing; }
|
||||
|
||||
private:
|
||||
|
||||
// Sequence * _track;
|
||||
static int _soloing;
|
||||
|
||||
char *_name;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
/* General DSP related functions. */
|
||||
|
||||
#include "dsp.h"
|
||||
#include "string.h" // for memset.
|
||||
|
||||
/* TODO: these functions are all targets for optimization (SSE?) */
|
||||
|
||||
|
@ -87,3 +88,10 @@ buffer_deinterleave_one_channel ( sample_t *dst, sample_t *src, int channel, int
|
|||
src += channels;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
buffer_fill_with_silence ( sample_t *buf, nframes_t nframes )
|
||||
{
|
||||
memset( buf, 0, nframes * sizeof( sample_t ) );
|
||||
}
|
||||
|
|
|
@ -28,3 +28,4 @@ void buffer_mix_with_gain ( sample_t *dst, sample_t *src, nframes_t nframes, flo
|
|||
void buffer_interleave_one_channel ( sample_t *dst, sample_t *src, int channel, int channels, nframes_t nframes );
|
||||
void buffer_interleave_one_channel_and_mix ( sample_t *dst, sample_t *src, int channel, int channels, nframes_t nframes );
|
||||
void buffer_deinterleave_one_channel ( sample_t *dst, sample_t *src, int channel, int channels, nframes_t nframes );
|
||||
void buffer_fill_with_silence ( sample_t *buf, nframes_t nframes );
|
||||
|
|
Loading…
Reference in New Issue