diff --git a/Makefile b/Makefile index 304ed9d..fd9e4d3 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,14 @@ test: $(OBJS) mixer: Mixer_Strip.o Mixer.o $(CXX) $(CXXFLAGS) $(LIBS) Mixer_Strip.o Mixer.o -o $@ + +ESRCS=Audio_File.C Audio_File_SF.C Loggable.C +EOBJS=$(ESRCS:.C=.o) + +engine: $(EOBJS) + $(CXX) $(CXXFLAGS) $(LIBS) $(EOBJS) -o $@ + + clean: rm -f $(OBJS) test makedepend diff --git a/Region.C b/Region.C index 2c66e4b..70f4da9 100644 --- a/Region.C +++ b/Region.C @@ -85,7 +85,7 @@ Region::init ( void ) _end = 0; _scale = 1.0f; _clip = NULL; - + _current = false; _box_color = FL_CYAN; _color = FL_BLUE; @@ -103,6 +103,7 @@ Region::Region ( const Region & rhs ) _scale = rhs._scale; _box_color = rhs._box_color; _color = rhs._color; + _current = false; log_create(); } @@ -222,6 +223,14 @@ Region::handle ( int m ) switch ( m ) { + case FL_ENTER: + _current = true; + redraw(); + break; + case FL_LEAVE: + _current = false; + redraw(); + break; case FL_PUSH: { @@ -469,7 +478,14 @@ Region::draw ( int X, int Y, int W, int H ) draw_label( _clip->name(), align() ); + if ( _current ) + { + char pat[40]; + snprintf( pat, sizeof( pat ), "%dm:%.1fs", (int)(length() / timeline->sample_rate) / 60, (double)length() / timeline->sample_rate ); + + draw_label( pat, (Fl_Align)(FL_ALIGN_INSIDE | FL_ALIGN_CENTER), FL_GRAY ); + } /* if ( _selected ) */ /* { */ diff --git a/Region.H b/Region.H index dafe629..78c5146 100644 --- a/Region.H +++ b/Region.H @@ -43,10 +43,12 @@ using namespace std; class Region : public Track_Widget { - Audio_File *_clip; /* clip this region represents */ + Audio_File *_clip; /* clip this region represents */ float _scale; /* amplitude adjustment */ + bool _current; /* region is receiving operations */ + static Fl_Boxtype _box; static Fl_Color _selection_color; static Fl_Color selection_color ( void ) { return _selection_color; } diff --git a/Track_Widget.C b/Track_Widget.C index c40be07..7891f86 100644 --- a/Track_Widget.C +++ b/Track_Widget.C @@ -23,7 +23,7 @@ list Track_Widget::_selection; Track_Widget * Track_Widget::_current; void -Track_Widget::draw_label ( const char *label, Fl_Align align ) +Track_Widget::draw_label ( const char *label, Fl_Align align, Fl_Color color ) { int X, Y; @@ -47,7 +47,7 @@ Track_Widget::draw_label ( const char *label, Fl_Align align ) Fl_Label lab; - lab.color = 0; + lab.color = color; lab.type = FL_SHADOW_LABEL; lab.value = label; lab.font = FL_HELVETICA; diff --git a/Track_Widget.H b/Track_Widget.H index 0b5e348..0111d4b 100644 --- a/Track_Widget.H +++ b/Track_Widget.H @@ -214,7 +214,7 @@ public: return _offset < rhs._offset; } - virtual void draw_label ( const char *label, Fl_Align align ); + virtual void draw_label ( const char *label, Fl_Align align, Fl_Color color=(Fl_Color)0 ); virtual int handle ( int m ); static bool