Browse Source

Add an option to add a new take.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
35fc23bec8
3 changed files with 38 additions and 3 deletions
  1. +8
    -0
      Audio_Track.H
  2. +20
    -0
      Track.H
  3. +10
    -3
      Track_Header.C

+ 8
- 0
Audio_Track.H View File

@@ -33,6 +33,14 @@ public:
{ {
} }



Track * clone_empty ( void )
{
Audio_Track *t = new Audio_Track( x(), y(), w(), h() );

return t;
}

const char *class_name ( void ) { return "Audio_Track"; } const char *class_name ( void ) { return "Audio_Track"; }


int handle ( int m ); int handle ( int m );


+ 20
- 0
Track.H View File

@@ -94,6 +94,13 @@ public:
log_create(); log_create();
} }


/* const Track & operator= ( const Track & rhs ) */
/* { */
/* if ( *this = rhs ) */
/* return; */

/* } */

virtual ~Track ( ) virtual ~Track ( )
{ {
/* FIXME: what to do with regions? */ /* FIXME: what to do with regions? */
@@ -102,6 +109,9 @@ public:
log_destroy(); log_destroy();
} }





static Track_Widget *pushed ( void ) { return _pushed; }; static Track_Widget *pushed ( void ) { return _pushed; };
static Track_Widget *belowmouse ( void ) { return _belowmouse; }; static Track_Widget *belowmouse ( void ) { return _belowmouse; };


@@ -126,6 +136,16 @@ public:


Track_Widget * overlaps ( Track_Widget *r ); Track_Widget * overlaps ( Track_Widget *r );


virtual Track * clone ( void )
{
assert( 0 );
}

virtual Track * clone_empty ( void )
{
return NULL;
}

virtual void snap ( Track_Widget *r ); virtual void snap ( Track_Widget *r );
virtual int handle ( int m ); virtual int handle ( int m );
virtual void draw ( void ); virtual void draw ( void );


+ 10
- 3
Track_Header.C View File

@@ -60,10 +60,14 @@ Track_Header::cb_button ( Fl_Widget *w )
{ {
int v = take_menu->value(); int v = take_menu->value();


if ( v == 0 )
switch ( v )
{ {
show_all_takes( take_menu->menu()[ v ].value() );
return;
case 0: /* show all takes */
show_all_takes( take_menu->menu()[ v ].value() );
return;
case 1: /* new */
track( track()->clone_empty() );
return;
} }


const char *s = take_menu->menu()[ v ].text; const char *s = take_menu->menu()[ v ].text;
@@ -147,7 +151,10 @@ Track_Header::Track_Header ( int X, int Y, int W, int H, const char *L ) :
o->color( FL_LIGHT1 ); o->color( FL_LIGHT1 );
o->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE ); o->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE );
o->callback( cb_button, this ); o->callback( cb_button, this );

o->add( "Show all takes", 0, 0, 0, FL_MENU_TOGGLE ); o->add( "Show all takes", 0, 0, 0, FL_MENU_TOGGLE );
o->add( "New", 0, 0, 0, FL_MENU_DIVIDER );

} }
o->end(); o->end();
} }


Loading…
Cancel
Save