diff --git a/Timeline/Annotation_Region.C b/Timeline/Annotation_Region.C index c80a4b9..5559b0f 100644 --- a/Timeline/Annotation_Region.C +++ b/Timeline/Annotation_Region.C @@ -123,4 +123,5 @@ Annotation_Region::handle ( int m ) } return r; +#include "const.h" } diff --git a/Timeline/Audio_Region.C b/Timeline/Audio_Region.C index e2d70f0..05d172f 100644 --- a/Timeline/Audio_Region.C +++ b/Timeline/Audio_Region.C @@ -32,6 +32,9 @@ #include "Engine/Audio_File.H" +#include "const.h" +#include "util/debug.h" + #include using std::min; using std::max; diff --git a/Timeline/Audio_Sequence.C b/Timeline/Audio_Sequence.C index 72d43a0..0c1510b 100644 --- a/Timeline/Audio_Sequence.C +++ b/Timeline/Audio_Sequence.C @@ -282,4 +282,5 @@ Audio_Sequence::handle ( int m ) default: return Sequence::handle( m ); } +#include "const.h" } diff --git a/Timeline/Control_Point.C b/Timeline/Control_Point.C index db03d6f..9e49129 100644 --- a/Timeline/Control_Point.C +++ b/Timeline/Control_Point.C @@ -115,4 +115,5 @@ Control_Point::handle ( int m ) } return r; +#include "const.h" } diff --git a/Timeline/Control_Sequence.C b/Timeline/Control_Sequence.C index fb85417..0c27819 100644 --- a/Timeline/Control_Sequence.C +++ b/Timeline/Control_Sequence.C @@ -343,4 +343,5 @@ Control_Sequence::handle ( int m ) default: return 0; } +#include "const.h" } diff --git a/Timeline/Engine/Audio_File.C b/Timeline/Engine/Audio_File.C index b64cda0..08731a1 100644 --- a/Timeline/Engine/Audio_File.C +++ b/Timeline/Engine/Audio_File.C @@ -21,6 +21,7 @@ #include "Audio_File_SF.H" #include "Audio_File_Dummy.H" +#include "const.h" #include "util/debug.h" #include diff --git a/Timeline/Engine/Audio_File_Dummy.C b/Timeline/Engine/Audio_File_Dummy.C index b91ede9..5dc5e3b 100644 --- a/Timeline/Engine/Audio_File_Dummy.C +++ b/Timeline/Engine/Audio_File_Dummy.C @@ -27,4 +27,5 @@ Audio_File_Dummy::from_file ( const char *filename ) Audio_File_Dummy *d = new Audio_File_Dummy; d->_filename = strdup( filename ); return d; +#include "const.h" } diff --git a/Timeline/Engine/Audio_File_SF.C b/Timeline/Engine/Audio_File_SF.C index d6f0187..169b719 100644 --- a/Timeline/Engine/Audio_File_SF.C +++ b/Timeline/Engine/Audio_File_SF.C @@ -31,6 +31,7 @@ // #define HAS_SF_FORMAT_VORBIS +#include "const.h" #include "util/debug.h" diff --git a/Timeline/Engine/Audio_Region.C b/Timeline/Engine/Audio_Region.C index b94a105..63d1874 100644 --- a/Timeline/Engine/Audio_Region.C +++ b/Timeline/Engine/Audio_Region.C @@ -26,6 +26,9 @@ #include "Audio_File.H" #include "dsp.h" +#include "const.h" +#include "const.h" +#include "util/debug.h" #include "util/Thread.H" diff --git a/Timeline/Engine/Audio_Sequence.C b/Timeline/Engine/Audio_Sequence.C index 87c62e3..ed720bf 100644 --- a/Timeline/Engine/Audio_Sequence.C +++ b/Timeline/Engine/Audio_Sequence.C @@ -21,6 +21,8 @@ #include "dsp.h" +#include "const.h" +#include "util/debug.h" #include "util/Thread.H" using namespace std; @@ -67,4 +69,5 @@ Audio_Sequence::play ( sample_t *buf, nframes_t frame, nframes_t nframes, int ch /* FIXME: bogus */ return nframes; +#include "const.h" } diff --git a/Timeline/Engine/Control_Sequence.C b/Timeline/Engine/Control_Sequence.C index e992384..adafc68 100644 --- a/Timeline/Engine/Control_Sequence.C +++ b/Timeline/Engine/Control_Sequence.C @@ -21,6 +21,8 @@ #include "../Transport.H" // for ->frame +#include "const.h" +#include "util/debug.h" #include "util/Thread.H" #include @@ -100,4 +102,5 @@ Control_Sequence::process ( nframes_t nframes ) } else return nframes; +#include "const.h" } diff --git a/Timeline/Engine/Disk_Stream.C b/Timeline/Engine/Disk_Stream.C index 8823a16..9121973 100644 --- a/Timeline/Engine/Disk_Stream.C +++ b/Timeline/Engine/Disk_Stream.C @@ -27,6 +27,10 @@ class Audio_Sequence; #include "Disk_Stream.H" #include "dsp.h" +#include "const.h" +#include "util/debug.h" + + /**********/ @@ -231,4 +235,5 @@ Disk_Stream::buffer_percent ( void ) sem_getvalue( &_blocks, &n ); return 100 - (n * 100 / _total_blocks); +#include "const.h" } diff --git a/Timeline/Engine/Disk_Stream.H b/Timeline/Engine/Disk_Stream.H index 926210e..356de56 100644 --- a/Timeline/Engine/Disk_Stream.H +++ b/Timeline/Engine/Disk_Stream.H @@ -28,6 +28,8 @@ #include "types.h" #include "util/Mutex.H" +#include "const.h" +#include "util/debug.h" #include "util/Thread.H" class Track; diff --git a/Timeline/Engine/Engine.C b/Timeline/Engine/Engine.C index ec30ee0..4fdd646 100644 --- a/Timeline/Engine/Engine.C +++ b/Timeline/Engine/Engine.C @@ -28,6 +28,8 @@ /* This is the home of the JACK process callback (does this *really* need to be a class?) */ +#include "const.h" +#include "util/debug.h" #include "util/Thread.H" @@ -309,4 +311,5 @@ Engine::request_locate ( nframes_t frame ) { if ( timeline ) timeline->seek( frame ); +#include "const.h" } diff --git a/Timeline/Engine/Peaks.C b/Timeline/Engine/Peaks.C index c61a28e..b33dfc0 100644 --- a/Timeline/Engine/Peaks.C +++ b/Timeline/Engine/Peaks.C @@ -39,6 +39,7 @@ #include "Peaks.H" #include "assert.h" +#include "const.h" #include "util/debug.h" #include "util/Thread.H" #include "util/file.h" diff --git a/Timeline/Engine/Playback_DS.C b/Timeline/Engine/Playback_DS.C index 169b0a4..ff049ec 100644 --- a/Timeline/Engine/Playback_DS.C +++ b/Timeline/Engine/Playback_DS.C @@ -30,6 +30,7 @@ #include "Engine.H" #include "dsp.h" +#include "const.h" #include "util/debug.h" #include "util/Thread.H" diff --git a/Timeline/Engine/Port.C b/Timeline/Engine/Port.C index dc73f59..cf4c95c 100644 --- a/Timeline/Engine/Port.C +++ b/Timeline/Engine/Port.C @@ -139,4 +139,5 @@ void Port::silence ( nframes_t nframes ) { memset( buffer( nframes ), 0, nframes * sizeof( sample_t ) ); +#include "const.h" } diff --git a/Timeline/Engine/Record_DS.C b/Timeline/Engine/Record_DS.C index 8fff82f..13305dd 100644 --- a/Timeline/Engine/Record_DS.C +++ b/Timeline/Engine/Record_DS.C @@ -29,6 +29,7 @@ #include "Engine.H" #include "dsp.h" +#include "const.h" #include "util/debug.h" #include "util/Thread.H" diff --git a/Timeline/Engine/Timeline.C b/Timeline/Engine/Timeline.C index c23edbd..88b2edb 100644 --- a/Timeline/Engine/Timeline.C +++ b/Timeline/Engine/Timeline.C @@ -225,4 +225,5 @@ Timeline::total_capture_xruns ( void ) } return r; +#include "const.h" } diff --git a/Timeline/Engine/Track.C b/Timeline/Engine/Track.C index bf3e0d0..0d12cd0 100644 --- a/Timeline/Engine/Track.C +++ b/Timeline/Engine/Track.C @@ -254,4 +254,5 @@ Track::finalize ( Capture *c, nframes_t frame ) c->audio_file->finalize(); delete c->audio_file; +#include "const.h" } diff --git a/Timeline/Engine/const.h b/Timeline/Engine/const.h new file mode 100644 index 0000000..44edea4 --- /dev/null +++ b/Timeline/Engine/const.h @@ -0,0 +1,20 @@ + +/*******************************************************************************/ +/* Copyright (C) 2008 Jonathan Moore Liles */ +/* */ +/* This program is free software; you can redistribute it and/or modify it */ +/* under the terms of the GNU General Public License as published by the */ +/* Free Software Foundation; either version 2 of the License, or (at your */ +/* option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, but WITHOUT */ +/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ +/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */ +/* more details. */ +/* */ +/* You should have received a copy of the GNU General Public License along */ +/* with This program; see the file COPYING. If not,write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/*******************************************************************************/ + +#define __MODULE__ "non-daw:engine" diff --git a/Timeline/Engine/dsp.C b/Timeline/Engine/dsp.C index 5145111..84d5842 100644 --- a/Timeline/Engine/dsp.C +++ b/Timeline/Engine/dsp.C @@ -94,4 +94,5 @@ void buffer_fill_with_silence ( sample_t *buf, nframes_t nframes ) { memset( buf, 0, nframes * sizeof( sample_t ) ); +#include "const.h" } diff --git a/Timeline/LASH.C b/Timeline/LASH.C index d40c4ea..050d058 100644 --- a/Timeline/LASH.C +++ b/Timeline/LASH.C @@ -31,6 +31,7 @@ extern TLE *tle; +#include "const.h" #include "util/debug.h" const float lash_poll_interval = 0.2f; diff --git a/Timeline/LASH_Client.C b/Timeline/LASH_Client.C index 901c692..b701d98 100644 --- a/Timeline/LASH_Client.C +++ b/Timeline/LASH_Client.C @@ -21,6 +21,7 @@ #include "LASH_Client.H" +#include "const.h" #include "util/debug.h" diff --git a/Timeline/Log_Entry.C b/Timeline/Log_Entry.C index 9d98a65..4feb176 100644 --- a/Timeline/Log_Entry.C +++ b/Timeline/Log_Entry.C @@ -19,6 +19,9 @@ #include "Log_Entry.H" +#include "const.h" +#include "util/debug.h" + Log_Entry::Log_Entry ( ) { _sa = (char**)malloc( sizeof( char * ) ); diff --git a/Timeline/Loggable.C b/Timeline/Loggable.C index 26d3572..ac3e9b2 100644 --- a/Timeline/Loggable.C +++ b/Timeline/Loggable.C @@ -33,6 +33,9 @@ #include "util/file.h" +#include "const.h" +#include "util/debug.h" + #include using std::min; using std::max; @@ -74,6 +77,33 @@ Loggable::ensure_size ( size_t n ) } } +void +Loggable::block_start ( void ) +{ + ++Loggable::_level; +} + +void +Loggable::block_end ( void ) +{ + --Loggable::_level; + + ASSERT( Loggable::_level >= 0, "Programming error" ); + + if ( Loggable::_level == 0 ) + flush(); +} + +Loggable * +Loggable::find ( int id ) +{ + if ( id > _log_id ) + return NULL; + + return _loggables[ id - 1 ]; +} + + /** Open the journal /filename/ and replay it, bringing the end state back into RAM */ bool Loggable::open ( const char *filename ) diff --git a/Timeline/Loggable.H b/Timeline/Loggable.H index 2bcf61a..f71d1b4 100644 --- a/Timeline/Loggable.H +++ b/Timeline/Loggable.H @@ -33,8 +33,6 @@ #include "types.h" -#include "util/debug.h" - typedef void (progress_func)( int, void * ); class Log_Entry; @@ -137,34 +135,10 @@ public: static void compact ( void ); - static - void - block_start ( void ) - { - ++Loggable::_level; - } + static void block_start ( void ); + static void block_end ( void ); - static - void - block_end ( void ) - { - --Loggable::_level; - - ASSERT( Loggable::_level >= 0, "Programming error" ); - - if ( Loggable::_level == 0 ) - flush(); - } - - static - Loggable * - find ( int id ) - { - if ( id > _log_id ) - return NULL; - - return _loggables[ id - 1 ]; - } + static Loggable * find ( int id ); Loggable ( bool loggable=true ) { diff --git a/Timeline/Project.C b/Timeline/Project.C index 7ebed2d..f9c0ba2 100644 --- a/Timeline/Project.C +++ b/Timeline/Project.C @@ -39,6 +39,7 @@ #include +#include "const.h" #include "util/debug.h" #include "util/file.h" diff --git a/Timeline/Sequence.C b/Timeline/Sequence.C index 011612f..2636554 100644 --- a/Timeline/Sequence.C +++ b/Timeline/Sequence.C @@ -30,6 +30,9 @@ #include "../FL/Boxtypes.H" +#include "const.h" +#include "util/debug.h" + using namespace std; diff --git a/Timeline/Sequence_Point.C b/Timeline/Sequence_Point.C index 272e40e..0933579 100644 --- a/Timeline/Sequence_Point.C +++ b/Timeline/Sequence_Point.C @@ -130,4 +130,5 @@ Sequence_Point::draw ( void ) // Sequence_Widget::draw(); draw_label( _label, align() ); +#include "const.h" } diff --git a/Timeline/Sequence_Region.C b/Timeline/Sequence_Region.C index 67584f6..c42e6af 100644 --- a/Timeline/Sequence_Region.C +++ b/Timeline/Sequence_Region.C @@ -248,4 +248,5 @@ Sequence_Region::draw_box ( void ) void Sequence_Region::draw ( void ) { +#include "const.h" } diff --git a/Timeline/Sequence_Widget.C b/Timeline/Sequence_Widget.C index 14c3435..50adf57 100644 --- a/Timeline/Sequence_Widget.C +++ b/Timeline/Sequence_Widget.C @@ -22,6 +22,9 @@ #include "Sequence_Widget.H" #include "Track.H" +#include "const.h" +#include "util/debug.h" + using namespace std; diff --git a/Timeline/Tempo_Point.C b/Timeline/Tempo_Point.C index 3a80fff..f71b7c2 100644 --- a/Timeline/Tempo_Point.C +++ b/Timeline/Tempo_Point.C @@ -171,4 +171,5 @@ Tempo_Point::edit ( float *tempo ) Tempo_Point_Editor ti( tempo ); return ti.sucess(); +#include "const.h" } diff --git a/Timeline/Tempo_Sequence.C b/Timeline/Tempo_Sequence.C index 0f98e28..d62fd6f 100644 --- a/Timeline/Tempo_Sequence.C +++ b/Timeline/Tempo_Sequence.C @@ -57,4 +57,5 @@ Tempo_Sequence::handle ( int m ) } +#include "const.h" } diff --git a/Timeline/Time_Point.C b/Timeline/Time_Point.C index 1dd243d..ff3f588 100644 --- a/Timeline/Time_Point.C +++ b/Timeline/Time_Point.C @@ -199,4 +199,5 @@ Time_Point::edit ( time_sig *sig ) Time_Point_Editor ti( sig ); return ti.sucess(); +#include "const.h" } diff --git a/Timeline/Time_Sequence.C b/Timeline/Time_Sequence.C index 0907a16..c0ac713 100644 --- a/Timeline/Time_Sequence.C +++ b/Timeline/Time_Sequence.C @@ -57,4 +57,5 @@ Time_Sequence::handle ( int m ) } +#include "const.h" } diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index c00eba0..f89230d 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -43,6 +43,9 @@ #include "FL/menu_popup.H" +#include "const.h" +#include "util/debug.h" + bool Timeline::draw_with_measure_lines = true; @@ -1401,4 +1404,5 @@ Timeline::remove_track ( Track *track ) /* FIXME: why is this necessary? doesn't the above add do DAMAGE_CHILD? */ redraw(); +#include "const.h" } diff --git a/Timeline/Track.C b/Timeline/Track.C index 78f20c1..662d3a9 100644 --- a/Timeline/Track.C +++ b/Timeline/Track.C @@ -37,6 +37,9 @@ #include "Control_Sequence.H" #include "Annotation_Sequence.H" +#include "const.h" +#include "util/debug.h" + int Track::_soloing = 0; @@ -776,4 +779,5 @@ Track::handle ( int m ) } return 0; +#include "const.h" } diff --git a/Timeline/Transport.C b/Timeline/Transport.C index 3890298..0a1b8b7 100644 --- a/Timeline/Transport.C +++ b/Timeline/Transport.C @@ -183,4 +183,5 @@ Transport::toggle ( void ) stop(); else start(); +#include "const.h" } diff --git a/Timeline/Waveform.C b/Timeline/Waveform.C index 402924f..4c8239a 100644 --- a/Timeline/Waveform.C +++ b/Timeline/Waveform.C @@ -117,4 +117,5 @@ Waveform::draw ( int X, int Y, int W, int H, fl_line_style( FL_SOLID, 0 ); } +#include "const.h" } diff --git a/Timeline/const.h b/Timeline/const.h new file mode 100644 index 0000000..b6fd94c --- /dev/null +++ b/Timeline/const.h @@ -0,0 +1,20 @@ + +/*******************************************************************************/ +/* Copyright (C) 2008 Jonathan Moore Liles */ +/* */ +/* This program is free software; you can redistribute it and/or modify it */ +/* under the terms of the GNU General Public License as published by the */ +/* Free Software Foundation; either version 2 of the License, or (at your */ +/* option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, but WITHOUT */ +/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ +/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */ +/* more details. */ +/* */ +/* You should have received a copy of the GNU General Public License along */ +/* with This program; see the file COPYING. If not,write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/*******************************************************************************/ + +#define __MODULE__ "non-daw" diff --git a/Timeline/main.C b/Timeline/main.C index f0f3de4..a947ba1 100644 --- a/Timeline/main.C +++ b/Timeline/main.C @@ -65,6 +65,7 @@ const char COPYRIGHT[] = "Copyright (C) 2008 Jonathan Moore Liles"; #define PACKAGE "non" +#include "const.h" #include "util/debug.h" char *user_config_dir; diff --git a/util/Thread.H b/util/Thread.H index 1136838..a264d20 100644 --- a/util/Thread.H +++ b/util/Thread.H @@ -22,8 +22,6 @@ /* simple wrapper for pthreads with thread role checking */ #include -#include "debug.h" - #define THREAD_ASSERT( n ) ASSERT( Thread::is( #n ), "Function called from wrong thread! (is %s, should be %s)", Thread::current()->name(), #n ) class Thread