diff --git a/Timeline/Loggable.H b/Timeline/Loggable.H index 389cf34..e35fe73 100644 --- a/Timeline/Loggable.H +++ b/Timeline/Loggable.H @@ -333,6 +333,7 @@ public: ADD( int, "%d", v ); ADD( nframes_t, "%lu", (unsigned long)v ); + ADD( unsigned long, "%lu", v ); ADD( const char *, "\"%s\"", v ? v : "" ); ADD( Loggable *, "0x%X", v ? v->id() : 0 ); ADD( float, "%f", v ); diff --git a/Timeline/Region.C b/Timeline/Region.C index 2f3a1bd..8fced44 100644 --- a/Timeline/Region.C +++ b/Timeline/Region.C @@ -42,6 +42,7 @@ using namespace std; extern Timeline *timeline; +bool Region::inherit_track_color = true; Fl_Boxtype Region::_box = FL_UP_BOX; @@ -556,7 +557,9 @@ Region::draw_box( void ) fl_push_clip( x(), y(), w(), h() ); Fl_Color selection_color = _selection_color; - Fl_Color color = _box_color; + + + Fl_Color color = Region::inherit_track_color ? track()->track()->color() : _box_color; if ( this == ((Audio_Sequence*)track())->capture() ) diff --git a/Timeline/Region.H b/Timeline/Region.H index 9059933..0165bcd 100644 --- a/Timeline/Region.H +++ b/Timeline/Region.H @@ -35,6 +35,7 @@ class Region : public Sequence_Widget public: + static bool inherit_track_color; struct Fade { diff --git a/Timeline/Sequence_Widget.H b/Timeline/Sequence_Widget.H index 9f7a9fa..1dd842b 100644 --- a/Timeline/Sequence_Widget.H +++ b/Timeline/Sequence_Widget.H @@ -96,11 +96,11 @@ protected: e.get( i, &s, &v ); if ( ! strcmp( s, ":x" ) ) - _r->offset = atol( v ); + _r->offset = atoll( v ); else if ( ! strcmp( s, ":l" ) ) - _r->start = atol( v ); + _r->start = atoll( v ); else if ( ! strcmp( s, ":r" ) ) - _r->end = atol( v ); + _r->end = atoll( v ); else if ( ! strcmp( s, ":s" ) ) { if ( atoi( v ) ) diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index 4422d9a..72b0d6e 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -23,6 +23,9 @@ decl {\#include "Audio_File.H" // for supported formats} {} decl {\#include "Waveform.H" // for options} {} +decl {\#include "Region.H" // for options} {selected +} + decl {\#include "Control_Sequence.H" // for options} {} decl {\#include } {} @@ -54,8 +57,7 @@ free( path ); // save unjournaled state -// Loggable::save_unjournaled( state_filename );} {selected - } +// Loggable::save_unjournaled( state_filename );} {} } Function {capture_format_cb( Fl_Widget *w, void *v )} {open private return_type {static void} } { @@ -106,7 +108,7 @@ free( path );} {} } { Fl_Window main_window { label {Non-DAW - Timeline} open - xywh {522 141 1024 768} type Double resizable xclass {Non-DAW} visible + xywh {577 27 1024 768} type Double resizable xclass {Non-DAW} visible } { Fl_Menu_Bar menubar {open xywh {0 0 1024 25} @@ -263,7 +265,7 @@ exit( 0 );} } {} } Submenu {} { - label {&Options} + label {&Options} open xywh {0 0 74 25} divider } { Submenu {} { @@ -316,6 +318,13 @@ timeline->redraw();} label {Filled fades} xywh {30 30 40 25} type Toggle value 1 } + MenuItem {} { + label {Inherit track color} + callback {Region::inherit_track_color = menu_picked_value( o ); + +timeline->redraw();} + xywh {40 40 40 25} type Toggle value 1 + } } Submenu {} { label {&Control Sequence} open diff --git a/Timeline/Track.H b/Timeline/Track.H index 3a76bdb..8686dd5 100644 --- a/Timeline/Track.H +++ b/Timeline/Track.H @@ -142,7 +142,7 @@ public: configure_outputs( atoi( v ) ); else if ( ! strcmp( s, ":c" ) ) { - color( (Fl_Color)atol( v ) ); + color( (Fl_Color)atoll( v ) ); redraw(); } else if ( ! strcmp( s, ":t" ) ) @@ -177,7 +177,7 @@ public: e.add( ":h", size() ); e.add( ":i", input.size() ); e.add( ":o", output.size() ); - e.add( ":c", color() ); + e.add( ":c", (unsigned long)color()); } /* for loggable */