add new profile object, use it to remove certain horizontal elements from GUI if...
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 7 Apr 2007 00:35:07 +0000 (00:35 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 7 Apr 2007 00:35:07 +0000 (00:35 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1676 d708f5d6-7413-0410-9779-e7cbd77b26cf

SConstruct
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui2.cc
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/editor_mouse.cc
gtk2_ardour/main.cc
libs/ardour/ardour/profile.h [new file with mode: 0644]
libs/ardour/globals.cc

index 2875ace5e476efd9713ab01adf254e340c0d7718..9f7e915b3dc35c20a0d2fc8de1ef144964861da3 100644 (file)
@@ -16,7 +16,7 @@ import SCons.Node.FS
 SConsignFile()
 EnsureSConsVersion(0, 96)
 
-ardour_version = '2.0beta12'
+ardour_version = '2.0rc1'
 
 subst_dict = { }
 
index 0eccc14b0fb3716e809b7819ca1c986a27542793..53b6888dcbb5b250c92b359159f754b648875d3c 100644 (file)
@@ -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 ();
+       }
+}
index c402baaff4188e275a03d83d6b5a96717f5e708b..8bd5e577e1788777995f9d842197d15a55d85f06 100644 (file)
@@ -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;
 
index 910e15ffea6d1873953963a1d3b6e72aefadcb73..1e038e3ac7322bbe275904d914d062ae34b68057 100644 (file)
@@ -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);
index 8e1ec8a560f72500a9ef82ee28ab4d482079d644..24a36f1e03b8b1ad158bc4b81ebcf8ac91fca39f 100644 (file)
@@ -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);
index 39680980d6e8f19fa6ba80ee668405c2b7e15bf3..6065c1bf1df4458f141963113fd75e378fce8220 100644 (file)
@@ -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);
index 0279c4953e562accdae168ddd34397d2c0635e42..501b4912c5c058e70dd248a2567f21238067efd2 100644 (file)
@@ -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 (file)
index 0000000..2ee47d3
--- /dev/null
@@ -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__ */
index 406f21832c0fd7e365b1971c36e6eede13b82961..2d22f4eb1189fee38825fc442f74c524ed51957e 100644 (file)
@@ -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;
        }