mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-09 23:25:43 +01:00
[Summary] Improving dropdown and merging the ARDOUR's and TRACKS' preferences
This commit is contained in:
parent
824aac98df
commit
dcaa492e3f
4 changed files with 139 additions and 43 deletions
|
|
@ -107,15 +107,15 @@ ARDOUR_UI::create_editor ()
|
|||
_frame_rate_button->signal_clicked.connect(sigc::mem_fun (*this, &ARDOUR_UI::on_frame_rate_button));
|
||||
_tracks_button->signal_clicked.connect(sigc::mem_fun (*this, &ARDOUR_UI::on_tracks_button));
|
||||
|
||||
_sample_rate_dropdown->signal_menu_item_clicked.connect (mem_fun(*this, &ARDOUR_UI::on_sample_rate_dropdown_item_clicked ));
|
||||
_display_format_dropdown->signal_menu_item_clicked.connect (mem_fun(*this, &ARDOUR_UI::on_display_format_dropdown_item_clicked ));
|
||||
_timecode_source_dropdown->signal_menu_item_clicked.connect (mem_fun(*this, &ARDOUR_UI::on_timecode_source_dropdown_item_clicked ));
|
||||
_sample_rate_dropdown->selected_item_changed.connect (mem_fun(*this, &ARDOUR_UI::on_sample_rate_dropdown_item_clicked ));
|
||||
_display_format_dropdown->selected_item_changed.connect (mem_fun(*this, &ARDOUR_UI::on_display_format_dropdown_item_clicked ));
|
||||
_timecode_source_dropdown->selected_item_changed.connect (mem_fun(*this, &ARDOUR_UI::on_timecode_source_dropdown_item_clicked ));
|
||||
|
||||
editor->Realized.connect (sigc::mem_fun (*this, &ARDOUR_UI::editor_realized));
|
||||
editor->signal_window_state_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::main_window_state_event_handler), true));
|
||||
|
||||
_midi_input_dropdown->signal_menu_item_clicked.connect (sigc::mem_fun (*this, &ARDOUR_UI::midi_input_chosen));
|
||||
_midi_output_dropdown->signal_menu_item_clicked.connect (sigc::mem_fun (*this, &ARDOUR_UI::midi_output_chosen));
|
||||
_midi_input_dropdown->selected_item_changed.connect (sigc::mem_fun (*this, &ARDOUR_UI::midi_input_chosen));
|
||||
_midi_output_dropdown->selected_item_changed.connect (sigc::mem_fun (*this, &ARDOUR_UI::midi_output_chosen));
|
||||
|
||||
populate_midi_inout_dropdowns ();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Dialog title="Tracks Preferences" resizeable="false">
|
||||
<style name="generic_control"
|
||||
winfont ="Arial 10"
|
||||
macfont ="Helvetica 10"
|
||||
winfont="Arial 10"
|
||||
macfont="Helvetica 10"
|
||||
fgnormal="#BFBFBF"
|
||||
bgnormal="#6C6C6C"
|
||||
fgactive="#BFBFBF"
|
||||
|
|
@ -57,6 +57,15 @@
|
|||
<EventBox bgnormal="#A0A0A0"
|
||||
width="107"
|
||||
height="1"/>
|
||||
<Iconbutton id="general_settings_tab_button"
|
||||
width="107"
|
||||
height="65"
|
||||
normalicon="preferences_general_settings_tab_button"
|
||||
activeicon="preferences_general_settings_tab_button_active"
|
||||
_prelighticon="preferences_general_settings_tab_button_prelight"/>
|
||||
<EventBox bgnormal="#A0A0A0"
|
||||
width="107"
|
||||
height="1"/>
|
||||
</VBox>
|
||||
|
||||
<Layout bgnormal="#565656"
|
||||
|
|
@ -92,7 +101,7 @@
|
|||
activeicon="preferences_apply_button_active"
|
||||
_prelighticon="preferences_apply_button_prelight"/>
|
||||
</Layout>
|
||||
<Layout id="midi_settings_layout"
|
||||
<Layout id="midi_settings_tab"
|
||||
bgnormal="#565656"
|
||||
x="113"
|
||||
y="1"
|
||||
|
|
@ -155,7 +164,7 @@
|
|||
</HBox>
|
||||
</ScrolledWindow>
|
||||
</Layout>
|
||||
<Layout id="audio_settings_layout"
|
||||
<Layout id="audio_settings_tab"
|
||||
bgnormal="#000000"
|
||||
x="113" y="1"
|
||||
width="505"
|
||||
|
|
@ -424,13 +433,17 @@
|
|||
_prelighticon="preference_no_button_prelight"/>
|
||||
</Layout>
|
||||
</Layout>
|
||||
<Layout id="session_settings_layout" bgnormal="#565656" x="113" y="1" width="505" height="557" visible="false">
|
||||
<!--
|
||||
|
||||
Igor! Add feel free to add what you need here!
|
||||
|
||||
-->
|
||||
<Label style="generic_control" text="FILE TYPE" x="24" y="40"/>
|
||||
<Layout id="session_settings_tab"
|
||||
bgnormal="#565656"
|
||||
x="113"
|
||||
y="1"
|
||||
width="505"
|
||||
height="557"
|
||||
visible="false">
|
||||
<Label style="generic_control"
|
||||
text="FILE TYPE"
|
||||
x="24"
|
||||
y="40"/>
|
||||
<Dropdown style="generic_dropdown"
|
||||
id="file_type_dropdown"
|
||||
x="215"
|
||||
|
|
@ -515,7 +528,7 @@
|
|||
text="AUTO LOCK TIMER"
|
||||
x="24"
|
||||
y="175"/>
|
||||
<Dropdown style="generic_button"
|
||||
<Dropdown style="generic_dropdown"
|
||||
id="auto_lock_timer_dropdown"
|
||||
x="215"
|
||||
y="175"
|
||||
|
|
@ -546,7 +559,7 @@
|
|||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
<Label style="generic_control" text="AUTO SAVE TIMER" x="24" y="205"/>
|
||||
<Dropdown style="generic_button"
|
||||
<Dropdown style="generic_dropdown"
|
||||
id="auto_save_timer_dropdown"
|
||||
x="215"
|
||||
y="205"
|
||||
|
|
@ -580,7 +593,7 @@
|
|||
text="PRE RECORD BUFFER"
|
||||
x="24"
|
||||
y="235"/>
|
||||
<Dropdown style="generic_button"
|
||||
<Dropdown style="generic_dropdown"
|
||||
id="pre_record_buffer_dropdown"
|
||||
x="215"
|
||||
y="235"
|
||||
|
|
@ -625,5 +638,61 @@
|
|||
<dropdownitem title="MONO"/>
|
||||
<dropdownitem title="STEREO"/>
|
||||
</Layout>
|
||||
<EventBox id="general_settings_tab"
|
||||
bgnormal="#565656"
|
||||
x="113"
|
||||
y="1"
|
||||
width="505"
|
||||
height="557"
|
||||
visible="false">
|
||||
<HBox>
|
||||
<VBox width="21"/>
|
||||
<VBox>
|
||||
<HBox height="21"/>
|
||||
<HBox >
|
||||
<Label style="generic_control"
|
||||
text="WAVEFORM SHAPE"
|
||||
horzalignment="end"/>
|
||||
<Dropdown style="generic_dropdown"
|
||||
id="waveform_dropdown"
|
||||
width="150"
|
||||
height="20"
|
||||
normalicon="preference_session_settings_dropdown"
|
||||
activeicon="preference_session_settings_dropdown_active"
|
||||
_prelighticon="preference_session_settings_dropdown_prelight">
|
||||
<!--ComboOption<WaveformShape>
|
||||
* wfsh = new ComboOption<WaveformShape>
|
||||
(
|
||||
"waveform-shape",
|
||||
_("Waveform shape"),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::get_waveform_shape),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_waveform_shape)
|
||||
);-->
|
||||
|
||||
<HBox>
|
||||
<VBox width="10"/>
|
||||
<Label style="generic_control"
|
||||
horzalignment="start"
|
||||
width="117"/>
|
||||
</HBox>
|
||||
<DropdownMenu style="generic_dropdown_menu">
|
||||
<Dropdownitem title="traditional"
|
||||
horzalignment="start"/>
|
||||
<Dropdownitem title="rectified"
|
||||
horzalignment="start"/>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
|
||||
</HBox>
|
||||
</VBox>
|
||||
</HBox>
|
||||
<!--<ScrolledWindow
|
||||
hscroll="never"
|
||||
vscroll="always"
|
||||
bgnormal="#565656"
|
||||
width="505"
|
||||
height="557">-->
|
||||
<!--</ScrolledWindow>-->
|
||||
</EventBox>
|
||||
</Layout>
|
||||
</Dialog>
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@
|
|||
|
||||
WavesDropdown::WavesDropdown (const std::string& title)
|
||||
: WavesIconButton (title)
|
||||
, _selected_item_number (-1)
|
||||
{
|
||||
signal_button_press_event().connect (sigc::mem_fun(*this, &WavesDropdown::on_mouse_pressed));
|
||||
signal_button_press_event().connect (sigc::mem_fun(*this, &WavesDropdown::_on_mouse_pressed));
|
||||
_menu.signal_hide ().connect (sigc::bind (sigc::mem_fun (*this, &CairoWidget::set_active), false));
|
||||
}
|
||||
|
||||
|
|
@ -30,13 +31,25 @@ WavesDropdown::~WavesDropdown ()
|
|||
{
|
||||
}
|
||||
|
||||
bool
|
||||
WavesDropdown::on_mouse_pressed (GdkEventButton*)
|
||||
void
|
||||
WavesDropdown::clear_items ()
|
||||
{
|
||||
_menu.popup (sigc::mem_fun(this, &WavesDropdown::_on_popup_menu_position), 1, gtk_get_current_event_time());
|
||||
_hovering = _pushed = false;
|
||||
set_active (true);
|
||||
return true;
|
||||
_menu.items().clear ();
|
||||
}
|
||||
|
||||
void
|
||||
WavesDropdown::set_selected_item (int selected_item_number)
|
||||
{
|
||||
Gtk::Menu_Helpers::MenuList& items = _menu.items ();
|
||||
|
||||
if ((selected_item_number < 0) || (selected_item_number >= items.size ())) {
|
||||
return;
|
||||
}
|
||||
|
||||
Gtk::Menu_Helpers::MenuList::iterator i = items.begin();
|
||||
std::advance (i, _selected_item_number);
|
||||
|
||||
_on_menu_item (_selected_item_number, (*i).get_data ("waves_dropdown_item_cookie"));
|
||||
}
|
||||
|
||||
Gtk::MenuItem&
|
||||
|
|
@ -53,6 +66,8 @@ WavesDropdown::add_menu_item (const std::string& item, void* cookie)
|
|||
child->set_style (get_style());
|
||||
}
|
||||
|
||||
menuitem.set_data ("waves_dropdown_item_cookie", cookie);
|
||||
|
||||
return menuitem;
|
||||
}
|
||||
|
||||
|
|
@ -70,6 +85,8 @@ WavesDropdown::add_radio_menu_item (const std::string& item, void* cookie)
|
|||
child->set_style (get_style());
|
||||
}
|
||||
|
||||
menuitem.set_data ("waves_dropdown_item_cookie", cookie);
|
||||
|
||||
return menuitem;
|
||||
}
|
||||
|
||||
|
|
@ -87,23 +104,21 @@ WavesDropdown::add_check_menu_item (const std::string& item, void* cookie)
|
|||
child->set_style (get_style());
|
||||
}
|
||||
|
||||
menuitem.set_data ("waves_dropdown_item_cookie", cookie);
|
||||
|
||||
return menuitem;
|
||||
}
|
||||
|
||||
void
|
||||
WavesDropdown::clear_items ()
|
||||
WavesDropdown::_on_menu_item (int item_number, void* cookie)
|
||||
{
|
||||
_menu.items().clear ();
|
||||
}
|
||||
_selected_item_number = item_number;
|
||||
|
||||
void
|
||||
WavesDropdown::_on_menu_item (size_t item_number, void* cookie)
|
||||
{
|
||||
Gtk::Menu_Helpers::MenuList& items = _menu.items ();
|
||||
Gtk::Menu_Helpers::MenuList::iterator i = items.begin();
|
||||
std::advance (i, item_number);
|
||||
std::advance (i, _selected_item_number);
|
||||
set_text ((*i).get_label());
|
||||
signal_menu_item_clicked (this, cookie);
|
||||
selected_item_changed (this, cookie);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -126,3 +141,12 @@ WavesDropdown::_on_popup_menu_position (int& x, int& y, bool& push_in)
|
|||
y += yo;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
WavesDropdown::_on_mouse_pressed (GdkEventButton*)
|
||||
{
|
||||
_menu.popup (sigc::mem_fun(this, &WavesDropdown::_on_popup_menu_position), 1, gtk_get_current_event_time());
|
||||
_hovering = _pushed = false;
|
||||
set_active (true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,22 +31,25 @@ class WavesDropdown : public WavesIconButton
|
|||
WavesDropdown (const std::string& title = "");
|
||||
virtual ~WavesDropdown ();
|
||||
Gtk::Menu& get_menu () { return _menu; }
|
||||
|
||||
bool on_mouse_pressed (GdkEventButton*);
|
||||
|
||||
Gtk::MenuItem& add_menu_item (const std::string& item, void* cookie);
|
||||
Gtk::RadioMenuItem& add_radio_menu_item (const std::string& item, void* cookie);
|
||||
Gtk::CheckMenuItem& add_check_menu_item (const std::string& item, void* cookie);
|
||||
|
||||
void clear_items ();
|
||||
int get_selected_item () { return _selected_item_number; }
|
||||
|
||||
void set_selected_item (int selected_item_number);
|
||||
|
||||
Gtk::MenuItem& add_menu_item (const std::string& item, void* cookie = 0);
|
||||
Gtk::RadioMenuItem& add_radio_menu_item (const std::string& item, void* cookie = 0);
|
||||
Gtk::CheckMenuItem& add_check_menu_item (const std::string& item, void* cookie = 0);
|
||||
|
||||
|
||||
sigc::signal2<void, WavesDropdown*, void*> signal_menu_item_clicked;
|
||||
sigc::signal2<void, WavesDropdown*, void*> selected_item_changed;
|
||||
|
||||
private:
|
||||
Gtk::Menu _menu;
|
||||
int _selected_item_number;
|
||||
Gtk::RadioMenuItem::Group _radio_menu_items_group;
|
||||
void _on_menu_item (size_t item_number, void* cookie);
|
||||
void _on_menu_item (int item_number, void* cookie);
|
||||
void _on_popup_menu_position (int& x, int& y, bool& push_in);
|
||||
bool _on_mouse_pressed (GdkEventButton*);
|
||||
};
|
||||
|
||||
#endif /* __gtk2_ardour_waves_dropdown_h__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue