new automation state model, sort of working, but not really
[ardour.git] / libs / ardour / diskstream.cc
index a9a5c6ce075ec9825d2655fd0fd001fa0a21d655..9e83c5e21a1243edbb9c755b97c7ed6f74cb9c91 100644 (file)
@@ -32,6 +32,8 @@
 #include <sys/stat.h>
 #include <sys/mman.h>
 
+#include <sigc++/bind.h>
+
 #include <pbd/error.h>
 #include <pbd/basename.h>
 #include <glibmm/thread.h>
@@ -56,10 +58,13 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-jack_nframes_t Diskstream::disk_io_chunk_frames = 0;
+/* XXX This goes uninitialized when there is no ~/.ardour2 directory.
+ * I can't figure out why, so this will do for now (just stole the
+ * default from configuration_vars.h).  0 is not a good value for
+ * allocating buffer sizes..
+ */
+nframes_t Diskstream::disk_io_chunk_frames = 1024 * 256;
 
-sigc::signal<void,Diskstream*>    Diskstream::DiskstreamCreated;
-sigc::signal<void,list<Source*>*> Diskstream::DeleteSources;
 sigc::signal<void>                Diskstream::DiskOverrun;
 sigc::signal<void>                Diskstream::DiskUnderrun;
 
@@ -81,7 +86,6 @@ Diskstream::Diskstream (Session& sess, const XMLNode& node)
 void
 Diskstream::init (Flag f)
 {
-       _refcnt = 0;
        _flags = f;
        _io = 0;
        _alignment_style = ExistingMaterial;
@@ -163,7 +167,7 @@ Diskstream::non_realtime_set_speed ()
 
        if (_seek_required) {
                if (speed() != 1.0f || speed() != -1.0f) {
-                       seek ((jack_nframes_t) (_session.transport_frame() * (double) speed()), true);
+                       seek ((nframes_t) (_session.transport_frame() * (double) speed()), true);
                }
                else {
                        seek (_session.transport_frame(), true);
@@ -186,7 +190,7 @@ Diskstream::realtime_set_speed (double sp, bool global)
        
        if (new_speed != _actual_speed) {
                
-               jack_nframes_t required_wrap_size = (jack_nframes_t) floor (_session.get_block_size() * 
+               nframes_t required_wrap_size = (nframes_t) floor (_session.get_block_size() * 
                                                                            fabs (new_speed)) + 1;
                
                if (required_wrap_size > wrap_buffer_size) {
@@ -261,7 +265,7 @@ Diskstream::set_loop (Location *location)
        return 0;
 }
 
-jack_nframes_t
+nframes_t
 Diskstream::get_capture_start_frame (uint32_t n)
 {
        Glib::Mutex::Lock lm (capture_info_lock);
@@ -274,7 +278,7 @@ Diskstream::get_capture_start_frame (uint32_t n)
        }
 }
 
-jack_nframes_t
+nframes_t
 Diskstream::get_captured_frames (uint32_t n)
 {
        Glib::Mutex::Lock lm (capture_info_lock);
@@ -288,7 +292,7 @@ Diskstream::get_captured_frames (uint32_t n)
 }
 
 void
-Diskstream::set_roll_delay (jack_nframes_t nframes)
+Diskstream::set_roll_delay (nframes_t nframes)
 {
        _roll_delay = nframes;
 }
@@ -327,9 +331,8 @@ Diskstream::use_playlist (Playlist* playlist)
                        reset_write_sources (false);
                }
                
-               plstate_connection = _playlist->StateChanged.connect (mem_fun (*this, &Diskstream::playlist_changed));
                plmod_connection = _playlist->Modified.connect (mem_fun (*this, &Diskstream::playlist_modified));
-               plgone_connection = _playlist->GoingAway.connect (mem_fun (*this, &Diskstream::playlist_deleted));
+               plgone_connection = _playlist->GoingAway.connect (bind (mem_fun (*this, &Diskstream::playlist_deleted), _playlist));
        }
 
        if (!overwrite_queued) {