Respond to MMC even when synced to JACK. Fixes #3700.
[ardour.git] / libs / ardour / ardour / export_profile_manager.h
index 30bb3c5b91becf1225d1015313f897e308822789..dc4b6b006016559a6f0a661fe8abf115ff374a0e 100644 (file)
 #include <vector>
 #include <map>
 #include <stdexcept>
+#include <string>
 
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
-#include <glibmm/ustring.h>
 
 #include "pbd/uuid.h"
 #include "pbd/file_utils.h"
@@ -55,7 +55,7 @@ class ExportProfileManager
 {
   public:
 
-       ExportProfileManager (Session & s);
+       ExportProfileManager (Session & s, std::string xml_node_name);
        ~ExportProfileManager ();
 
        void load_profile ();
@@ -75,6 +75,7 @@ class ExportProfileManager
        typedef std::pair<PBD::UUID, PBD::sys::path> FilePair;
        typedef std::map<PBD::UUID, PBD::sys::path> FileMap;
 
+       std::string const xml_node_name;
        HandlerPtr  handler;
        Session &   session;
 
@@ -124,21 +125,20 @@ class ExportProfileManager
 
                TimespanState (boost::shared_ptr<Location> session_range,
                               boost::shared_ptr<Location> selection_range,
-                              boost::shared_ptr<LocationList> ranges) :
-                 timespans (new TimespanList ()),
-                 time_format (Timecode),
-
-                 session_range (session_range),
-                 selection_range (selection_range),
-                 ranges (ranges)
+                              boost::shared_ptr<LocationList> ranges)
+                 : timespans (new TimespanList ())
+                 , time_format (Timecode)
+                 , session_range (session_range)
+                 , selection_range (selection_range)
+                 , ranges (ranges)
                {}
        };
 
        typedef boost::shared_ptr<TimespanState> TimespanStatePtr;
        typedef std::list<TimespanStatePtr> TimespanStateList;
 
-       void set_selection_range (nframes_t start = 0, nframes_t end = 0);
-       std::string set_single_range (nframes_t start, nframes_t end, Glib::ustring name);
+       void set_selection_range (framepos_t start = 0, framepos_t end = 0);
+       std::string set_single_range (framepos_t start, framepos_t end, std::string name);
        TimespanStateList const & get_timespans () { return check_list (timespans); }
 
   private:
@@ -175,6 +175,8 @@ class ExportProfileManager
        typedef std::list<ChannelConfigStatePtr> ChannelConfigStateList;
 
        ChannelConfigStateList const & get_channel_configs () { return check_list (channel_configs); }
+       void clear_channel_configs () { channel_configs.clear(); }
+       ChannelConfigStatePtr add_channel_config ();
 
   private:
 
@@ -206,7 +208,7 @@ class ExportProfileManager
        void remove_format_profile (FormatPtr format);
        FormatPtr get_new_format (FormatPtr original);
 
-       boost::signals2::signal<void()> FormatListChanged;
+       PBD::Signal0<void> FormatListChanged;
 
   private:
 
@@ -251,9 +253,9 @@ class ExportProfileManager
 /* Warnings */
   public:
        struct Warnings {
-               std::list<Glib::ustring> errors;
-               std::list<Glib::ustring> warnings;
-               std::list<Glib::ustring> conflicting_filenames;
+               std::list<std::string> errors;
+               std::list<std::string> warnings;
+               std::list<std::string> conflicting_filenames;
        };
 
        boost::shared_ptr<Warnings> get_warnings ();
@@ -264,6 +266,9 @@ class ExportProfileManager
                           ChannelConfigStatePtr channel_config_state,
                           FormatStatePtr format_state,
                           FilenameStatePtr filename_state);
+       
+       bool check_format (FormatPtr format, uint32_t channels);
+       bool check_sndfile_format (FormatPtr format, unsigned int channels);
 
  /* Utilities */