Work towards removal of Session's Diskstream list.
[ardour.git] / libs / ardour / ardour / diskstream.h
index f43e8273a7c891683a8f6a55d051fac26a96c065..b595879264f0023fad87fbda5e3421a9635619e9 100644 (file)
@@ -33,7 +33,7 @@
 
 #include <pbd/fastlog.h>
 #include <pbd/ringbufferNPT.h>
+#include <pbd/stateful.h>
 
 #include <ardour/ardour.h>
 #include <ardour/configuration.h>
@@ -42,7 +42,7 @@
 #include <ardour/route.h>
 #include <ardour/port.h>
 #include <ardour/utils.h>
-#include <ardour/stateful.h>
+
 
 struct tm;
 
@@ -67,9 +67,6 @@ class Diskstream : public Stateful, public sigc::trackable
                Destructive = 0x4
        };
 
-       Diskstream (Session &, const string& name, Flag f = Recordable);
-       Diskstream (Session &, const XMLNode&);
-
        string name () const { return _name; }
        virtual int set_name (string str, void* src);
 
@@ -80,6 +77,9 @@ class Diskstream : public Stateful, public sigc::trackable
        void unref() { if (_refcnt) _refcnt--; if (_refcnt == 0) delete this; }
        uint32_t refcnt() const { return _refcnt; }
 
+       virtual float playback_buffer_load() const = 0;
+       virtual float capture_buffer_load() const = 0;
+
        void set_flag (Flag f)   { _flags |= f; }
        void unset_flag (Flag f) { _flags &= ~f; }
 
@@ -96,16 +96,17 @@ class Diskstream : public Stateful, public sigc::trackable
        bool destructive() const { return _flags & Destructive; }
        virtual void set_destructive (bool yn);
 
-       id_t   id()          const { return _id; }
-       bool   hidden()      const { return _flags & Hidden; }
-       bool   recordable()  const { return _flags & Recordable; }
-       bool   reversed()    const { return _actual_speed < 0.0f; }
-       double speed()       const { return _visible_speed; }
+       const PBD::ID& id()          const { return _id; }
+       bool           hidden()      const { return _flags & Hidden; }
+       bool           recordable()  const { return _flags & Recordable; }
+       bool           reversed()    const { return _actual_speed < 0.0f; }
+       double         speed()       const { return _visible_speed; }
        
        virtual void punch_in()  {}
        virtual void punch_out() {}
 
        virtual void set_speed (double);
+       virtual void non_realtime_set_speed () = 0;
 
        virtual Playlist *playlist () = 0;
        virtual int use_new_playlist () = 0;
@@ -128,6 +129,9 @@ class Diskstream : public Stateful, public sigc::trackable
        /* Stateful */
        virtual XMLNode& get_state(void) = 0;
        virtual int      set_state(const XMLNode& node) = 0;
+       
+       // FIXME: makes sense for all diskstream types?
+       virtual void monitor_input (bool) {}
 
        jack_nframes_t capture_offset() const { return _capture_offset; }
        virtual void   set_capture_offset ();
@@ -142,9 +146,9 @@ class Diskstream : public Stateful, public sigc::trackable
 
        virtual void handle_input_change (IOChange, void *src);
 
-       sigc::signal<void,void*> record_enable_changed;
-       sigc::signal<void>       speed_changed;
-       sigc::signal<void,void*> reverse_changed;
+       sigc::signal<void,void*> RecordEnableChanged;
+       sigc::signal<void>       SpeedChanged;
+       sigc::signal<void,void*> ReverseChanged;
        sigc::signal<void>       PlaylistChanged;
        sigc::signal<void>       AlignmentStyleChanged;
 
@@ -152,12 +156,13 @@ class Diskstream : public Stateful, public sigc::trackable
        static sigc::signal<void>                DiskUnderrun;
        static sigc::signal<void,Diskstream*>    DiskstreamCreated; // XXX use a ref with sigc2
        //static sigc::signal<void,list<Source*>*> DeleteSources;
-       
-       XMLNode* deprecated_io_node;
 
   protected:
        friend class Session;
 
+       Diskstream (Session &, const string& name, Flag f = Recordable);
+       Diskstream (Session &, const XMLNode&);
+
        /* the Session is the only point of access for these
           because they require that the Session is "inactive"
           while they are called.
@@ -166,7 +171,7 @@ class Diskstream : public Stateful, public sigc::trackable
        virtual void set_pending_overwrite (bool) = 0;
        virtual int  overwrite_existing_buffers () = 0;
        virtual void reverse_scrub_buffer (bool to_forward) = 0;
-       //void set_block_size (jack_nframes_t);
+       virtual void set_block_size (jack_nframes_t) = 0;
        virtual int  internal_playback_seek (jack_nframes_t distance) = 0;
        virtual int  can_internal_playback_seek (jack_nframes_t distance) = 0;
        virtual int  rename_write_sources () = 0;
@@ -273,7 +278,7 @@ class Diskstream : public Stateful, public sigc::trackable
        ARDOUR::Session&  _session;
        ARDOUR::IO*       _io;
        uint32_t          _n_channels;
-       id_t              _id;
+       PBD::ID           _id;
 
        mutable gint             _record_enabled;
        double                   _visible_speed;