diff --git a/Timeline/Audio_Region.C b/Timeline/Audio_Region.C index 9638250..593b6bc 100644 --- a/Timeline/Audio_Region.C +++ b/Timeline/Audio_Region.C @@ -579,7 +579,7 @@ Audio_Region::draw ( void ) int ox = timeline->ts_to_x( _r->start ); if ( ox > OX + sequence()->w() || - ox < OX && ox + abs_w() < OX ) + ( ox < OX && ox + abs_w() < OX ) ) /* not in viewport */ return; diff --git a/Timeline/Engine/Audio_File.C b/Timeline/Engine/Audio_File.C index d384e09..442af43 100644 --- a/Timeline/Engine/Audio_File.C +++ b/Timeline/Engine/Audio_File.C @@ -23,6 +23,8 @@ #include "util/debug.h" +#include + std::map Audio_File::_open_files; Audio_File::~Audio_File ( ) @@ -32,6 +34,16 @@ Audio_File::~Audio_File ( ) free( _filename ); } +const Audio_File::format_desc * +Audio_File::find_format ( const format_desc *fd, const char *name ) +{ + for ( ; fd->name; ++fd ) + if ( ! strcmp( fd->name, name ) ) + return fd; + + return NULL; +} + void Audio_File::all_supported_formats ( std::list &formats ) { diff --git a/Timeline/Engine/Audio_File.H b/Timeline/Engine/Audio_File.H index 10761c0..746975a 100644 --- a/Timeline/Engine/Audio_File.H +++ b/Timeline/Engine/Audio_File.H @@ -56,16 +56,7 @@ protected: Peaks _peaks; - static const format_desc * - find_format ( const format_desc *fd, const char *name ) - { - for ( ; fd->name; ++fd ) - if ( ! strcmp( fd->name, name ) ) - return fd; - - return NULL; - } - + static const format_desc * find_format ( const format_desc *fd, const char *name ); public: diff --git a/Timeline/Engine/Audio_File_Dummy.C b/Timeline/Engine/Audio_File_Dummy.C new file mode 100644 index 0000000..b91ede9 --- /dev/null +++ b/Timeline/Engine/Audio_File_Dummy.C @@ -0,0 +1,30 @@ + +/*******************************************************************************/ +/* 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. */ +/*******************************************************************************/ + +#include "Audio_File_Dummy.H" + +#include + +Audio_File_Dummy * +Audio_File_Dummy::from_file ( const char *filename ) +{ + Audio_File_Dummy *d = new Audio_File_Dummy; + d->_filename = strdup( filename ); + return d; +} diff --git a/Timeline/Engine/Audio_File_Dummy.H b/Timeline/Engine/Audio_File_Dummy.H index 042c478..1168ca8 100644 --- a/Timeline/Engine/Audio_File_Dummy.H +++ b/Timeline/Engine/Audio_File_Dummy.H @@ -29,14 +29,7 @@ class Audio_File_Dummy : public Audio_File public: -/* static const Audio_File::format_desc supported_formats[]; */ - - static Audio_File_Dummy *from_file ( const char *filename ) - { - Audio_File_Dummy *d = new Audio_File_Dummy; - d->_filename = strdup( filename ); - return d; - } + static Audio_File_Dummy *from_file ( const char *filename ); bool dummy ( void ) const { return true; } diff --git a/Timeline/Engine/Disk_Stream.H b/Timeline/Engine/Disk_Stream.H index 4db7a3e..926210e 100644 --- a/Timeline/Engine/Disk_Stream.H +++ b/Timeline/Engine/Disk_Stream.H @@ -80,7 +80,8 @@ protected: void block_processed ( void ) { sem_post( &_blocks ); } bool wait_for_block ( void ) { - while ( ! sem_wait( &_blocks ) && errno == EINTR ); + while ( ! sem_wait( &_blocks ) && errno == EINTR ) + {} return ! _terminate; } diff --git a/Timeline/Engine/Peaks.C b/Timeline/Engine/Peaks.C index b5a40c5..9afce47 100644 --- a/Timeline/Engine/Peaks.C +++ b/Timeline/Engine/Peaks.C @@ -372,11 +372,13 @@ Peaks::read_peakfile_peaks ( Peak *peaks, nframes_t s, int npeaks, nframes_t chu if ( ! transport->recording ) { if ( ! current() ) + { /* Build peaks asyncronously */ if ( ! fork() ) exit( make_peaks() ); else return 0; + } } Peakfile _peakfile; diff --git a/Timeline/Engine/Record_DS.H b/Timeline/Engine/Record_DS.H index e83181f..e46f15d 100644 --- a/Timeline/Engine/Record_DS.H +++ b/Timeline/Engine/Record_DS.H @@ -24,7 +24,6 @@ #include "Audio_File_SF.H" class Audio_File; class Peak_Writer; -class Track::Capture; class Record_DS : public Disk_Stream { diff --git a/Timeline/Loggable.C b/Timeline/Loggable.C index 06ee142..3ddb607 100644 --- a/Timeline/Loggable.C +++ b/Timeline/Loggable.C @@ -466,6 +466,8 @@ Loggable::compact ( void ) fseek( _fp, 0, SEEK_END ); } +#include + /** Buffered sprintf wrapper */ void Loggable::log ( const char *fmt, ... ) diff --git a/Timeline/Transport.C b/Timeline/Transport.C index 9d888af..b7cf747 100644 --- a/Timeline/Transport.C +++ b/Timeline/Transport.C @@ -143,10 +143,12 @@ Transport::cb_button ( Fl_Widget *w ) redraw(); if ( rolling ) + { if ( _record_button->value() ) timeline->record(); else timeline->stop(); + } } }