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 | |
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
-rw-r--r-- | SConstruct | 2 | ||||
-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 | ||||
-rw-r--r-- | libs/ardour/ardour/profile.h | 31 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 4 |
9 files changed, 70 insertions, 10 deletions
diff --git a/SConstruct b/SConstruct index 2875ace5e4..9f7e915b3d 100644 --- a/SConstruct +++ b/SConstruct @@ -16,7 +16,7 @@ import SCons.Node.FS SConsignFile() EnsureSConsVersion(0, 96) -ardour_version = '2.0beta12' +ardour_version = '2.0rc1' subst_dict = { } 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); diff --git a/libs/ardour/ardour/profile.h b/libs/ardour/ardour/profile.h new file mode 100644 index 0000000000..2ee47d39ea --- /dev/null +++ b/libs/ardour/ardour/profile.h @@ -0,0 +1,31 @@ +#ifndef __ardour_profile_h__ +#define __ardour_profile_h__ + +#include <boost/dynamic_bitset.hpp> +#include <stdint.h> + +namespace ARDOUR { + +class RuntimeProfile { + public: + enum Element { + SmallScreen, + LastElement + }; + + RuntimeProfile() { bits.resize (LastElement); } + ~RuntimeProfile() {} + + void set_small_screen() { bits[SmallScreen] = true; } + bool get_small_screen() const { return bits[SmallScreen]; } + + private: + boost::dynamic_bitset<uint64_t> bits; + +}; + +extern RuntimeProfile* Profile; + +}; // namespace ARDOUR + +#endif /* __ardour_profile_h__ */ diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 406f21832c..2d22f4eb11 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -42,6 +42,7 @@ #include <ardour/ardour.h> #include <ardour/audio_library.h> #include <ardour/configuration.h> +#include <ardour/profile.h> #include <ardour/plugin_manager.h> #include <ardour/audiosource.h> #include <ardour/utils.h> @@ -61,6 +62,7 @@ #include "i18n.h" ARDOUR::Configuration* ARDOUR::Config = 0; +ARDOUR::RuntimeProfile* ARDOUR::Profile = 0; ARDOUR::AudioLibrary* ARDOUR::Library = 0; #ifdef HAVE_LIBLO @@ -294,6 +296,8 @@ ARDOUR::init (bool use_vst, bool try_optimization) Config->set_use_vst (use_vst); + Profile = new RuntimeProfile; + if (setup_midi ()) { return -1; } |