X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gtk2_ardour%2Foption_editor.h;h=f29fe1ed479763e0da2a730e4bce9e9ba9dce37a;hb=885f1fd684da31a730f90ebad23ad9ff39baedb0;hp=ac768383ee58438f8758e859b6c3ac6ecfc80122;hpb=408090adce65f6a23e1e4b7afbd26f0cd6177e88;p=ardour.git diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h index ac768383ee..f29fe1ed47 100644 --- a/gtk2_ardour/option_editor.h +++ b/gtk2_ardour/option_editor.h @@ -25,7 +25,10 @@ #include #include #include +#include + #include "gtkmm2ext/slider_controller.h" + #include "ardour_window.h" #include "audio_clock.h" #include "ardour/types.h" @@ -78,7 +81,7 @@ public: private: void maybe_add_note (OptionEditorPage *, int); - + std::string _note; }; @@ -121,6 +124,38 @@ protected: Gtk::VBox* _box; ///< constituent box for subclasses to add widgets to }; +class RcConfigDisplay : public OptionEditorComponent +{ +public: + RcConfigDisplay (std::string const &, std::string const &, sigc::slot, char s = '\0'); + void add_to_page (OptionEditorPage *); + void parameter_changed (std::string const & p); + void set_state_from_config (); + Gtk::Widget& tip_widget() { return *_info; } +protected: + sigc::slot _get; + Gtk::Label* _label; + Gtk::Label* _info; + std::string _id; + char _sep; +}; + +class RcActionButton : public OptionEditorComponent +{ +public: + RcActionButton (std::string const & t, const Glib::SignalProxy0< void >::SlotType & slot, std::string const & l = ""); + void add_to_page (OptionEditorPage *); + + void parameter_changed (std::string const & p) {} + void set_state_from_config () {} + Gtk::Widget& tip_widget() { return *_button; } + +protected: + Gtk::Button* _button; + Gtk::Label* _label; + std::string _name; +}; + /** Base class for components which provide UI to change an option */ class Option : public OptionEditorComponent { @@ -582,6 +617,8 @@ public: private: void db_changed (); + void on_activate (); + bool on_key_press (GdkEventKey* ev); Gtk::Adjustment _db_adjustment; Gtkmm2ext::HSliderController* _db_slider; @@ -624,9 +661,8 @@ public: Gtk::Widget& tip_widget() { return _file_chooser; } private: - void file_set (); - void current_folder_set (); - + void selection_changed (); + sigc::slot _get; ///< slot to get the configuration variable's value sigc::slot _set; ///< slot to set the configuration variable's value Gtk::FileChooserButton _file_chooser; @@ -647,7 +683,7 @@ public: }; /** The OptionEditor dialog base class */ -class OptionEditor : public ArdourWindow +class OptionEditor : public ARDOUR::SessionHandlePtr, virtual public sigc::trackable { public: OptionEditor (PBD::Configuration *, std::string const &); @@ -655,23 +691,60 @@ public: void add_option (std::string const &, OptionEditorComponent *); void add_page (std::string const &, Gtk::Widget& page_widget); - + void set_current_page (std::string const &); protected: - virtual void parameter_changed (std::string const &); - + PBD::Configuration* _config; + Gtk::Notebook& notebook() { return _notebook; } + Gtk::TreeView& treeview() { return option_treeview; } -private: + class OptionColumns : public Gtk::TreeModel::ColumnRecord + { + public: + Gtk::TreeModelColumn name; + Gtk::TreeModelColumn widget; - PBD::ScopedConnection config_connection; + OptionColumns() { + add (name); + add (widget); + } + }; + OptionColumns option_columns; + Glib::RefPtr option_tree; + +private: + PBD::ScopedConnection config_connection; Gtk::Notebook _notebook; + Gtk::TreeView option_treeview; std::map _pages; + + void add_path_to_treeview (std::string const &, Gtk::Widget&); + void treeview_row_selected (); }; -#endif /* __gtk_ardour_option_editor_h__ */ +/** The OptionEditor dialog-as-container base class */ +class OptionEditorContainer : public OptionEditor, public Gtk::VBox +{ +public: + OptionEditorContainer (PBD::Configuration *, std::string const &); + ~OptionEditorContainer() {} +private: + Gtk::HBox hpacker; +}; +/** The OptionEditor dialog-as-container base class */ +class OptionEditorWindow : public OptionEditor, public Gtk::Window +{ +public: + OptionEditorWindow (PBD::Configuration *, std::string const &); + ~OptionEditorWindow() {} +private: + Gtk::VBox container; + Gtk::HBox hpacker; +}; +#endif /* __gtk_ardour_option_editor_h__ */