Make measure line drawing optional.

pull/3/head
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 );
redraw();
return 0;
}
return 0;
}
};

View File

@ -103,7 +103,7 @@ Loggable::compact();}
}
MenuItem {} {
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}
}
}
@ -196,6 +196,18 @@ Loggable::compact();}
label {&Display} open
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 {} {
label {&Waveforms} open
xywh {0 0 74 25}

View File

@ -31,6 +31,8 @@
#include "Track.H"
bool Timeline::draw_with_measure_lines = true;
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 );
xoffset = 0;
_enable_measure_lines = true;
X = Y = 0;
{
@ -256,7 +256,7 @@ Timeline::nearest_line ( int ix )
void
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;
// fl_line_style( FL_DASH, 2 );

View File

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