mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Allow status bar components to be individually shown / hidden.
git-svn-id: svn://localhost/ardour2/branches/3.0@10296 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ae2bbd98a5
commit
f8c6840677
5 changed files with 155 additions and 6 deletions
|
|
@ -329,6 +329,17 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
|
||||||
|
|
||||||
starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup));
|
starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup));
|
||||||
stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown));
|
stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown));
|
||||||
|
|
||||||
|
{
|
||||||
|
_status_bar_visiblity = (StatusBarComponent) (StatusCPULoad | StatusBufferLoad | StatusSampleRate | StatusFormat);
|
||||||
|
XMLNode* n = Config->extra_xml (X_("UI"));
|
||||||
|
if (n) {
|
||||||
|
XMLProperty* p = n->property (X_("status-bar-visibility"));
|
||||||
|
if (p) {
|
||||||
|
_status_bar_visiblity = (StatusBarComponent) string_2_enum (p->value(), _status_bar_visiblity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return true if a session was chosen and `apply' clicked, otherwise false if `cancel' was clicked */
|
/** @return true if a session was chosen and `apply' clicked, otherwise false if `cancel' was clicked */
|
||||||
|
|
@ -712,6 +723,11 @@ ARDOUR_UI::startup ()
|
||||||
add_window_proxy (_global_port_matrix[*i]);
|
add_window_proxy (_global_port_matrix[*i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We have to do this here since goto_editor_window() ends up calling show_all() on the
|
||||||
|
* editor window, and we may want stuff to be hidden.
|
||||||
|
*/
|
||||||
|
update_status_bar_visibility ();
|
||||||
|
|
||||||
BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME));
|
BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
#include "editing.h"
|
#include "editing.h"
|
||||||
#include "ui_config.h"
|
#include "ui_config.h"
|
||||||
#include "window_proxy.h"
|
#include "window_proxy.h"
|
||||||
|
#include "enums.h"
|
||||||
|
|
||||||
class About;
|
class About;
|
||||||
class AddRouteDialog;
|
class AddRouteDialog;
|
||||||
|
|
@ -720,6 +721,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
||||||
int ambiguous_file (std::string file, std::string path, std::vector<std::string> hits);
|
int ambiguous_file (std::string file, std::string path, std::vector<std::string> hits);
|
||||||
|
|
||||||
bool click_button_clicked (GdkEventButton *);
|
bool click_button_clicked (GdkEventButton *);
|
||||||
|
|
||||||
|
bool status_bar_button_press_event (GdkEventButton *);
|
||||||
|
void update_status_bar_visibility ();
|
||||||
|
void toggle_status_bar_visibility (StatusBarComponent);
|
||||||
|
StatusBarComponent _status_bar_visiblity;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __ardour_gui_h__ */
|
#endif /* __ardour_gui_h__ */
|
||||||
|
|
|
||||||
|
|
@ -522,6 +522,13 @@ ARDOUR_UI::build_menu_bar ()
|
||||||
// so use this instead ...
|
// so use this instead ...
|
||||||
gtk_settings_set_long_property (gtk_settings_get_default(), "gtk-can-change-accels", 1, "Ardour:designers");
|
gtk_settings_set_long_property (gtk_settings_get_default(), "gtk-can-change-accels", 1, "Ardour:designers");
|
||||||
|
|
||||||
|
EventBox* ev = manage (new EventBox);
|
||||||
|
ev->show ();
|
||||||
|
HBox* hbox = manage (new HBox);
|
||||||
|
hbox->show ();
|
||||||
|
|
||||||
|
ev->add (*hbox);
|
||||||
|
|
||||||
wall_clock_box.add (wall_clock_label);
|
wall_clock_box.add (wall_clock_label);
|
||||||
wall_clock_box.set_name ("WallClock");
|
wall_clock_box.set_name ("WallClock");
|
||||||
wall_clock_label.set_name ("WallClock");
|
wall_clock_label.set_name ("WallClock");
|
||||||
|
|
@ -562,18 +569,119 @@ ARDOUR_UI::build_menu_bar ()
|
||||||
if (!Profile->get_small_screen()) {
|
if (!Profile->get_small_screen()) {
|
||||||
#ifndef GTKOSX
|
#ifndef GTKOSX
|
||||||
// OSX provides its own wallclock, thank you very much
|
// OSX provides its own wallclock, thank you very much
|
||||||
menu_hbox.pack_end (wall_clock_box, false, false, 2);
|
_status_bar_visiblity = (StatusBarComponent) (_status_bar_visiblity | StatusWallClock);
|
||||||
#endif
|
#endif
|
||||||
menu_hbox.pack_end (disk_space_box, false, false, 4);
|
_status_bar_visiblity = (StatusBarComponent) (_status_bar_visiblity | StatusDiskSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hbox->pack_end (wall_clock_box, false, false, 2);
|
||||||
|
hbox->pack_end (disk_space_box, false, false, 4);
|
||||||
|
hbox->pack_end (cpu_load_box, false, false, 4);
|
||||||
|
hbox->pack_end (buffer_load_box, false, false, 4);
|
||||||
|
hbox->pack_end (sample_rate_box, false, false, 4);
|
||||||
|
hbox->pack_end (format_box, false, false, 4);
|
||||||
|
|
||||||
menu_hbox.pack_end (cpu_load_box, false, false, 4);
|
menu_hbox.pack_end (*ev, false, false);
|
||||||
menu_hbox.pack_end (buffer_load_box, false, false, 4);
|
|
||||||
menu_hbox.pack_end (sample_rate_box, false, false, 4);
|
|
||||||
menu_hbox.pack_end (format_box, false, false, 4);
|
|
||||||
|
|
||||||
menu_bar_base.set_name ("MainMenuBar");
|
menu_bar_base.set_name ("MainMenuBar");
|
||||||
menu_bar_base.add (menu_hbox);
|
menu_bar_base.add (menu_hbox);
|
||||||
|
|
||||||
|
ev->signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::status_bar_button_press_event));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ARDOUR_UI::status_bar_button_press_event (GdkEventButton* ev)
|
||||||
|
{
|
||||||
|
if (ev->button != 3) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
using namespace Menu_Helpers;
|
||||||
|
|
||||||
|
Menu* m = manage (new Menu);
|
||||||
|
|
||||||
|
MenuList& items = m->items ();
|
||||||
|
|
||||||
|
items.push_back (CheckMenuElem (_("Wall Clock")));
|
||||||
|
CheckMenuItem* i = dynamic_cast<CheckMenuItem*> (&items.back ());
|
||||||
|
i->set_active (_status_bar_visiblity & StatusWallClock);
|
||||||
|
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::toggle_status_bar_visibility), StatusWallClock));
|
||||||
|
|
||||||
|
items.push_back (CheckMenuElem (_("Disk Space")));
|
||||||
|
i = dynamic_cast<CheckMenuItem*> (&items.back ());
|
||||||
|
i->set_active (_status_bar_visiblity & StatusDiskSpace);
|
||||||
|
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::toggle_status_bar_visibility), StatusDiskSpace));
|
||||||
|
|
||||||
|
items.push_back (CheckMenuElem (_("DSP")));
|
||||||
|
i = dynamic_cast<CheckMenuItem*> (&items.back ());
|
||||||
|
i->set_active (_status_bar_visiblity & StatusCPULoad);
|
||||||
|
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::toggle_status_bar_visibility), StatusCPULoad));
|
||||||
|
|
||||||
|
items.push_back (CheckMenuElem (_("Buffers")));
|
||||||
|
i = dynamic_cast<CheckMenuItem*> (&items.back ());
|
||||||
|
i->set_active (_status_bar_visiblity & StatusBufferLoad);
|
||||||
|
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::toggle_status_bar_visibility), StatusBufferLoad));
|
||||||
|
|
||||||
|
items.push_back (CheckMenuElem (_("JACK Sampling Rate and Latency")));
|
||||||
|
i = dynamic_cast<CheckMenuItem*> (&items.back ());
|
||||||
|
i->set_active (_status_bar_visiblity & StatusSampleRate);
|
||||||
|
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::toggle_status_bar_visibility), StatusSampleRate));
|
||||||
|
|
||||||
|
items.push_back (CheckMenuElem (_("File Format")));
|
||||||
|
i = dynamic_cast<CheckMenuItem*> (&items.back ());
|
||||||
|
i->set_active (_status_bar_visiblity & StatusFormat);
|
||||||
|
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::toggle_status_bar_visibility), StatusFormat));
|
||||||
|
|
||||||
|
m->popup (1, ev->time);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::update_status_bar_visibility ()
|
||||||
|
{
|
||||||
|
if (_status_bar_visiblity & StatusWallClock) {
|
||||||
|
wall_clock_box.show ();
|
||||||
|
} else {
|
||||||
|
wall_clock_box.hide ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_status_bar_visiblity & StatusDiskSpace) {
|
||||||
|
disk_space_box.show ();
|
||||||
|
} else {
|
||||||
|
disk_space_box.hide ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_status_bar_visiblity & StatusCPULoad) {
|
||||||
|
cpu_load_box.show ();
|
||||||
|
} else {
|
||||||
|
cpu_load_box.hide ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_status_bar_visiblity & StatusBufferLoad) {
|
||||||
|
buffer_load_box.show ();
|
||||||
|
} else {
|
||||||
|
buffer_load_box.hide ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_status_bar_visiblity & StatusSampleRate) {
|
||||||
|
sample_rate_box.show ();
|
||||||
|
} else {
|
||||||
|
sample_rate_box.hide ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_status_bar_visiblity & StatusFormat) {
|
||||||
|
format_box.show ();
|
||||||
|
} else {
|
||||||
|
format_box.hide ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::toggle_status_bar_visibility (StatusBarComponent c)
|
||||||
|
{
|
||||||
|
_status_bar_visiblity = (StatusBarComponent) (_status_bar_visiblity ^ c);
|
||||||
|
update_status_bar_visibility ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -721,6 +829,7 @@ ARDOUR_UI::save_ardour_state ()
|
||||||
Config->add_extra_xml (get_transport_controllable_state());
|
Config->add_extra_xml (get_transport_controllable_state());
|
||||||
|
|
||||||
XMLNode* window_node = new XMLNode (X_("UI"));
|
XMLNode* window_node = new XMLNode (X_("UI"));
|
||||||
|
window_node->add_property (X_("status-bar-visibility"), enum_2_string (_status_bar_visiblity));
|
||||||
|
|
||||||
for (list<WindowProxyBase*>::iterator i = _window_proxies.begin(); i != _window_proxies.end(); ++i) {
|
for (list<WindowProxyBase*>::iterator i = _window_proxies.begin(); i != _window_proxies.end(); ++i) {
|
||||||
if ((*i)->rc_configured()) {
|
if ((*i)->rc_configured()) {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ setup_gtk_ardour_enums ()
|
||||||
EditPoint edit_point;
|
EditPoint edit_point;
|
||||||
LayerDisplay layer_display;
|
LayerDisplay layer_display;
|
||||||
RegionListSortType region_list_sort_type;
|
RegionListSortType region_list_sort_type;
|
||||||
|
StatusBarComponent status_bar_component;
|
||||||
|
|
||||||
#define REGISTER(e) enum_writer.register_distinct (typeid(e).name(), i, s); i.clear(); s.clear()
|
#define REGISTER(e) enum_writer.register_distinct (typeid(e).name(), i, s); i.clear(); s.clear()
|
||||||
#define REGISTER_BITS(e) enum_writer.register_bits (typeid(e).name(), i, s); i.clear(); s.clear()
|
#define REGISTER_BITS(e) enum_writer.register_bits (typeid(e).name(), i, s); i.clear(); s.clear()
|
||||||
|
|
@ -83,4 +84,12 @@ setup_gtk_ardour_enums ()
|
||||||
REGISTER_ENUM (ByStartInFile);
|
REGISTER_ENUM (ByStartInFile);
|
||||||
REGISTER_ENUM (ByTimestamp);
|
REGISTER_ENUM (ByTimestamp);
|
||||||
REGISTER (region_list_sort_type);
|
REGISTER (region_list_sort_type);
|
||||||
|
|
||||||
|
REGISTER_ENUM (StatusWallClock);
|
||||||
|
REGISTER_ENUM (StatusDiskSpace);
|
||||||
|
REGISTER_ENUM (StatusCPULoad);
|
||||||
|
REGISTER_ENUM (StatusBufferLoad);
|
||||||
|
REGISTER_ENUM (StatusSampleRate);
|
||||||
|
REGISTER_ENUM (StatusFormat);
|
||||||
|
REGISTER_BITS (status_bar_component);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,15 @@ enum Height {
|
||||||
HeightSmall
|
HeightSmall
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum StatusBarComponent {
|
||||||
|
StatusWallClock = 0x1,
|
||||||
|
StatusDiskSpace = 0x2,
|
||||||
|
StatusCPULoad = 0x4,
|
||||||
|
StatusBufferLoad = 0x8,
|
||||||
|
StatusSampleRate = 0x10,
|
||||||
|
StatusFormat = 0x20
|
||||||
|
};
|
||||||
|
|
||||||
extern void setup_gtk_ardour_enums ();
|
extern void setup_gtk_ardour_enums ();
|
||||||
|
|
||||||
#endif /* __ardour_gtk_enums_h__ */
|
#endif /* __ardour_gtk_enums_h__ */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue