One fix.
[ardour.git] / gtk2_ardour / export_channel_selector.h
index cfb71b34f532d884bd6b2735fb6d3be00c7ca1ed..d5607ef30b6567ac8904c8a2ac8e3b8258021f48 100644 (file)
 #include <list>
 
 #include "ardour/export_profile_manager.h"
-#include "ardour/export_channel.h"
+
+#ifdef interface
+#undef interface
+#endif
 
 #include <gtkmm.h>
 #include <sigc++/signal.h>
@@ -47,6 +50,7 @@ class ExportChannelSelector : public Gtk::HBox, public ARDOUR::SessionHandlePtr
 {
   protected:
        typedef boost::shared_ptr<ARDOUR::ExportChannelConfiguration> ChannelConfigPtr;
+       typedef std::list<ChannelConfigPtr> ChannelConfigList;
        typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ProfileManagerPtr;
 
        ProfileManagerPtr manager;
@@ -122,14 +126,14 @@ class PortExportChannelSelector : public ExportChannelSelector
                typedef Gtk::TreeModelColumn<Glib::RefPtr<Gtk::ListStore> > ComboCol;
                ComboCol                             port_list_col;
 
-               /* Channel struct, that represents the selected port and it's name */
+               /* Channel struct, that represents the selected port and its name */
 
                struct Channel {
                  public:
                        Channel (RouteCols & cols) { cols.add (port); cols.add (label); }
 
-                       Gtk::TreeModelColumn<ARDOUR::AudioPort *>  port;
-                       Gtk::TreeModelColumn<std::string>        label;
+                       Gtk::TreeModelColumn<boost::weak_ptr<ARDOUR::AudioPort> > port;
+                       Gtk::TreeModelColumn<std::string> label;
                };
                std::list<Channel> channels;
 
@@ -143,11 +147,11 @@ class PortExportChannelSelector : public ExportChannelSelector
                class PortCols : public Gtk::TreeModel::ColumnRecord
                {
                  public:
-                       PortCols () { add (selected); add(port); add(label); }
+                       PortCols () { add(selected); add(port); add(label); }
 
-                       Gtk::TreeModelColumn<bool>                  selected;  // not used ATM
-                       Gtk::TreeModelColumn<ARDOUR::AudioPort *>   port;
-                       Gtk::TreeModelColumn<std::string>         label;
+                       Gtk::TreeModelColumn<bool> selected;  // not used ATM
+                       Gtk::TreeModelColumn<boost::weak_ptr<ARDOUR::AudioPort> > port;
+                       Gtk::TreeModelColumn<std::string> label;
                };
                PortCols port_cols;
        };
@@ -225,4 +229,51 @@ class RegionExportChannelSelector : public ExportChannelSelector
        Gtk::RadioButton      processed_button;
 };
 
+class TrackExportChannelSelector : public ExportChannelSelector
+{
+  public:
+       TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager);
+
+       virtual void sync_with_manager ();
+
+       bool track_output () const { return track_output_button.get_active(); }
+
+  private:
+
+       void fill_list();
+       void add_track (boost::shared_ptr<ARDOUR::Route> route);
+       void update_config();
+       ChannelConfigList configs;
+
+       Gtk::VBox main_layout;
+
+       struct TrackCols : public Gtk::TreeModelColumnRecord
+       {
+         public:
+               Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
+               Gtk::TreeModelColumn<std::string>     label;
+               Gtk::TreeModelColumn<bool>            selected;
+               Gtk::TreeModelColumn<uint32_t>        order_key;
+
+               TrackCols () { add (route); add(label); add(selected); add(order_key); }
+       };
+       TrackCols                    track_cols;
+
+       Glib::RefPtr<Gtk::ListStore> track_list;
+       Gtk::TreeView                track_view;
+
+       Gtk::ScrolledWindow          track_scroller;
+
+       Gtk::HBox                    options_box;
+       Gtk::CheckButton             track_output_button;
+       Gtk::Button                  select_tracks_button;
+       Gtk::Button                  select_busses_button;
+       Gtk::Button                  select_none_button;
+       void select_tracks ();
+       void select_busses ();
+       void select_none ();
+
+       void track_outputs_selected ();
+};
+
 #endif /* __export_channel_selector_h__ */