Browse Source

Permit user to pick track color. Journal track color.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
1a89c40d7b
3 changed files with 35 additions and 2 deletions
  1. +7
    -2
      Timeline/Timeline.C
  2. +22
    -0
      Timeline/Track.C
  3. +6
    -0
      Timeline/Track.H

+ 7
- 2
Timeline/Timeline.C View File

@@ -87,6 +87,8 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Wi

X = Y = 0;

p1 = p2 = 0;

{
Scalebar *o = new Scalebar( X, Y + H - 18, W - 18, 18 );

@@ -578,8 +580,11 @@ Timeline::draw_cursor ( nframes_t frame, Fl_Color color )
void
Timeline::draw_playhead ( void )
{
draw_cursor( p1, FL_BLUE );
draw_cursor( p2, FL_GREEN );
if ( p1 != p2 )
{
draw_cursor( p1, FL_BLUE );
draw_cursor( p2, FL_GREEN );
}

draw_cursor( transport->frame, FL_RED );
}


+ 22
- 0
Timeline/Track.C View File

@@ -29,6 +29,9 @@

#include "../FL/Fl_Sometimes_Input.H"
#include <FL/fl_ask.H>
#include <FL/Fl_Color_Chooser.H>
// #include <FL/fl_draw.H>
#include <FL/Fl.H>

int Track::_soloing = 0;

@@ -419,6 +422,7 @@ Track::handle ( int m )
{ "Quad", 0, 0, 0, FL_MENU_RADIO | ( c == 4 ? FL_MENU_VALUE : 0 ) },
{ "...", 0, 0, 0, FL_MENU_RADIO | ( c == 3 || c > 4 ? FL_MENU_VALUE : 0 ) },
{ 0 },
{ "Color" },
{ "Remove", 0, 0, 0, transport->rolling ? FL_MENU_INACTIVE : 0 },
{ 0 },
};
@@ -452,6 +456,20 @@ Track::handle ( int m )
}
}
else if ( r == &menu[ 6 ] )
{
unsigned char r, g, b;

Fl::get_color( color(), r, g, b );

if ( fl_color_chooser( "Track Color", r, g, b ) )
{
color( fl_rgb_color( r, g, b ) );
}

// color( fl_show_colormap( color() ) );
redraw();
}
else if ( r == &menu[ 7 ] )
{
int r = fl_choice( "Are you certain you want to remove track \"%s\"?", "Cancel", NULL, "Remove", name() );

@@ -465,12 +483,16 @@ Track::handle ( int m )
}
}
}

return 1;
}
}
default:
return Fl_Group::handle( m );

}

return 0;
}




+ 6
- 0
Timeline/Track.H View File

@@ -140,6 +140,11 @@ public:
configure_inputs( atoi( v ) );
else if ( ! strcmp( s, ":o" ) )
configure_outputs( atoi( v ) );
else if ( ! strcmp( s, ":c" ) )
{
color( (Fl_Color)atol( v ) );
redraw();
}
else if ( ! strcmp( s, ":t" ) )
{
int i;
@@ -172,6 +177,7 @@ public:
e.add( ":h", size() );
e.add( ":i", input.size() );
e.add( ":o", output.size() );
e.add( ":c", color() );
}

/* for loggable */


Loading…
Cancel
Save