diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-04-07 00:35:07 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-04-07 00:35:07 +0000 |
commit | c36c7f4b94e4cce75120ae322c0a697c9c494275 (patch) | |
tree | b019f0aa8eeb7ffb5545b17a54ad8e8f041074fc /gtk2_ardour | |
parent | 2dd0b9321c87838e9f2276c02f5942daac2b836e (diff) |
add new profile object, use it to remove certain horizontal elements from GUI if screen is narrow; make verbose canvas cursor use primary clock mode if secondary clock is not visible
git-svn-id: svn://localhost/ardour2/trunk@1676 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui2.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 9 | ||||
-rw-r--r-- | gtk2_ardour/main.cc | 1 |
6 files changed, 34 insertions, 9 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 0eccc14b0f..53b6888dcb 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -50,6 +50,7 @@ #include <midi++/mmc.h> #include <ardour/ardour.h> +#include <ardour/profile.h> #include <ardour/session_route.h> #include <ardour/port.h> #include <ardour/audioengine.h> @@ -642,11 +643,11 @@ ARDOUR_UI::update_sample_rate (nframes_t ignored) nframes_t rate = engine->frame_rate(); if (fmod (rate, 1000.0) != 0.0) { - snprintf (buf, sizeof (buf), _("%.1f kHz / %4.1f msecs"), + snprintf (buf, sizeof (buf), _("%.1f kHz / %4.1f ms"), (float) rate/1000.0f, (engine->frames_per_cycle() / (float) rate) * 1000.0f); } else { - snprintf (buf, sizeof (buf), _("%u kHz / %4.1f msecs"), + snprintf (buf, sizeof (buf), _("%u kHz / %4.1f ms"), rate/1000, (engine->frames_per_cycle() / (float) rate) * 1000.0f); } @@ -2711,3 +2712,11 @@ ARDOUR_UI::TransportControllable::set_id (const string& str) { _id = str; } + +void +ARDOUR_UI::setup_profile () +{ + if (gdk_screen_width() < 1200) { + Profile->set_small_screen (); + } +} diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index c402baaff4..8bd5e577e1 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -212,6 +212,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI void set_keybindings_path (std::string path); void save_keybindings (); + void setup_profile (); + protected: friend class PublicEditor; diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 910e15ffea..1e038e3ac7 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -34,6 +34,7 @@ #include <ardour/audioengine.h> #include <ardour/ardour.h> +#include <ardour/profile.h> #include <ardour/route.h> #include "ardour_ui.h" @@ -364,7 +365,9 @@ ARDOUR_UI::setup_transport () HBox* clock_box = manage (new HBox); clock_box->pack_start (primary_clock, false, false); - clock_box->pack_start (secondary_clock, false, false); + if (!ARDOUR::Profile->get_small_screen()) { + clock_box->pack_start (secondary_clock, false, false); + } VBox* time_controls_box = manage (new VBox); time_controls_box->pack_start (sync_option_combo, false, false); time_controls_box->pack_start (time_master_button, false, false); diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 8e1ec8a560..24a36f1e03 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -37,6 +37,7 @@ #include "actions.h" #include <ardour/session.h> +#include <ardour/profile.h> #include <ardour/audioengine.h> #include <ardour/control_protocol_manager.h> @@ -698,11 +699,13 @@ ARDOUR_UI::build_menu_bar () sample_rate_label.set_name ("SampleRate"); menu_hbox.pack_start (*menu_bar, true, true); - menu_hbox.pack_end (wall_clock_box, false, false, 10); - menu_hbox.pack_end (disk_space_box, false, false, 10); - menu_hbox.pack_end (cpu_load_box, false, false, 10); - menu_hbox.pack_end (buffer_load_box, false, false, 10); - menu_hbox.pack_end (sample_rate_box, false, false, 10); + if (!Profile->get_small_screen()) { + menu_hbox.pack_end (wall_clock_box, false, false, 2); + menu_hbox.pack_end (disk_space_box, false, false, 4); + } + menu_hbox.pack_end (cpu_load_box, false, false, 4); + menu_hbox.pack_end (buffer_load_box, false, false, 4); + menu_hbox.pack_end (sample_rate_box, false, false, 4); menu_bar_base.set_name ("MainMenuBar"); menu_bar_base.add (menu_hbox); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 39680980d6..6065c1bf1d 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -46,6 +46,7 @@ #include "rgb_macros.h" #include <ardour/types.h> +#include <ardour/profile.h> #include <ardour/route.h> #include <ardour/audio_track.h> #include <ardour/audio_diskstream.h> @@ -3307,6 +3308,12 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event where = (nframes_t) (unit_to_frame (ix1) * speed); boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region())); + /* undo the previous hide_dependent_views so that xfades don't + disappear on copying regions + */ + + rv->get_time_axis_view().reveal_dependent_views (*rv); + if (!drag_info.copy) { /* the region that used to be in the old playlist is not @@ -3510,7 +3517,7 @@ Editor::show_verbose_time_cursor (nframes_t frame, double offset, double xpos, d return; } - switch (ARDOUR_UI::instance()->secondary_clock.mode ()) { + switch (Profile->get_small_screen() ? ARDOUR_UI::instance()->primary_clock.mode () : ARDOUR_UI::instance()->secondary_clock.mode ()) { case AudioClock::BBT: session->bbt_time (frame, bbt); snprintf (buf, sizeof (buf), "%02" PRIu32 "|%02" PRIu32 "|%02" PRIu32, bbt.bars, bbt.beats, bbt.ticks); diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index 0279c4953e..501b4912c5 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -273,6 +273,7 @@ int main (int argc, char *argv[]) ARDOUR::init (use_vst, try_hw_optimization); setup_gtk_ardour_enums (); Config->set_current_owner (ConfigVariableBase::Interface); + ui->setup_profile (); try { engine = new ARDOUR::AudioEngine (jack_client_name); |