Browse Source

Make mute and solo buttons work.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
d87b35c4e0
5 changed files with 34 additions and 11 deletions
  1. +3
    -5
      Timeline/Playback_DS.C
  2. +19
    -5
      Timeline/Track.C
  3. +3
    -1
      Timeline/Track.H
  4. +8
    -0
      Timeline/dsp.C
  5. +1
    -0
      Timeline/dsp.h

+ 3
- 5
Timeline/Playback_DS.C View File

@@ -213,11 +213,9 @@ Playback_DS::process ( nframes_t nframes )
/* FIXME: we need to resync somehow */ /* 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(); block_processed();


+ 19
- 5
Timeline/Track.C View File

@@ -30,6 +30,8 @@
#include "../FL/Fl_Sometimes_Input.H" #include "../FL/Fl_Sometimes_Input.H"
#include <FL/fl_ask.H> #include <FL/fl_ask.H>


int Track::_soloing = 0;

void void
Track::cb_input_field ( Fl_Widget *w, void *v ) Track::cb_input_field ( Fl_Widget *w, void *v )
{ {
@@ -57,14 +59,26 @@ void
Track::cb_button ( Fl_Widget *w ) Track::cb_button ( Fl_Widget *w )
{ {


printf( "FIXME: inform mixer here\n" );
if ( w == record_button ) 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 else
record_ds->stop( transport->frame );
--_soloing;
} }
else else
if ( w == take_menu ) if ( w == take_menu )


+ 3
- 1
Timeline/Track.H View File

@@ -54,9 +54,11 @@ public:
Track ( const char *L, int channels=1 ); Track ( const char *L, int channels=1 );
~Track ( ); ~Track ( );


static bool soloing ( void ) { return _soloing; }

private: private:


// Sequence * _track;
static int _soloing;


char *_name; char *_name;




+ 8
- 0
Timeline/dsp.C View File

@@ -20,6 +20,7 @@
/* General DSP related functions. */ /* General DSP related functions. */


#include "dsp.h" #include "dsp.h"
#include "string.h" // for memset.


/* TODO: these functions are all targets for optimization (SSE?) */ /* 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; src += channels;
} }
} }


void
buffer_fill_with_silence ( sample_t *buf, nframes_t nframes )
{
memset( buf, 0, nframes * sizeof( sample_t ) );
}

+ 1
- 0
Timeline/dsp.h View File

@@ -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 ( 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_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_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…
Cancel
Save