Allow strips to add or remove personal sends
[ardour.git] / gtk2_ardour / export_format_dialog.h
index 418b015d8ca628eb7e5daab2fd23f67200cf5f31..7df227ccb9c2cdabcfbf358e365b5f2c448d724e 100644 (file)
 #include "ardour/export_formats.h"
 
 #include "pbd/xml++.h"
+#include "pbd/signals.h"
 
 #include "ardour_dialog.h"
 #include "audio_clock.h"
 
-#include <gtkmm.h>
-
-class ExportFormatDialog : public ArdourDialog {
-  private:
-
-       typedef ARDOUR::ExportFormatManager::WeakCompatPtr WeakCompatPtr;
+#ifdef interface
+#undef interface
+#endif
+
+#include <gtkmm/adjustment.h>
+#include <gtkmm/box.h>
+#include <gtkmm/checkbutton.h>
+#include <gtkmm/combobox.h>
+#include <gtkmm/entry.h>
+#include <gtkmm/label.h>
+#include <gtkmm/liststore.h>
+#include <gtkmm/radiobutton.h>
+#include <gtkmm/spinbutton.h>
+#include <gtkmm/table.h>
+#include <gtkmm/treeview.h>
+
+class ExportFormatDialog : public ArdourDialog, public PBD::ScopedConnectionList
+{
+private:
+
+       typedef ARDOUR::WeakExportFormatCompatibilityPtr WeakCompatPtr;
+       typedef ARDOUR::WeakExportFormatPtr WeakFormatPtr;
        typedef ARDOUR::ExportFormatManager::WeakQualityPtr WeakQualityPtr;
-       typedef ARDOUR::ExportFormatManager::WeakFormatPtr WeakFormatPtr;
        typedef ARDOUR::ExportFormatManager::WeakSampleRatePtr WeakSampleRatePtr;
        typedef ARDOUR::ExportFormatManager::WeakSampleFormatPtr WeakSampleFormatPtr;
        typedef ARDOUR::ExportFormatManager::WeakDitherTypePtr WeakDitherTypePtr;
@@ -46,14 +62,14 @@ class ExportFormatDialog : public ArdourDialog {
        typedef boost::shared_ptr<ARDOUR::ExportFormatSpecification> FormatPtr;
 
 
-  public:
+public:
 
        explicit ExportFormatDialog (FormatPtr format, bool new_dialog = false);
        ~ExportFormatDialog ();
 
        void set_session (ARDOUR::Session* s);
 
-  private:
+private:
 
        FormatPtr                   format;
        ARDOUR::ExportFormatManager manager;
@@ -76,7 +92,7 @@ class ExportFormatDialog : public ArdourDialog {
 
        /* These are connected to signals from GUI components, and should change element states  */
 
-       void update_compatibility_selection (Glib::ustring const & path);
+       void update_compatibility_selection (std::string const & path);
        void update_quality_selection ();
        void update_format_selection ();
        void update_sample_rate_selection ();
@@ -107,7 +123,9 @@ class ExportFormatDialog : public ArdourDialog {
 
        template<typename T, typename ColsT>
        void change_compatibility (bool compatibility, boost::weak_ptr<T> w_ptr, Glib::RefPtr<Gtk::ListStore> & list, ColsT & cols,
-                                  Glib::ustring const & c_incompatible = "red", Glib::ustring const & c_compatible = "white");
+                                  std::string const & c_incompatible = "red", std::string const & c_compatible = "white");
+
+       void update_description();
 
        uint32_t applying_changes_from_engine;
 
@@ -119,6 +137,7 @@ class ExportFormatDialog : public ArdourDialog {
        void update_trim_end_selection ();
 
        void update_normalize_selection ();
+       void update_normalize_sensitivity ();
        void update_silence_start_selection ();
        void update_silence_end_selection ();
 
@@ -130,7 +149,7 @@ class ExportFormatDialog : public ArdourDialog {
 
        /*** Encoding options */
 
-       void change_encoding_options (ARDOUR::ExportFormatManager::FormatPtr ptr);
+       void change_encoding_options (ARDOUR::ExportFormatPtr ptr);
 
        void empty_encoding_option_table ();
        void remove_widget (Gtk::Widget & to_remove, Gtk::Container * remove_from);
@@ -150,14 +169,23 @@ class ExportFormatDialog : public ArdourDialog {
 
        Gtk::Label name_label;
        Gtk::Entry name_entry;
+       Gtk::Label name_generated_part;
 
        /* Normalize */
 
        Gtk::HBox        normalize_hbox;
        Gtk::CheckButton normalize_checkbox;
-       Gtk::SpinButton  normalize_spinbutton;
-       Gtk::Adjustment  normalize_adjustment;
-       Gtk::Label       normalize_db_label;
+       Gtk::RadioButton normalize_peak_rb;
+       Gtk::RadioButton normalize_loudness_rb;
+       Gtk::SpinButton  normalize_dbfs_spinbutton;
+       Gtk::Adjustment  normalize_dbfs_adjustment;
+       Gtk::SpinButton  normalize_lufs_spinbutton;
+       Gtk::Adjustment  normalize_lufs_adjustment;
+       Gtk::SpinButton  normalize_dbtp_spinbutton;
+       Gtk::Adjustment  normalize_dbtp_adjustment;
+       Gtk::Label       normalize_dbfs_label;
+       Gtk::Label       normalize_lufs_label;
+       Gtk::Label       normalize_dbtp_label;
 
        /* Silence  */
 
@@ -171,14 +199,19 @@ class ExportFormatDialog : public ArdourDialog {
        Gtk::CheckButton silence_end_checkbox;
        AudioClock       silence_end_clock;
 
+       /* Post-export hook */
+
+       Gtk::Label       command_label;
+       Gtk::Entry       command_entry;
+
        /* Format table */
 
        struct CompatibilityCols : public Gtk::TreeModelColumnRecord
        {
-         public:
-               Gtk::TreeModelColumn<ARDOUR::ExportFormatManager::CompatPtr>  ptr;
-               Gtk::TreeModelColumn<bool>                                    selected;
-               Gtk::TreeModelColumn<Glib::ustring>                           label;
+       public:
+               Gtk::TreeModelColumn<ARDOUR::ExportFormatCompatibilityPtr>  ptr;
+               Gtk::TreeModelColumn<bool>                                  selected;
+               Gtk::TreeModelColumn<std::string>                           label;
 
                CompatibilityCols () { add(ptr); add(selected); add(label); }
        };
@@ -191,10 +224,10 @@ class ExportFormatDialog : public ArdourDialog {
 
        struct QualityCols : public Gtk::TreeModelColumnRecord
        {
-         public:
+       public:
                Gtk::TreeModelColumn<ARDOUR::ExportFormatManager::QualityPtr>  ptr;
-               Gtk::TreeModelColumn<Glib::ustring>                            color;
-               Gtk::TreeModelColumn<Glib::ustring>                            label;
+               Gtk::TreeModelColumn<std::string>                            color;
+               Gtk::TreeModelColumn<std::string>                            label;
 
                QualityCols () { add(ptr); add(color); add(label); }
        };
@@ -203,10 +236,10 @@ class ExportFormatDialog : public ArdourDialog {
 
        struct FormatCols : public Gtk::TreeModelColumnRecord
        {
-         public:
-               Gtk::TreeModelColumn<ARDOUR::ExportFormatManager::FormatPtr>  ptr;
-               Gtk::TreeModelColumn<Glib::ustring>                           color;
-               Gtk::TreeModelColumn<Glib::ustring>                           label;
+       public:
+               Gtk::TreeModelColumn<ARDOUR::ExportFormatPtr>  ptr;
+               Gtk::TreeModelColumn<std::string>              color;
+               Gtk::TreeModelColumn<std::string>              label;
 
                FormatCols () { add(ptr); add(color); add(label); }
        };
@@ -215,10 +248,10 @@ class ExportFormatDialog : public ArdourDialog {
 
        struct SampleRateCols : public Gtk::TreeModelColumnRecord
        {
-         public:
+       public:
                Gtk::TreeModelColumn<ARDOUR::ExportFormatManager::SampleRatePtr>  ptr;
-               Gtk::TreeModelColumn<Glib::ustring>                               color;
-               Gtk::TreeModelColumn<Glib::ustring>                               label;
+               Gtk::TreeModelColumn<std::string>                               color;
+               Gtk::TreeModelColumn<std::string>                               label;
 
                SampleRateCols () { add(ptr); add(color); add(label); }
        };
@@ -241,9 +274,9 @@ class ExportFormatDialog : public ArdourDialog {
 
        struct SRCQualityCols : public Gtk::TreeModelColumnRecord
        {
-         public:
+       public:
                Gtk::TreeModelColumn<ARDOUR::ExportFormatBase::SRCQuality>  id;
-               Gtk::TreeModelColumn<Glib::ustring>                         label;
+               Gtk::TreeModelColumn<std::string>                         label;
 
                SRCQualityCols () { add(id); add(label); }
        };
@@ -271,10 +304,10 @@ class ExportFormatDialog : public ArdourDialog {
 
        struct SampleFormatCols : public Gtk::TreeModelColumnRecord
        {
-         public:
+       public:
                Gtk::TreeModelColumn<ARDOUR::HasSampleFormat::SampleFormatPtr>   ptr;
-               Gtk::TreeModelColumn<Glib::ustring>                              color;
-               Gtk::TreeModelColumn<Glib::ustring>                              label;
+               Gtk::TreeModelColumn<std::string>                              color;
+               Gtk::TreeModelColumn<std::string>                              label;
 
                SampleFormatCols () { add(ptr); add(color); add(label); }
        };
@@ -283,10 +316,10 @@ class ExportFormatDialog : public ArdourDialog {
 
        struct DitherTypeCols : public Gtk::TreeModelColumnRecord
        {
-         public:
+       public:
                Gtk::TreeModelColumn<ARDOUR::HasSampleFormat::DitherTypePtr>   ptr;
-               Gtk::TreeModelColumn<Glib::ustring>                            color;
-               Gtk::TreeModelColumn<Glib::ustring>                            label;
+               Gtk::TreeModelColumn<std::string>                            color;
+               Gtk::TreeModelColumn<std::string>                            label;
 
                DitherTypeCols () { add(ptr); add (color); add(label); }
        };
@@ -296,6 +329,17 @@ class ExportFormatDialog : public ArdourDialog {
        Gtk::Label  sample_format_label;
        Gtk::Label  dither_label;
 
+       Gtk::CheckButton with_cue;
+       Gtk::CheckButton with_toc;
+       Gtk::CheckButton with_mp4chaps;
+
+       Gtk::VBox cue_toc_vbox;
+
+       void update_with_toc ();
+       void update_with_cue ();
+       void update_with_mp4chaps();
+       void update_command ();
+
        Gtk::TreeView sample_format_view;
        Gtk::TreeView dither_type_view;