quick checks on empty control lists, to avoid unnecessary work
[ardour.git] / gtk2_ardour / export_channel_selector.h
index 63af76e77d73376c4721e37fada1cb6835282c9c..6dd770cbb3a424772938905e1f4700b1e4ca24e9 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>
@@ -123,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;
 
@@ -144,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;
        };
@@ -230,25 +233,27 @@ class TrackExportChannelSelector : public ExportChannelSelector
 {
   public:
        TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager);
-       
+
        virtual void sync_with_manager ();
-       
+
   private:
 
        void fill_list();
-       void add_track(ARDOUR::IO * io);
+       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<ARDOUR::IO *>  track;
-               Gtk::TreeModelColumn<std::string>   label;
-               Gtk::TreeModelColumn<bool>          selected;
+               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 (track); add(label); add(selected); }
+               TrackCols () { add (route); add(label); add(selected); add(order_key); }
        };
        TrackCols                    track_cols;
 
@@ -256,7 +261,17 @@ class TrackExportChannelSelector : public ExportChannelSelector
        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__ */