Option to glue new markers to bars and beats (part of
authorCarl Hetherington <carl@carlh.net>
Wed, 14 Sep 2011 20:39:03 +0000 (20:39 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 14 Sep 2011 20:39:03 +0000 (20:39 +0000)
#4202).

git-svn-id: svn://localhost/ardour2/branches/3.0@10087 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/session_option_editor.cc
libs/ardour/ardour/session_configuration_vars.h
libs/ardour/location.cc

index 73663ebe2228da6aebe53c7f1ed4b0c250ea08ea..bd5f359297ce26c416bad9579dd3de27699e1888 100644 (file)
@@ -293,6 +293,15 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
                            sigc::mem_fun (*_session_config, &SessionConfiguration::get_bwf_organization_code),
                            sigc::mem_fun (*_session_config, &SessionConfiguration::set_bwf_organization_code)
                            ));
+
+       add_option (_("Misc"), new OptionEditorHeading (_("Glue to bars and beats")));
+
+       add_option (_("Misc"), new BoolOption (
+                           "glue-new-markers-to-bars-and-beats",
+                           _("Glue new markers to bars and beats"),
+                           sigc::mem_fun (*_session_config, &SessionConfiguration::get_glue_new_markers_to_bars_and_beats),
+                           sigc::mem_fun (*_session_config, &SessionConfiguration::set_glue_new_markers_to_bars_and_beats)
+                           ));
 }
 
 void
index 5924adcc863531c6b04de2c5f12ece9c02e72277..acefc9250638cf2390a0910c517bc2a9b2b86ad9 100644 (file)
@@ -61,3 +61,4 @@ CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", JACK)
 CONFIG_VARIABLE (InsertMergePolicy, insert_merge_policy, "insert-merge-policy", InsertMergeRelax)
 CONFIG_VARIABLE (framecnt_t, timecode_offset, "timecode-offset", 0)
 CONFIG_VARIABLE (bool, timecode_offset_negative, "timecode-offset-negative", true)
+CONFIG_VARIABLE (bool, glue_new_markers_to_bars_and_beats, "glue-new-markers-to-bars-and-beats", false)
index 7095596101be1e6fbc9cbceb48f1f99d7f2406b0..b6a09d863ab189a5e3ea1a84209c6ad4ad02f366 100644 (file)
@@ -54,6 +54,7 @@ Location::Location (Session& s)
        assert (_end >= 0);
 }
 
+/** Construct a new Location, giving it the position lock style determined by glue-new-markers-to-bars-and-beats */
 Location::Location (Session& s, framepos_t sample_start, framepos_t sample_end, const std::string &name, Flags bits)
        : SessionHandleRef (s)
        , _name (name)
@@ -61,7 +62,7 @@ Location::Location (Session& s, framepos_t sample_start, framepos_t sample_end,
        , _end (sample_end)
        , _flags (bits)
        , _locked (false)
-       , _position_lock_style (AudioTime)
+       , _position_lock_style (s.config.get_glue_new_markers_to_bars_and_beats() ? MusicTime : AudioTime)
 {
        recompute_bbt_from_frames ();