Work on reorganizing the build.

This commit is contained in:
Jonathan Moore Liles 2008-03-20 02:13:45 -05:00
parent c415fe9680
commit 7c6d211871
8 changed files with 131 additions and 150 deletions

View File

@ -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 );
}
}
};

27
FL/Makefile Normal file
View File

@ -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

View File

@ -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)"

33
Mixer/Makefile Normal file
View File

@ -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

View File

@ -33,7 +33,7 @@
Fl_Single_Window *main_window;
#include "Boxtypes.H"
#include <FL/Boxtypes.H>
int
main ( int argc, char **arv )

View File

@ -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 <FL/Fl_Scalepack.H>} {public global
}
decl {\#include "Fl_Flip_Button.H"} {public global
decl {\#include <FL/Fl_Flip_Button.H>} {public global
}
decl {\#include "Boxtypes.H"} {public global
decl {\#include <FL/Fl_Arc_Dial.H>} {public global
}
decl {\#include "Fl_Arc_Dial.H"} {public global
decl {\#include <FL/Boxtypes.H>} {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
}

37
Timeline/Makefile Normal file
View File

@ -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

18
make.inc Normal file
View File

@ -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