21 #include <gtkmm/box.h>
22 #include <gtkmm/alignment.h>
29 #include "ardour/utils.h"
47 int const n = p->
table.property_n_rows();
49 if (!_note.empty ()) {
53 p->
table.resize (m, 3);
54 p->
table.attach (*w, 1, 3, n, n + 1, FILL | EXPAND);
56 maybe_add_note (p, n + 1);
62 int const n = p->
table.property_n_rows();
64 if (!_note.empty ()) {
68 p->
table.resize (m, 3);
69 p->
table.attach (*wa, 1, 2, n, n + 1, FILL);
70 p->
table.attach (*wb, 2, 3, n, n + 1, FILL | EXPAND);
72 maybe_add_note (p, n + 1);
78 if (!_note.empty ()) {
79 Gtk::Label* l = manage (
new Gtk::Label (
string_compose (
X_(
"<i>%1</i>"), _note)));
80 l->set_use_markup (
true);
81 p->
table.attach (*l, 1, 3, n, n + 1, FILL | EXPAND);
94 s <<
"<b>" << h <<
"</b>";
96 _label->set_use_markup (
true);
102 int const n = p->
table.property_n_rows();
103 p->
table.resize (n + 2, 3);
105 p->
table.attach (*manage (
new Label (
"")), 0, 3, n, n + 1, FILL | EXPAND);
106 p->
table.attach (*_label, 0, 3, n + 1, n + 2, FILL | EXPAND);
112 add_widget_to_page (p, _box);
120 _button = manage (
new CheckButton);
121 _label = manage (
new Label);
164 _entry = manage (
new Entry);
185 _entry->set_sensitive (s);
191 std::string text =
_entry->get_text ();
192 for (
size_t i = 0; i <
_invalid.length(); ++i) {
193 text.erase (std::remove(text.begin(), text.end(),
_invalid.at(i)), text.end());
195 if (text !=
_entry->get_text ()) {
222 string const & i,
string const & n,
string const & t,
string const &
f,
223 sigc::slot<bool> g, sigc::slot<bool, bool> s
229 _label = manage (
new Label (n +
":"));
230 _label->set_alignment (0, 0.5);
231 _combo = manage (
new ComboBoxText);
256 _set (
_combo->get_active_row_number () == 0 ?
false :
true);
262 _combo->set_sensitive (yn);
275 _label.set_text (n +
":");
276 _label.set_alignment (0, 0.5);
277 _label.set_name (
X_(
"OptionsLabel"));
281 _box.set_spacing (4);
282 _box.set_homogeneous (
false);
301 snprintf (buf,
sizeof (buf),
"-inf");
323 , _clock (
X_(
"timecode-offset"), true,
X_(
""), true, false, true, false)
327 _label.set_text (n +
":");
328 _label.set_alignment (0, 0.5);
329 _label.set_name (
X_(
"OptionsLabel"));
338 if (!Timecode::parse_timecode_format(
_get(), TC)) {
344 if (TC.negative) { when=-when; }
353 _set (Timecode::timecode_format_time(TC));
372 table.set_spacings (4);
373 table.set_col_spacing (0, 32);
374 box.pack_start (
table,
false,
false);
375 box.set_border_width (4);
376 n.append_page (
box, t);
386 using namespace Notebook_Helpers;
388 set_default_size (300, 300);
391 set_name (
"Preferences");
392 add_events (Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK);
394 set_border_width (4);
410 for (std::map<std::string, OptionEditorPage*>::iterator i =
_pages.begin(); i !=
_pages.end(); ++i) {
411 for (std::list<OptionEditorComponent*>::iterator j = i->second->components.begin(); j != i->second->components.end(); ++j) {
426 for (std::map<std::string, OptionEditorPage*>::iterator i =
_pages.begin(); i !=
_pages.end(); ++i) {
427 for (std::list<OptionEditorComponent*>::iterator j = i->second->components.begin(); j != i->second->components.end(); ++j) {
428 (*j)->parameter_changed (p);
463 p->
box.pack_start (w,
true,
true);
486 _file_chooser.set_action (Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
500 Gtk::Label *label = manage (
new Label (
_name));
501 label->set_alignment (0, 0.5);
502 label->set_name (
X_(
"OptionsLabel"));
void set_note(std::string const &)
std::list< OptionEditorComponent * > components
framepos_t current_time(framepos_t position=0) const
void filter_text(const Glib::ustring &, int *)
void set(framepos_t, bool force=false, ARDOUR::framecnt_t offset=0)
void set_current_page(std::string const &)
void add_page(std::string const &, Gtk::Widget &page_widget)
void set_session(ARDOUR::Session *s)
LIBGTKMM2EXT_API void set_size_request_to_display_given_text(Gtk::Widget &w, const gchar *text, gint hpadding, gint vpadding)
OptionEditorPage(Gtk::Notebook &, std::string const &)
Gtkmm2ext::HSliderController * _db_slider
void set_state_from_config()
DirectoryOption(std::string const &, std::string const &, sigc::slot< std::string >, sigc::slot< bool, std::string >)
Gtk::CheckButton * _button
UI button.
LIBARDOUR_API double slider_position_to_gain_with_max(double g, double max_gain=2.0)
ClockOption(std::string const &, std::string const &, sigc::slot< std::string >, sigc::slot< bool, std::string >)
void set_state_from_config()
std::map< std::string, OptionEditorPage * > _pages
Gtk::VBox _fader_centering_box
sigc::slot< bool, std::string > _set
slot to set the configuration variable's value
#define ENSURE_GUI_THREAD(obj, method,...)
sigc::slot< std::string > _get
slot to get the configuration variable's value
static float accurate_coefficient_to_dB(float coeff)
sigc::slot< std::string > _get
double frames_per_timecode_frame() const
virtual void parameter_changed(std::string const &)
sigc::slot< bool, std::string > _set
slot to set the configuration variable's value
void add_to_page(OptionEditorPage *)
Gtk::FileChooserButton _file_chooser
bool timecode_drop_frames() const
ARDOUR::Session * _session
LIBARDOUR_API RCConfiguration * Config
PBD::ScopedConnection config_connection
void maybe_add_note(OptionEditorPage *, int)
sigc::slot< ARDOUR::gain_t > _get
void add_option(std::string const &, OptionEditorComponent *)
Base class for option editing dialog boxes.
LIBGTKMM2EXT_API Gtk::Label * left_aligned_label(std::string const &)
LIBPBD_API std::string poor_mans_glob(std::string path)
void add_widget_to_page(OptionEditorPage *, Gtk::Widget *)
Gtk::Entry * _entry
UI entry.
void set_state_from_config()
PBD::Signal1< void, std::string > ParameterChanged
sigc::signal< void > ValueChanged
void sample_to_timecode(framepos_t sample, Timecode::Time &timecode, bool use_offset, bool use_subframes) const
void set_state_from_config()
BoolComboOption(std::string const &, std::string const &, std::string const &, std::string const &, sigc::slot< bool >, sigc::slot< bool, bool >)
void set_state_from_config()
void set_session(ARDOUR::Session *)
LIBARDOUR_API double gain_to_slider_position_with_max(double g, double max_gain=2.0)
void add_to_page(OptionEditorPage *)
sigc::slot< bool, bool > _set
void set_state_from_config()
sigc::slot< bool, std::string > _set
BoolOption(std::string const &, std::string const &, sigc::slot< bool >, sigc::slot< bool, bool >)
void add_widgets_to_page(OptionEditorPage *, Gtk::Widget *, Gtk::Widget *)
RouteDisplayBoolOption(std::string const &, std::string const &, sigc::slot< bool >, sigc::slot< bool, bool >)
virtual void add_to_page(OptionEditorPage *)=0
void timecode_to_sample(Timecode::Time &timecode, framepos_t &sample, bool use_offset, bool use_subframes) const
Gtk::Label * _label
label for button, so we can use markup
EntryOption(std::string const &, std::string const &, sigc::slot< std::string >, sigc::slot< bool, std::string >)
void add_to_page(OptionEditorPage *)
Gtk::Adjustment _db_adjustment
FaderOption(std::string const &, std::string const &, sigc::slot< ARDOUR::gain_t > g, sigc::slot< bool, ARDOUR::gain_t > s)
sigc::slot< bool, ARDOUR::gain_t > _set
Gtk::ComboBoxText * _combo
sigc::slot< std::string > _get
slot to get the configuration variable's value
virtual void set_state_from_config()=0
OptionEditor(PBD::Configuration *, std::string const &)
Gtk::Label * _label
UI label.
OptionEditorHeading(std::string const &)
void add_to_page(OptionEditorPage *)
void add_to_page(OptionEditorPage *)
void add_to_page(OptionEditorPage *)
void add_to_page(OptionEditorPage *)
bool focus_out(GdkEventFocus *)
sigc::slot< bool, bool > _set
slot to set the configuration variable's value
std::string string_compose(const std::string &fmt, const T1 &o1)
PBD::Configuration * _config
sigc::slot< bool > _get
slot to get the configuration variable's value
void add_to_page(OptionEditorPage *)