mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
new_grid: Rewrite of Snap and Grid. (squashed commit)
Separate Snap from Grid. Lots of naming changes. Multiple simultaneous snap options allowed. Grid is one of the possible Snap options. Grid uses the same data as the rulers. Replace complicated tempo_lines with simple grid_lines. The Grid is zoom-scale-sensitive along with the rulers. If you are zoomed out, grid becomes coarser.
This commit is contained in:
parent
d6eb1c826f
commit
dc61256466
32 changed files with 959 additions and 1360 deletions
|
|
@ -341,11 +341,9 @@ This mode provides many different operations on both regions and control points,
|
||||||
;; numbers
|
;; numbers
|
||||||
|
|
||||||
@vis|Editor/cycle-zoom-focus|1|cycle to next zoom focus
|
@vis|Editor/cycle-zoom-focus|1|cycle to next zoom focus
|
||||||
@grid|Editor/cycle-snap-mode|2|cycle to next grid snap mode
|
@grid|Editor/cycle-snap-mode|2|cycle to next snap mode
|
||||||
@grid|Editor/prev-snap-choice|3|use next grid unit
|
@grid|Editor/prev-grid-choice|3|use prev grid unit
|
||||||
@grid|Editor/prev-snap-choice-music-only|<@PRIMARY@>3|use previous grid unit
|
@grid|Editor/next-grid-choice|4|use next grid unit
|
||||||
@grid|Editor/next-snap-choice|4|use next grid unit
|
|
||||||
@grid|Editor/next-snap-choice-music-only|<@PRIMARY@>4|use next musical grid unit
|
|
||||||
@gmode|Transport/ToggleAutoPlay|5|toggle auto play
|
@gmode|Transport/ToggleAutoPlay|5|toggle auto play
|
||||||
@gmode|Transport/ToggleAutoReturn|6|toggle auto return
|
@gmode|Transport/ToggleAutoReturn|6|toggle auto return
|
||||||
@gmode|Transport/ToggleClick|7|toggle click (metronome)
|
@gmode|Transport/ToggleClick|7|toggle click (metronome)
|
||||||
|
|
|
||||||
|
|
@ -232,48 +232,29 @@
|
||||||
<menuitem action='cycle-edit-point'/>
|
<menuitem action='cycle-edit-point'/>
|
||||||
<menuitem action='cycle-edit-point-with-marker'/>
|
<menuitem action='cycle-edit-point-with-marker'/>
|
||||||
</menu>
|
</menu>
|
||||||
<menu name='SnapMode' action='SnapMode'>
|
<menuitem action='cycle-snap-mode'/>
|
||||||
<menuitem action='snap-off'/>
|
<menu name='GridChoice' action='GridChoice'>
|
||||||
<menuitem action='snap-normal'/>
|
<menuitem action='prev-grid-choice'/>
|
||||||
<menuitem action='snap-magnetic'/>
|
<menuitem action='next-grid-choice'/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<menuitem action='cycle-snap-mode'/>
|
<menuitem action='grid-type-none'/>
|
||||||
<menuitem action='next-snap-choice'/>
|
<menuitem action='grid-type-bar'/>
|
||||||
<menuitem action='prev-snap-choice'/>
|
<menuitem action='grid-type-beat'/>
|
||||||
<menuitem action='next-snap-choice-music-only'/>
|
<menuitem action='grid-type-halves'/>
|
||||||
<menuitem action='prev-snap-choice-music-only'/>
|
<menuitem action='grid-type-quarters'/>
|
||||||
</menu>
|
<menuitem action='grid-type-eighths'/>
|
||||||
<menu name='SnapTo' action='SnapTo'>
|
<menuitem action='grid-type-asixteenthbeat'/>
|
||||||
<menuitem action='snap-to-cd-frame'/>
|
<menuitem action='grid-type-thirtyseconds'/>
|
||||||
<menuitem action='snap-to-timecode-frame'/>
|
<menuitem action='grid-type-thirds'/>
|
||||||
<menuitem action='snap-to-timecode-seconds'/>
|
<menuitem action='grid-type-sixths'/>
|
||||||
<menuitem action='snap-to-timecode-minutes'/>
|
<menuitem action='grid-type-twelfths'/>
|
||||||
<menuitem action='snap-to-seconds'/>
|
<menuitem action='grid-type-twentyfourths'/>
|
||||||
<menuitem action='snap-to-minutes'/>
|
<menuitem action='grid-type-fifths'/>
|
||||||
<menuitem action='snap-to-onetwentyeighths'/>
|
<menuitem action='grid-type-tenths'/>
|
||||||
<menuitem action='snap-to-sixtyfourths'/>
|
<menuitem action='grid-type-twentieths'/>
|
||||||
<menuitem action='snap-to-thirtyseconds'/>
|
<menuitem action='grid-type-sevenths'/>
|
||||||
<menuitem action='snap-to-twentyeighths'/>
|
<menuitem action='grid-type-fourteenths'/>
|
||||||
<menuitem action='snap-to-twentyfourths'/>
|
<menuitem action='grid-type-twentyeighths'/>
|
||||||
<menuitem action='snap-to-twentieths'/>
|
|
||||||
<menuitem action='snap-to-asixteenthbeat'/>
|
|
||||||
<menuitem action='snap-to-fourteenths'/>
|
|
||||||
<menuitem action='snap-to-twelfths'/>
|
|
||||||
<menuitem action='snap-to-tenths'/>
|
|
||||||
<menuitem action='snap-to-eighths'/>
|
|
||||||
<menuitem action='snap-to-sevenths'/>
|
|
||||||
<menuitem action='snap-to-sixths'/>
|
|
||||||
<menuitem action='snap-to-fifths'/>
|
|
||||||
<menuitem action='snap-to-quarters'/>
|
|
||||||
<menuitem action='snap-to-thirds'/>
|
|
||||||
<menuitem action='snap-to-halves'/>
|
|
||||||
<menuitem action='snap-to-beat'/>
|
|
||||||
<menuitem action='snap-to-bar'/>
|
|
||||||
<menuitem action='snap-to-mark'/>
|
|
||||||
<menuitem action='snap-to-region-start'/>
|
|
||||||
<menuitem action='snap-to-region-end'/>
|
|
||||||
<menuitem action='snap-to-region-sync'/>
|
|
||||||
<menuitem action='snap-to-region-boundary'/>
|
|
||||||
</menu>
|
</menu>
|
||||||
<separator/>
|
<separator/>
|
||||||
<menu action="TempoMenu">
|
<menu action="TempoMenu">
|
||||||
|
|
@ -532,7 +513,6 @@
|
||||||
<menuitem action='show-editor-list'/>
|
<menuitem action='show-editor-list'/>
|
||||||
<menuitem action='ToggleMixerList'/>
|
<menuitem action='ToggleMixerList'/>
|
||||||
<menuitem action='ToggleMonitorSection'/>
|
<menuitem action='ToggleMonitorSection'/>
|
||||||
<menuitem action='ToggleMeasureVisibility'/>
|
|
||||||
<menuitem action='ToggleSummary'/>
|
<menuitem action='ToggleSummary'/>
|
||||||
<menuitem action='ToggleGroupTabs'/>
|
<menuitem action='ToggleGroupTabs'/>
|
||||||
<menuitem action='show-marker-lines'/>
|
<menuitem action='show-marker-lines'/>
|
||||||
|
|
|
||||||
|
|
@ -1531,8 +1531,7 @@ ARDOUR_UI::every_second ()
|
||||||
void
|
void
|
||||||
ARDOUR_UI::every_point_one_seconds ()
|
ARDOUR_UI::every_point_one_seconds ()
|
||||||
{
|
{
|
||||||
// TODO get rid of this..
|
if (editor) editor->build_region_boundary_cache();
|
||||||
// ShuttleControl is updated directly via TransportStateChange signal
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,9 @@ public:
|
||||||
|
|
||||||
bool get_smart_mode () const;
|
bool get_smart_mode () const;
|
||||||
|
|
||||||
|
RCOptionEditor* get_rc_option_editor() { return rc_option_editor; }
|
||||||
|
void show_tabbable (ArdourWidgets::Tabbable*);
|
||||||
|
|
||||||
int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = "");
|
int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = "");
|
||||||
int build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path);
|
int build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path);
|
||||||
bool ask_about_loading_existing_session (const std::string& session_path);
|
bool ask_about_loading_existing_session (const std::string& session_path);
|
||||||
|
|
@ -392,7 +395,6 @@ private:
|
||||||
bool _initial_verbose_plugin_scan;
|
bool _initial_verbose_plugin_scan;
|
||||||
bool first_time_engine_run;
|
bool first_time_engine_run;
|
||||||
|
|
||||||
void show_tabbable (ArdourWidgets::Tabbable*);
|
|
||||||
void hide_tabbable (ArdourWidgets::Tabbable*);
|
void hide_tabbable (ArdourWidgets::Tabbable*);
|
||||||
void detach_tabbable (ArdourWidgets::Tabbable*);
|
void detach_tabbable (ArdourWidgets::Tabbable*);
|
||||||
void attach_tabbable (ArdourWidgets::Tabbable*);
|
void attach_tabbable (ArdourWidgets::Tabbable*);
|
||||||
|
|
|
||||||
|
|
@ -517,7 +517,10 @@ ARDOUR_UI::parameter_changed (std::string p)
|
||||||
/* force a redraw */
|
/* force a redraw */
|
||||||
gtk_rc_reset_styles (gtk_settings_get_default());
|
gtk_rc_reset_styles (gtk_settings_get_default());
|
||||||
}
|
}
|
||||||
|
} else if ( (p == "snap-to-region-sync") || (p == "snap-to-region-start") || (p == "snap-to-region-end") ) {
|
||||||
|
if (editor) editor->mark_region_boundary_cache_dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ using namespace std;
|
||||||
|
|
||||||
// This involves some cpp magic. --taybin
|
// This involves some cpp magic. --taybin
|
||||||
|
|
||||||
#define SNAPTYPE(a) /*empty*/
|
#define GRIDTYPE(a) /*empty*/
|
||||||
#define SNAPMODE(a) /*empty*/
|
#define SNAPMODE(a) /*empty*/
|
||||||
#define REGIONLISTSORTTYPE(a) /*empty*/
|
#define REGIONLISTSORTTYPE(a) /*empty*/
|
||||||
#define MOUSEMODE(a) /*empty*/
|
#define MOUSEMODE(a) /*empty*/
|
||||||
|
|
@ -37,24 +37,24 @@ using namespace std;
|
||||||
|
|
||||||
namespace Editing {
|
namespace Editing {
|
||||||
|
|
||||||
// SNAPTYPE
|
// GRIDTYPE
|
||||||
#undef SNAPTYPE
|
#undef GRIDTYPE
|
||||||
#define SNAPTYPE(s) if (!strcmp(type, #s)) {return s;}
|
#define GRIDTYPE(s) if (!strcmp(type, #s)) {return s;}
|
||||||
SnapType
|
GridType
|
||||||
str2snaptype (const string & str) {
|
str2gridtype (const string & str) {
|
||||||
const char* type = str.c_str();
|
const char* type = str.c_str();
|
||||||
#include "editing_syms.h"
|
#include "editing_syms.h"
|
||||||
return SnapToBar;
|
return GridTypeBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef SNAPTYPE
|
#undef GRIDTYPE
|
||||||
#define SNAPTYPE(s) N_(#s),
|
#define GRIDTYPE(s) N_(#s),
|
||||||
const char *snaptypestrs[] = {
|
const char *gridtypestrs[] = {
|
||||||
#include "editing_syms.h"
|
#include "editing_syms.h"
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
#undef SNAPTYPE
|
#undef GRIDTYPE
|
||||||
#define SNAPTYPE(a) /*empty*/
|
#define GRIDTYPE(a) /*empty*/
|
||||||
|
|
||||||
// SNAPMODE
|
// SNAPMODE
|
||||||
#undef SNAPMODE
|
#undef SNAPMODE
|
||||||
|
|
@ -63,7 +63,7 @@ SnapMode
|
||||||
str2snapmode (const string & str) {
|
str2snapmode (const string & str) {
|
||||||
const char* type = str.c_str();
|
const char* type = str.c_str();
|
||||||
#include "editing_syms.h"
|
#include "editing_syms.h"
|
||||||
return SnapNormal;
|
return SnapMagnetic;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef SNAPMODE
|
#undef SNAPMODE
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
// This involves some cpp magic. --taybin
|
// This involves some cpp magic. --taybin
|
||||||
|
|
||||||
#define SNAPTYPE(a) /*empty*/
|
#define GRIDTYPE(a) /*empty*/
|
||||||
#define SNAPMODE(a) /*empty*/
|
#define SNAPMODE(a) /*empty*/
|
||||||
#define REGIONLISTSORTTYPE(a) /*empty*/
|
#define REGIONLISTSORTTYPE(a) /*empty*/
|
||||||
#define MOUSEMODE(a) /*empty*/
|
#define MOUSEMODE(a) /*empty*/
|
||||||
|
|
@ -43,19 +43,19 @@
|
||||||
|
|
||||||
namespace Editing {
|
namespace Editing {
|
||||||
|
|
||||||
// SNAPTYPE
|
// GRIDTYPE
|
||||||
#undef SNAPTYPE
|
#undef GRIDTYPE
|
||||||
#define SNAPTYPE(a) a,
|
#define GRIDTYPE(a) a,
|
||||||
enum SnapType {
|
enum GridType {
|
||||||
#include "editing_syms.h"
|
#include "editing_syms.h"
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const char *snaptypestrs[];
|
extern const char *gridtypestrs[];
|
||||||
inline const char* enum2str(SnapType m) {return snaptypestrs[m];}
|
inline const char* enum2str(GridType m) {return gridtypestrs[m];}
|
||||||
SnapType str2snaptype(const std::string &);
|
GridType str2gridtype(const std::string &);
|
||||||
|
|
||||||
#undef SNAPTYPE
|
#undef GRIDTYPE
|
||||||
#define SNAPTYPE(a) /*empty*/
|
#define GRIDTYPE(a) /*empty*/
|
||||||
|
|
||||||
// SNAPMODE
|
// SNAPMODE
|
||||||
#undef SNAPMODE
|
#undef SNAPMODE
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
namespace PBD {
|
namespace PBD {
|
||||||
|
|
||||||
DEFINE_ENUM_CONVERT(Editing::ZoomFocus)
|
DEFINE_ENUM_CONVERT(Editing::ZoomFocus)
|
||||||
DEFINE_ENUM_CONVERT(Editing::SnapType)
|
DEFINE_ENUM_CONVERT(Editing::GridType)
|
||||||
DEFINE_ENUM_CONVERT(Editing::SnapMode)
|
DEFINE_ENUM_CONVERT(Editing::SnapMode)
|
||||||
DEFINE_ENUM_CONVERT(Editing::EditPoint)
|
DEFINE_ENUM_CONVERT(Editing::EditPoint)
|
||||||
DEFINE_ENUM_CONVERT(Editing::RegionListSortType)
|
DEFINE_ENUM_CONVERT(Editing::RegionListSortType)
|
||||||
|
|
|
||||||
|
|
@ -18,36 +18,28 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Changing this order will break the menu */
|
/* Changing this order will break the menu */
|
||||||
SNAPTYPE(SnapToCDFrame)
|
GRIDTYPE(GridTypeNone)
|
||||||
SNAPTYPE(SnapToTimecodeFrame)
|
GRIDTYPE(GridTypeBar)
|
||||||
SNAPTYPE(SnapToTimecodeSeconds)
|
GRIDTYPE(GridTypeBeat)
|
||||||
SNAPTYPE(SnapToTimecodeMinutes)
|
GRIDTYPE(GridTypeBeatDiv2)
|
||||||
SNAPTYPE(SnapToSeconds)
|
GRIDTYPE(GridTypeBeatDiv4)
|
||||||
SNAPTYPE(SnapToMinutes)
|
GRIDTYPE(GridTypeBeatDiv8)
|
||||||
SNAPTYPE(SnapToBeatDiv128)
|
GRIDTYPE(GridTypeBeatDiv16)
|
||||||
SNAPTYPE(SnapToBeatDiv64)
|
GRIDTYPE(GridTypeBeatDiv32)
|
||||||
SNAPTYPE(SnapToBeatDiv32)
|
GRIDTYPE(GridTypeBeatDiv3) //Triplet eighths
|
||||||
SNAPTYPE(SnapToBeatDiv28)
|
GRIDTYPE(GridTypeBeatDiv6)
|
||||||
SNAPTYPE(SnapToBeatDiv24)
|
GRIDTYPE(GridTypeBeatDiv12)
|
||||||
SNAPTYPE(SnapToBeatDiv20)
|
GRIDTYPE(GridTypeBeatDiv24)
|
||||||
SNAPTYPE(SnapToBeatDiv16)
|
GRIDTYPE(GridTypeBeatDiv5) //Quintuplet eighths
|
||||||
SNAPTYPE(SnapToBeatDiv14)
|
GRIDTYPE(GridTypeBeatDiv10)
|
||||||
SNAPTYPE(SnapToBeatDiv12)
|
GRIDTYPE(GridTypeBeatDiv20)
|
||||||
SNAPTYPE(SnapToBeatDiv10)
|
GRIDTYPE(GridTypeBeatDiv7) //Septuplet eighths
|
||||||
SNAPTYPE(SnapToBeatDiv8)
|
GRIDTYPE(GridTypeBeatDiv14)
|
||||||
SNAPTYPE(SnapToBeatDiv7)
|
GRIDTYPE(GridTypeBeatDiv28)
|
||||||
SNAPTYPE(SnapToBeatDiv6)
|
GRIDTYPE(GridTypeSmpte)
|
||||||
SNAPTYPE(SnapToBeatDiv5)
|
GRIDTYPE(GridTypeMinSec)
|
||||||
SNAPTYPE(SnapToBeatDiv4)
|
GRIDTYPE(GridTypeSamples)
|
||||||
SNAPTYPE(SnapToBeatDiv3)
|
|
||||||
SNAPTYPE(SnapToBeatDiv2)
|
|
||||||
SNAPTYPE(SnapToBeat)
|
|
||||||
SNAPTYPE(SnapToBar)
|
|
||||||
SNAPTYPE(SnapToMark)
|
|
||||||
SNAPTYPE(SnapToRegionStart)
|
|
||||||
SNAPTYPE(SnapToRegionEnd)
|
|
||||||
SNAPTYPE(SnapToRegionSync)
|
|
||||||
SNAPTYPE(SnapToRegionBoundary)
|
|
||||||
|
|
||||||
/* Changing this order will break the menu */
|
/* Changing this order will break the menu */
|
||||||
SNAPMODE(SnapOff)
|
SNAPMODE(SnapOff)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -128,6 +128,7 @@ class RulerDialog;
|
||||||
class Selection;
|
class Selection;
|
||||||
class SoundFileOmega;
|
class SoundFileOmega;
|
||||||
class StreamView;
|
class StreamView;
|
||||||
|
class GridLines;
|
||||||
class TempoLines;
|
class TempoLines;
|
||||||
class TimeAxisView;
|
class TimeAxisView;
|
||||||
class TimeInfoBox;
|
class TimeInfoBox;
|
||||||
|
|
@ -161,18 +162,15 @@ public:
|
||||||
double trackviews_height () const;
|
double trackviews_height () const;
|
||||||
|
|
||||||
void cycle_snap_mode ();
|
void cycle_snap_mode ();
|
||||||
void next_snap_choice ();
|
void next_grid_choice ();
|
||||||
void next_snap_choice_music_only ();
|
void prev_grid_choice ();
|
||||||
void next_snap_choice_music_and_time ();
|
void set_grid_to (Editing::GridType);
|
||||||
void prev_snap_choice ();
|
|
||||||
void prev_snap_choice_music_only ();
|
|
||||||
void prev_snap_choice_music_and_time ();
|
|
||||||
void set_snap_to (Editing::SnapType);
|
|
||||||
void set_snap_mode (Editing::SnapMode);
|
void set_snap_mode (Editing::SnapMode);
|
||||||
|
|
||||||
Editing::SnapMode snap_mode () const;
|
Editing::SnapMode snap_mode () const;
|
||||||
Editing::SnapType snap_type () const;
|
Editing::GridType grid_type () const;
|
||||||
bool snap_musical () const;
|
bool grid_musical () const;
|
||||||
|
bool grid_nonmusical () const;
|
||||||
|
|
||||||
void undo (uint32_t n = 1);
|
void undo (uint32_t n = 1);
|
||||||
void redo (uint32_t n = 1);
|
void redo (uint32_t n = 1);
|
||||||
|
|
@ -273,8 +271,7 @@ public:
|
||||||
|
|
||||||
/* tempo */
|
/* tempo */
|
||||||
|
|
||||||
void set_show_measures (bool yn);
|
void update_grid ();
|
||||||
bool show_measures () const { return _show_measures; }
|
|
||||||
|
|
||||||
/* analysis window */
|
/* analysis window */
|
||||||
|
|
||||||
|
|
@ -361,7 +358,6 @@ public:
|
||||||
void toggle_zero_line_visibility ();
|
void toggle_zero_line_visibility ();
|
||||||
void set_summary ();
|
void set_summary ();
|
||||||
void set_group_tabs ();
|
void set_group_tabs ();
|
||||||
void toggle_measure_visibility ();
|
|
||||||
|
|
||||||
/* returns the left-most and right-most time that the gui should allow the user to scroll to */
|
/* returns the left-most and right-most time that the gui should allow the user to scroll to */
|
||||||
std::pair <samplepos_t,samplepos_t> session_gui_extents (bool use_extra = true) const;
|
std::pair <samplepos_t,samplepos_t> session_gui_extents (bool use_extra = true) const;
|
||||||
|
|
@ -458,19 +454,16 @@ public:
|
||||||
|
|
||||||
void snap_to (ARDOUR::MusicSample& first,
|
void snap_to (ARDOUR::MusicSample& first,
|
||||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||||
|
ARDOUR::SnapPref pref = ARDOUR::SnapToAny,
|
||||||
bool for_mark = false,
|
bool for_mark = false,
|
||||||
bool ensure_snap = false);
|
bool ensure_snap = false);
|
||||||
|
|
||||||
void snap_to_with_modifier (ARDOUR::MusicSample& first,
|
void snap_to_with_modifier (ARDOUR::MusicSample& first,
|
||||||
GdkEvent const * ev,
|
GdkEvent const * ev,
|
||||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||||
|
ARDOUR::SnapPref pref = ARDOUR::SnapToAny,
|
||||||
bool for_mark = false);
|
bool for_mark = false);
|
||||||
|
|
||||||
void snap_to (ARDOUR::MusicSample& first,
|
|
||||||
ARDOUR::MusicSample& last,
|
|
||||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
|
||||||
bool for_mark = false);
|
|
||||||
|
|
||||||
void set_snapped_cursor_position (samplepos_t pos);
|
void set_snapped_cursor_position (samplepos_t pos);
|
||||||
|
|
||||||
void begin_selection_op_history ();
|
void begin_selection_op_history ();
|
||||||
|
|
@ -614,9 +607,9 @@ private:
|
||||||
void on_samples_per_pixel_changed ();
|
void on_samples_per_pixel_changed ();
|
||||||
|
|
||||||
Editing::MouseMode mouse_mode;
|
Editing::MouseMode mouse_mode;
|
||||||
Editing::SnapType pre_internal_snap_type;
|
Editing::GridType pre_internal_grid_type;
|
||||||
Editing::SnapMode pre_internal_snap_mode;
|
Editing::SnapMode pre_internal_snap_mode;
|
||||||
Editing::SnapType internal_snap_type;
|
Editing::GridType internal_grid_type;
|
||||||
Editing::SnapMode internal_snap_mode;
|
Editing::SnapMode internal_snap_mode;
|
||||||
Editing::MouseMode effective_mouse_mode () const;
|
Editing::MouseMode effective_mouse_mode () const;
|
||||||
|
|
||||||
|
|
@ -816,7 +809,6 @@ private:
|
||||||
size_t push_canvas_cursor (Gdk::Cursor*);
|
size_t push_canvas_cursor (Gdk::Cursor*);
|
||||||
void pop_canvas_cursor ();
|
void pop_canvas_cursor ();
|
||||||
|
|
||||||
Gdk::Cursor* which_grabber_cursor () const;
|
|
||||||
Gdk::Cursor* which_track_cursor () const;
|
Gdk::Cursor* which_track_cursor () const;
|
||||||
Gdk::Cursor* which_mode_cursor () const;
|
Gdk::Cursor* which_mode_cursor () const;
|
||||||
Gdk::Cursor* which_trim_cursor (bool left_side) const;
|
Gdk::Cursor* which_trim_cursor (bool left_side) const;
|
||||||
|
|
@ -1068,7 +1060,9 @@ private:
|
||||||
ARDOUR::samplepos_t find_next_region_boundary (ARDOUR::samplepos_t, int32_t dir, const TrackViewList&);
|
ARDOUR::samplepos_t find_next_region_boundary (ARDOUR::samplepos_t, int32_t dir, const TrackViewList&);
|
||||||
|
|
||||||
std::vector<ARDOUR::samplepos_t> region_boundary_cache;
|
std::vector<ARDOUR::samplepos_t> region_boundary_cache;
|
||||||
|
void mark_region_boundary_cache_dirty () { _region_boundary_cache_dirty = true; }
|
||||||
void build_region_boundary_cache ();
|
void build_region_boundary_cache ();
|
||||||
|
bool _region_boundary_cache_dirty;
|
||||||
|
|
||||||
Gtk::HBox toplevel_hpacker;
|
Gtk::HBox toplevel_hpacker;
|
||||||
|
|
||||||
|
|
@ -1530,7 +1524,7 @@ private:
|
||||||
|
|
||||||
void move_range_selection_start_or_end_to_region_boundary (bool, bool);
|
void move_range_selection_start_or_end_to_region_boundary (bool, bool);
|
||||||
|
|
||||||
Editing::SnapType _snap_type;
|
Editing::GridType _grid_type;
|
||||||
Editing::SnapMode _snap_mode;
|
Editing::SnapMode _snap_mode;
|
||||||
|
|
||||||
bool ignore_gui_changes;
|
bool ignore_gui_changes;
|
||||||
|
|
@ -1668,7 +1662,6 @@ private:
|
||||||
|
|
||||||
/* display control */
|
/* display control */
|
||||||
|
|
||||||
bool _show_measures;
|
|
||||||
/// true if the editor should follow the playhead, otherwise false
|
/// true if the editor should follow the playhead, otherwise false
|
||||||
bool _follow_playhead;
|
bool _follow_playhead;
|
||||||
/// true if we scroll the tracks rather than the playhead
|
/// true if we scroll the tracks rather than the playhead
|
||||||
|
|
@ -1676,17 +1669,17 @@ private:
|
||||||
/// true if we are in fullscreen mode
|
/// true if we are in fullscreen mode
|
||||||
bool _maximised;
|
bool _maximised;
|
||||||
|
|
||||||
TempoLines* tempo_lines;
|
std::vector<ArdourCanvas::Ruler::Mark> grid_marks;
|
||||||
|
GridLines* grid_lines;
|
||||||
|
|
||||||
ArdourCanvas::Container* global_rect_group;
|
ArdourCanvas::Container* global_rect_group;
|
||||||
ArdourCanvas::Container* time_line_group;
|
ArdourCanvas::Container* time_line_group;
|
||||||
|
|
||||||
void hide_measures ();
|
void hide_grid_lines ();
|
||||||
void draw_measures (std::vector<ARDOUR::TempoMap::BBTPoint>&);
|
void maybe_draw_grid_lines ();
|
||||||
|
|
||||||
void new_tempo_section ();
|
void new_tempo_section ();
|
||||||
|
|
||||||
|
|
||||||
void remove_tempo_marker (ArdourCanvas::Item*);
|
void remove_tempo_marker (ArdourCanvas::Item*);
|
||||||
void remove_meter_marker (ArdourCanvas::Item*);
|
void remove_meter_marker (ArdourCanvas::Item*);
|
||||||
gint real_remove_tempo_marker (ARDOUR::TempoSection*);
|
gint real_remove_tempo_marker (ARDOUR::TempoSection*);
|
||||||
|
|
@ -1761,7 +1754,8 @@ private:
|
||||||
|
|
||||||
void tempo_map_changed (const PBD::PropertyChange&);
|
void tempo_map_changed (const PBD::PropertyChange&);
|
||||||
void tempometric_position_changed (const PBD::PropertyChange&);
|
void tempometric_position_changed (const PBD::PropertyChange&);
|
||||||
void redisplay_tempo (bool immediate_redraw);
|
|
||||||
|
void redisplay_grid (bool immediate_redraw);
|
||||||
|
|
||||||
uint32_t bbt_beat_subdivision;
|
uint32_t bbt_beat_subdivision;
|
||||||
|
|
||||||
|
|
@ -1821,22 +1815,25 @@ private:
|
||||||
void set_edit_mode (ARDOUR::EditMode);
|
void set_edit_mode (ARDOUR::EditMode);
|
||||||
void cycle_edit_mode ();
|
void cycle_edit_mode ();
|
||||||
|
|
||||||
ArdourWidgets::ArdourDropdown snap_type_selector;
|
ArdourWidgets::ArdourDropdown grid_type_selector;
|
||||||
void build_snap_type_menu ();
|
void build_grid_type_menu ();
|
||||||
|
|
||||||
|
ArdourWidgets::ArdourButton snap_mode_button;
|
||||||
|
bool snap_mode_button_clicked (GdkEventButton *);
|
||||||
|
|
||||||
ArdourWidgets::ArdourDropdown snap_mode_selector;
|
|
||||||
void build_snap_mode_menu ();
|
|
||||||
Gtk::HBox snap_box;
|
Gtk::HBox snap_box;
|
||||||
|
|
||||||
std::vector<std::string> snap_type_strings;
|
Gtk::HBox _box;
|
||||||
|
|
||||||
|
std::vector<std::string> grid_type_strings;
|
||||||
std::vector<std::string> snap_mode_strings;
|
std::vector<std::string> snap_mode_strings;
|
||||||
|
|
||||||
void snap_type_selection_done (Editing::SnapType);
|
void grid_type_selection_done (Editing::GridType);
|
||||||
void snap_mode_selection_done (Editing::SnapMode);
|
void snap_mode_selection_done (Editing::SnapMode);
|
||||||
void snap_mode_chosen (Editing::SnapMode);
|
void snap_mode_chosen (Editing::SnapMode);
|
||||||
void snap_type_chosen (Editing::SnapType);
|
void grid_type_chosen (Editing::GridType);
|
||||||
|
|
||||||
Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
|
Glib::RefPtr<Gtk::RadioAction> grid_type_action (Editing::GridType);
|
||||||
Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
|
Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
|
||||||
|
|
||||||
//zoom focus meu stuff
|
//zoom focus meu stuff
|
||||||
|
|
@ -2187,14 +2184,18 @@ private:
|
||||||
void select_next_stripable (bool routes_only = true);
|
void select_next_stripable (bool routes_only = true);
|
||||||
void select_prev_stripable (bool routes_only = true);
|
void select_prev_stripable (bool routes_only = true);
|
||||||
|
|
||||||
|
samplepos_t snap_to_grid ( std::vector<ArdourCanvas::Ruler::Mark> marks,
|
||||||
|
samplepos_t presnap,
|
||||||
|
ARDOUR::RoundMode direction = ARDOUR::RoundNearest);
|
||||||
|
|
||||||
void snap_to_internal (ARDOUR::MusicSample& first,
|
void snap_to_internal (ARDOUR::MusicSample& first,
|
||||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||||
|
ARDOUR::SnapPref gpref = ARDOUR::SnapToAny,
|
||||||
bool for_mark = false,
|
bool for_mark = false,
|
||||||
bool ensure_snap = false);
|
bool ensure_snap = false);
|
||||||
|
|
||||||
void timecode_snap_to_internal (ARDOUR::MusicSample& first,
|
samplepos_t marker_snap_to_internal (samplepos_t presnap,
|
||||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
ARDOUR::RoundMode direction = ARDOUR::RoundNearest);
|
||||||
bool for_mark = false);
|
|
||||||
|
|
||||||
RhythmFerret* rhythm_ferret;
|
RhythmFerret* rhythm_ferret;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -543,55 +543,48 @@ Editor::register_actions ()
|
||||||
myactions.register_action (editor_actions, "set-edit-lock", S_("EditMode|Lock"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Lock));
|
myactions.register_action (editor_actions, "set-edit-lock", S_("EditMode|Lock"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Lock));
|
||||||
myactions.register_action (editor_actions, "cycle-edit-mode", _("Cycle Edit Mode"), sigc::mem_fun (*this, &Editor::cycle_edit_mode));
|
myactions.register_action (editor_actions, "cycle-edit-mode", _("Cycle Edit Mode"), sigc::mem_fun (*this, &Editor::cycle_edit_mode));
|
||||||
|
|
||||||
myactions.register_action (editor_actions, X_("SnapTo"), _("Snap to"));
|
myactions.register_action (editor_actions, X_("GridChoice"), _("Snap & Grid"));
|
||||||
myactions.register_action (editor_actions, X_("SnapMode"), _("Snap Mode"));
|
|
||||||
|
|
||||||
RadioAction::Group snap_mode_group;
|
RadioAction::Group snap_mode_group;
|
||||||
myactions.register_radio_action (editor_actions, snap_mode_group, X_("snap-off"), _("No Grid"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapOff)));
|
/* deprecated */ myactions.register_radio_action (editor_actions, snap_mode_group, X_("snap-off"), _("No Grid"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapOff)));
|
||||||
myactions.register_radio_action (editor_actions, snap_mode_group, X_("snap-normal"), _("Grid"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapNormal)));
|
/* deprecated */ myactions.register_radio_action (editor_actions, snap_mode_group, X_("snap-normal"), _("Grid"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapNormal))); //deprecated
|
||||||
myactions.register_radio_action (editor_actions, snap_mode_group, X_("snap-magnetic"), _("Magnetic"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapMagnetic)));
|
/* deprecated */ myactions.register_radio_action (editor_actions, snap_mode_group, X_("snap-magnetic"), _("Magnetic"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapMagnetic)));
|
||||||
|
|
||||||
myactions.register_action (editor_actions, X_("cycle-snap-mode"), _("Next Snap Mode"), sigc::mem_fun (*this, &Editor::cycle_snap_mode));
|
snap_mode_button.set_text (_("Snap"));
|
||||||
myactions.register_action (editor_actions, X_("next-snap-choice"), _("Next Snap Choice"), sigc::mem_fun (*this, &Editor::next_snap_choice));
|
snap_mode_button.set_name ("mouse mode button");
|
||||||
myactions.register_action (editor_actions, X_("next-snap-choice-music-only"), _("Next Musical Snap Choice"), sigc::mem_fun (*this, &Editor::next_snap_choice_music_only));
|
snap_mode_button.signal_button_press_event().connect (sigc::mem_fun (*this, &Editor::snap_mode_button_clicked), false);
|
||||||
myactions.register_action (editor_actions, X_("prev-snap-choice"), _("Previous Snap Choice"), sigc::mem_fun (*this, &Editor::prev_snap_choice));
|
|
||||||
myactions.register_action (editor_actions, X_("prev-snap-choice-music-only"), _("Previous Musical Snap Choice"), sigc::mem_fun (*this, &Editor::prev_snap_choice_music_only));
|
myactions.register_action (editor_actions, X_("cycle-snap-mode"), _("Toggle Snap"), sigc::mem_fun (*this, &Editor::cycle_snap_mode));
|
||||||
|
myactions.register_action (editor_actions, X_("next-grid-choice"), _("Next Quantize Grid Choice"), sigc::mem_fun (*this, &Editor::next_grid_choice));
|
||||||
|
myactions.register_action (editor_actions, X_("prev-grid-choice"), _("Previous Quantize Grid Choice"), sigc::mem_fun (*this, &Editor::prev_grid_choice));
|
||||||
|
|
||||||
Glib::RefPtr<ActionGroup> snap_actions = myactions.create_action_group (X_("Snap"));
|
Glib::RefPtr<ActionGroup> snap_actions = myactions.create_action_group (X_("Snap"));
|
||||||
RadioAction::Group snap_choice_group;
|
RadioAction::Group grid_choice_group;
|
||||||
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-cd-frame"), _("Snap to CD Frame"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToCDFrame)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-thirtyseconds"), grid_type_strings[(int)GridTypeBeatDiv32].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv32)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-timecode-frame"), _("Snap to Timecode Frame"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToTimecodeFrame)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-twentyeighths"), grid_type_strings[(int)GridTypeBeatDiv28].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv28)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-timecode-seconds"), _("Snap to Timecode Seconds"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToTimecodeSeconds)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-twentyfourths"), grid_type_strings[(int)GridTypeBeatDiv24].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv24)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-timecode-minutes"), _("Snap to Timecode Minutes"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToTimecodeMinutes)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-twentieths"), grid_type_strings[(int)GridTypeBeatDiv20].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv20)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-seconds"), _("Snap to Seconds"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSeconds)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-asixteenthbeat"), grid_type_strings[(int)GridTypeBeatDiv16].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv16)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-minutes"), _("Snap to Minutes"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToMinutes)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-fourteenths"), grid_type_strings[(int)GridTypeBeatDiv14].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv14)));
|
||||||
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-twelfths"), grid_type_strings[(int)GridTypeBeatDiv12].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv12)));
|
||||||
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-tenths"), grid_type_strings[(int)GridTypeBeatDiv10].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv10)));
|
||||||
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-eighths"), grid_type_strings[(int)GridTypeBeatDiv8].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv8)));
|
||||||
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-sevenths"), grid_type_strings[(int)GridTypeBeatDiv7].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv7)));
|
||||||
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-sixths"), grid_type_strings[(int)GridTypeBeatDiv6].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv6)));
|
||||||
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-fifths"), grid_type_strings[(int)GridTypeBeatDiv5].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv5)));
|
||||||
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-quarters"), grid_type_strings[(int)GridTypeBeatDiv4].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv4)));
|
||||||
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-thirds"), grid_type_strings[(int)GridTypeBeatDiv3].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv3)));
|
||||||
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-halves"), grid_type_strings[(int)GridTypeBeatDiv2].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeatDiv2)));
|
||||||
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-onetwentyeighths"), _("Snap to One Twenty Eighths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv128)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-smpte"), grid_type_strings[(int)GridTypeSmpte].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeSmpte)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-sixtyfourths"), _("Snap to Sixty Fourths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv64)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-minsec"), grid_type_strings[(int)GridTypeMinSec].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeMinSec)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirtyseconds"), _("Snap to Thirty Seconds"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv32)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-samples"), grid_type_strings[(int)GridTypeSamples].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeSamples)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-twentyeighths"), _("Snap to Twenty Eighths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv28)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-twentyfourths"), _("Snap to Twenty Fourths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv24)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-twentieths"), _("Snap to Twentieths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv20)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-asixteenthbeat"), _("Snap to Sixteenths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv16)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-fourteenths"), _("Snap to Fourteenths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv14)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-twelfths"), _("Snap to Twelfths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv12)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-tenths"), _("Snap to Tenths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv10)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-eighths"), _("Snap to Eighths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv8)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-sevenths"), _("Snap to Sevenths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv7)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-sixths"), _("Snap to Sixths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv6)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-fifths"), _("Snap to Fifths"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv5)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-quarters"), _("Snap to Quarters"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv4)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirds"), _("Snap to Thirds"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv3)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-halves"), _("Snap to Halves"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeatDiv2)));
|
|
||||||
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-beat"), _("Snap to Beat"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeat)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-beat"), grid_type_strings[(int)GridTypeBeat].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBeat)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-bar"), _("Snap to Bar"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBar)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-bar"), grid_type_strings[(int)GridTypeBar].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeBar)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-mark"), _("Snap to Mark"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToMark)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-start"), _("Snap to Region Start"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionStart)));
|
myactions.register_radio_action (snap_actions, grid_choice_group, X_("grid-type-none"), grid_type_strings[(int)GridTypeNone].c_str(), (sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_chosen), Editing::GridTypeNone)));
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-end"), _("Snap to Region End"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionEnd)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-sync"), _("Snap to Region Sync"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionSync)));
|
|
||||||
myactions.register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-boundary"), _("Snap to Region Boundary"), (sigc::bind (sigc::mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionBoundary)));
|
|
||||||
|
|
||||||
myactions.register_toggle_action (editor_actions, X_("show-marker-lines"), _("Show Marker Lines"), sigc::mem_fun (*this, &Editor::toggle_marker_lines));
|
myactions.register_toggle_action (editor_actions, X_("show-marker-lines"), _("Show Marker Lines"), sigc::mem_fun (*this, &Editor::toggle_marker_lines));
|
||||||
|
|
||||||
|
|
@ -738,8 +731,6 @@ Editor::register_actions ()
|
||||||
|
|
||||||
myactions.register_toggle_action (editor_actions, X_("ToggleGroupTabs"), _("Show Group Tabs"), sigc::mem_fun (*this, &Editor::set_group_tabs));
|
myactions.register_toggle_action (editor_actions, X_("ToggleGroupTabs"), _("Show Group Tabs"), sigc::mem_fun (*this, &Editor::set_group_tabs));
|
||||||
|
|
||||||
myactions.register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measure Lines"), sigc::mem_fun (*this, &Editor::toggle_measure_visibility));
|
|
||||||
|
|
||||||
myactions.register_action (editor_actions, X_("toggle-midi-input-active"), _("Toggle MIDI Input Active for Editor-Selected Tracks/Busses"),
|
myactions.register_action (editor_actions, X_("toggle-midi-input-active"), _("Toggle MIDI Input Active for Editor-Selected Tracks/Busses"),
|
||||||
sigc::bind (sigc::mem_fun (*this, &Editor::toggle_midi_input_active), false));
|
sigc::bind (sigc::mem_fun (*this, &Editor::toggle_midi_input_active), false));
|
||||||
|
|
||||||
|
|
@ -1026,16 +1017,6 @@ Editor::set_xjadeo_viewoption (int what)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Editor::toggle_measure_visibility ()
|
|
||||||
{
|
|
||||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleMeasureVisibility"));
|
|
||||||
if (act) {
|
|
||||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
|
||||||
set_show_measures (tact->get_active());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::edit_current_meter ()
|
Editor::edit_current_meter ()
|
||||||
{
|
{
|
||||||
|
|
@ -1051,101 +1032,74 @@ Editor::edit_current_tempo ()
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<RadioAction>
|
RefPtr<RadioAction>
|
||||||
Editor::snap_type_action (SnapType type)
|
Editor::grid_type_action (GridType type)
|
||||||
{
|
{
|
||||||
const char* action = 0;
|
const char* action = 0;
|
||||||
RefPtr<Action> act;
|
RefPtr<Action> act;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Editing::SnapToCDFrame:
|
case Editing::GridTypeBeatDiv32:
|
||||||
action = "snap-to-cd-frame";
|
action = "grid-type-thirtyseconds";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToTimecodeFrame:
|
case Editing::GridTypeBeatDiv28:
|
||||||
action = "snap-to-timecode-frame";
|
action = "grid-type-twentyeighths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToTimecodeSeconds:
|
case Editing::GridTypeBeatDiv24:
|
||||||
action = "snap-to-timecode-seconds";
|
action = "grid-type-twentyfourths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToTimecodeMinutes:
|
case Editing::GridTypeBeatDiv20:
|
||||||
action = "snap-to-timecode-minutes";
|
action = "grid-type-twentieths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToSeconds:
|
case Editing::GridTypeBeatDiv16:
|
||||||
action = "snap-to-seconds";
|
action = "grid-type-asixteenthbeat";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToMinutes:
|
case Editing::GridTypeBeatDiv14:
|
||||||
action = "snap-to-minutes";
|
action = "grid-type-fourteenths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv128:
|
case Editing::GridTypeBeatDiv12:
|
||||||
action = "snap-to-onetwentyeighths";
|
action = "grid-type-twelfths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv64:
|
case Editing::GridTypeBeatDiv10:
|
||||||
action = "snap-to-sixtyfourths";
|
action = "grid-type-tenths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv32:
|
case Editing::GridTypeBeatDiv8:
|
||||||
action = "snap-to-thirtyseconds";
|
action = "grid-type-eighths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv28:
|
case Editing::GridTypeBeatDiv7:
|
||||||
action = "snap-to-twentyeighths";
|
action = "grid-type-sevenths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv24:
|
case Editing::GridTypeBeatDiv6:
|
||||||
action = "snap-to-twentyfourths";
|
action = "grid-type-sixths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv20:
|
case Editing::GridTypeBeatDiv5:
|
||||||
action = "snap-to-twentieths";
|
action = "grid-type-fifths";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv16:
|
case Editing::GridTypeBeatDiv4:
|
||||||
action = "snap-to-asixteenthbeat";
|
action = "grid-type-quarters";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv14:
|
case Editing::GridTypeBeatDiv3:
|
||||||
action = "snap-to-fourteenths";
|
action = "grid-type-thirds";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv12:
|
case Editing::GridTypeBeatDiv2:
|
||||||
action = "snap-to-twelfths";
|
action = "grid-type-halves";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv10:
|
case Editing::GridTypeBeat:
|
||||||
action = "snap-to-tenths";
|
action = "grid-type-beat";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv8:
|
case Editing::GridTypeBar:
|
||||||
action = "snap-to-eighths";
|
action = "grid-type-bar";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv7:
|
case Editing::GridTypeNone:
|
||||||
action = "snap-to-sevenths";
|
action = "grid-type-none";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv6:
|
case Editing::GridTypeSmpte:
|
||||||
action = "snap-to-sixths";
|
action = "grid-type-smpte";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv5:
|
case Editing::GridTypeSamples:
|
||||||
action = "snap-to-fifths";
|
action = "grid-type-samples";
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv4:
|
case Editing::GridTypeMinSec:
|
||||||
action = "snap-to-quarters";
|
action = "grid-type-minsec";
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv3:
|
|
||||||
action = "snap-to-thirds";
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv2:
|
|
||||||
action = "snap-to-halves";
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeat:
|
|
||||||
action = "snap-to-beat";
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBar:
|
|
||||||
action = "snap-to-bar";
|
|
||||||
break;
|
|
||||||
case Editing::SnapToMark:
|
|
||||||
action = "snap-to-mark";
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionStart:
|
|
||||||
action = "snap-to-region-start";
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionEnd:
|
|
||||||
action = "snap-to-region-end";
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionSync:
|
|
||||||
action = "snap-to-region-sync";
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionBoundary:
|
|
||||||
action = "snap-to-region-boundary";
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap-to type", (int) type) << endmsg;
|
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap-to type", (int) type) << endmsg;
|
||||||
|
|
@ -1159,371 +1113,113 @@ Editor::snap_type_action (SnapType type)
|
||||||
return ract;
|
return ract;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
error << string_compose (_("programming error: %1"), "Editor::snap_type_chosen could not find action to match type.") << endmsg;
|
error << string_compose (_("programming error: %1"), "Editor::grid_type_chosen could not find action to match type.") << endmsg;
|
||||||
return RefPtr<RadioAction>();
|
return RefPtr<RadioAction>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::next_snap_choice ()
|
Editor::next_grid_choice ()
|
||||||
{
|
{
|
||||||
switch (_snap_type) {
|
switch (_grid_type) {
|
||||||
case Editing::SnapToCDFrame:
|
case Editing::GridTypeBeatDiv32:
|
||||||
set_snap_to (Editing::SnapToTimecodeFrame);
|
set_grid_to (Editing::GridTypeNone);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToTimecodeFrame:
|
case Editing::GridTypeBeatDiv16:
|
||||||
set_snap_to (Editing::SnapToTimecodeSeconds);
|
set_grid_to (Editing::GridTypeBeatDiv32);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToTimecodeSeconds:
|
case Editing::GridTypeBeatDiv8:
|
||||||
set_snap_to (Editing::SnapToTimecodeMinutes);
|
set_grid_to (Editing::GridTypeBeatDiv16);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToTimecodeMinutes:
|
case Editing::GridTypeBeatDiv4:
|
||||||
set_snap_to (Editing::SnapToSeconds);
|
set_grid_to (Editing::GridTypeBeatDiv8);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToSeconds:
|
case Editing::GridTypeBeatDiv2:
|
||||||
set_snap_to (Editing::SnapToMinutes);
|
set_grid_to (Editing::GridTypeBeatDiv4);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToMinutes:
|
case Editing::GridTypeBeat:
|
||||||
set_snap_to (Editing::SnapToBeatDiv128);
|
set_grid_to (Editing::GridTypeBeatDiv2);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv128:
|
case Editing::GridTypeBar:
|
||||||
set_snap_to (Editing::SnapToBeatDiv64);
|
set_grid_to (Editing::GridTypeBeat);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv64:
|
case Editing::GridTypeNone:
|
||||||
set_snap_to (Editing::SnapToBeatDiv32);
|
set_grid_to (Editing::GridTypeBar);
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv32:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv28);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv28:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv24);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv24:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv20);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv20:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv16);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv16:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv14);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv14:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv12);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv12:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv10);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv10:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv8);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv8:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv7);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv7:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv6);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv6:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv5);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv5:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv4);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv4:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv3);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv3:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv2);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv2:
|
|
||||||
set_snap_to (Editing::SnapToBeat);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeat:
|
|
||||||
set_snap_to (Editing::SnapToBar);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBar:
|
|
||||||
set_snap_to (Editing::SnapToMark);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToMark:
|
|
||||||
set_snap_to (Editing::SnapToRegionStart);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionStart:
|
|
||||||
set_snap_to (Editing::SnapToRegionEnd);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionEnd:
|
|
||||||
set_snap_to (Editing::SnapToRegionSync);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionSync:
|
|
||||||
set_snap_to (Editing::SnapToRegionBoundary);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionBoundary:
|
|
||||||
set_snap_to (Editing::SnapToCDFrame);
|
|
||||||
break;
|
break;
|
||||||
|
case Editing::GridTypeBeatDiv3:
|
||||||
|
case Editing::GridTypeBeatDiv6:
|
||||||
|
case Editing::GridTypeBeatDiv12:
|
||||||
|
case Editing::GridTypeBeatDiv24:
|
||||||
|
case Editing::GridTypeBeatDiv5:
|
||||||
|
case Editing::GridTypeBeatDiv10:
|
||||||
|
case Editing::GridTypeBeatDiv20:
|
||||||
|
case Editing::GridTypeBeatDiv7:
|
||||||
|
case Editing::GridTypeBeatDiv14:
|
||||||
|
case Editing::GridTypeBeatDiv28:
|
||||||
|
case Editing::GridTypeSmpte:
|
||||||
|
case Editing::GridTypeMinSec:
|
||||||
|
case Editing::GridTypeSamples:
|
||||||
|
break; //do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::prev_snap_choice ()
|
Editor::prev_grid_choice ()
|
||||||
{
|
{
|
||||||
switch (_snap_type) {
|
switch (_grid_type) {
|
||||||
case Editing::SnapToCDFrame:
|
case Editing::GridTypeBeatDiv32:
|
||||||
set_snap_to (Editing::SnapToRegionBoundary);
|
set_grid_to (Editing::GridTypeBeatDiv16);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToTimecodeFrame:
|
case Editing::GridTypeBeatDiv16:
|
||||||
set_snap_to (Editing::SnapToCDFrame);
|
set_grid_to (Editing::GridTypeBeatDiv8);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToTimecodeSeconds:
|
case Editing::GridTypeBeatDiv8:
|
||||||
set_snap_to (Editing::SnapToTimecodeFrame);
|
set_grid_to (Editing::GridTypeBeatDiv4);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToTimecodeMinutes:
|
case Editing::GridTypeBeatDiv4:
|
||||||
set_snap_to (Editing::SnapToTimecodeSeconds);
|
set_grid_to (Editing::GridTypeBeatDiv2);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToSeconds:
|
case Editing::GridTypeBeatDiv2:
|
||||||
set_snap_to (Editing::SnapToTimecodeMinutes);
|
set_grid_to (Editing::GridTypeBeat);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToMinutes:
|
case Editing::GridTypeBeat:
|
||||||
set_snap_to (Editing::SnapToSeconds);
|
set_grid_to (Editing::GridTypeBar);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv128:
|
case Editing::GridTypeBar:
|
||||||
set_snap_to (Editing::SnapToMinutes);
|
set_grid_to (Editing::GridTypeNone);
|
||||||
break;
|
break;
|
||||||
case Editing::SnapToBeatDiv64:
|
case Editing::GridTypeNone:
|
||||||
set_snap_to (Editing::SnapToBeatDiv128);
|
set_grid_to (Editing::GridTypeBeatDiv32);
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv32:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv64);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv28:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv32);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv24:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv28);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv20:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv24);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv16:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv20);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv14:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv16);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv12:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv14);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv10:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv12);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv8:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv10);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv7:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv8);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv6:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv7);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv5:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv6);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv4:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv5);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv3:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv4);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv2:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv3);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeat:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv2);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBar:
|
|
||||||
set_snap_to (Editing::SnapToBeat);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToMark:
|
|
||||||
set_snap_to (Editing::SnapToBar);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionStart:
|
|
||||||
set_snap_to (Editing::SnapToMark);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionEnd:
|
|
||||||
set_snap_to (Editing::SnapToRegionStart);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionSync:
|
|
||||||
set_snap_to (Editing::SnapToRegionEnd);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToRegionBoundary:
|
|
||||||
set_snap_to (Editing::SnapToRegionSync);
|
|
||||||
break;
|
break;
|
||||||
|
case Editing::GridTypeBeatDiv3:
|
||||||
|
case Editing::GridTypeBeatDiv6:
|
||||||
|
case Editing::GridTypeBeatDiv12:
|
||||||
|
case Editing::GridTypeBeatDiv24:
|
||||||
|
case Editing::GridTypeBeatDiv5:
|
||||||
|
case Editing::GridTypeBeatDiv10:
|
||||||
|
case Editing::GridTypeBeatDiv20:
|
||||||
|
case Editing::GridTypeBeatDiv7:
|
||||||
|
case Editing::GridTypeBeatDiv14:
|
||||||
|
case Editing::GridTypeBeatDiv28:
|
||||||
|
case Editing::GridTypeSmpte:
|
||||||
|
case Editing::GridTypeMinSec:
|
||||||
|
case Editing::GridTypeSamples:
|
||||||
|
break; //do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::next_snap_choice_music_only ()
|
Editor::grid_type_chosen (GridType type)
|
||||||
{
|
|
||||||
switch (_snap_type) {
|
|
||||||
case Editing::SnapToMark:
|
|
||||||
case Editing::SnapToRegionStart:
|
|
||||||
case Editing::SnapToRegionEnd:
|
|
||||||
case Editing::SnapToRegionSync:
|
|
||||||
case Editing::SnapToRegionBoundary:
|
|
||||||
case Editing::SnapToCDFrame:
|
|
||||||
case Editing::SnapToTimecodeFrame:
|
|
||||||
case Editing::SnapToTimecodeSeconds:
|
|
||||||
case Editing::SnapToTimecodeMinutes:
|
|
||||||
case Editing::SnapToSeconds:
|
|
||||||
case Editing::SnapToMinutes:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv128);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv128:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv64);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv64:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv32);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv32:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv28);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv28:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv24);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv24:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv20);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv20:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv16);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv16:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv14);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv14:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv12);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv12:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv10);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv10:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv8);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv8:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv7);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv7:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv6);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv6:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv5);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv5:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv4);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv4:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv3);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv3:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv2);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv2:
|
|
||||||
set_snap_to (Editing::SnapToBeat);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeat:
|
|
||||||
set_snap_to (Editing::SnapToBar);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBar:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv128);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::prev_snap_choice_music_only ()
|
|
||||||
{
|
|
||||||
switch (_snap_type) {
|
|
||||||
case Editing::SnapToMark:
|
|
||||||
case Editing::SnapToRegionStart:
|
|
||||||
case Editing::SnapToRegionEnd:
|
|
||||||
case Editing::SnapToRegionSync:
|
|
||||||
case Editing::SnapToRegionBoundary:
|
|
||||||
case Editing::SnapToCDFrame:
|
|
||||||
case Editing::SnapToTimecodeFrame:
|
|
||||||
case Editing::SnapToTimecodeSeconds:
|
|
||||||
case Editing::SnapToTimecodeMinutes:
|
|
||||||
case Editing::SnapToSeconds:
|
|
||||||
case Editing::SnapToMinutes:
|
|
||||||
set_snap_to (Editing::SnapToBar);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv128:
|
|
||||||
set_snap_to (Editing::SnapToBeat);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv64:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv128);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv32:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv64);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv28:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv32);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv24:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv28);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv20:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv24);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv16:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv20);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv14:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv16);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv12:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv14);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv10:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv12);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv8:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv10);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv7:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv8);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv6:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv7);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv5:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv6);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv4:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv5);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv3:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv4);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeatDiv2:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv3);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBeat:
|
|
||||||
set_snap_to (Editing::SnapToBeatDiv2);
|
|
||||||
break;
|
|
||||||
case Editing::SnapToBar:
|
|
||||||
set_snap_to (Editing::SnapToBeat);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::snap_type_chosen (SnapType type)
|
|
||||||
{
|
{
|
||||||
/* this is driven by a toggle on a radio group, and so is invoked twice,
|
/* this is driven by a toggle on a radio group, and so is invoked twice,
|
||||||
once for the item that became inactive and once for the one that became
|
once for the item that became inactive and once for the one that became
|
||||||
active.
|
active.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
RefPtr<RadioAction> ract = snap_type_action (type);
|
RefPtr<RadioAction> ract = grid_type_action (type);
|
||||||
|
|
||||||
if (ract && ract->get_active()) {
|
if (ract && ract->get_active()) {
|
||||||
set_snap_to (type);
|
set_grid_to (type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1565,8 +1261,6 @@ Editor::cycle_snap_mode ()
|
||||||
{
|
{
|
||||||
switch (_snap_mode) {
|
switch (_snap_mode) {
|
||||||
case SnapOff:
|
case SnapOff:
|
||||||
set_snap_mode (SnapNormal);
|
|
||||||
break;
|
|
||||||
case SnapNormal:
|
case SnapNormal:
|
||||||
set_snap_mode (SnapMagnetic);
|
set_snap_mode (SnapMagnetic);
|
||||||
break;
|
break;
|
||||||
|
|
@ -1584,6 +1278,10 @@ Editor::snap_mode_chosen (SnapMode mode)
|
||||||
active.
|
active.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (mode == SnapNormal) {
|
||||||
|
mode = SnapMagnetic;
|
||||||
|
}
|
||||||
|
|
||||||
RefPtr<RadioAction> ract = snap_mode_action (mode);
|
RefPtr<RadioAction> ract = snap_mode_action (mode);
|
||||||
|
|
||||||
if (ract && ract->get_active()) {
|
if (ract && ract->get_active()) {
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ Editor::track_canvas_viewport_size_allocated ()
|
||||||
}
|
}
|
||||||
|
|
||||||
update_fixed_rulers();
|
update_fixed_rulers();
|
||||||
redisplay_tempo (false);
|
redisplay_grid (false);
|
||||||
_summary->set_overlays_dirty ();
|
_summary->set_overlays_dirty ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1044,7 +1044,7 @@ Editor::color_handler()
|
||||||
_track_canvas->queue_draw ();
|
_track_canvas->queue_draw ();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
redisplay_tempo (true);
|
redisplay_grid (true);
|
||||||
|
|
||||||
if (_session)
|
if (_session)
|
||||||
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
|
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
|
||||||
|
|
@ -1148,26 +1148,6 @@ Editor::pop_canvas_cursor ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Gdk::Cursor*
|
|
||||||
Editor::which_grabber_cursor () const
|
|
||||||
{
|
|
||||||
Gdk::Cursor* c = _cursors->grabber;
|
|
||||||
|
|
||||||
switch (_edit_point) {
|
|
||||||
case EditAtMouse:
|
|
||||||
c = _cursors->grabber_edit_point;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
boost::shared_ptr<Movable> m = _movable.lock();
|
|
||||||
if (m && m->locked()) {
|
|
||||||
c = _cursors->speaker;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
Gdk::Cursor*
|
Gdk::Cursor*
|
||||||
Editor::which_trim_cursor (bool left) const
|
Editor::which_trim_cursor (bool left) const
|
||||||
{
|
{
|
||||||
|
|
@ -1267,7 +1247,7 @@ Editor::which_track_cursor () const
|
||||||
switch (_join_object_range_state) {
|
switch (_join_object_range_state) {
|
||||||
case JOIN_OBJECT_RANGE_NONE:
|
case JOIN_OBJECT_RANGE_NONE:
|
||||||
case JOIN_OBJECT_RANGE_OBJECT:
|
case JOIN_OBJECT_RANGE_OBJECT:
|
||||||
cursor = which_grabber_cursor ();
|
cursor = _cursors->grabber;
|
||||||
break;
|
break;
|
||||||
case JOIN_OBJECT_RANGE_RANGE:
|
case JOIN_OBJECT_RANGE_RANGE:
|
||||||
cursor = _cursors->selector;
|
cursor = _cursors->selector;
|
||||||
|
|
@ -1314,14 +1294,7 @@ Editor::which_canvas_cursor(ItemType type) const
|
||||||
cursor = which_track_cursor ();
|
cursor = which_track_cursor ();
|
||||||
break;
|
break;
|
||||||
case PlayheadCursorItem:
|
case PlayheadCursorItem:
|
||||||
switch (_edit_point) {
|
cursor = _cursors->grabber;
|
||||||
case EditAtMouse:
|
|
||||||
cursor = _cursors->grabber_edit_point;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
cursor = _cursors->grabber;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SelectionItem:
|
case SelectionItem:
|
||||||
cursor = _cursors->selector;
|
cursor = _cursors->selector;
|
||||||
|
|
@ -1431,7 +1404,7 @@ Editor::which_canvas_cursor(ItemType type) const
|
||||||
case VideoBarItem:
|
case VideoBarItem:
|
||||||
case TransportMarkerBarItem:
|
case TransportMarkerBarItem:
|
||||||
case DropZoneItem:
|
case DropZoneItem:
|
||||||
cursor = which_grabber_cursor();
|
cursor = _cursors->grabber;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -293,16 +293,9 @@ Drag::start_grab (GdkEvent* event, Gdk::Cursor *cursor)
|
||||||
_was_rolling = false;
|
_was_rolling = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (_editor->snap_type()) {
|
// if ( UIConfiguration::instance().get_snap_to_region_start() || UIConfiguration::instance().get_snap_to_region_end() || UIConfiguration::instance().get_snap_to_region_sync() ) {
|
||||||
case SnapToRegionStart:
|
// _editor->build_region_boundary_cache ();
|
||||||
case SnapToRegionEnd:
|
// }
|
||||||
case SnapToRegionSync:
|
|
||||||
case SnapToRegionBoundary:
|
|
||||||
_editor->build_region_boundary_cache ();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Call to end a drag `successfully'. Ungrabs item and calls
|
/** Call to end a drag `successfully'. Ungrabs item and calls
|
||||||
|
|
@ -388,7 +381,7 @@ Drag::setup_snap_delta (MusicSample pos)
|
||||||
{
|
{
|
||||||
TempoMap& map (_editor->session()->tempo_map());
|
TempoMap& map (_editor->session()->tempo_map());
|
||||||
MusicSample snap (pos);
|
MusicSample snap (pos);
|
||||||
_editor->snap_to (snap, ARDOUR::RoundNearest, false, true);
|
_editor->snap_to (snap, ARDOUR::RoundNearest, ARDOUR::SnapToAny, false, true);
|
||||||
_snap_delta = snap.sample - pos.sample;
|
_snap_delta = snap.sample - pos.sample;
|
||||||
|
|
||||||
_snap_delta_music = 0.0;
|
_snap_delta_music = 0.0;
|
||||||
|
|
@ -3231,7 +3224,7 @@ TrimDrag::setup_pointer_sample_offset ()
|
||||||
MeterMarkerDrag::MeterMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c)
|
MeterMarkerDrag::MeterMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c)
|
||||||
: Drag (e, i)
|
: Drag (e, i)
|
||||||
, _copy (c)
|
, _copy (c)
|
||||||
, _old_snap_type (e->snap_type())
|
, _old_grid_type (e->grid_type())
|
||||||
, _old_snap_mode (e->snap_mode())
|
, _old_snap_mode (e->snap_mode())
|
||||||
, before_state (0)
|
, before_state (0)
|
||||||
{
|
{
|
||||||
|
|
@ -3304,14 +3297,14 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
|
||||||
}
|
}
|
||||||
/* only snap to bars. leave snap mode alone for audio locked meters.*/
|
/* only snap to bars. leave snap mode alone for audio locked meters.*/
|
||||||
if (_real_section->position_lock_style() != AudioTime) {
|
if (_real_section->position_lock_style() != AudioTime) {
|
||||||
_editor->set_snap_to (SnapToBar);
|
_editor->set_grid_to (GridTypeBar);
|
||||||
_editor->set_snap_mode (SnapNormal);
|
_editor->set_snap_mode (SnapMagnetic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
samplepos_t pf = adjusted_current_sample (event);
|
samplepos_t pf = adjusted_current_sample (event);
|
||||||
|
|
||||||
if (_real_section->position_lock_style() == AudioTime && _editor->snap_musical()) {
|
if (_real_section->position_lock_style() == AudioTime && _editor->grid_musical()) {
|
||||||
/* never snap to music for audio locked */
|
/* never snap to music for audio locked */
|
||||||
pf = adjusted_current_sample (event, false);
|
pf = adjusted_current_sample (event, false);
|
||||||
}
|
}
|
||||||
|
|
@ -3336,7 +3329,7 @@ MeterMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reinstate old snap setting */
|
/* reinstate old snap setting */
|
||||||
_editor->set_snap_to (_old_snap_type);
|
_editor->set_grid_to (_old_grid_type);
|
||||||
_editor->set_snap_mode (_old_snap_mode);
|
_editor->set_snap_mode (_old_snap_mode);
|
||||||
|
|
||||||
TempoMap& map (_editor->session()->tempo_map());
|
TempoMap& map (_editor->session()->tempo_map());
|
||||||
|
|
@ -3356,7 +3349,7 @@ MeterMarkerDrag::aborted (bool moved)
|
||||||
_marker->set_position (_marker->meter().sample ());
|
_marker->set_position (_marker->meter().sample ());
|
||||||
if (moved) {
|
if (moved) {
|
||||||
/* reinstate old snap setting */
|
/* reinstate old snap setting */
|
||||||
_editor->set_snap_to (_old_snap_type);
|
_editor->set_grid_to (_old_grid_type);
|
||||||
_editor->set_snap_mode (_old_snap_mode);
|
_editor->set_snap_mode (_old_snap_mode);
|
||||||
|
|
||||||
_editor->session()->tempo_map().set_state (*before_state, Stateful::current_state_version);
|
_editor->session()->tempo_map().set_state (*before_state, Stateful::current_state_version);
|
||||||
|
|
@ -3473,7 +3466,7 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
|
||||||
} else if (_movable && !_real_section->locked_to_meter()) {
|
} else if (_movable && !_real_section->locked_to_meter()) {
|
||||||
samplepos_t pf;
|
samplepos_t pf;
|
||||||
|
|
||||||
if (_editor->snap_musical()) {
|
if (_editor->grid_musical()) {
|
||||||
/* we can't snap to a grid that we are about to move.
|
/* we can't snap to a grid that we are about to move.
|
||||||
* gui_move_tempo() will sort out snap using the supplied beat divisions.
|
* gui_move_tempo() will sort out snap using the supplied beat divisions.
|
||||||
*/
|
*/
|
||||||
|
|
@ -3607,7 +3600,7 @@ BBTRulerDrag::motion (GdkEvent* event, bool first_move)
|
||||||
TempoMap& map (_editor->session()->tempo_map());
|
TempoMap& map (_editor->session()->tempo_map());
|
||||||
samplepos_t pf;
|
samplepos_t pf;
|
||||||
|
|
||||||
if (_editor->snap_musical()) {
|
if (_editor->grid_musical()) {
|
||||||
pf = adjusted_current_sample (event, false);
|
pf = adjusted_current_sample (event, false);
|
||||||
} else {
|
} else {
|
||||||
pf = adjusted_current_sample (event);
|
pf = adjusted_current_sample (event);
|
||||||
|
|
@ -3755,7 +3748,7 @@ TempoTwistDrag::motion (GdkEvent* event, bool first_move)
|
||||||
|
|
||||||
samplepos_t pf;
|
samplepos_t pf;
|
||||||
|
|
||||||
if (_editor->snap_musical()) {
|
if (_editor->grid_musical()) {
|
||||||
pf = adjusted_current_sample (event, false);
|
pf = adjusted_current_sample (event, false);
|
||||||
} else {
|
} else {
|
||||||
pf = adjusted_current_sample (event);
|
pf = adjusted_current_sample (event);
|
||||||
|
|
@ -5099,7 +5092,7 @@ RubberbandSelectDrag::motion (GdkEvent* event, bool)
|
||||||
MusicSample grab (grab_sample (), 0);
|
MusicSample grab (grab_sample (), 0);
|
||||||
|
|
||||||
if (UIConfiguration::instance().get_rubberbanding_snaps_to_grid ()) {
|
if (UIConfiguration::instance().get_rubberbanding_snaps_to_grid ()) {
|
||||||
_editor->snap_to_with_modifier (grab, event);
|
_editor->snap_to_with_modifier (grab, event, RoundNearest, SnapToGrid);
|
||||||
} else {
|
} else {
|
||||||
grab.sample = raw_grab_sample ();
|
grab.sample = raw_grab_sample ();
|
||||||
}
|
}
|
||||||
|
|
@ -6078,7 +6071,7 @@ NoteDrag::total_dx (GdkEvent * event) const
|
||||||
|
|
||||||
/* possibly snap and return corresponding delta in quarter notes */
|
/* possibly snap and return corresponding delta in quarter notes */
|
||||||
MusicSample snap (st, 0);
|
MusicSample snap (st, 0);
|
||||||
_editor->snap_to_with_modifier (snap, event);
|
_editor->snap_to_with_modifier (snap, event, RoundNearest, SnapToGrid);
|
||||||
double ret = map.exact_qn_at_sample (snap.sample, snap.division) - n_qn - snap_delta_music (event->button.state);
|
double ret = map.exact_qn_at_sample (snap.sample, snap.division) - n_qn - snap_delta_music (event->button.state);
|
||||||
|
|
||||||
/* prevent the earliest note being dragged earlier than the region's start position */
|
/* prevent the earliest note being dragged earlier than the region's start position */
|
||||||
|
|
|
||||||
|
|
@ -759,7 +759,7 @@ private:
|
||||||
ARDOUR::MeterSection* _real_section;
|
ARDOUR::MeterSection* _real_section;
|
||||||
|
|
||||||
bool _copy;
|
bool _copy;
|
||||||
Editing::SnapType _old_snap_type;
|
Editing::GridType _old_grid_type;
|
||||||
Editing::SnapMode _old_snap_mode;
|
Editing::SnapMode _old_snap_mode;
|
||||||
XMLNode* before_state;
|
XMLNode* before_state;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@
|
||||||
#include "marker.h"
|
#include "marker.h"
|
||||||
#include "streamview.h"
|
#include "streamview.h"
|
||||||
#include "region_gain_line.h"
|
#include "region_gain_line.h"
|
||||||
|
#include "rc_option_editor.h"
|
||||||
#include "automation_time_axis.h"
|
#include "automation_time_axis.h"
|
||||||
#include "control_point.h"
|
#include "control_point.h"
|
||||||
#include "selection.h"
|
#include "selection.h"
|
||||||
|
|
@ -217,6 +218,25 @@ Editor::mouse_mode_object_range_toggled()
|
||||||
set_mouse_mode(m, true); //call this so the button styles can get updated
|
set_mouse_mode(m, true); //call this so the button styles can get updated
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Editor::snap_mode_button_clicked (GdkEventButton* ev)
|
||||||
|
{
|
||||||
|
if (ev->button != 3) {
|
||||||
|
cycle_snap_mode();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
RCOptionEditor* rc_option_editor = ARDOUR_UI::instance()->get_rc_option_editor();
|
||||||
|
if ( rc_option_editor ) {
|
||||||
|
ARDOUR_UI::instance()->show_tabbable (rc_option_editor);
|
||||||
|
rc_option_editor->set_current_page (_("Editor/Snap"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static Glib::RefPtr<Action>
|
static Glib::RefPtr<Action>
|
||||||
get_mouse_mode_action(MouseMode m)
|
get_mouse_mode_action(MouseMode m)
|
||||||
{
|
{
|
||||||
|
|
@ -296,10 +316,10 @@ Editor::mouse_mode_toggled (MouseMode m)
|
||||||
this must toggle the actions and not call set_snap_*() directly,
|
this must toggle the actions and not call set_snap_*() directly,
|
||||||
otherwise things get out of sync and the combo box stops working. */
|
otherwise things get out of sync and the combo box stops working. */
|
||||||
if (!was_internal && internal_editing()) {
|
if (!was_internal && internal_editing()) {
|
||||||
snap_type_action(internal_snap_type)->set_active(true);
|
grid_type_action(internal_grid_type)->set_active(true);
|
||||||
snap_mode_action(internal_snap_mode)->set_active(true);
|
snap_mode_action(internal_snap_mode)->set_active(true);
|
||||||
} else if (was_internal && !internal_editing()) {
|
} else if (was_internal && !internal_editing()) {
|
||||||
snap_type_action(pre_internal_snap_type)->set_active(true);
|
grid_type_action(pre_internal_grid_type)->set_active(true);
|
||||||
snap_mode_action(pre_internal_snap_mode)->set_active(true);
|
snap_mode_action(pre_internal_snap_mode)->set_active(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1571,7 +1591,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
|
|
||||||
case MarkerBarItem:
|
case MarkerBarItem:
|
||||||
if (!_dragging_playhead) {
|
if (!_dragging_playhead) {
|
||||||
snap_to_with_modifier (where, event, RoundNearest, true);
|
snap_to_with_modifier (where, event, RoundNearest, SnapToAny, true);
|
||||||
mouse_add_new_marker (where.sample);
|
mouse_add_new_marker (where.sample);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1579,7 +1599,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case CdMarkerBarItem:
|
case CdMarkerBarItem:
|
||||||
if (!_dragging_playhead) {
|
if (!_dragging_playhead) {
|
||||||
// if we get here then a dragged range wasn't done
|
// if we get here then a dragged range wasn't done
|
||||||
snap_to_with_modifier (where, event, RoundNearest, true);
|
snap_to_with_modifier (where, event, RoundNearest, SnapToAny, true);
|
||||||
mouse_add_new_marker (where.sample, true);
|
mouse_add_new_marker (where.sample, true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -2377,23 +2397,10 @@ Editor::mouse_rename_region (ArdourCanvas::Item* /*item*/, GdkEvent* /*event*/)
|
||||||
void
|
void
|
||||||
Editor::mouse_brush_insert_region (RegionView* rv, samplepos_t pos)
|
Editor::mouse_brush_insert_region (RegionView* rv, samplepos_t pos)
|
||||||
{
|
{
|
||||||
/* no brushing without a useful snap setting */
|
/* no brushing without a useful quantize setting */
|
||||||
|
if (_grid_type == GridTypeNone)
|
||||||
switch (_snap_mode) {
|
|
||||||
case SnapMagnetic:
|
|
||||||
return; /* can't work because it allows region to be placed anywhere */
|
|
||||||
default:
|
|
||||||
break; /* OK */
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (_snap_type) {
|
|
||||||
case SnapToMark:
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* don't brush a copy over the original */
|
/* don't brush a copy over the original */
|
||||||
|
|
||||||
if (pos == rv->region()->position()) {
|
if (pos == rv->region()->position()) {
|
||||||
|
|
|
||||||
|
|
@ -193,16 +193,16 @@ Editor::split_regions_at (MusicSample where, RegionSelection& regions, bool snap
|
||||||
// region boundaries, don't pay attention to them
|
// region boundaries, don't pay attention to them
|
||||||
|
|
||||||
if (regions.size() == 1) {
|
if (regions.size() == 1) {
|
||||||
switch (_snap_type) {
|
// switch (_snap_type) { //ToDo !!!
|
||||||
case SnapToRegionStart:
|
// case SnapToRegionStart:
|
||||||
case SnapToRegionSync:
|
// case SnapToRegionSync:
|
||||||
case SnapToRegionEnd:
|
// case SnapToRegionEnd:
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
if (snap_sample) {
|
// if (snap_sample) {
|
||||||
snap_to (where);
|
snap_to (where);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
if (snap_sample) {
|
if (snap_sample) {
|
||||||
snap_to (where);
|
snap_to (where);
|
||||||
|
|
@ -707,6 +707,13 @@ Editor::move_to_end ()
|
||||||
void
|
void
|
||||||
Editor::build_region_boundary_cache ()
|
Editor::build_region_boundary_cache ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//ToDo: maybe set a timer so we don't recalutate when lots of changes are coming in
|
||||||
|
//ToDo: maybe somehow defer this until session is fully loaded.
|
||||||
|
|
||||||
|
if ( !_region_boundary_cache_dirty )
|
||||||
|
return;
|
||||||
|
|
||||||
samplepos_t pos = 0;
|
samplepos_t pos = 0;
|
||||||
vector<RegionPoint> interesting_points;
|
vector<RegionPoint> interesting_points;
|
||||||
boost::shared_ptr<Region> r;
|
boost::shared_ptr<Region> r;
|
||||||
|
|
@ -721,36 +728,29 @@ Editor::build_region_boundary_cache ()
|
||||||
|
|
||||||
bool maybe_first_sample = false;
|
bool maybe_first_sample = false;
|
||||||
|
|
||||||
switch (_snap_type) {
|
if ( UIConfiguration::instance().get_snap_to_region_start() ) {
|
||||||
case SnapToRegionStart:
|
|
||||||
interesting_points.push_back (Start);
|
interesting_points.push_back (Start);
|
||||||
maybe_first_sample = true;
|
maybe_first_sample = true;
|
||||||
break;
|
}
|
||||||
case SnapToRegionEnd:
|
|
||||||
|
if ( UIConfiguration::instance().get_snap_to_region_end() ) {
|
||||||
interesting_points.push_back (End);
|
interesting_points.push_back (End);
|
||||||
break;
|
}
|
||||||
case SnapToRegionSync:
|
|
||||||
|
if ( UIConfiguration::instance().get_snap_to_region_sync() ) {
|
||||||
interesting_points.push_back (SyncPoint);
|
interesting_points.push_back (SyncPoint);
|
||||||
break;
|
|
||||||
case SnapToRegionBoundary:
|
|
||||||
interesting_points.push_back (Start);
|
|
||||||
interesting_points.push_back (End);
|
|
||||||
maybe_first_sample = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
fatal << string_compose (_("build_region_boundary_cache called with snap_type = %1"), _snap_type) << endmsg;
|
|
||||||
abort(); /*NOTREACHED*/
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeAxisView *ontrack = 0;
|
TimeAxisView *ontrack = 0;
|
||||||
TrackViewList tlist;
|
TrackViewList tlist;
|
||||||
|
|
||||||
if (!selection->tracks.empty()) {
|
//in the past, we used the track selection to limit snap. I think this is not desired.
|
||||||
tlist = selection->tracks.filter_to_unique_playlists ();
|
//or if it is, it needs to be updated every time the track selection changes (so the snapped-cursor can show it)
|
||||||
} else {
|
// if (!selection->tracks.empty()) {
|
||||||
|
// tlist = selection->tracks.filter_to_unique_playlists ();
|
||||||
|
// } else {
|
||||||
tlist = track_views.filter_to_unique_playlists ();
|
tlist = track_views.filter_to_unique_playlists ();
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (maybe_first_sample) {
|
if (maybe_first_sample) {
|
||||||
TrackViewList::const_iterator i;
|
TrackViewList::const_iterator i;
|
||||||
|
|
@ -822,6 +822,8 @@ Editor::build_region_boundary_cache ()
|
||||||
/* finally sort to be sure that the order is correct */
|
/* finally sort to be sure that the order is correct */
|
||||||
|
|
||||||
sort (region_boundary_cache.begin(), region_boundary_cache.end());
|
sort (region_boundary_cache.begin(), region_boundary_cache.end());
|
||||||
|
|
||||||
|
_region_boundary_cache_dirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<Region>
|
boost::shared_ptr<Region>
|
||||||
|
|
@ -7057,7 +7059,7 @@ Editor::snap_regions_to_grid ()
|
||||||
(*r)->region()->clear_changes ();
|
(*r)->region()->clear_changes ();
|
||||||
|
|
||||||
MusicSample start ((*r)->region()->first_sample (), 0);
|
MusicSample start ((*r)->region()->first_sample (), 0);
|
||||||
snap_to (start);
|
snap_to (start, RoundNearest, SnapToGrid );
|
||||||
(*r)->region()->set_position (start.sample, start.division);
|
(*r)->region()->set_position (start.sample, start.division);
|
||||||
_session->add_command(new StatefulDiffCommand ((*r)->region()));
|
_session->add_command(new StatefulDiffCommand ((*r)->region()));
|
||||||
}
|
}
|
||||||
|
|
@ -7266,7 +7268,7 @@ Editor::playhead_forward_to_grid ()
|
||||||
|
|
||||||
if (pos.sample < max_samplepos - 1) {
|
if (pos.sample < max_samplepos - 1) {
|
||||||
pos.sample += 2;
|
pos.sample += 2;
|
||||||
snap_to_internal (pos, RoundUpAlways, false, true);
|
snap_to_internal (pos, RoundUpAlways, SnapToGrid, false, true);
|
||||||
_session->request_locate (pos.sample);
|
_session->request_locate (pos.sample);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7283,7 +7285,7 @@ Editor::playhead_backward_to_grid ()
|
||||||
|
|
||||||
if (pos.sample > 2) {
|
if (pos.sample > 2) {
|
||||||
pos.sample -= 2;
|
pos.sample -= 2;
|
||||||
snap_to_internal (pos, RoundDownAlways, false, true);
|
snap_to_internal (pos, RoundDownAlways, SnapToGrid, false, true);
|
||||||
_session->request_locate (pos.sample);
|
_session->request_locate (pos.sample);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -516,6 +516,15 @@ EditorRegions::remove_unused_regions ()
|
||||||
void
|
void
|
||||||
EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange& what_changed)
|
EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
|
//maybe update the grid here
|
||||||
|
PropertyChange grid_interests;
|
||||||
|
grid_interests.add (ARDOUR::Properties::position);
|
||||||
|
grid_interests.add (ARDOUR::Properties::length);
|
||||||
|
grid_interests.add (ARDOUR::Properties::sync_position);
|
||||||
|
if (what_changed.contains (grid_interests)) {
|
||||||
|
_editor->mark_region_boundary_cache_dirty();
|
||||||
|
}
|
||||||
|
|
||||||
PropertyChange our_interests;
|
PropertyChange our_interests;
|
||||||
|
|
||||||
our_interests.add (ARDOUR::Properties::name);
|
our_interests.add (ARDOUR::Properties::name);
|
||||||
|
|
|
||||||
|
|
@ -585,7 +585,7 @@ Editor::update_ruler_visibility ()
|
||||||
|
|
||||||
compute_fixed_ruler_scale ();
|
compute_fixed_ruler_scale ();
|
||||||
update_fixed_rulers();
|
update_fixed_rulers();
|
||||||
redisplay_tempo (false);
|
redisplay_grid (false);
|
||||||
|
|
||||||
/* Changing ruler visibility means that any lines on markers might need updating */
|
/* Changing ruler visibility means that any lines on markers might need updating */
|
||||||
for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
|
for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
|
||||||
|
|
@ -989,73 +989,72 @@ Editor::compute_bbt_ruler_scale (samplepos_t lower, samplepos_t upper)
|
||||||
|
|
||||||
bbt_ruler_scale = bbt_show_many;
|
bbt_ruler_scale = bbt_show_many;
|
||||||
|
|
||||||
switch (_snap_type) {
|
switch (_grid_type) {
|
||||||
case SnapToBeatDiv2:
|
case GridTypeBeatDiv2:
|
||||||
bbt_beat_subdivision = 2;
|
bbt_beat_subdivision = 2;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv3:
|
case GridTypeBeatDiv3:
|
||||||
bbt_beat_subdivision = 3;
|
bbt_beat_subdivision = 3;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv4:
|
case GridTypeBeatDiv4:
|
||||||
bbt_beat_subdivision = 4;
|
bbt_beat_subdivision = 4;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv5:
|
case GridTypeBeatDiv5:
|
||||||
bbt_beat_subdivision = 5;
|
bbt_beat_subdivision = 5;
|
||||||
bbt_accent_modulo = 2; // XXX YIKES
|
bbt_accent_modulo = 2; // XXX YIKES
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv6:
|
case GridTypeBeatDiv6:
|
||||||
bbt_beat_subdivision = 6;
|
bbt_beat_subdivision = 6;
|
||||||
bbt_accent_modulo = 2; // XXX YIKES
|
bbt_accent_modulo = 2; // XXX YIKES
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv7:
|
case GridTypeBeatDiv7:
|
||||||
bbt_beat_subdivision = 7;
|
bbt_beat_subdivision = 7;
|
||||||
bbt_accent_modulo = 2; // XXX YIKES
|
bbt_accent_modulo = 2; // XXX YIKES
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv8:
|
case GridTypeBeatDiv8:
|
||||||
bbt_beat_subdivision = 8;
|
bbt_beat_subdivision = 8;
|
||||||
bbt_accent_modulo = 2;
|
bbt_accent_modulo = 2;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv10:
|
case GridTypeBeatDiv10:
|
||||||
bbt_beat_subdivision = 10;
|
bbt_beat_subdivision = 10;
|
||||||
bbt_accent_modulo = 2; // XXX YIKES
|
bbt_accent_modulo = 2; // XXX YIKES
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv12:
|
case GridTypeBeatDiv12:
|
||||||
bbt_beat_subdivision = 12;
|
bbt_beat_subdivision = 12;
|
||||||
bbt_accent_modulo = 3;
|
bbt_accent_modulo = 3;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv14:
|
case GridTypeBeatDiv14:
|
||||||
bbt_beat_subdivision = 14;
|
bbt_beat_subdivision = 14;
|
||||||
bbt_accent_modulo = 3; // XXX YIKES!
|
bbt_accent_modulo = 3; // XXX YIKES!
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv16:
|
case GridTypeBeatDiv16:
|
||||||
bbt_beat_subdivision = 16;
|
bbt_beat_subdivision = 16;
|
||||||
bbt_accent_modulo = 4;
|
bbt_accent_modulo = 4;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv20:
|
case GridTypeBeatDiv20:
|
||||||
bbt_beat_subdivision = 20;
|
bbt_beat_subdivision = 20;
|
||||||
bbt_accent_modulo = 5;
|
bbt_accent_modulo = 5;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv24:
|
case GridTypeBeatDiv24:
|
||||||
bbt_beat_subdivision = 24;
|
bbt_beat_subdivision = 24;
|
||||||
bbt_accent_modulo = 6;
|
bbt_accent_modulo = 6;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv28:
|
case GridTypeBeatDiv28:
|
||||||
bbt_beat_subdivision = 28;
|
bbt_beat_subdivision = 28;
|
||||||
bbt_accent_modulo = 7;
|
bbt_accent_modulo = 7;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv32:
|
case GridTypeBeatDiv32:
|
||||||
bbt_beat_subdivision = 32;
|
bbt_beat_subdivision = 32;
|
||||||
bbt_accent_modulo = 8;
|
bbt_accent_modulo = 8;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv64:
|
case GridTypeBar:
|
||||||
bbt_beat_subdivision = 64;
|
case GridTypeBeat:
|
||||||
bbt_accent_modulo = 8;
|
bbt_beat_subdivision = 4;
|
||||||
break;
|
break;
|
||||||
case SnapToBeatDiv128:
|
case GridTypeNone:
|
||||||
bbt_beat_subdivision = 128;
|
case GridTypeSmpte:
|
||||||
bbt_accent_modulo = 8;
|
case GridTypeMinSec:
|
||||||
break;
|
case GridTypeSamples:
|
||||||
default:
|
|
||||||
bbt_beat_subdivision = 4;
|
bbt_beat_subdivision = 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1075,6 +1074,21 @@ Editor::compute_bbt_ruler_scale (samplepos_t lower, samplepos_t upper)
|
||||||
bbt_bar_helper_on = true;
|
bbt_bar_helper_on = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//set upper limits on the beat_density based on the user's grid selection
|
||||||
|
if ( _grid_type == GridTypeBar ) {
|
||||||
|
beat_density = fmax (beat_density, 16.01);
|
||||||
|
} else if ( _grid_type == GridTypeBeat ) {
|
||||||
|
beat_density = fmax (beat_density, 4.001);
|
||||||
|
} else if ( _grid_type == GridTypeBeatDiv4) {
|
||||||
|
beat_density = fmax (beat_density, 2.001);
|
||||||
|
} else if ( _grid_type == GridTypeBeatDiv8) {
|
||||||
|
beat_density = fmax (beat_density, 1.001);
|
||||||
|
} else if ( _grid_type == GridTypeBeatDiv16) {
|
||||||
|
beat_density = fmax (beat_density, 0.2501);
|
||||||
|
} else if ( _grid_type == GridTypeBeatDiv32) {
|
||||||
|
beat_density = fmax (beat_density, 0.12501);
|
||||||
|
}
|
||||||
|
|
||||||
if (beat_density > 8192) {
|
if (beat_density > 8192) {
|
||||||
bbt_ruler_scale = bbt_show_many;
|
bbt_ruler_scale = bbt_show_many;
|
||||||
} else if (beat_density > 1024) {
|
} else if (beat_density > 1024) {
|
||||||
|
|
@ -1084,16 +1098,14 @@ Editor::compute_bbt_ruler_scale (samplepos_t lower, samplepos_t upper)
|
||||||
} else if (beat_density > 128) {
|
} else if (beat_density > 128) {
|
||||||
bbt_ruler_scale = bbt_show_4;
|
bbt_ruler_scale = bbt_show_4;
|
||||||
} else if (beat_density > 16) {
|
} else if (beat_density > 16) {
|
||||||
bbt_ruler_scale = bbt_show_1;
|
bbt_ruler_scale = bbt_show_1;
|
||||||
} else if (beat_density > 2) {
|
} else if (beat_density > 4) {
|
||||||
bbt_ruler_scale = bbt_show_beats;
|
bbt_ruler_scale = bbt_show_beats;
|
||||||
} else if (beat_density > 0.5) {
|
} else if (beat_density > 1) {
|
||||||
bbt_ruler_scale = bbt_show_ticks;
|
bbt_ruler_scale = bbt_show_ticks;
|
||||||
} else {
|
} else if (beat_density > 0.25) {
|
||||||
bbt_ruler_scale = bbt_show_ticks_detail;
|
bbt_ruler_scale = bbt_show_ticks_detail;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if ((bbt_ruler_scale == bbt_show_ticks_detail) && beats < 3) {
|
|
||||||
bbt_ruler_scale = bbt_show_ticks_super_detail;
|
bbt_ruler_scale = bbt_show_ticks_super_detail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1713,6 +1725,10 @@ Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdoubl
|
||||||
lower = 0;
|
lower = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( minsec_mark_interval== 0) { //we got here too early; divide-by-zero imminent
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pos = (((1000 * (samplepos_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval;
|
pos = (((1000 * (samplepos_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval;
|
||||||
|
|
||||||
switch (minsec_ruler_scale) {
|
switch (minsec_ruler_scale) {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
#include "rgb_macros.h"
|
#include "rgb_macros.h"
|
||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
#include "time_axis_view.h"
|
#include "time_axis_view.h"
|
||||||
#include "tempo_lines.h"
|
#include "grid_lines.h"
|
||||||
#include "ui_config.h"
|
#include "ui_config.h"
|
||||||
|
|
||||||
#include "pbd/i18n.h"
|
#include "pbd/i18n.h"
|
||||||
|
|
@ -180,18 +180,12 @@ Editor::tempo_map_changed (const PropertyChange& /*ignored*/)
|
||||||
|
|
||||||
ENSURE_GUI_THREAD (*this, &Editor::tempo_map_changed, ignored);
|
ENSURE_GUI_THREAD (*this, &Editor::tempo_map_changed, ignored);
|
||||||
|
|
||||||
if (tempo_lines) {
|
|
||||||
tempo_lines->tempo_map_changed(_session->tempo_map().music_origin());
|
|
||||||
}
|
|
||||||
|
|
||||||
compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
||||||
std::vector<TempoMap::BBTPoint> grid;
|
|
||||||
if (bbt_ruler_scale != bbt_show_many) {
|
|
||||||
compute_current_bbt_points (grid, _leftmost_sample, _leftmost_sample + current_page_samples());
|
|
||||||
}
|
|
||||||
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
|
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
|
||||||
draw_measures (grid);
|
|
||||||
update_tempo_based_rulers ();
|
update_tempo_based_rulers ();
|
||||||
|
|
||||||
|
maybe_draw_grid_lines ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -203,10 +197,6 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/)
|
||||||
|
|
||||||
ENSURE_GUI_THREAD (*this, &Editor::tempo_map_changed);
|
ENSURE_GUI_THREAD (*this, &Editor::tempo_map_changed);
|
||||||
|
|
||||||
if (tempo_lines) {
|
|
||||||
tempo_lines->tempo_map_changed(_session->tempo_map().music_origin());
|
|
||||||
}
|
|
||||||
|
|
||||||
TempoSection* prev_ts = 0;
|
TempoSection* prev_ts = 0;
|
||||||
double max_tempo = 0.0;
|
double max_tempo = 0.0;
|
||||||
double min_tempo = DBL_MAX;
|
double min_tempo = DBL_MAX;
|
||||||
|
|
@ -281,18 +271,14 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/)
|
||||||
}
|
}
|
||||||
|
|
||||||
compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
||||||
std::vector<TempoMap::BBTPoint> grid;
|
|
||||||
|
|
||||||
if (bbt_ruler_scale != bbt_show_many) {
|
|
||||||
compute_current_bbt_points (grid, _leftmost_sample, _leftmost_sample + current_page_samples());
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_measures (grid);
|
|
||||||
update_tempo_based_rulers ();
|
update_tempo_based_rulers ();
|
||||||
|
|
||||||
|
maybe_draw_grid_lines ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::redisplay_tempo (bool immediate_redraw)
|
Editor::redisplay_grid (bool immediate_redraw)
|
||||||
{
|
{
|
||||||
if (!_session) {
|
if (!_session) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -300,20 +286,12 @@ Editor::redisplay_tempo (bool immediate_redraw)
|
||||||
|
|
||||||
if (immediate_redraw) {
|
if (immediate_redraw) {
|
||||||
|
|
||||||
//only recalculate bbt_ruler_scale on a zoom or snap-change; not every redraw; if a case is found where this is necessary, uncomment this line.
|
update_tempo_based_rulers ();
|
||||||
// compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
|
|
||||||
|
|
||||||
std::vector<TempoMap::BBTPoint> grid;
|
update_grid();
|
||||||
|
|
||||||
if (bbt_ruler_scale != bbt_show_many) {
|
|
||||||
compute_current_bbt_points (grid, _leftmost_sample, _leftmost_sample + current_page_samples());
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_measures (grid);
|
|
||||||
update_tempo_based_rulers (); // redraw rulers and measure lines
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Glib::signal_idle().connect (sigc::bind_return (sigc::bind (sigc::mem_fun (*this, &Editor::redisplay_tempo), true), false));
|
Glib::signal_idle().connect (sigc::bind_return (sigc::bind (sigc::mem_fun (*this, &Editor::redisplay_grid), true), false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
|
|
@ -379,26 +357,39 @@ Editor::compute_current_bbt_points (std::vector<TempoMap::BBTPoint>& grid, sampl
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::hide_measures ()
|
Editor::hide_grid_lines ()
|
||||||
{
|
{
|
||||||
if (tempo_lines) {
|
if (grid_lines) {
|
||||||
tempo_lines->hide();
|
grid_lines->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::draw_measures (std::vector<ARDOUR::TempoMap::BBTPoint>& grid)
|
Editor::maybe_draw_grid_lines ()
|
||||||
{
|
{
|
||||||
if (_session == 0 || _show_measures == false || distance (grid.begin(), grid.end()) == 0) {
|
if ( _session == 0 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tempo_lines == 0) {
|
if (grid_lines == 0) {
|
||||||
tempo_lines = new TempoLines (time_line_group, ArdourCanvas::LineSet::Vertical, new BeatsSamplesConverter (_session->tempo_map(), _session->tempo_map().music_origin()));
|
grid_lines = new GridLines (time_line_group, ArdourCanvas::LineSet::Vertical);
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsigned divisions = get_grid_beat_divisions(_leftmost_sample);
|
grid_marks.clear();
|
||||||
tempo_lines->draw (grid, divisions, _leftmost_sample, _session->sample_rate());
|
samplepos_t rightmost_sample = _leftmost_sample + current_page_samples();
|
||||||
|
|
||||||
|
if ( grid_musical() ) {
|
||||||
|
metric_get_bbt (grid_marks, _leftmost_sample, rightmost_sample, 12);
|
||||||
|
} else if (_grid_type== GridTypeSmpte) {
|
||||||
|
metric_get_timecode (grid_marks, _leftmost_sample, rightmost_sample, 12);
|
||||||
|
} else if (_grid_type == GridTypeSamples) {
|
||||||
|
metric_get_samples (grid_marks, _leftmost_sample, rightmost_sample, 12);
|
||||||
|
} else if (_grid_type == GridTypeMinSec) {
|
||||||
|
metric_get_minsec (grid_marks, _leftmost_sample, rightmost_sample, 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
grid_lines->draw ( grid_marks );
|
||||||
|
grid_lines->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,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;
|
||||||
SnapType snap_type;
|
GridType grid_type;
|
||||||
SnapMode snap_mode;
|
SnapMode snap_mode;
|
||||||
ZoomFocus zoom_focus;
|
ZoomFocus zoom_focus;
|
||||||
ItemType item_type;
|
ItemType item_type;
|
||||||
|
|
@ -94,37 +94,28 @@ setup_gtk_ardour_enums ()
|
||||||
REGISTER_ENUM (ByTimestamp);
|
REGISTER_ENUM (ByTimestamp);
|
||||||
REGISTER (region_list_sort_type);
|
REGISTER (region_list_sort_type);
|
||||||
|
|
||||||
REGISTER_ENUM (SnapToCDFrame);
|
REGISTER_ENUM (GridTypeNone);
|
||||||
REGISTER_ENUM (SnapToTimecodeFrame);
|
REGISTER_ENUM (GridTypeBar);
|
||||||
REGISTER_ENUM (SnapToTimecodeSeconds);
|
REGISTER_ENUM (GridTypeBeat);
|
||||||
REGISTER_ENUM (SnapToTimecodeMinutes);
|
REGISTER_ENUM (GridTypeBeatDiv2);
|
||||||
REGISTER_ENUM (SnapToSeconds);
|
REGISTER_ENUM (GridTypeBeatDiv4);
|
||||||
REGISTER_ENUM (SnapToMinutes);
|
REGISTER_ENUM (GridTypeBeatDiv8);
|
||||||
REGISTER_ENUM (SnapToBeatDiv128);
|
REGISTER_ENUM (GridTypeBeatDiv16);
|
||||||
REGISTER_ENUM (SnapToBeatDiv64);
|
REGISTER_ENUM (GridTypeBeatDiv32);
|
||||||
REGISTER_ENUM (SnapToBeatDiv32);
|
REGISTER_ENUM (GridTypeBeatDiv3);
|
||||||
REGISTER_ENUM (SnapToBeatDiv28);
|
REGISTER_ENUM (GridTypeBeatDiv6);
|
||||||
REGISTER_ENUM (SnapToBeatDiv24);
|
REGISTER_ENUM (GridTypeBeatDiv12);
|
||||||
REGISTER_ENUM (SnapToBeatDiv20);
|
REGISTER_ENUM (GridTypeBeatDiv24);
|
||||||
REGISTER_ENUM (SnapToBeatDiv16);
|
REGISTER_ENUM (GridTypeBeatDiv5);
|
||||||
REGISTER_ENUM (SnapToBeatDiv14);
|
REGISTER_ENUM (GridTypeBeatDiv10);
|
||||||
REGISTER_ENUM (SnapToBeatDiv12);
|
REGISTER_ENUM (GridTypeBeatDiv20);
|
||||||
REGISTER_ENUM (SnapToBeatDiv10);
|
REGISTER_ENUM (GridTypeBeatDiv7);
|
||||||
REGISTER_ENUM (SnapToBeatDiv8);
|
REGISTER_ENUM (GridTypeBeatDiv14);
|
||||||
REGISTER_ENUM (SnapToBeatDiv7);
|
REGISTER_ENUM (GridTypeBeatDiv28);
|
||||||
REGISTER_ENUM (SnapToBeatDiv6);
|
REGISTER_ENUM (GridTypeSmpte);
|
||||||
REGISTER_ENUM (SnapToBeatDiv5);
|
REGISTER_ENUM (GridTypeMinSec);
|
||||||
REGISTER_ENUM (SnapToBeatDiv4);
|
REGISTER_ENUM (GridTypeSamples);
|
||||||
REGISTER_ENUM (SnapToBeatDiv3);
|
REGISTER (grid_type);
|
||||||
REGISTER_ENUM (SnapToBeatDiv2);
|
|
||||||
REGISTER_ENUM (SnapToBeat);
|
|
||||||
REGISTER_ENUM (SnapToBar);
|
|
||||||
REGISTER_ENUM (SnapToMark);
|
|
||||||
REGISTER_ENUM (SnapToRegionStart);
|
|
||||||
REGISTER_ENUM (SnapToRegionEnd);
|
|
||||||
REGISTER_ENUM (SnapToRegionSync);
|
|
||||||
REGISTER_ENUM (SnapToRegionBoundary);
|
|
||||||
REGISTER (snap_type);
|
|
||||||
|
|
||||||
REGISTER_ENUM (SnapOff);
|
REGISTER_ENUM (SnapOff);
|
||||||
REGISTER_ENUM (SnapNormal);
|
REGISTER_ENUM (SnapNormal);
|
||||||
|
|
|
||||||
|
|
@ -834,7 +834,7 @@ LuaInstance::register_classes (lua_State* L)
|
||||||
.endClass ()
|
.endClass ()
|
||||||
|
|
||||||
.beginClass <PublicEditor> ("Editor")
|
.beginClass <PublicEditor> ("Editor")
|
||||||
.addFunction ("snap_type", &PublicEditor::snap_type)
|
.addFunction ("grid_type", &PublicEditor::grid_type)
|
||||||
.addFunction ("snap_mode", &PublicEditor::snap_mode)
|
.addFunction ("snap_mode", &PublicEditor::snap_mode)
|
||||||
.addFunction ("set_snap_mode", &PublicEditor::set_snap_mode)
|
.addFunction ("set_snap_mode", &PublicEditor::set_snap_mode)
|
||||||
|
|
||||||
|
|
@ -865,8 +865,7 @@ LuaInstance::register_classes (lua_State* L)
|
||||||
.addFunction ("add_location_from_playhead_cursor", &PublicEditor::add_location_from_playhead_cursor)
|
.addFunction ("add_location_from_playhead_cursor", &PublicEditor::add_location_from_playhead_cursor)
|
||||||
.addFunction ("remove_location_at_playhead_cursor", &PublicEditor::remove_location_at_playhead_cursor)
|
.addFunction ("remove_location_at_playhead_cursor", &PublicEditor::remove_location_at_playhead_cursor)
|
||||||
|
|
||||||
.addFunction ("set_show_measures", &PublicEditor::set_show_measures)
|
.addFunction ("update_grid", &PublicEditor::update_grid)
|
||||||
.addFunction ("show_measures", &PublicEditor::show_measures)
|
|
||||||
.addFunction ("remove_tracks", &PublicEditor::remove_tracks)
|
.addFunction ("remove_tracks", &PublicEditor::remove_tracks)
|
||||||
|
|
||||||
.addFunction ("set_loop_range", &PublicEditor::set_loop_range)
|
.addFunction ("set_loop_range", &PublicEditor::set_loop_range)
|
||||||
|
|
@ -1028,7 +1027,7 @@ LuaInstance::register_classes (lua_State* L)
|
||||||
// Editing Symbols
|
// Editing Symbols
|
||||||
|
|
||||||
#undef ZOOMFOCUS
|
#undef ZOOMFOCUS
|
||||||
#undef SNAPTYPE
|
#undef GRIDTYPE
|
||||||
#undef SNAPMODE
|
#undef SNAPMODE
|
||||||
#undef MOUSEMODE
|
#undef MOUSEMODE
|
||||||
#undef DISPLAYCONTROL
|
#undef DISPLAYCONTROL
|
||||||
|
|
@ -1037,7 +1036,7 @@ LuaInstance::register_classes (lua_State* L)
|
||||||
#undef IMPORTDISPOSITION
|
#undef IMPORTDISPOSITION
|
||||||
|
|
||||||
#define ZOOMFOCUS(NAME) .addConst (stringify(NAME), (Editing::ZoomFocus)Editing::NAME)
|
#define ZOOMFOCUS(NAME) .addConst (stringify(NAME), (Editing::ZoomFocus)Editing::NAME)
|
||||||
#define SNAPTYPE(NAME) .addConst (stringify(NAME), (Editing::SnapType)Editing::NAME)
|
#define GRIDTYPE(NAME) .addConst (stringify(NAME), (Editing::GridType)Editing::NAME)
|
||||||
#define SNAPMODE(NAME) .addConst (stringify(NAME), (Editing::SnapMode)Editing::NAME)
|
#define SNAPMODE(NAME) .addConst (stringify(NAME), (Editing::SnapMode)Editing::NAME)
|
||||||
#define MOUSEMODE(NAME) .addConst (stringify(NAME), (Editing::MouseMode)Editing::NAME)
|
#define MOUSEMODE(NAME) .addConst (stringify(NAME), (Editing::MouseMode)Editing::NAME)
|
||||||
#define DISPLAYCONTROL(NAME) .addConst (stringify(NAME), (Editing::DisplayControl)Editing::NAME)
|
#define DISPLAYCONTROL(NAME) .addConst (stringify(NAME), (Editing::DisplayControl)Editing::NAME)
|
||||||
|
|
|
||||||
|
|
@ -3511,7 +3511,7 @@ MidiRegionView::nudge_notes (bool forward, bool fine)
|
||||||
next_pos.sample -= 1;
|
next_pos.sample -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
trackview.editor().snap_to (next_pos, (forward ? RoundUpAlways : RoundDownAlways), false);
|
trackview.editor().snap_to (next_pos, (forward ? RoundUpAlways : RoundDownAlways), SnapToGrid, false);
|
||||||
const samplecnt_t distance = ref_point - next_pos.sample;
|
const samplecnt_t distance = ref_point - next_pos.sample;
|
||||||
delta = region_samples_to_region_beats (fabs ((double)distance));
|
delta = region_samples_to_region_beats (fabs ((double)distance));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ MouseCursors::MouseCursors ()
|
||||||
, selector (0)
|
, selector (0)
|
||||||
, grabber (0)
|
, grabber (0)
|
||||||
, grabber_note (0)
|
, grabber_note (0)
|
||||||
, grabber_edit_point (0)
|
|
||||||
, zoom_in (0)
|
, zoom_in (0)
|
||||||
, zoom_out (0)
|
, zoom_out (0)
|
||||||
, time_fx (0)
|
, time_fx (0)
|
||||||
|
|
@ -94,7 +93,6 @@ MouseCursors::drop_all ()
|
||||||
delete selector; selector = 0;
|
delete selector; selector = 0;
|
||||||
delete grabber; grabber = 0;
|
delete grabber; grabber = 0;
|
||||||
delete grabber_note; grabber_note = 0;
|
delete grabber_note; grabber_note = 0;
|
||||||
delete grabber_edit_point; grabber_edit_point = 0;
|
|
||||||
delete zoom_in; zoom_in = 0;
|
delete zoom_in; zoom_in = 0;
|
||||||
delete zoom_out; zoom_out = 0;
|
delete zoom_out; zoom_out = 0;
|
||||||
delete time_fx; time_fx = 0;
|
delete time_fx; time_fx = 0;
|
||||||
|
|
@ -164,7 +162,6 @@ MouseCursors::set_cursor_set (const std::string& name)
|
||||||
scissors = make_cursor ("scissors", 5, 0);
|
scissors = make_cursor ("scissors", 5, 0);
|
||||||
grabber = make_cursor ("grabber", 5, 0);
|
grabber = make_cursor ("grabber", 5, 0);
|
||||||
grabber_note = make_cursor ("grabber_note", 5, 10);
|
grabber_note = make_cursor ("grabber_note", 5, 10);
|
||||||
grabber_edit_point = make_cursor ("grabber_edit_point", 5, 17);
|
|
||||||
left_side_trim = make_cursor ("trim_left_cursor", 5, 11);
|
left_side_trim = make_cursor ("trim_left_cursor", 5, 11);
|
||||||
anchored_left_side_trim = make_cursor ("anchored_trim_left_cursor", 5, 11);
|
anchored_left_side_trim = make_cursor ("anchored_trim_left_cursor", 5, 11);
|
||||||
right_side_trim = make_cursor ("trim_right_cursor", 23, 11);
|
right_side_trim = make_cursor ("trim_right_cursor", 23, 11);
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ public:
|
||||||
Gdk::Cursor* selector;
|
Gdk::Cursor* selector;
|
||||||
Gdk::Cursor* grabber;
|
Gdk::Cursor* grabber;
|
||||||
Gdk::Cursor* grabber_note;
|
Gdk::Cursor* grabber_note;
|
||||||
Gdk::Cursor* grabber_edit_point;
|
|
||||||
Gdk::Cursor* zoom_in;
|
Gdk::Cursor* zoom_in;
|
||||||
Gdk::Cursor* zoom_out;
|
Gdk::Cursor* zoom_out;
|
||||||
Gdk::Cursor* time_fx;
|
Gdk::Cursor* time_fx;
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,9 @@ public:
|
||||||
/** Set the snap type.
|
/** Set the snap type.
|
||||||
* @param t Snap type (defined in editing_syms.h)
|
* @param t Snap type (defined in editing_syms.h)
|
||||||
*/
|
*/
|
||||||
virtual void set_snap_to (Editing::SnapType t) = 0;
|
virtual void set_grid_to (Editing::GridType t) = 0;
|
||||||
|
|
||||||
virtual Editing::SnapType snap_type () const = 0;
|
virtual Editing::GridType grid_type () const = 0;
|
||||||
virtual Editing::SnapMode snap_mode () const = 0;
|
virtual Editing::SnapMode snap_mode () const = 0;
|
||||||
|
|
||||||
/** Set the snap mode.
|
/** Set the snap mode.
|
||||||
|
|
@ -149,6 +149,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void snap_to (ARDOUR::MusicSample& first,
|
virtual void snap_to (ARDOUR::MusicSample& first,
|
||||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||||
|
ARDOUR::SnapPref gpref = ARDOUR::SnapToAny,
|
||||||
bool for_mark = false,
|
bool for_mark = false,
|
||||||
bool ensure_snap = false) = 0;
|
bool ensure_snap = false) = 0;
|
||||||
|
|
||||||
|
|
@ -219,8 +220,7 @@ public:
|
||||||
virtual void trigger_script (int nth) = 0;
|
virtual void trigger_script (int nth) = 0;
|
||||||
virtual void add_location_from_playhead_cursor () = 0;
|
virtual void add_location_from_playhead_cursor () = 0;
|
||||||
virtual void remove_location_at_playhead_cursor () = 0;
|
virtual void remove_location_at_playhead_cursor () = 0;
|
||||||
virtual void set_show_measures (bool yn) = 0;
|
virtual void update_grid () = 0;
|
||||||
virtual bool show_measures () const = 0;
|
|
||||||
virtual void remove_tracks () = 0;
|
virtual void remove_tracks () = 0;
|
||||||
virtual void set_loop_range (samplepos_t start, samplepos_t end, std::string cmd) = 0;
|
virtual void set_loop_range (samplepos_t start, samplepos_t end, std::string cmd) = 0;
|
||||||
virtual void set_punch_range (samplepos_t start, samplepos_t end, std::string cmd) = 0;
|
virtual void set_punch_range (samplepos_t start, samplepos_t end, std::string cmd) = 0;
|
||||||
|
|
@ -461,7 +461,8 @@ public:
|
||||||
virtual void snap_to_with_modifier (ARDOUR::MusicSample& first,
|
virtual void snap_to_with_modifier (ARDOUR::MusicSample& first,
|
||||||
GdkEvent const * ev,
|
GdkEvent const * ev,
|
||||||
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
|
||||||
bool for_mark = false) = 0;
|
ARDOUR::SnapPref gpref = ARDOUR::SnapToAny,
|
||||||
|
bool for_mark = false) = 0;
|
||||||
|
|
||||||
virtual void set_snapped_cursor_position (samplepos_t pos) = 0;
|
virtual void set_snapped_cursor_position (samplepos_t pos) = 0;
|
||||||
|
|
||||||
|
|
@ -471,6 +472,9 @@ public:
|
||||||
virtual void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0;
|
virtual void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0;
|
||||||
virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&) const = 0;
|
virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&) const = 0;
|
||||||
|
|
||||||
|
virtual void build_region_boundary_cache () = 0;
|
||||||
|
virtual void mark_region_boundary_cache_dirty () = 0;
|
||||||
|
|
||||||
virtual void mouse_add_new_tempo_event (samplepos_t where) = 0;
|
virtual void mouse_add_new_tempo_event (samplepos_t where) = 0;
|
||||||
virtual void mouse_add_new_meter_event (samplepos_t where) = 0;
|
virtual void mouse_add_new_meter_event (samplepos_t where) = 0;
|
||||||
virtual void edit_tempo_section (ARDOUR::TempoSection*) = 0;
|
virtual void edit_tempo_section (ARDOUR::TempoSection*) = 0;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ using namespace Gtkmm2ext;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
||||||
static const gchar *_grid_strings[] = {
|
static const gchar *_grid_strings[] = {
|
||||||
N_("main grid"),
|
N_("Main Grid"),
|
||||||
N_("Beats/128"),
|
N_("Beats/128"),
|
||||||
N_("Beats/64"),
|
N_("Beats/64"),
|
||||||
N_("Beats/32"),
|
N_("Beats/32"),
|
||||||
|
|
|
||||||
|
|
@ -2306,14 +2306,6 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
|
|
||||||
add_option (_("Editor"), new OptionEditorHeading (_("General")));
|
add_option (_("Editor"), new OptionEditorHeading (_("General")));
|
||||||
|
|
||||||
add_option (_("Editor"),
|
|
||||||
new BoolOption (
|
|
||||||
"rubberbanding-snaps-to-grid",
|
|
||||||
_("Snap rubberband to grid"),
|
|
||||||
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_rubberbanding_snaps_to_grid),
|
|
||||||
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_rubberbanding_snaps_to_grid)
|
|
||||||
));
|
|
||||||
|
|
||||||
bo = new BoolOption (
|
bo = new BoolOption (
|
||||||
"name-new-markers",
|
"name-new-markers",
|
||||||
_("Prompt for new marker names"),
|
_("Prompt for new marker names"),
|
||||||
|
|
@ -2510,6 +2502,49 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_snapped_cursor)
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_snapped_cursor)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
add_option (_("Editor/Snap"),
|
||||||
|
new BoolOption (
|
||||||
|
"rubberbanding-snaps-to-grid",
|
||||||
|
_("Snap rubberband to grid"),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_rubberbanding_snaps_to_grid),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_rubberbanding_snaps_to_grid)
|
||||||
|
));
|
||||||
|
|
||||||
|
add_option (_("Editor/Snap"), new OptionEditorHeading (_("When \"Snap\" is enabled, snap to:")));
|
||||||
|
|
||||||
|
|
||||||
|
add_option (_("Editor/Snap"),
|
||||||
|
new BoolOption (
|
||||||
|
"snap-to-region-sync",
|
||||||
|
_("Region Sync Points"),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_snap_to_region_sync),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_snap_to_region_sync)
|
||||||
|
));
|
||||||
|
|
||||||
|
add_option (_("Editor/Snap"),
|
||||||
|
new BoolOption (
|
||||||
|
"snap-to-region-start",
|
||||||
|
_("Region Starts"),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_snap_to_region_start),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_snap_to_region_start)
|
||||||
|
));
|
||||||
|
|
||||||
|
add_option (_("Editor/Snap"),
|
||||||
|
new BoolOption (
|
||||||
|
"snap-to-region-end",
|
||||||
|
_("Region Ends"),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_snap_to_region_end),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_snap_to_region_end)
|
||||||
|
));
|
||||||
|
|
||||||
|
add_option (_("Editor/Snap"),
|
||||||
|
new BoolOption (
|
||||||
|
"snap-to-grid",
|
||||||
|
_("Grid"),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_snap_to_grid),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_snap_to_grid)
|
||||||
|
));
|
||||||
|
|
||||||
add_option (_("Editor/Modifiers"), new OptionEditorHeading (_("Keyboard Modifiers")));
|
add_option (_("Editor/Modifiers"), new OptionEditorHeading (_("Keyboard Modifiers")));
|
||||||
add_option (_("Editor/Modifiers"), new KeyboardOptions);
|
add_option (_("Editor/Modifiers"), new KeyboardOptions);
|
||||||
add_option (_("Editor/Modifiers"), new OptionEditorBlank ());
|
add_option (_("Editor/Modifiers"), new OptionEditorBlank ());
|
||||||
|
|
|
||||||
|
|
@ -948,12 +948,12 @@ RegionView::snap_sample_to_sample (sampleoffset_t x, bool ensure_snap) const
|
||||||
|
|
||||||
/* try a snap in either direction */
|
/* try a snap in either direction */
|
||||||
MusicSample sample (session_sample, 0);
|
MusicSample sample (session_sample, 0);
|
||||||
editor.snap_to (sample, RoundNearest, false, ensure_snap);
|
editor.snap_to (sample, RoundNearest, SnapToAny, false, ensure_snap);
|
||||||
|
|
||||||
/* if we went off the beginning of the region, snap forwards */
|
/* if we went off the beginning of the region, snap forwards */
|
||||||
if (sample.sample < _region->position ()) {
|
if (sample.sample < _region->position ()) {
|
||||||
sample.sample = session_sample;
|
sample.sample = session_sample;
|
||||||
editor.snap_to (sample, RoundUpAlways, false, ensure_snap);
|
editor.snap_to (sample, RoundUpAlways, SnapToAny, false, ensure_snap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* back to region relative, keeping the relevant divisor */
|
/* back to region relative, keeping the relevant divisor */
|
||||||
|
|
|
||||||
|
|
@ -103,3 +103,8 @@ UI_CONFIG_VARIABLE (std::string, stripable_color_palette, "stripable-color-palet
|
||||||
|
|
||||||
UI_CONFIG_VARIABLE (bool, show_snapped_cursor, "show-snapped-cursor", true)
|
UI_CONFIG_VARIABLE (bool, show_snapped_cursor, "show-snapped-cursor", true)
|
||||||
UI_CONFIG_VARIABLE (uint32_t, snap_threshold, "snap-threshold", 25)
|
UI_CONFIG_VARIABLE (uint32_t, snap_threshold, "snap-threshold", 25)
|
||||||
|
UI_CONFIG_VARIABLE (bool, snap_to_marks, "snap-to-marks", true)
|
||||||
|
UI_CONFIG_VARIABLE (bool, snap_to_region_sync, "snap-to-region-sync", true)
|
||||||
|
UI_CONFIG_VARIABLE (bool, snap_to_region_start, "snap-to-region-start", true)
|
||||||
|
UI_CONFIG_VARIABLE (bool, snap_to_region_end, "snap-to-region-end", true)
|
||||||
|
UI_CONFIG_VARIABLE (bool, snap_to_grid, "snap-to-grid", false)
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ gtk2_ardour_sources = [
|
||||||
'template_dialog.cc',
|
'template_dialog.cc',
|
||||||
'tempo_curve.cc',
|
'tempo_curve.cc',
|
||||||
'tempo_dialog.cc',
|
'tempo_dialog.cc',
|
||||||
'tempo_lines.cc',
|
'grid_lines.cc',
|
||||||
'time_axis_view.cc',
|
'time_axis_view.cc',
|
||||||
'time_axis_view_item.cc',
|
'time_axis_view_item.cc',
|
||||||
'time_fx_dialog.cc',
|
'time_fx_dialog.cc',
|
||||||
|
|
|
||||||
|
|
@ -238,6 +238,11 @@ namespace ARDOUR {
|
||||||
RoundUpMaybe = 2 ///< Round up only if necessary
|
RoundUpMaybe = 2 ///< Round up only if necessary
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum SnapPref {
|
||||||
|
SnapToAny = 0, ///< Snaps to the closest of ( snap prefs, grid quantization )
|
||||||
|
SnapToGrid = 1, ///< Prefer snapping to the closest grid quantization, if a Grid selection is enabled
|
||||||
|
};
|
||||||
|
|
||||||
class AnyTime {
|
class AnyTime {
|
||||||
public:
|
public:
|
||||||
enum Type {
|
enum Type {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue