This commit is contained in:
Jonathan Moore Liles 2008-05-22 15:58:36 -05:00
parent c79d48c663
commit 8eb4cb8735
11 changed files with 44 additions and 43 deletions

View File

@ -35,9 +35,8 @@
#include "Engine/Audio_File.H"
#include <algorithm>
// using std::algorithm;
using namespace std;
using std::min;
using std::max;
extern Timeline *timeline;

View File

@ -17,16 +17,20 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include <Fl/fl_ask.H>
#include "Audio_Sequence.H"
#include "Waveform.H"
#include <Fl/fl_ask.H>
#include <list>
using namespace std;
#include "Track.H"
#include "Engine/Audio_File.H" // for ::from_file()
#include "Transport.H" // for locate()
Audio_Sequence::Audio_Sequence ( Track *track ) : Sequence( track )
{

View File

@ -18,6 +18,8 @@
/*******************************************************************************/
#include <FL/fl_ask.H>
#include <list>
using namespace std;
#include "Control_Sequence.H"
#include "Track.H"

View File

@ -21,6 +21,10 @@
#include "dsp.h"
using namespace std;
/**********/
/* Engine */
/**********/

View File

@ -19,18 +19,16 @@
#pragma once
#include "types.h"
#include <jack/ringbuffer.h>
#include <semaphore.h>
#include <errno.h>
#include <pthread.h>
#include "util/Mutex.H"
#include <vector>
using std::vector;
#include "types.h"
#include "util/Mutex.H"
class Track;
class Audio_Sequence;
@ -52,7 +50,7 @@ protected:
nframes_t _frame; /* location of disk read */
vector < jack_ringbuffer_t * >_rb; /* one ringbuffer for each channel */
std::vector < jack_ringbuffer_t * >_rb; /* one ringbuffer for each channel */
sem_t _blocks; /* semaphore to wake the IO thread with */

View File

@ -27,6 +27,12 @@
#include <stdarg.h>
#include <string.h>
#include <algorithm>
using std::min;
using std::max;
FILE *Loggable::_fp;
int Loggable::_log_id = 0;
int Loggable::_level = 0;
@ -34,8 +40,8 @@ int Loggable::_undo_index = 1;
size_t Loggable::_loggables_size = 0;
Loggable ** Loggable::_loggables;
map <string, create_func*> Loggable::_class_map;
queue <char *> Loggable::_transaction;
std::map <std::string, create_func*> Loggable::_class_map;
std::queue <char *> Loggable::_transaction;
bool
Loggable::open ( const char *filename )
@ -334,11 +340,11 @@ Loggable::do_this ( const char *s, bool reverse )
Log_Entry e( sa );
ASSERT( _class_map[ string( classname ) ], "Journal contains an object of class \"%s\", but I don't know how to create such objects.", classname );
ASSERT( _class_map[ std::string( classname ) ], "Journal contains an object of class \"%s\", but I don't know how to create such objects.", classname );
{
/* create */
Loggable *l = _class_map[ string( classname ) ]( e );
Loggable *l = _class_map[ std::string( classname ) ]( e );
l->update_id( id );
l->log_create();
}
@ -486,7 +492,7 @@ Loggable::snapshot( FILE *fp )
{
const Loggable * l = _loggables[ i ];
if ( l && _class_map[ string( l->class_name() ) ] )
if ( l && _class_map[ std::string( l->class_name() ) ] )
l->log_create();
}

View File

@ -27,39 +27,18 @@
#include <string.h>
#include <assert.h>
#include <vector>
#include <map>
#include <string>
#include <queue>
using namespace std;
#include "types.h"
#include "util/debug.h"
/* welcome to C++ */
/* This class is just a dummy to allow base classes with null ids but
* whose children are really loggable. */
/* class Loggable_ID */
/* { */
/* public: */
/* Loggable_ID ( ) { } */
/* virtual ~Loggable_ID ( ) { } */
/* virtual int id ( void ) const = 0; */
/* virtual const char *class_name ( void ) const = 0; */
/* }; */
class Log_Entry;
class Loggable;
typedef Loggable *(create_func)(Log_Entry &);
#define LOG_REGISTER_CREATE( class ) \
Loggable::register_create( #class, & class ::create );
@ -92,9 +71,9 @@ class Loggable
static size_t _loggables_size;
static Loggable ** _loggables;
static map <string, create_func*> _class_map;
static std::map <std::string, create_func*> _class_map;
static queue <char *> _transaction;
static std::queue <char *> _transaction;
private:
@ -214,7 +193,7 @@ public:
{
// printf( "registering %s to %p\n", name, func );
_class_map[ string( name ) ] = func;
_class_map[ std::string( name ) ] = func;
}
/* log messages for journal */

View File

@ -29,6 +29,8 @@
#include "../FL/Boxtypes.H"
using namespace std;
queue <Sequence_Widget *> Sequence::_delete_queue;
Sequence::Sequence ( Track *track ) : Fl_Widget( 0, 0, 0, 0 ), Loggable( true )

View File

@ -31,6 +31,7 @@
#include <assert.h>
#include <list>
#include <queue>
class Track;
class Sequence_Widget;
@ -46,7 +47,7 @@ class Sequence : public Fl_Widget, public Loggable
Sequence ( const Sequence &rhs );
Sequence & operator= ( const Sequence &rhs );
static queue <Sequence_Widget *> _delete_queue;
static std::queue <Sequence_Widget *> _delete_queue;
void init ( void );

View File

@ -17,9 +17,13 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/
#include <FL/fl_draw.H>
#include "Sequence_Widget.H"
#include <FL/fl_draw.H>
using namespace std;
list <Sequence_Widget *> Sequence_Widget::_selection;
Sequence_Widget * Sequence_Widget::_current = NULL;
@ -27,6 +31,8 @@ Sequence_Widget * Sequence_Widget::_pushed = NULL;
Sequence_Widget * Sequence_Widget::_belowmouse = NULL;
Fl_Color Sequence_Widget::_selection_color = FL_MAGENTA;
void
Sequence_Widget::get ( Log_Entry &e ) const
{

View File

@ -215,7 +215,7 @@ public:
bool selected ( void ) const
{
return ::find( _selection.begin(), _selection.end(), this ) != _selection.end();
return std::find( _selection.begin(), _selection.end(), this ) != _selection.end();
}
void select ( void )