Make measure line drawing optional.

This commit is contained in:
Jonathan Moore Liles 2008-04-24 21:48:44 -05:00
parent 031f279eb2
commit bb2cd56561
4 changed files with 22 additions and 8 deletions

View File

@ -219,6 +219,10 @@ public:
type( t ); type( t );
redraw(); redraw();
return 0;
} }
return 0;
} }
}; };

View File

@ -103,7 +103,7 @@ Loggable::compact();}
} }
MenuItem {} { MenuItem {} {
label Load label Load
callback {((Fl_Menu_Settings*)menubar)->load( options_menu, "foo.state" );} selected callback {((Fl_Menu_Settings*)menubar)->load( options_menu, "foo.state" );}
xywh {10 10 40 25} xywh {10 10 40 25}
} }
} }
@ -196,6 +196,18 @@ Loggable::compact();}
label {&Display} open label {&Display} open
xywh {0 0 74 25} xywh {0 0 74 25}
} { } {
Submenu {} {
label {&Timeline} open
xywh {0 0 74 25}
} {
MenuItem {} {
label {&Measure lines}
callback {Timeline::draw_with_measure_lines = menu_picked_value( o );
timeline->redraw();} selected
xywh {0 0 40 25} type Toggle value 1
}
}
Submenu {} { Submenu {} {
label {&Waveforms} open label {&Waveforms} open
xywh {0 0 74 25} xywh {0 0 74 25}

View File

@ -31,6 +31,8 @@
#include "Track.H" #include "Track.H"
bool Timeline::draw_with_measure_lines = true;
const float UPDATE_FREQ = 0.02f; const float UPDATE_FREQ = 0.02f;
@ -83,8 +85,6 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Wi
box( FL_FLAT_BOX ); box( FL_FLAT_BOX );
xoffset = 0; xoffset = 0;
_enable_measure_lines = true;
X = Y = 0; X = Y = 0;
{ {
@ -256,7 +256,7 @@ Timeline::nearest_line ( int ix )
void void
Timeline::draw_measure ( int X, int Y, int W, int H, Fl_Color color, bool BBT ) Timeline::draw_measure ( int X, int Y, int W, int H, Fl_Color color, bool BBT )
{ {
if ( ! _enable_measure_lines ) if ( ! draw_with_measure_lines )
return; return;
// fl_line_style( FL_DASH, 2 ); // fl_line_style( FL_DASH, 2 );

View File

@ -61,8 +61,6 @@ class Track;
#define redraw_overlay() #define redraw_overlay()
#endif #endif
struct Rectangle struct Rectangle
{ {
int x; int x;
@ -88,8 +86,6 @@ class Timeline : public Fl_Overlay_Window, public RWLock
Rectangle _selection; Rectangle _selection;
bool _enable_measure_lines;
enum snap_flags_e { enum snap_flags_e {
SNAP_TO_REGION, SNAP_TO_REGION,
SNAP_TO_BAR, SNAP_TO_BAR,
@ -116,6 +112,8 @@ class Timeline : public Fl_Overlay_Window, public RWLock
public: public:
static bool draw_with_measure_lines;
Tempo_Sequence *tempo_track; Tempo_Sequence *tempo_track;
Time_Sequence *time_track; Time_Sequence *time_track;
Ruler_Sequence *ruler_track; Ruler_Sequence *ruler_track;