From 7c6d2118718a5de4033139ea4a6771bdc041043a Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Thu, 20 Mar 2008 02:13:45 -0500 Subject: [PATCH] Work on reorganizing the build. --- FL/Fl_Arc_Dial.H | 97 +++----------------------------------------- FL/Makefile | 27 ++++++++++++ Makefile | 57 +++----------------------- Mixer/Makefile | 33 +++++++++++++++ Mixer/Mixer.C | 2 +- Mixer/Mixer_Strip.fl | 10 ++--- Timeline/Makefile | 37 +++++++++++++++++ make.inc | 18 ++++++++ 8 files changed, 131 insertions(+), 150 deletions(-) create mode 100644 FL/Makefile create mode 100644 Mixer/Makefile create mode 100644 Timeline/Makefile create mode 100644 make.inc diff --git a/FL/Fl_Arc_Dial.H b/FL/Fl_Arc_Dial.H index e532bb9..bde86d2 100644 --- a/FL/Fl_Arc_Dial.H +++ b/FL/Fl_Arc_Dial.H @@ -28,104 +28,17 @@ class Fl_Arc_Dial : public Fl_Dial { +protected: + + virtual int handle ( int ); + virtual void draw ( void ); + public: Fl_Arc_Dial ( int X, int Y, int W, int H, const char *L = 0 ) : Fl_Dial( X, Y, W, H, L ) { box( FL_OVAL_BOX ); -// step( 0.1f ); } -private: - - -protected: - - int handle ( int m ) - { - /* Fl_Dial and friends should really handle mousewheel, but they don't in FTLK1 */ - - switch ( m ) - { - case FL_MOUSEWHEEL: - { - if ( this != Fl::belowmouse() ) - return 0; - - int d = Fl::event_dy(); - - double v = increment( value(), d ); - - if ( v < minimum() ) - v = minimum(); - else if ( v > maximum() ) - v = maximum(); - - value( v ); - - return 1; - } - } - - return Fl_Dial::handle( m ); - } - - - virtual void - draw ( void ) - { - int X = x(); - int Y = y(); - int W = w(); - int H = h(); - -/* if ( damage() & FL_DAMAGE_ALL ) */ - draw_box(); -// draw_box( box(), X, Y, W, H, color() ); - -// draw_burnished_oval_box( x(), y(), w(), h(), color() ); - - X += Fl::box_dx(box()); - Y += Fl::box_dy(box()); - W -= Fl::box_dw(box()); - H -= Fl::box_dh(box()); - - double angle = ( angle2() - angle1() ) * ( value() - minimum()) / ( maximum() - minimum() ) + angle1(); - -// draw_box(); - - draw_label(); - - fl_line_style( FL_SOLID, W / 6 ); - - X += W / 8; - Y += H / 8; - W -= W / 4; - H -= H / 4; - - if ( box() == FL_NO_BOX ) - { - /* draw backgrond arc */ - fl_color( fl_color_average( FL_BLACK, selection_color(), 0.80f ) ); - fl_arc( X, Y, W, H, 270 - angle1(), 270 - angle2() ); - } - - fl_color( selection_color() ); - - if ( type() == FL_FILL_DIAL ) - fl_arc( X, Y, W, H, 270 - angle1(), 270 - angle ); - else - { - const int d = 6; - - /* account for edge conditions */ - angle = angle < angle1() + d ? angle1() + d : angle; - angle = angle > angle2() - d ? angle2() - d : angle; - - fl_arc( X, Y, W, H, 270 - (angle - d), 270 - (angle + d) ); - - fl_line_style( FL_SOLID, 0 ); - } - } }; diff --git a/FL/Makefile b/FL/Makefile new file mode 100644 index 0000000..8c59784 --- /dev/null +++ b/FL/Makefile @@ -0,0 +1,27 @@ + +SRCS= \ + Fl_Scalepack.C \ + Fl_Arc_Dial.C \ + Boxtypes.C \ + +OBJS := $(SRCS:.C=.o) + +INCLUDES=-I.. + +all: libfl_widgets.a + +$(OBJS): Makefile + +include ../make.inc + +libfl_widgets.a: $(OBJS) + ar rcs $@ $(OBJS) +# $(CXX) -static $(CXXFLAGS) $(LIBS) $(OBJS) -o $@ + +clean: + rm -f $(OBJS) mixer makedepend + +valgrind: + valgrind ./test + +include makedepend diff --git a/Makefile b/Makefile index a2101b9..88eb3e6 100644 --- a/Makefile +++ b/Makefile @@ -1,54 +1,7 @@ -CXXFLAGS=-ggdb -Wall -O0 -fno-rtti -fno-exceptions -#LIBS=-L/usr/lib/sox -I/usr/include/sox -lsox -lsfx -LIBS=-lsndfile `fltk-config --ldflags` -# CXXFLAGS=`fltk-config -cxxflags` +CXXFLAGS := -ggdb -Wall -O0 -fno-rtti -fno-exceptions +LIBS := -lsndfile `fltk-config --ldflags` -SRCS= Waveform.C Region.C Peaks.C main.C Track.C Audio_Track.C Timeline.C Audio_File.C Audio_File_SF.C Loggable.C Track_Header.C Track_Widget.C - -OBJS=$(SRCS:.C=.o) - -.PHONEY: all clean install dist valgrind - -all: test makedepend - -.C.o: - @ echo -n "Compiling: "; tput bold; tput setaf 3; echo $<; tput sgr0; true - @ $(CXX) $(CXXFLAGS) -c $< -o $@ - - -%.C : %.fl - @ fluid -c $< - -$(OBJS): Makefile - - -test: $(OBJS) - $(CXX) $(CXXFLAGS) $(LIBS) $(OBJS) -o $@ - -mixer: Mixer_Strip.o Mixer.o DPM.o Fl_Scalepack.o Panner.o Boxtypes.o - $(CXX) $(CXXFLAGS) $(LIBS) Mixer_Strip.o Mixer.o DPM.o Fl_Scalepack.o Boxtypes.o Panner.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 - -valgrind: - valgrind ./test - -TAGS: $(SRCS) - etags $(SRCS) - -makedepend: $(SRCS) - @ echo -n Checking dependencies... - @ makedepend -f- -- $(CXXFLAGS) -- $(SRCS) > makedepend 2>/dev/null && echo done. - - -include makedepend +all: + @ make -C FL CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" + @ make -C Mixer CXXFLAGS="$(CXXFLAGS)" LIBS="$(LIBS)" diff --git a/Mixer/Makefile b/Mixer/Makefile new file mode 100644 index 0000000..4b6b918 --- /dev/null +++ b/Mixer/Makefile @@ -0,0 +1,33 @@ + +SRCS= \ + DPM.C \ + Mixer_Strip.C \ + Panner.C \ + Mixer.C \ + +OBJS := $(SRCS:.C=.o) + +LIBS := $(LIBS) -L../FL -lfl + +INCLUDES=-I.. + +CXXFLAGS := $(CXXFLAGS) -fPIC + +.PHONEY: all clean install dist valgrind + +all: mixer + +$(OBJS): Makefile + +include ../make.inc + +mixer: $(OBJS) + $(CXX) $(CXXFLAGS) $(LIBS) $(OBJS) -o $@ -L../FL -lfl_widgets + +clean: + rm -f $(OBJS) mixer makedepend + +valgrind: + valgrind ./test + +include makedepend diff --git a/Mixer/Mixer.C b/Mixer/Mixer.C index fe73f8b..9a10543 100644 --- a/Mixer/Mixer.C +++ b/Mixer/Mixer.C @@ -33,7 +33,7 @@ Fl_Single_Window *main_window; -#include "Boxtypes.H" +#include int main ( int argc, char **arv ) diff --git a/Mixer/Mixer_Strip.fl b/Mixer/Mixer_Strip.fl index 0124738..edddec7 100644 --- a/Mixer/Mixer_Strip.fl +++ b/Mixer/Mixer_Strip.fl @@ -8,16 +8,16 @@ decl {\#include "DPM.H"} {public global decl {\#include "Panner.H"} {public global } -decl {\#include "Fl_Scalepack.H"} {public global +decl {\#include } {public global } -decl {\#include "Fl_Flip_Button.H"} {public global +decl {\#include } {public global } -decl {\#include "Boxtypes.H"} {public global +decl {\#include } {public global } -decl {\#include "Fl_Arc_Dial.H"} {public global +decl {\#include } {selected public global } widget_class Mixer_Strip {open @@ -49,7 +49,7 @@ widget_class Mixer_Strip {open } } Fl_Button {} { - label {post/pre} selected + label {post/pre} xywh {61 183 45 22} type Toggle box ROUNDED_BOX color 106 selection_color 65 align 64 class Fl_Flip_Button } diff --git a/Timeline/Makefile b/Timeline/Makefile new file mode 100644 index 0000000..6fbaa92 --- /dev/null +++ b/Timeline/Makefile @@ -0,0 +1,37 @@ + +SRCS= \ + Waveform.C \ + Region.C \ + main.C \ + Track.C \ + Audio_Track.C \ + Timeline.C \ + Track_Header.C \ + Track_Widget.C \ + ../Engine/Audio_File.C \ + ../Engine/Audio_File_SF.C \ + ../Engine/Peaks.C \ + ../Engine/Loggable.C \ + +OBJS=$(SRCS:.C=.o) + +INCLUDES=-I../Engine -I../FL + +.PHONEY: all clean install dist valgrind + +all: timeline + +$(OBJS): Makefile + +include ../make.inc + +timeline: $(OBJS) + $(CXX) $(CXXFLAGS) $(INCLUDES) $(LIBS) $(OBJS) -o $@ + +clean: + rm -f $(OBJS) timeline makedepend + +valgrind: + valgrind ./test + +include makedepend diff --git a/make.inc b/make.inc new file mode 100644 index 0000000..8f10ab7 --- /dev/null +++ b/make.inc @@ -0,0 +1,18 @@ + +# To be included in all makefiles + +.C.o: + @ echo -n "Compiling: "; tput bold; tput setaf 3; echo $<; tput sgr0; true + @ $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@ + +%.C : %.fl + @ fluid -c $< + +TAGS: $(SRCS) + etags $(SRCS) + +makedepend: $(SRCS) + @ echo -n Checking dependencies... + @ makedepend -f- -- $(CXXFLAGS) -- $(SRCS) > makedepend 2>/dev/null && echo done. + +all: makedepend