fix crashing bug caused by recursive set_state() nonsense; sync snap_type, snap_mode, zoom_focus GUI elements; minor tweaks
git-svn-id: svn://localhost/ardour2/trunk@1048 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
2001efa088
commit
a0e8568266
|
@ -131,9 +131,31 @@
|
|||
<menuitem action='zoom-focus-playhead'/>
|
||||
<menuitem action='zoom-focus-edit'/>
|
||||
</menu>
|
||||
<menu name='SnapMode' action='SnapMode'>
|
||||
<menuitem action='snap-normal'/>
|
||||
<menuitem action='snap-magnetic'/>
|
||||
</menu>
|
||||
<menu name='SnapTo' action='SnapTo'>
|
||||
<menuitem action='snap-to-beat'/>
|
||||
<menuitem action='snap-to-bar'/>
|
||||
<menuitem action='snap-to-frame'/>
|
||||
<menuitem action='snap-to-cd-frame'/>
|
||||
<menuitem action='snap-to-smpte-frame'/>
|
||||
<menuitem action='snap-to-smpte-seconds'/>
|
||||
<menuitem action='snap-to-smpte-minutes'/>
|
||||
<menuitem action='snap-to-seconds'/>
|
||||
<menuitem action='snap-to-minutes'/>
|
||||
<menuitem action='snap-to-thirtyseconds'/>
|
||||
<menuitem action='snap-to-asixteenthbeat'/>
|
||||
<menuitem action='snap-to-eighths'/>
|
||||
<menuitem action='snap-to-quarters'/>
|
||||
<menuitem action='snap-to-thirds'/>
|
||||
<menuitem action='snap-to-beat'/>
|
||||
<menuitem action='snap-to-bar'/>
|
||||
<menuitem action='snap-to-mark'/>
|
||||
<menuitem action='snap-to-edit-cursor'/>
|
||||
<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 name='MeterFalloff' action='MeterFalloff'>
|
||||
<menuitem action='MeterFalloffOff'/>
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include "editing.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
// This involves some cpp magic. --taybin
|
||||
|
@ -24,6 +26,13 @@ str2snaptype (const string & str) {
|
|||
#include "editing_syms.h"
|
||||
return SnapToBar;
|
||||
}
|
||||
|
||||
#undef SNAPTYPE
|
||||
#define SNAPTYPE(s) N_(#s),
|
||||
const char *snaptypestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef SNAPTYPE
|
||||
#define SNAPTYPE(a) /*empty*/
|
||||
|
||||
|
@ -36,9 +45,17 @@ str2snapmode (const string & str) {
|
|||
#include "editing_syms.h"
|
||||
return SnapNormal;
|
||||
}
|
||||
|
||||
#undef SNAPMODE
|
||||
#define SNAPMODE(s) N_(#s),
|
||||
const char *snapmodestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef SNAPMODE
|
||||
#define SNAPMODE(a) /*empty*/
|
||||
|
||||
|
||||
// REGIONLISTSORTTYPE
|
||||
#undef REGIONLISTSORTTYPE
|
||||
#define REGIONLISTSORTTYPE(s) if (!strcmp(type, #s)) {return s;}
|
||||
|
@ -48,6 +65,13 @@ str2regionlistsorttype (const string & str) {
|
|||
#include "editing_syms.h"
|
||||
return ByName;
|
||||
}
|
||||
|
||||
#undef REGIONLISTSORTTYPE
|
||||
#define REGIONLISTSORTTYPE(s) N_(#s),
|
||||
const char *regionlistsorttypestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef REGIONLISTSORTTYPE
|
||||
#define REGIONLISTSORTTYPE(a) /*empty*/
|
||||
|
||||
|
@ -60,6 +84,13 @@ str2mousemode (const string & str) {
|
|||
#include "editing_syms.h"
|
||||
return MouseObject;
|
||||
}
|
||||
|
||||
#undef MOUSEMODE
|
||||
#define MOUSEMODE(s) N_(#s),
|
||||
const char *mousemodestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef MOUSEMODE
|
||||
#define MOUSEMODE(a) /*empty*/
|
||||
|
||||
|
@ -72,6 +103,13 @@ str2zoomfocus (const string & str) {
|
|||
#include "editing_syms.h"
|
||||
return ZoomFocusPlayhead;
|
||||
}
|
||||
|
||||
#undef ZOOMFOCUS
|
||||
#define ZOOMFOCUS(s) N_(#s),
|
||||
const char *zoomfocusstrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef ZOOMFOCUS
|
||||
#define ZOOMFOCUS(a) /*empty*/
|
||||
|
||||
|
@ -84,7 +122,25 @@ str2displaycontrol (const string & str) {
|
|||
#include "editing_syms.h"
|
||||
return FollowPlayhead;
|
||||
}
|
||||
|
||||
#undef DISPLAYCONTROL
|
||||
#define DISPLAYCONTROL(s) N_(#s),
|
||||
const char *displaycontrolstrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef DISPLAYCONTROL
|
||||
#define DISPLAYCONTROL(a) /*empty*/
|
||||
|
||||
//IMPORTMODE
|
||||
#undef IMPORTMODE
|
||||
#define IMPORTMODE(s) N_(#s),
|
||||
const char *importmodestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
0
|
||||
};
|
||||
#undef IMPORTMODE
|
||||
#define IMPORTMODE(a) /*empty*/
|
||||
|
||||
} // namespace Editing
|
||||
|
||||
|
|
|
@ -24,11 +24,7 @@ enum SnapType {
|
|||
#include "editing_syms.h"
|
||||
};
|
||||
|
||||
#undef SNAPTYPE
|
||||
#define SNAPTYPE(s) #s,
|
||||
static const char *snaptypestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
};
|
||||
extern const char *snaptypestrs[];
|
||||
inline const char* enum2str(SnapType m) {return snaptypestrs[m];}
|
||||
SnapType str2snaptype(const std::string &);
|
||||
|
||||
|
@ -42,11 +38,7 @@ enum SnapMode {
|
|||
#include "editing_syms.h"
|
||||
};
|
||||
|
||||
#undef SNAPMODE
|
||||
#define SNAPMODE(s) #s,
|
||||
static const char *snapmodestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
};
|
||||
extern const char *snapmodestrs[];
|
||||
inline const char* enum2str(SnapMode m) {return snapmodestrs[m];}
|
||||
SnapMode str2snapmode(const std::string &);
|
||||
|
||||
|
@ -60,11 +52,7 @@ enum RegionListSortType {
|
|||
#include "editing_syms.h"
|
||||
};
|
||||
|
||||
#undef REGIONLISTSORTTYPE
|
||||
#define REGIONLISTSORTTYPE(s) #s,
|
||||
static const char *regionlistsorttypestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
};
|
||||
extern const char *regionlistsorttypestrs[];
|
||||
inline const char* enum2str(RegionListSortType m) {return regionlistsorttypestrs[m];}
|
||||
RegionListSortType str2regionlistsorttype(const std::string &);
|
||||
|
||||
|
@ -78,11 +66,7 @@ enum MouseMode {
|
|||
#include "editing_syms.h"
|
||||
};
|
||||
|
||||
#undef MOUSEMODE
|
||||
#define MOUSEMODE(s) #s,
|
||||
static const char *mousemodestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
};
|
||||
extern const char *mousemodestrs[];
|
||||
inline const char* enum2str(MouseMode m) {return mousemodestrs[m];}
|
||||
MouseMode str2mousemode(const std::string &);
|
||||
|
||||
|
@ -96,11 +80,7 @@ enum ZoomFocus {
|
|||
#include "editing_syms.h"
|
||||
};
|
||||
|
||||
#undef ZOOMFOCUS
|
||||
#define ZOOMFOCUS(s) #s,
|
||||
static const char *zoomfocusstrs[] = {
|
||||
#include "editing_syms.h"
|
||||
};
|
||||
extern const char *zoomfocusstrs[];
|
||||
inline const char* enum2str(ZoomFocus m) {return zoomfocusstrs[m];}
|
||||
ZoomFocus str2zoomfocus(const std::string &);
|
||||
|
||||
|
@ -114,11 +94,7 @@ enum DisplayControl {
|
|||
#include "editing_syms.h"
|
||||
};
|
||||
|
||||
#undef DISPLAYCONTROL
|
||||
#define DISPLAYCONTROL(s) #s,
|
||||
static const char *displaycontrolstrs[] = {
|
||||
#include "editing_syms.h"
|
||||
};
|
||||
extern const char *displaycontrolstrs[];
|
||||
inline const char* enum2str(DisplayControl m) {return displaycontrolstrs[m];}
|
||||
DisplayControl str2displaycontrol (const std::string &);
|
||||
|
||||
|
@ -132,11 +108,7 @@ enum ImportMode {
|
|||
#include "editing_syms.h"
|
||||
};
|
||||
|
||||
#undef IMPORTMODE
|
||||
#define IMPORTMODE(s) #s,
|
||||
static const char *importmodestrs[] = {
|
||||
#include "editing_syms.h"
|
||||
};
|
||||
extern const char *importmodestrs[];
|
||||
inline const char* enum2str(ImportMode m) {return importmodestrs[m];}
|
||||
ImportMode str2importmode (const std::string &);
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ const double Editor::timebar_height = 15.0;
|
|||
|
||||
#include "editor_xpms"
|
||||
|
||||
static const gchar *snap_type_strings[] = {
|
||||
static const gchar *_snap_type_strings[] = {
|
||||
N_("None"),
|
||||
N_("CD Frames"),
|
||||
N_("SMPTE Frames"),
|
||||
|
@ -121,13 +121,13 @@ static const gchar *snap_type_strings[] = {
|
|||
0
|
||||
};
|
||||
|
||||
static const gchar *snap_mode_strings[] = {
|
||||
N_("Normal Snap"),
|
||||
N_("Magnetic Snap"),
|
||||
static const gchar *_snap_mode_strings[] = {
|
||||
N_("Normal"),
|
||||
N_("Magnetic"),
|
||||
0
|
||||
};
|
||||
|
||||
static const gchar *zoom_focus_strings[] = {
|
||||
static const gchar *_zoom_focus_strings[] = {
|
||||
N_("Left"),
|
||||
N_("Right"),
|
||||
N_("Center"),
|
||||
|
@ -239,6 +239,10 @@ Editor::Editor (AudioEngine& eng)
|
|||
current_mixer_strip = 0;
|
||||
current_bbt_points = 0;
|
||||
|
||||
snap_type_strings = I18N (_snap_type_strings);
|
||||
snap_mode_strings = I18N (_snap_mode_strings);
|
||||
zoom_focus_strings = I18N(_zoom_focus_strings);
|
||||
|
||||
snap_type = SnapToFrame;
|
||||
set_snap_to (snap_type);
|
||||
snap_mode = SnapNormal;
|
||||
|
@ -1996,8 +2000,11 @@ void
|
|||
Editor::set_snap_to (SnapType st)
|
||||
{
|
||||
snap_type = st;
|
||||
vector<string> txt = I18N (snap_type_strings);
|
||||
snap_type_selector.set_active_text (txt[(int)st]);
|
||||
string str = snap_type_strings[(int) st];
|
||||
|
||||
if (str != snap_type_selector.get_active_text()) {
|
||||
snap_type_selector.set_active_text (str);
|
||||
}
|
||||
|
||||
instant_save ();
|
||||
|
||||
|
@ -2018,8 +2025,11 @@ void
|
|||
Editor::set_snap_mode (SnapMode mode)
|
||||
{
|
||||
snap_mode = mode;
|
||||
vector<string> txt = I18N (snap_mode_strings);
|
||||
snap_mode_selector.set_active_text (txt[(int)mode]);
|
||||
string str = snap_mode_strings[(int)mode];
|
||||
|
||||
if (str != snap_mode_selector.get_active_text ()) {
|
||||
snap_mode_selector.set_active_text (str);
|
||||
}
|
||||
|
||||
instant_save ();
|
||||
}
|
||||
|
@ -2583,10 +2593,10 @@ Editor::setup_toolbar ()
|
|||
zoom_box.pack_start (zoom_out_full_button, false, false);
|
||||
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (zoom_range_clock, _("Current Zoom Range\n(Width of visible area)"));
|
||||
|
||||
|
||||
zoom_focus_selector.set_name ("ZoomFocusSelector");
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (zoom_focus_selector, "Focus Center", 2+FUDGE, 0);
|
||||
set_popdown_strings (zoom_focus_selector, I18N (zoom_focus_strings));
|
||||
set_popdown_strings (zoom_focus_selector, zoom_focus_strings);
|
||||
zoom_focus_selector.signal_changed().connect (mem_fun(*this, &Editor::zoom_focus_selection_done));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (zoom_focus_selector, _("Zoom focus"));
|
||||
|
||||
|
@ -2600,13 +2610,13 @@ Editor::setup_toolbar ()
|
|||
|
||||
snap_type_selector.set_name ("SnapTypeSelector");
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (snap_type_selector, "SMPTE Seconds", 2+FUDGE, 10);
|
||||
set_popdown_strings (snap_type_selector, I18N (snap_type_strings));
|
||||
set_popdown_strings (snap_type_selector, snap_type_strings);
|
||||
snap_type_selector.signal_changed().connect (mem_fun(*this, &Editor::snap_type_selection_done));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (snap_type_selector, _("Unit to snap cursors and ranges to"));
|
||||
|
||||
snap_mode_selector.set_name ("SnapModeSelector");
|
||||
Gtkmm2ext::set_size_request_to_display_given_text (snap_mode_selector, "Magnetic Snap", 2+FUDGE, 10);
|
||||
set_popdown_strings (snap_mode_selector, I18N (snap_mode_strings));
|
||||
set_popdown_strings (snap_mode_selector, snap_mode_strings);
|
||||
snap_mode_selector.signal_changed().connect (mem_fun(*this, &Editor::snap_mode_selection_done));
|
||||
|
||||
snap_box.pack_start (edit_cursor_clock, false, false);
|
||||
|
@ -3448,10 +3458,6 @@ Editor::edit_mode_selection_done ()
|
|||
void
|
||||
Editor::snap_type_selection_done ()
|
||||
{
|
||||
if (session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
string choice = snap_type_selector.get_active_text();
|
||||
SnapType snaptype = SnapToFrame;
|
||||
|
||||
|
@ -3497,35 +3503,34 @@ Editor::snap_type_selection_done ()
|
|||
snaptype = SnapToFrame;
|
||||
}
|
||||
|
||||
set_snap_to (snaptype);
|
||||
RefPtr<RadioAction> ract = snap_type_action (snaptype);
|
||||
if (ract) {
|
||||
ract->set_active ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::snap_mode_selection_done ()
|
||||
{
|
||||
if(session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
string choice = snap_mode_selector.get_active_text();
|
||||
SnapMode mode = SnapNormal;
|
||||
|
||||
if (choice == _("Normal Snap")) {
|
||||
if (choice == _("Normal")) {
|
||||
mode = SnapNormal;
|
||||
} else if (choice == _("Magnetic Snap")) {
|
||||
} else if (choice == _("Magnetic")) {
|
||||
mode = SnapMagnetic;
|
||||
}
|
||||
|
||||
set_snap_mode (mode);
|
||||
RefPtr<RadioAction> ract = snap_mode_action (mode);
|
||||
|
||||
if (ract) {
|
||||
ract->set_active (true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::zoom_focus_selection_done ()
|
||||
{
|
||||
if (session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
string choice = zoom_focus_selector.get_active_text();
|
||||
ZoomFocus focus_type = ZoomFocusLeft;
|
||||
|
||||
|
@ -3540,8 +3545,12 @@ Editor::zoom_focus_selection_done ()
|
|||
} else if (choice == _("Edit Cursor")) {
|
||||
focus_type = ZoomFocusEdit;
|
||||
}
|
||||
|
||||
RefPtr<RadioAction> ract = zoom_focus_action (focus_type);
|
||||
|
||||
set_zoom_focus (focus_type);
|
||||
if (ract) {
|
||||
ract->set_active ();
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
|
@ -3672,8 +3681,11 @@ Editor::get_valid_views (TimeAxisView* track, RouteGroup* group)
|
|||
void
|
||||
Editor::set_zoom_focus (ZoomFocus f)
|
||||
{
|
||||
vector<string> txt = I18N (zoom_focus_strings);
|
||||
zoom_focus_selector.set_active_text (txt[(int)f]);
|
||||
string str = zoom_focus_strings[(int)f];
|
||||
|
||||
if (str != zoom_focus_selector.get_active_text()) {
|
||||
zoom_focus_selector.set_active_text (str);
|
||||
}
|
||||
|
||||
if (zoom_focus != f) {
|
||||
zoom_focus = f;
|
||||
|
|
|
@ -1272,13 +1272,26 @@ class Editor : public PublicEditor
|
|||
Gtk::ComboBoxText snap_mode_selector;
|
||||
Gtk::HBox snap_box;
|
||||
|
||||
std::vector<std::string> snap_type_strings;
|
||||
std::vector<std::string> snap_mode_strings;
|
||||
|
||||
void snap_type_selection_done ();
|
||||
void snap_mode_selection_done ();
|
||||
|
||||
void snap_mode_chosen (Editing::SnapMode);
|
||||
void snap_type_chosen (Editing::SnapType);
|
||||
|
||||
Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
|
||||
Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
|
||||
|
||||
Gtk::ComboBoxText zoom_focus_selector;
|
||||
Gtk::VBox zoom_focus_box;
|
||||
Gtk::VBox zoom_focus_box;
|
||||
|
||||
std::vector<std::string> zoom_focus_strings;
|
||||
|
||||
void zoom_focus_selection_done ();
|
||||
void zoom_focus_chosen (Editing::ZoomFocus);
|
||||
|
||||
Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
|
||||
|
||||
Gtk::HBox zoom_box;
|
||||
|
||||
|
|
|
@ -258,15 +258,15 @@ Editor::register_actions ()
|
|||
Glib::RefPtr<ActionGroup> zoom_actions = ActionGroup::create (X_("Zoom"));
|
||||
RadioAction::Group zoom_group;
|
||||
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-left", _("Zoom Focus Left"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusLeft));
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-left", _("Zoom Focus Left"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusLeft));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-right", _("Zoom Focus Right"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusRight));
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-right", _("Zoom Focus Right"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusRight));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-center", _("Zoom Focus Center"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusCenter));
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-center", _("Zoom Focus Center"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusCenter));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-playhead", _("Zoom Focus Playhead"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusPlayhead));
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-playhead", _("Zoom Focus Playhead"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusPlayhead));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-edit", _("Zoom Focus Edit"), bind (mem_fun(*this, &Editor::set_zoom_focus), Editing::ZoomFocusEdit));
|
||||
ActionManager::register_radio_action (zoom_actions, zoom_group, "zoom-focus-edit", _("Zoom Focus Edit"), bind (mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusEdit));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
Glib::RefPtr<ActionGroup> mouse_mode_actions = ActionGroup::create (X_("MouseMode"));
|
||||
|
@ -278,31 +278,36 @@ Editor::register_actions ()
|
|||
ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-zoom", _("Zoom Tool"), bind (mem_fun(*this, &Editor::set_mouse_mode), Editing::MouseZoom, false));
|
||||
ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-timefx", _("Timefx Tool"), bind (mem_fun(*this, &Editor::set_mouse_mode), Editing::MouseTimeFX, false));
|
||||
|
||||
ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap To"));
|
||||
ActionManager::register_action (editor_actions, X_("SnapMode"), _("Snap Mode"));
|
||||
|
||||
RadioAction::Group snap_mode_group;
|
||||
ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-normal"), _("Normal"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapNormal)));
|
||||
ActionManager::register_radio_action (editor_actions, snap_mode_group, X_("snap-magnetic"), _("Magnetic"), (bind (mem_fun(*this, &Editor::snap_mode_chosen), Editing::SnapMagnetic)));
|
||||
|
||||
Glib::RefPtr<ActionGroup> snap_actions = ActionGroup::create (X_("Snap"));
|
||||
RadioAction::Group snap_choice_group;
|
||||
|
||||
ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap To"));
|
||||
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-frame"), _("Snap to frame"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToFrame)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-cd-frame"), _("Snap to cd frame"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToCDFrame)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-frame"), _("Snap to SMPTE frame"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToSMPTEFrame)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-seconds"), _("Snap to SMPTE seconds"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToSMPTESeconds)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-minutes"), _("Snap to SMPTE minutes"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToSMPTEMinutes)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-seconds"), _("Snap to seconds"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToSeconds)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-minutes"), _("Snap to minutes"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToMinutes)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirtyseconds"), _("Snap to thirtyseconds"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToAThirtysecondBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-asixteenthbeat"), _("Snap to asixteenthbeat"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToASixteenthBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-eighths"), _("Snap to eighths"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToAEighthBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-quarters"), _("Snap to quarters"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToAQuarterBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirds"), _("Snap to thirds"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToAThirdBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-beat"), _("Snap to beat"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-bar"), _("Snap to bar"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToBar)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-mark"), _("Snap to mark"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToMark)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-edit-cursor"), _("Snap to edit cursor"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToEditCursor)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-start"), _("Snap to region start"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToRegionStart)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-end"), _("Snap to region end"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToRegionEnd)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-sync"), _("Snap to region sync"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToRegionSync)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-boundary"), _("Snap to region boundary"), (bind (mem_fun(*this, &Editor::set_snap_to), Editing::SnapToRegionBoundary)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-frame"), _("Snap to frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToFrame)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-cd-frame"), _("Snap to cd frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToCDFrame)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-frame"), _("Snap to SMPTE frame"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTEFrame)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-seconds"), _("Snap to SMPTE seconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTESeconds)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-smpte-minutes"), _("Snap to SMPTE minutes"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSMPTEMinutes)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-seconds"), _("Snap to seconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToSeconds)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-minutes"), _("Snap to minutes"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToMinutes)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirtyseconds"), _("Snap to thirtyseconds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToAThirtysecondBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-asixteenthbeat"), _("Snap to asixteenthbeat"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToASixteenthBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-eighths"), _("Snap to eighths"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToAEighthBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-quarters"), _("Snap to quarters"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToAQuarterBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-thirds"), _("Snap to thirds"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToAThirdBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-beat"), _("Snap to beat"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBeat)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-bar"), _("Snap to bar"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToBar)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-mark"), _("Snap to mark"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToMark)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-edit-cursor"), _("Snap to edit cursor"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToEditCursor)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-start"), _("Snap to region start"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionStart)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-end"), _("Snap to region end"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionEnd)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-sync"), _("Snap to region sync"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionSync)));
|
||||
ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-boundary"), _("Snap to region boundary"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionBoundary)));
|
||||
|
||||
/* REGION LIST */
|
||||
|
||||
|
@ -625,6 +630,206 @@ Editor::set_layer_model (LayerModel model)
|
|||
}
|
||||
}
|
||||
|
||||
RefPtr<RadioAction>
|
||||
Editor::snap_type_action (SnapType type)
|
||||
{
|
||||
|
||||
const char* action = 0;
|
||||
RefPtr<Action> act;
|
||||
|
||||
switch (type) {
|
||||
case Editing::SnapToFrame:
|
||||
action = "snap-to-frame";
|
||||
break;
|
||||
case Editing::SnapToCDFrame:
|
||||
action = "snap-to-cd-frame";
|
||||
break;
|
||||
case Editing::SnapToSMPTEFrame:
|
||||
action = "snap-to-smpte-frame";
|
||||
break;
|
||||
case Editing::SnapToSMPTESeconds:
|
||||
action = "snap-to-smpte-seconds";
|
||||
break;
|
||||
case Editing::SnapToSMPTEMinutes:
|
||||
action = "snap-to-smpte-minutes";
|
||||
break;
|
||||
case Editing::SnapToSeconds:
|
||||
action = "snap-to-seconds";
|
||||
break;
|
||||
case Editing::SnapToMinutes:
|
||||
action = "snap-to-minutes";
|
||||
break;
|
||||
case Editing::SnapToAThirtysecondBeat:
|
||||
action = "snap-to-thirtyseconds";
|
||||
break;
|
||||
case Editing::SnapToASixteenthBeat:
|
||||
action = "snap-to-asixteenthbeat";
|
||||
break;
|
||||
case Editing::SnapToAEighthBeat:
|
||||
action = "snap-to-eighths";
|
||||
break;
|
||||
case Editing::SnapToAQuarterBeat:
|
||||
action = "snap-to-quarters";
|
||||
break;
|
||||
case Editing::SnapToAThirdBeat:
|
||||
action = "snap-to-thirds";
|
||||
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::SnapToEditCursor:
|
||||
action = "snap-to-edit-cursor";
|
||||
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;
|
||||
default:
|
||||
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap-to type", (int) type) << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
act = ActionManager::get_action (X_("Snap"), action);
|
||||
|
||||
if (act) {
|
||||
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
||||
return ract;
|
||||
|
||||
} else {
|
||||
error << string_compose (_("programming error: %1"), "Editor::snap_type_chosen could not find action to match type.") << endmsg;
|
||||
return RefPtr<RadioAction>();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::snap_type_chosen (SnapType type)
|
||||
{
|
||||
/* 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
|
||||
active.
|
||||
*/
|
||||
|
||||
RefPtr<RadioAction> ract = snap_type_action (type);
|
||||
|
||||
if (ract && ract->get_active()) {
|
||||
set_snap_to (type);
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<RadioAction>
|
||||
Editor::snap_mode_action (SnapMode mode)
|
||||
{
|
||||
const char* action = 0;
|
||||
RefPtr<Action> act;
|
||||
|
||||
switch (mode) {
|
||||
case Editing::SnapNormal:
|
||||
action = X_("snap-normal");
|
||||
break;
|
||||
case Editing::SnapMagnetic:
|
||||
action = X_("snap-magnetic");
|
||||
break;
|
||||
default:
|
||||
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap mode type", (int) mode) << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
act = ActionManager::get_action (X_("Editor"), action);
|
||||
|
||||
if (act) {
|
||||
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
||||
return ract;
|
||||
|
||||
} else {
|
||||
error << string_compose (_("programming error: %1: %2"), "Editor::snap_mode_chosen could not find action to match mode.", action) << endmsg;
|
||||
return RefPtr<RadioAction> ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::snap_mode_chosen (SnapMode mode)
|
||||
{
|
||||
/* 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
|
||||
active.
|
||||
*/
|
||||
|
||||
RefPtr<RadioAction> ract = snap_mode_action (mode);
|
||||
|
||||
if (ract && ract->get_active()) {
|
||||
set_snap_mode (mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RefPtr<RadioAction>
|
||||
Editor::zoom_focus_action (ZoomFocus focus)
|
||||
{
|
||||
const char* action = 0;
|
||||
RefPtr<Action> act;
|
||||
|
||||
switch (focus) {
|
||||
case ZoomFocusLeft:
|
||||
action = X_("zoom-focus-left");
|
||||
break;
|
||||
case ZoomFocusRight:
|
||||
action = X_("zoom-focus-right");
|
||||
break;
|
||||
case ZoomFocusCenter:
|
||||
action = X_("zoom-focus-center");
|
||||
break;
|
||||
case ZoomFocusPlayhead:
|
||||
action = X_("zoom-focus-playhead");
|
||||
break;
|
||||
case ZoomFocusEdit:
|
||||
action = X_("zoom-focus-edit");
|
||||
break;
|
||||
default:
|
||||
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible focus type", (int) focus) << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
act = ActionManager::get_action (X_("Zoom"), action);
|
||||
|
||||
if (act) {
|
||||
RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
|
||||
return ract;
|
||||
} else {
|
||||
error << string_compose (_("programming error: %1: %2"), "Editor::zoom_focus_action could not find action to match focus.", action) << endmsg;
|
||||
}
|
||||
|
||||
return RefPtr<RadioAction> ();
|
||||
}
|
||||
|
||||
void
|
||||
Editor::zoom_focus_chosen (ZoomFocus focus)
|
||||
{
|
||||
/* 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
|
||||
active.
|
||||
*/
|
||||
|
||||
RefPtr<RadioAction> ract = zoom_focus_action (focus);
|
||||
|
||||
if (ract && ract->get_active()) {
|
||||
set_zoom_focus (focus);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::smpte_fps_chosen (Session::SmpteFormat format)
|
||||
{
|
||||
|
|
|
@ -198,7 +198,7 @@ AudioTrack::_set_state (const XMLNode& node, bool call_base)
|
|||
XMLNodeConstIterator iter;
|
||||
|
||||
if (call_base) {
|
||||
if (Route::set_state (node)) {
|
||||
if (Route::_set_state (node, call_base)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -701,8 +701,6 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
|
|||
_envelope.set_max_xval (_length);
|
||||
_envelope.truncate_end (_length);
|
||||
|
||||
cerr << "envelope for " << _name << " has " << _envelope.size() << " points\n";
|
||||
|
||||
} else if (child->name() == "FadeIn") {
|
||||
|
||||
_fade_in.clear ();
|
||||
|
|
Loading…
Reference in New Issue