Use PBD::copy_file in Session::create() to copy the template file.
[ardour.git] / libs / ardour / ardour / session.h
index f06c4117a610a3f3e7d82c72c13ec7224aa25084..35f4d32372b6bc80073cb02eda796b5a0e3280a0 100644 (file)
@@ -1,22 +1,21 @@
-       /*
-               Copyright (C) 2000 Paul Davis 
+/*
+    Copyright (C) 2000 Paul Davis 
 
-               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 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.
+    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; if not, write to the Free Software
-               Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-               $Id$
-       */
+*/
 
 #ifndef __ardour_session_h__
 #define __ardour_session_h__
@@ -29,6 +28,7 @@
 #include <stack>
 
 #include <boost/weak_ptr.hpp>
+#include <boost/dynamic_bitset.hpp>
 
 #include <stdint.h>
 
@@ -117,9 +117,9 @@ using std::set;
 class Session : public PBD::StatefulDestructible
 {
   private:
-       typedef std::pair<boost::shared_ptr<Route>,bool> RouteBooleanState;
+       typedef std::pair<boost::weak_ptr<Route>,bool> RouteBooleanState;
        typedef vector<RouteBooleanState> GlobalRouteBooleanState;
-       typedef std::pair<boost::shared_ptr<Route>,MeterPoint> RouteMeterState;
+       typedef std::pair<boost::weak_ptr<Route>,MeterPoint> RouteMeterState;
        typedef vector<RouteMeterState> GlobalRouteMeterState;
 
   public:
@@ -175,7 +175,7 @@ class Session : public PBD::StatefulDestructible
                        Route*               route;
            };
 
-           boost::shared_ptr<Region>   region;
+           boost::shared_ptr<Region>     region;
 
            list<AudioRange>     audio_range;
            list<MusicRange>     music_range;
@@ -240,19 +240,18 @@ class Session : public PBD::StatefulDestructible
        
        virtual ~Session ();
 
-
-       static int find_session (string str, string& path, string& snapshot, bool& isnew);
-       
        string path() const { return _path; }
        string name() const { return _name; }
        string snap_name() const { return _current_snapshot_name; }
        string raid_path () const;
+       string export_dir () const;
 
        void set_snap_name ();
 
        void set_dirty ();
        void set_clean ();
        bool dirty() const { return _state_of_the_state & Dirty; }
+       void set_deletion_in_progress ();
        bool deletion_in_progress() const { return _state_of_the_state & Deletion; }
        sigc::signal<void> DirtyChanged;
 
@@ -334,6 +333,8 @@ class Session : public PBD::StatefulDestructible
        void disable_record (bool rt_context, bool force = false);
        void step_back_from_record ();
        
+       void maybe_write_autosave ();
+
        /* Proxy signal for region hidden changes */
 
        sigc::signal<void,boost::shared_ptr<Region> > RegionHiddenChange;
@@ -359,13 +360,17 @@ class Session : public PBD::StatefulDestructible
        void request_bounded_roll (nframes_t start, nframes_t end);
        void request_stop (bool abort = false);
        void request_locate (nframes_t frame, bool with_roll = false);
+
        void request_play_loop (bool yn);
+       bool get_play_loop () const { return play_loop; }
+
        nframes_t  last_transport_start() const { return _last_roll_location; }
        void goto_end ()   { request_locate (end_location->start(), false);}
        void goto_start () { request_locate (start_location->start(), false); }
        void set_session_start (nframes_t start) { start_location->set_start(start); }
        void set_session_end (nframes_t end) { end_location->set_start(end); _end_location_is_free = false; }
        void use_rf_shuttle_speed ();
+       void allow_auto_play (bool yn);
        void request_transport_speed (float speed);
        void request_overwrite_buffer (Diskstream*);
        void request_diskstream_speed (Diskstream&, float speed);
@@ -388,6 +393,9 @@ class Session : public PBD::StatefulDestructible
        double frames_per_smpte_frame() const { return _frames_per_smpte_frame; }
        nframes_t smpte_frames_per_hour() const { return _smpte_frames_per_hour; }
 
+       float smpte_frames_per_second() const;
+       bool smpte_drop_frames() const;
+
        /* Locations */
 
        Locations *locations() { return &_locations; }
@@ -398,6 +406,7 @@ class Session : public PBD::StatefulDestructible
 
        void set_auto_punch_location (Location *);
        void set_auto_loop_location (Location *);
+       int location_name(string& result, string base = string(""));
 
        void reset_input_monitor_state ();
 
@@ -415,6 +424,8 @@ class Session : public PBD::StatefulDestructible
        int save_template (string template_name);
         int save_history (string snapshot_name = "");
         int restore_history (string snapshot_name);
+       void remove_state (string snapshot_name);
+       void rename_state (string old_name, string new_name);
 
        static int rename_template (string old_name, string new_name);
 
@@ -482,6 +493,8 @@ class Session : public PBD::StatefulDestructible
        void   resort_routes ();
        void   resort_routes_using (boost::shared_ptr<RouteList>);
        
+       void    set_remote_control_ids();
+
        AudioEngine &engine() { return _engine; };
 
        int32_t  max_level;
@@ -492,19 +505,6 @@ class Session : public PBD::StatefulDestructible
        nframes_t transport_frame () const {return _transport_frame; }
        nframes_t audible_frame () const;
 
-       enum SmpteFormat {
-               smpte_23976,
-               smpte_24,
-               smpte_24976,
-               smpte_25,
-               smpte_2997,
-               smpte_2997drop,
-               smpte_30,
-               smpte_30drop,
-               smpte_5994,
-               smpte_60,
-       };
-
        enum PullupFormat {
                pullup_Plus4Plus1,
                pullup_Plus4,
@@ -514,11 +514,10 @@ class Session : public PBD::StatefulDestructible
                pullup_Minus1,
                pullup_Minus4Plus1,
                pullup_Minus4,
-               pullup_Minus4Minus1,
+               pullup_Minus4Minus1
        };
 
-       int  set_smpte_type (float fps, bool drop_frames);
-
+       int  set_smpte_format (SmpteFormat);
        void sync_time_vars();
 
        void bbt_time (nframes_t when, BBT_Time&);
@@ -562,7 +561,8 @@ class Session : public PBD::StatefulDestructible
        string new_region_name (string);
        string path_from_region_name (string name, string identifier);
 
-       boost::shared_ptr<Region> find_whole_file_parent (Region&);
+       boost::shared_ptr<Region> find_whole_file_parent (boost::shared_ptr<Region const>);
+       
        void find_equivalent_playlist_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >& result);
 
        boost::shared_ptr<Region>      XMLRegionFactory (const XMLNode&, bool full);
@@ -580,7 +580,7 @@ class Session : public PBD::StatefulDestructible
            bool multichan;
            bool sample_convert;
            volatile bool freeze;
-           string pathname;
+           std::vector<Glib::ustring> paths;
            
            /* result */
            std::vector<boost::shared_ptr<Region> > new_regions;
@@ -595,14 +595,14 @@ class Session : public PBD::StatefulDestructible
 
        int start_audio_export (ARDOUR::AudioExportSpecification&);
        int stop_audio_export (ARDOUR::AudioExportSpecification&);
-       
+       void finalize_audio_export ();
+
        void add_source (boost::shared_ptr<Source>);
        void remove_source (boost::weak_ptr<Source>);
-       int  cleanup_audio_file_source (boost::shared_ptr<AudioFileSource>);
 
        struct cleanup_report {
            vector<string> paths;
-           int32_t space;
+           int64_t space;
        };
 
        int  cleanup_sources (cleanup_report&);
@@ -618,8 +618,7 @@ class Session : public PBD::StatefulDestructible
           this playlist.
        */
        
-       sigc::signal<int,ARDOUR::Playlist*> AskAboutPlaylistDeletion;
-
+       sigc::signal<int,boost::shared_ptr<ARDOUR::Playlist> > AskAboutPlaylistDeletion;
 
        /* handlers should return !0 for use pending state, 0 for
           ignore it.
@@ -627,25 +626,24 @@ class Session : public PBD::StatefulDestructible
 
        static sigc::signal<int> AskAboutPendingState;
        
-       sigc::signal<void,boost::shared_ptr<Source> > SourceAdded;
-       sigc::signal<void,boost::shared_ptr<Source> > SourceRemoved;
-
        boost::shared_ptr<AudioFileSource> create_audio_source_for_session (ARDOUR::AudioDiskstream&, uint32_t which_channel, bool destructive);
 
        boost::shared_ptr<MidiSource> create_midi_source_for_session (ARDOUR::MidiDiskstream&);
 
        boost::shared_ptr<Source> source_by_id (const PBD::ID&);
+       boost::shared_ptr<Source> source_by_path_and_channel (const Glib::ustring&, uint16_t);
 
        /* playlist management */
 
-       Playlist* playlist_by_name (string name);
-       void add_playlist (Playlist *);
-       sigc::signal<void,Playlist*> PlaylistAdded;
-       sigc::signal<void,Playlist*> PlaylistRemoved;
+       boost::shared_ptr<Playlist> playlist_by_name (string name);
+       void add_playlist (boost::shared_ptr<Playlist>);
+       sigc::signal<void,boost::shared_ptr<Playlist> > PlaylistAdded;
+       sigc::signal<void,boost::shared_ptr<Playlist> > PlaylistRemoved;
 
        uint32_t n_playlists() const;
 
-       template<class T> void foreach_playlist (T *obj, void (T::*func)(Playlist *));
+       template<class T> void foreach_playlist (T *obj, void (T::*func)(boost::shared_ptr<Playlist>));
+       void get_playlists (std::vector<boost::shared_ptr<Playlist> >&);
 
        /* named selections */
 
@@ -691,6 +689,7 @@ class Session : public PBD::StatefulDestructible
        void set_all_mute (bool);
 
        sigc::signal<void,bool> SoloActive;
+       sigc::signal<void> SoloChanged;
        
        void record_disenable_all ();
        void record_enable_all ();
@@ -706,9 +705,11 @@ class Session : public PBD::StatefulDestructible
        uint32_t n_plugin_inserts() const { return _plugin_inserts.size(); }
        uint32_t n_sends() const { return _sends.size(); }
 
-       string next_send_name();
-       string next_insert_name();
-       
+       uint32_t next_send_id();
+       uint32_t next_insert_id();
+       void mark_send_id (uint32_t);
+       void mark_insert_id (uint32_t);
+
        /* s/w "RAID" management */
        
        nframes_t available_capture_duration();
@@ -746,6 +747,8 @@ class Session : public PBD::StatefulDestructible
 
        void deliver_midi (MIDI::Port*, MIDI::byte*, int32_t size);
 
+       void set_mmc_device_id (uint32_t id);
+       
        /* Scrubbing */
 
        void start_scrub (nframes_t where);
@@ -756,17 +759,23 @@ class Session : public PBD::StatefulDestructible
 
        /* History (for editors, mixers, UIs etc.) */
 
+       /** Undo some transactions.
+        * @param n Number of transactions to undo.
+        */
        void undo (uint32_t n) {
-               history.undo (n);
+               _history.undo (n);
        }
+
        void redo (uint32_t n) {
-               history.redo (n);
+               _history.redo (n);
        }
 
-       uint32_t undo_depth() const { return history.undo_depth(); }
-       uint32_t redo_depth() const { return history.redo_depth(); }
-       string next_undo() const { return history.next_undo(); }
-       string next_redo() const { return history.next_redo(); }
+       UndoHistory& history() { return _history; }
+       
+       uint32_t undo_depth() const { return _history.undo_depth(); }
+       uint32_t redo_depth() const { return _history.redo_depth(); }
+       string next_undo() const { return _history.next_undo(); }
+       string next_redo() const { return _history.next_redo(); }
 
        void begin_reversible_command (string cmd_name);
        void commit_reversible_command (Command* cmd = 0);
@@ -775,62 +784,78 @@ class Session : public PBD::StatefulDestructible
                current_trans->add_command (cmd);
        }
 
-       std::map<PBD::ID, PBD::StatefulDestructible*> registry;
+       std::map<PBD::ID, PBD::StatefulThingWithGoingAway*> registry;
 
         // these commands are implemented in libs/ardour/session_command.cc
-       Command *memento_command_factory(XMLNode *n);
-        void register_with_memento_command_factory(PBD::ID, PBD::StatefulDestructible *);
+       Command* memento_command_factory(XMLNode* n);
+        void register_with_memento_command_factory(PBD::ID, PBD::StatefulThingWithGoingAway*);
+
+       Command* global_state_command_factory (const XMLNode& n);
+
+       class GlobalRouteStateCommand : public Command
+       {
+         public:
+               GlobalRouteStateCommand (Session&, void*);
+               GlobalRouteStateCommand (Session&, const XMLNode& node);
+               int set_state (const XMLNode&);
+               XMLNode& get_state ();
+
+         protected:
+               GlobalRouteBooleanState before, after;
+               Session& sess;
+               void* src;
+               
+       };
 
-        class GlobalSoloStateCommand : public Command
+        class GlobalSoloStateCommand : public GlobalRouteStateCommand
         {
-            GlobalRouteBooleanState before, after;
-            Session &sess;
-            void *src;
-        public:
-            GlobalSoloStateCommand(Session &, void *src);
-            void operator()();
-            void undo();
-            XMLNode &get_state();
-            void mark();
+         public:
+               GlobalSoloStateCommand (Session &, void *src);
+               GlobalSoloStateCommand (Session&, const XMLNode&);
+               void operator()(); //redo
+               void undo();
+               XMLNode &get_state();
+               void mark();
         };
 
-        class GlobalMuteStateCommand : public Command
+        class GlobalMuteStateCommand : public GlobalRouteStateCommand
         {
-            GlobalRouteBooleanState before, after;
-            Session &sess;
-            void *src;
-        public:
-            GlobalMuteStateCommand(Session &, void *src);
-            void operator()();
-            void undo();
-            XMLNode &get_state();
-            void mark();
+         public:
+               GlobalMuteStateCommand(Session &, void *src);
+               GlobalMuteStateCommand (Session&, const XMLNode&);
+               void operator()(); // redo
+               void undo();
+               XMLNode &get_state();
+               void mark();
         };
 
-        class GlobalRecordEnableStateCommand : public Command
+        class GlobalRecordEnableStateCommand : public GlobalRouteStateCommand
         {
-            GlobalRouteBooleanState before, after;
-            Session &sess;
-            void *src;
-        public:
-            GlobalRecordEnableStateCommand(Session &, void *src);
-            void operator()();
-            void undo();
-            XMLNode &get_state();
-            void mark();
+         public:
+               GlobalRecordEnableStateCommand(Session &, void *src);
+               GlobalRecordEnableStateCommand (Session&, const XMLNode&);
+               void operator()(); // redo
+               void undo();
+               XMLNode &get_state();
+               void mark();
         };
 
         class GlobalMeteringStateCommand : public Command
         {
-            GlobalRouteMeterState before, after;
-            Session &sess;
-            void *src;
-        public:
-            GlobalMeteringStateCommand(Session &, void *src);
-            void operator()();
-            void undo();
-            XMLNode &get_state();
-            void mark();
+         public:
+               GlobalMeteringStateCommand(Session &, void *src);
+               GlobalMeteringStateCommand (Session&, const XMLNode&);
+               void operator()();
+               void undo();
+               XMLNode &get_state();
+               int set_state (const XMLNode&);
+               void mark();
+
+         protected:
+               Session& sess;
+               void* src;
+               GlobalRouteMeterState before;
+               GlobalRouteMeterState after;
         };
 
        /* clicking */
@@ -879,12 +904,6 @@ class Session : public PBD::StatefulDestructible
        static int read_favorite_dirs (FavoriteDirs&);
 
        static int write_favorite_dirs (FavoriteDirs&);
-       
-       /* file suffixes */
-
-       static const char* template_suffix() { return _template_suffix; }
-       static const char* statefile_suffix() { return _statefile_suffix; }
-       static const char* pending_suffix() { return _pending_suffix; }
 
        /* buffers for gain and pan */
 
@@ -907,16 +926,6 @@ class Session : public PBD::StatefulDestructible
                                  void* ptr,
                                  float opt);
 
-       typedef float (*compute_peak_t)                         (Sample *, nframes_t, float);
-       typedef void  (*apply_gain_to_buffer_t)         (Sample *, nframes_t, float);
-       typedef void  (*mix_buffers_with_gain_t)        (Sample *, Sample *, nframes_t, float);
-       typedef void  (*mix_buffers_no_gain_t)          (Sample *, Sample *, nframes_t);
-
-       static compute_peak_t                   compute_peak;
-       static apply_gain_to_buffer_t   apply_gain_to_buffer;
-       static mix_buffers_with_gain_t  mix_buffers_with_gain;
-       static mix_buffers_no_gain_t    mix_buffers_no_gain;
-
        static sigc::signal<void> SendFeedback;
 
        /* Controllables */
@@ -943,10 +952,9 @@ class Session : public PBD::StatefulDestructible
        
   private:
        int  create (bool& new_session, string* mix_template, nframes_t initial_length);
+       void destroy ();
 
-       static const char* _template_suffix;
-       static const char* _statefile_suffix;
-       static const char* _pending_suffix;
+       nframes_t compute_initial_length ();
 
        enum SubState {
                PendingDeclickIn   = 0x1,
@@ -965,6 +973,7 @@ class Session : public PBD::StatefulDestructible
 
        AudioEngine            &_engine;
        mutable gint            processing_prohibited;
+       /// the function called when the main JACK process callback happens
        process_function_type    process_function;
        process_function_type    last_process_function;
        bool                     waiting_for_sync_offset;
@@ -979,6 +988,7 @@ class Session : public PBD::StatefulDestructible
        volatile float          _transport_speed;
        volatile float          _desired_transport_speed;
        float                   _last_transport_speed;
+       bool                     auto_play_legal;
        nframes_t          _last_slave_transport_frame;
        nframes_t           maximum_output_latency;
        nframes_t           last_stop_frame;
@@ -1092,7 +1102,6 @@ class Session : public PBD::StatefulDestructible
 
        void hookup_io ();
        void when_engine_running ();
-       sigc::connection first_time_running;
        void graph_reordered ();
 
        string _current_snapshot_name;
@@ -1124,6 +1133,8 @@ class Session : public PBD::StatefulDestructible
        bool              butler_should_run;
        mutable gint      butler_should_do_transport_work;
        int               butler_request_pipe[2];
+
+       inline bool transport_work_requested() const { return g_atomic_int_get(&butler_should_do_transport_work); }
        
        struct ButlerRequest {
            enum Type {
@@ -1266,8 +1277,7 @@ class Session : public PBD::StatefulDestructible
        void mmc_record_pause (MIDI::MachineControl &);
        void mmc_record_strobe (MIDI::MachineControl &);
        void mmc_record_exit (MIDI::MachineControl &);
-       void mmc_track_record_status (MIDI::MachineControl &, 
-                                     uint32_t track, bool enabled);
+       void mmc_track_record_status (MIDI::MachineControl &, uint32_t track, bool enabled);
        void mmc_fast_forward (MIDI::MachineControl &);
        void mmc_rewind (MIDI::MachineControl &);
        void mmc_locate (MIDI::MachineControl &, const MIDI::byte *);
@@ -1296,17 +1306,17 @@ class Session : public PBD::StatefulDestructible
        nframes_t _smpte_frames_per_hour;
        nframes_t _smpte_offset;
        bool _smpte_offset_negative;
-       
+
        /* cache the most-recently requested time conversions. This helps when we
         * have multiple clocks showing the same time (e.g. the transport frame) */
        bool           last_smpte_valid;
-       jack_nframes_t last_smpte_when;
+       nframes_t last_smpte_when;
        SMPTE::Time    last_smpte;
        
        bool _send_smpte_update; ///< Flag to send a full frame (SMPTE) MTC message this cycle
 
-       int send_full_time_code(jack_nframes_t nframes);
-       int send_midi_time_code_for_cycle(jack_nframes_t nframes);
+       int send_full_time_code(nframes_t nframes);
+       int send_midi_time_code_for_cycle(nframes_t nframes);
 
        nframes_t adjust_apparent_position (nframes_t frames);
        
@@ -1382,9 +1392,8 @@ class Session : public PBD::StatefulDestructible
        void realtime_stop (bool abort);
        void non_realtime_start_scrub ();
        void non_realtime_set_speed ();
-       void non_realtime_stop (bool abort);
-       void non_realtime_overwrite ();
-       void non_realtime_buffer_fill ();
+       void non_realtime_stop (bool abort, int entry_request_count, bool& finished);
+       void non_realtime_overwrite (int entry_request_count, bool& finished);
        void butler_transport_work ();
        void post_transport ();
        void engine_halted ();
@@ -1459,19 +1468,19 @@ class Session : public PBD::StatefulDestructible
        /* PLAYLISTS */
        
        mutable Glib::Mutex playlist_lock;
-       typedef set<Playlist *> PlaylistList;
+       typedef set<boost::shared_ptr<Playlist> > PlaylistList;
        PlaylistList playlists;
        PlaylistList unused_playlists;
 
        int load_playlists (const XMLNode&);
        int load_unused_playlists (const XMLNode&);
-       void remove_playlist (Playlist *);
-       void track_playlist (Playlist *, bool);
+       void remove_playlist (boost::weak_ptr<Playlist>);
+       void track_playlist (bool, boost::weak_ptr<Playlist>);
 
-       Playlist *playlist_factory (string name);
-       Playlist *XMLPlaylistFactory (const XMLNode&);
+       boost::shared_ptr<Playlist> playlist_factory (string name);
+       boost::shared_ptr<Playlist> XMLPlaylistFactory (const XMLNode&);
 
-       void playlist_length_changed (Playlist *);
+       void playlist_length_changed ();
        void diskstream_playlist_changed (boost::shared_ptr<Diskstream>);
 
        /* NAMED SELECTIONS */
@@ -1512,9 +1521,12 @@ class Session : public PBD::StatefulDestructible
        list<PortInsert *>   _port_inserts;
        list<PluginInsert *> _plugin_inserts;
        list<Send *>         _sends;
+       boost::dynamic_bitset<uint32_t>  send_bitset;
+       boost::dynamic_bitset<uint32_t>  insert_bitset;
        uint32_t          send_cnt;
        uint32_t          insert_cnt;
 
+
        void add_redirect (Redirect *);
        void remove_redirect (Redirect *);
 
@@ -1547,7 +1559,9 @@ class Session : public PBD::StatefulDestructible
        static const char* dead_sound_dir_name;
        static const char* interchange_dir_name;
        static const char* peak_dir_name;
-
+       static const char* export_dir_name;
+       
+       string old_sound_dir (bool with_path = true) const;
        string discover_best_sound_dir (bool destructive = false);
        int ensure_sound_dir (string, string&);
        void refresh_disk_space ();
@@ -1566,7 +1580,7 @@ class Session : public PBD::StatefulDestructible
 
        void reverse_diskstream_buffers ();
 
-       UndoHistory history;
+       UndoHistory _history;
        UndoTransaction* current_trans;
 
        GlobalRouteBooleanState get_global_route_boolean (bool (Route::*method)(void) const);
@@ -1581,6 +1595,7 @@ class Session : public PBD::StatefulDestructible
 
        void jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int);
        int  jack_sync_callback (jack_transport_state_t, jack_position_t*);
+       void reset_jack_connection (jack_client_t* jack);
        void record_enable_change_all (bool yn);
 
        XMLNode& state(bool);
@@ -1658,7 +1673,7 @@ class Session : public PBD::StatefulDestructible
                            void* ptr,
                            float opt);
 
-       /* number of hardware audio ports we're using,
+       /* number of hardware ports we're using,
           based on max (requested,available)
        */
 
@@ -1683,7 +1698,6 @@ class Session : public PBD::StatefulDestructible
 
        void config_changed (const char*);
 
-       void add_control_protocol (const ControlProtocolInfo* const, XMLNode*);
        XMLNode& get_control_protocol_state ();
        
 };