@@ -579,7 +579,7 @@ Audio_Region::draw ( void ) | |||||
int ox = timeline->ts_to_x( _r->start ); | int ox = timeline->ts_to_x( _r->start ); | ||||
if ( ox > OX + sequence()->w() || | if ( ox > OX + sequence()->w() || | ||||
ox < OX && ox + abs_w() < OX ) | |||||
( ox < OX && ox + abs_w() < OX ) ) | |||||
/* not in viewport */ | /* not in viewport */ | ||||
return; | return; | ||||
@@ -23,6 +23,8 @@ | |||||
#include "util/debug.h" | #include "util/debug.h" | ||||
#include <string.h> | |||||
std::map <std::string, Audio_File*> Audio_File::_open_files; | std::map <std::string, Audio_File*> Audio_File::_open_files; | ||||
Audio_File::~Audio_File ( ) | Audio_File::~Audio_File ( ) | ||||
@@ -32,6 +34,16 @@ Audio_File::~Audio_File ( ) | |||||
free( _filename ); | 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 | void | ||||
Audio_File::all_supported_formats ( std::list <const char *> &formats ) | Audio_File::all_supported_formats ( std::list <const char *> &formats ) | ||||
{ | { | ||||
@@ -56,16 +56,7 @@ protected: | |||||
Peaks _peaks; | 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: | public: | ||||
@@ -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 <string.h> | |||||
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; | |||||
} |
@@ -29,14 +29,7 @@ class Audio_File_Dummy : public Audio_File | |||||
public: | 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; } | bool dummy ( void ) const { return true; } | ||||
@@ -80,7 +80,8 @@ protected: | |||||
void block_processed ( void ) { sem_post( &_blocks ); } | void block_processed ( void ) { sem_post( &_blocks ); } | ||||
bool wait_for_block ( void ) | bool wait_for_block ( void ) | ||||
{ | { | ||||
while ( ! sem_wait( &_blocks ) && errno == EINTR ); | |||||
while ( ! sem_wait( &_blocks ) && errno == EINTR ) | |||||
{} | |||||
return ! _terminate; | return ! _terminate; | ||||
} | } | ||||
@@ -372,11 +372,13 @@ Peaks::read_peakfile_peaks ( Peak *peaks, nframes_t s, int npeaks, nframes_t chu | |||||
if ( ! transport->recording ) | if ( ! transport->recording ) | ||||
{ | { | ||||
if ( ! current() ) | if ( ! current() ) | ||||
{ | |||||
/* Build peaks asyncronously */ | /* Build peaks asyncronously */ | ||||
if ( ! fork() ) | if ( ! fork() ) | ||||
exit( make_peaks() ); | exit( make_peaks() ); | ||||
else | else | ||||
return 0; | return 0; | ||||
} | |||||
} | } | ||||
Peakfile _peakfile; | Peakfile _peakfile; | ||||
@@ -24,7 +24,6 @@ | |||||
#include "Audio_File_SF.H" | #include "Audio_File_SF.H" | ||||
class Audio_File; | class Audio_File; | ||||
class Peak_Writer; | class Peak_Writer; | ||||
class Track::Capture; | |||||
class Record_DS : public Disk_Stream | class Record_DS : public Disk_Stream | ||||
{ | { | ||||
@@ -466,6 +466,8 @@ Loggable::compact ( void ) | |||||
fseek( _fp, 0, SEEK_END ); | fseek( _fp, 0, SEEK_END ); | ||||
} | } | ||||
#include <stdarg.h> | |||||
/** Buffered sprintf wrapper */ | /** Buffered sprintf wrapper */ | ||||
void | void | ||||
Loggable::log ( const char *fmt, ... ) | Loggable::log ( const char *fmt, ... ) | ||||
@@ -143,10 +143,12 @@ Transport::cb_button ( Fl_Widget *w ) | |||||
redraw(); | redraw(); | ||||
if ( rolling ) | if ( rolling ) | ||||
{ | |||||
if ( _record_button->value() ) | if ( _record_button->value() ) | ||||
timeline->record(); | timeline->record(); | ||||
else | else | ||||
timeline->stop(); | timeline->stop(); | ||||
} | |||||
} | } | ||||
} | } | ||||