Set session of PluginPinWidget created after ::set_session()
[ardour.git] / gtk2_ardour / export_channel_selector.h
index 984026a74873b4b14df556e11734ddec42b30f8f..1be8ec3547e3776c8277f7386b3da08c0be3ffba 100644 (file)
 
 #include "ardour/export_profile_manager.h"
 
-#include <gtkmm.h>
+#ifdef interface
+#undef interface
+#endif
+
 #include <sigc++/signal.h>
 #include <boost/shared_ptr.hpp>
 
+#include <gtkmm/alignment.h>
+#include <gtkmm/box.h>
+#include <gtkmm/cellrenderercombo.h>
+#include <gtkmm/checkbutton.h>
+#include <gtkmm/label.h>
+#include <gtkmm/liststore.h>
+#include <gtkmm/scrolledwindow.h>
+#include <gtkmm/spinbutton.h>
+#include <gtkmm/treemodel.h>
+#include <gtkmm/treeview.h>
+
 namespace ARDOUR {
        class Session;
        class ExportChannelConfiguration;
@@ -44,14 +58,14 @@ class XMLNode;
 
 class ExportChannelSelector : public Gtk::HBox, public ARDOUR::SessionHandlePtr
 {
-  protected:
+protected:
        typedef boost::shared_ptr<ARDOUR::ExportChannelConfiguration> ChannelConfigPtr;
        typedef std::list<ChannelConfigPtr> ChannelConfigList;
        typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ProfileManagerPtr;
 
        ProfileManagerPtr manager;
 
-  public:
+public:
        ExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager)
                : SessionHandlePtr (session)
                , manager (manager)
@@ -66,15 +80,14 @@ class ExportChannelSelector : public Gtk::HBox, public ARDOUR::SessionHandlePtr
 
 class PortExportChannelSelector : public ExportChannelSelector
 {
-
-  public:
+public:
 
        PortExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager);
        ~PortExportChannelSelector ();
 
        void sync_with_manager ();
 
-  private:
+private:
 
        void fill_route_list ();
        void update_channel_count ();
@@ -97,12 +110,12 @@ class PortExportChannelSelector : public ExportChannelSelector
 
        class RouteCols : public Gtk::TreeModelColumnRecord
        {
-         public:
+       public:
 
                struct Channel;
 
                RouteCols () : n_channels (0)
-                       { add (selected); add (name); add (io); add (port_list_col); }
+               { add (selected); add (name); add (io); add (port_list_col); }
 
                void add_channels (uint32_t chans);
                uint32_t n_channels;
@@ -122,10 +135,10 @@ 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:
+               public:
                        Channel (RouteCols & cols) { cols.add (port); cols.add (label); }
 
                        Gtk::TreeModelColumn<boost::weak_ptr<ARDOUR::AudioPort> > port;
@@ -142,7 +155,7 @@ class PortExportChannelSelector : public ExportChannelSelector
 
                class PortCols : public Gtk::TreeModel::ColumnRecord
                {
-                 public:
+               public:
                        PortCols () { add(selected); add(port); add(label); }
 
                        Gtk::TreeModelColumn<bool> selected;  // not used ATM
@@ -154,8 +167,9 @@ class PortExportChannelSelector : public ExportChannelSelector
 
        /* Channels view */
 
-       class ChannelTreeView : public Gtk::TreeView {
-         public:
+       class ChannelTreeView : public Gtk::TreeView
+       {
+       public:
 
                ChannelTreeView (uint32_t max_channels);
                void set_config (ChannelConfigPtr c);
@@ -168,7 +182,7 @@ class PortExportChannelSelector : public ExportChannelSelector
 
                sigc::signal<void> CriticalSelectionChanged;
 
-         private:
+       private:
 
                ChannelConfigPtr config;
                void update_config ();
@@ -195,7 +209,7 @@ class PortExportChannelSelector : public ExportChannelSelector
 
 class RegionExportChannelSelector : public ExportChannelSelector
 {
-  public:
+public:
        RegionExportChannelSelector (ARDOUR::Session * session,
                                     ProfileManagerPtr manager,
                                     ARDOUR::AudioRegion const & region,
@@ -203,7 +217,7 @@ class RegionExportChannelSelector : public ExportChannelSelector
 
        virtual void sync_with_manager ();
 
-  private:
+private:
 
        void handle_selection ();
 
@@ -232,12 +246,13 @@ class TrackExportChannelSelector : public ExportChannelSelector
 
        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;
@@ -248,8 +263,9 @@ class TrackExportChannelSelector : public ExportChannelSelector
                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); }
+               TrackCols () { add (route); add(label); add(selected); add(order_key); }
        };
        TrackCols                    track_cols;
 
@@ -259,9 +275,15 @@ class TrackExportChannelSelector : public ExportChannelSelector
        Gtk::ScrolledWindow          track_scroller;
 
        Gtk::HBox                    options_box;
-       Gtk::RadioButton::Group      source_group;
-       Gtk::RadioButton             region_contents_button;
-       Gtk::RadioButton             track_output_button;
+       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__ */