From 9c19d865bbb33ec287580c8386d87dbb6b807e5f Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 20 Jun 2008 23:38:29 -0500 Subject: [PATCH] More comments. --- Timeline/Audio_Sequence.C | 3 ++ Timeline/LASH.C | 2 +- Timeline/LASH_Client.C | 7 ++- Timeline/Loggable.C | 7 +++ Timeline/Project.C | 2 + Timeline/Timeline.C | 3 ++ Timeline/Track.C | 6 +++ Timeline/Transport.C | 104 ++++++++++++++++++++------------------ Timeline/Waveform.C | 2 + 9 files changed, 84 insertions(+), 52 deletions(-) diff --git a/Timeline/Audio_Sequence.C b/Timeline/Audio_Sequence.C index eecda1b..72d43a0 100644 --- a/Timeline/Audio_Sequence.C +++ b/Timeline/Audio_Sequence.C @@ -17,6 +17,9 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ +/* An Audio_Sequence is a sequence of Audio_Regions. Takes and 'track + * contents' consist of these objects */ + #include #include "Audio_Sequence.H" diff --git a/Timeline/LASH.C b/Timeline/LASH.C index dbcce00..d40c4ea 100644 --- a/Timeline/LASH.C +++ b/Timeline/LASH.C @@ -17,7 +17,7 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ -/* actual implementation of our side of the LASH protocol */ +/* Actual implementation of our side of the LASH protocol */ /* NOTES: Since LASH doesn't provide us with the information we * need--when we need it--we just punt and only use LASH to save and diff --git a/Timeline/LASH_Client.C b/Timeline/LASH_Client.C index 54aad69..901c692 100644 --- a/Timeline/LASH_Client.C +++ b/Timeline/LASH_Client.C @@ -17,11 +17,14 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ +/* Handler based wrapper for LASH */ + #include "LASH_Client.H" - #include "util/debug.h" + + LASH_Client::LASH_Client ( ) { _void = 0; @@ -32,6 +35,8 @@ LASH_Client::~LASH_Client ( ) /* TODO: anything? */ } + + #ifdef HAVE_LASH #include diff --git a/Timeline/Loggable.C b/Timeline/Loggable.C index 1a867ac..d9c4a5d 100644 --- a/Timeline/Loggable.C +++ b/Timeline/Loggable.C @@ -17,6 +17,13 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ +/* This class handles all journaling. All journaled objects must + inherit from Loggable as well as define a few special methods (via + macros), get and set methods, and have contructors and destructors + that call log_create() and log_destroy() in the appropriate + order. Any action that might affect multiple loggable objects + *must* be braced by calls to Loggable::block_start() and + Loggable::block_end() in order for Undo to work properly. */ #include "Loggable.H" diff --git a/Timeline/Project.C b/Timeline/Project.C index 59fe67e..f38892c 100644 --- a/Timeline/Project.C +++ b/Timeline/Project.C @@ -20,6 +20,8 @@ /* Routings for opening/closing/creation of projects. All the actual project state belongs to Timeline and other classes. */ +/* Project management routines. */ + #include #include #include diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index 3999bb6..b2014c2 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -17,6 +17,9 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ +/* This is the Timeline widget, which contains all the tracks and + * provides cursor overlays, scrolling, zooming, measure lines, tempo + * map and just about everything else. */ #include #include diff --git a/Timeline/Track.C b/Timeline/Track.C index c1ff26d..61a14af 100644 --- a/Timeline/Track.C +++ b/Timeline/Track.C @@ -17,6 +17,12 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ +/* A Track is a container for various sequences; the sequence, the + * takes (inactive sequences), annotation sequences, control + * sequences */ +/* TODO: split into Track and Audio_Track (and maybe later Video_Track + * and MIDI_Track */ + #include "Track.H" #include "Transport.H" diff --git a/Timeline/Transport.C b/Timeline/Transport.C index b7cf747..d2d0570 100644 --- a/Timeline/Transport.C +++ b/Timeline/Transport.C @@ -17,6 +17,7 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ +/* Controls the audio transport */ #include "Transport.H" @@ -26,56 +27,7 @@ #define client engine->client() -void -Transport::poll ( void ) -{ - jack_transport_state_t ts; - - ts = jack_transport_query( client, this ); - - rolling = ts == JackTransportRolling; -} - -void -Transport::locate ( nframes_t frame ) -{ - jack_transport_locate( client, frame ); -} - - -void -Transport::start ( void ) -{ -// MESSAGE( "Starting transport" ); - if ( _record_button->value() ) - timeline->record(); - - jack_transport_start( client ); -} - -void -Transport::stop ( void ) -{ -// MESSAGE( "Stopping transport" ); - if ( _record_button->value() ) - toggle_record(); - - jack_transport_stop( client ); -} - -void -Transport::toggle ( void ) -{ - if ( rolling ) - stop(); - else - start(); -} - - -/*******/ -/* GUI */ -/*******/ + Transport::Transport ( int X, int Y, int W, int H, const char *L ) : Fl_Pack( X, Y, W, H, L ) @@ -118,6 +70,8 @@ Transport::Transport ( int X, int Y, int W, int H, const char *L ) end(); } + + void Transport::cb_button ( Fl_Widget *w, void *v ) { @@ -174,3 +128,53 @@ Transport::handle ( int m ) return Fl_Pack::handle( m ); } + +/***********/ +/* Control */ +/***********/ + +void +Transport::poll ( void ) +{ + jack_transport_state_t ts; + + ts = jack_transport_query( client, this ); + + rolling = ts == JackTransportRolling; +} + +void +Transport::locate ( nframes_t frame ) +{ + jack_transport_locate( client, frame ); +} + + +void +Transport::start ( void ) +{ +// MESSAGE( "Starting transport" ); + if ( _record_button->value() ) + timeline->record(); + + jack_transport_start( client ); +} + +void +Transport::stop ( void ) +{ +// MESSAGE( "Stopping transport" ); + if ( _record_button->value() ) + toggle_record(); + + jack_transport_stop( client ); +} + +void +Transport::toggle ( void ) +{ + if ( rolling ) + stop(); + else + start(); +} diff --git a/Timeline/Waveform.C b/Timeline/Waveform.C index ae20234..402924f 100644 --- a/Timeline/Waveform.C +++ b/Timeline/Waveform.C @@ -17,6 +17,8 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ +/* routines to draw a waveform from peak data */ + #include #include "Waveform.H"