add some horz and vert zoom actions; remove some whitespace from the code of the ui-actions, so they are easier to see and maintain

This commit is contained in:
Ben Loftis 2016-01-16 19:32:00 -06:00 committed by Robin Gareus
parent 16623b1cb3
commit 27d82af077
5 changed files with 110 additions and 76 deletions

View file

@ -275,6 +275,22 @@ Editor::register_actions ()
reg_sens (editor_actions, "expand-tracks", _("Expand Track Height"), sigc::bind (sigc::mem_fun (*this, &Editor::tav_zoom_step), false)); reg_sens (editor_actions, "expand-tracks", _("Expand Track Height"), sigc::bind (sigc::mem_fun (*this, &Editor::tav_zoom_step), false));
reg_sens (editor_actions, "shrink-tracks", _("Shrink Track Height"), sigc::bind (sigc::mem_fun (*this, &Editor::tav_zoom_step), true)); reg_sens (editor_actions, "shrink-tracks", _("Shrink Track Height"), sigc::bind (sigc::mem_fun (*this, &Editor::tav_zoom_step), true));
reg_sens (editor_actions, "fit_1_track", _("Fit 1 Track"), sigc::bind (sigc::mem_fun(*this, &Editor::set_visible_track_count), 1));
reg_sens (editor_actions, "fit_2_tracks", _("Fit 2 Tracks"), sigc::bind (sigc::mem_fun(*this, &Editor::set_visible_track_count), 2));
reg_sens (editor_actions, "fit_4_tracks", _("Fit 4 Tracks"), sigc::bind (sigc::mem_fun(*this, &Editor::set_visible_track_count), 4));
reg_sens (editor_actions, "fit_8_tracks", _("Fit 8 Tracks"), sigc::bind (sigc::mem_fun(*this, &Editor::set_visible_track_count), 8));
reg_sens (editor_actions, "fit_16_tracks", _("Fit 16 Tracks"), sigc::bind (sigc::mem_fun(*this, &Editor::set_visible_track_count), 16));
reg_sens (editor_actions, "fit_32_tracks", _("Fit 32 Tracks"), sigc::bind (sigc::mem_fun(*this, &Editor::set_visible_track_count), 32));
reg_sens (editor_actions, "fit_all_tracks", _("Fit All Tracks"), sigc::bind (sigc::mem_fun(*this, &Editor::set_visible_track_count), 0));
reg_sens (editor_actions, "zoom_10_ms", _("Zoom to 10 ms"), sigc::bind (sigc::mem_fun(*this, &Editor::set_zoom_preset), 10));
reg_sens (editor_actions, "zoom_100_ms", _("Zoom to 100 ms"), sigc::bind (sigc::mem_fun(*this, &Editor::set_zoom_preset), 100));
reg_sens (editor_actions, "zoom_1_sec", _("Zoom to 1 sec"), sigc::bind (sigc::mem_fun(*this, &Editor::set_zoom_preset), 1000));
reg_sens (editor_actions, "zoom_10_sec", _("Zoom to 10 sec"), sigc::bind (sigc::mem_fun(*this, &Editor::set_zoom_preset), 10 * 1000));
reg_sens (editor_actions, "zoom_1_min", _("Zoom to 1 min"), sigc::bind (sigc::mem_fun(*this, &Editor::set_zoom_preset), 60 * 1000));
reg_sens (editor_actions, "zoom_5_min", _("Zoom to 5 min"), sigc::bind (sigc::mem_fun(*this, &Editor::set_zoom_preset), 5 * 60 * 1000));
reg_sens (editor_actions, "zoom_10_min", _("Zoom to 10 min"), sigc::bind (sigc::mem_fun(*this, &Editor::set_zoom_preset), 10 * 60 * 1000));
act = reg_sens (editor_actions, "move-selected-tracks-up", _("Move Selected Tracks Up"), sigc::bind (sigc::mem_fun(*_routes, &EditorRoutes::move_selected_tracks), true)); act = reg_sens (editor_actions, "move-selected-tracks-up", _("Move Selected Tracks Up"), sigc::bind (sigc::mem_fun(*_routes, &EditorRoutes::move_selected_tracks), true));
ActionManager::track_selection_sensitive_actions.push_back (act); ActionManager::track_selection_sensitive_actions.push_back (act);
act = reg_sens (editor_actions, "move-selected-tracks-down", _("Move Selected Tracks Down"), sigc::bind (sigc::mem_fun(*_routes, &EditorRoutes::move_selected_tracks), false)); act = reg_sens (editor_actions, "move-selected-tracks-down", _("Move Selected Tracks Down"), sigc::bind (sigc::mem_fun(*_routes, &EditorRoutes::move_selected_tracks), false));

View file

@ -345,89 +345,44 @@ BasicUI::jump_by_bars (double bars)
session->request_locate ( session->convert_to_frames (any) ); session->request_locate ( session->convert_to_frames (any) );
} }
void void BasicUI::mark_in () { access_action("Editor/start-range"); }
BasicUI::mark_in () void BasicUI::mark_out () { access_action("Editor/finish-range"); }
{
access_action("Editor/start-range");
}
void void BasicUI::toggle_click () { access_action("Transport/ToggleClick"); }
BasicUI::mark_out () void BasicUI::midi_panic () { access_action("MIDI/panic"); }
{ void BasicUI::toggle_roll () { access_action("Transport/ToggleRoll"); }
access_action("Editor/finish-range"); void BasicUI::stop_forget () { access_action("Transport/ToggleRollForgetCapture"); }
}
void void BasicUI::set_punch_range () { access_action("Editor/set-punch-from-edit-range"); }
BasicUI::toggle_click () void BasicUI::set_loop_range () { access_action("Editor/set-loop-from-edit-range"); }
{ void BasicUI::set_session_range () { access_action("Editor/set-session-from-edit-range"); }
access_action("Transport/ToggleClick");
}
void void BasicUI::toggle_monitor_mute () { /*access_action("Editor/toggle_monitor_mute"); */ }
BasicUI::midi_panic () void BasicUI::toggle_monitor_dim () { /*access_action("Editor/toggle_monitor_dim"); */ }
{ void BasicUI::toggle_monitor_mono () { /*access_action("Editor/toggle_monitor_mono"); */ }
access_action("MIDI/panic");
}
void void BasicUI::quick_snapshot_stay () { access_action("Main/QuickSnapshotStay"); }
BasicUI::toggle_roll () void BasicUI::quick_snapshot_switch () { access_action("Main/QuickSnapshotSwitch"); }
{
access_action("Transport/ToggleRoll");
}
void void BasicUI::fit_1_track() { access_action("Editor/fit_1_track"); }
BasicUI::stop_forget () void BasicUI::fit_2_tracks() { access_action("Editor/fit_2_tracks"); }
{ void BasicUI::fit_4_tracks() { access_action("Editor/fit_4_tracks"); }
access_action("Transport/ToggleRollForgetCapture"); void BasicUI::fit_8_tracks() { access_action("Editor/fit_8_tracks"); }
} void BasicUI::fit_16_tracks() { access_action("Editor/fit_16_tracks"); }
void BasicUI::fit_32_tracks() { access_action("Editor/fit_32_tracks"); }
void BasicUI::fit_all_tracks() { access_action("Editor/fit_all_tracks"); }
void void BasicUI::zoom_10_ms() { access_action("Editor/zoom_10_ms"); }
BasicUI::set_punch_range () void BasicUI::zoom_100_ms() { access_action("Editor/zoom_100_ms"); }
{ void BasicUI::zoom_1_sec() { access_action("Editor/zoom_1_sec"); }
access_action("Editor/set-punch-from-edit-range"); void BasicUI::zoom_10_sec() { access_action("Editor/zoom_10_sec"); }
} void BasicUI::zoom_1_min() { access_action("Editor/zoom_1_min"); }
void BasicUI::zoom_5_min() { access_action("Editor/zoom_5_min"); }
void BasicUI::zoom_10_min() { access_action("Editor/zoom_10_min"); }
void BasicUI::zoom_to_session() { access_action("Editor/zooom-to-session"); }
void void BasicUI::scroll_up_1_track() { access_action("Editor/scroll_up_1_track"); }
BasicUI::set_loop_range () void BasicUI::scroll_dn_1_track() { access_action("Editor/scroll_dn_1_track"); }
{
access_action("Editor/set-loop-from-edit-range");
}
void
BasicUI::set_session_range ()
{
access_action("Editor/set-session-from-edit-range");
}
void
BasicUI::toggle_monitor_mute ()
{
//access_action("Editor/toggle_monitor_mute"); ToDo
}
void
BasicUI::toggle_monitor_dim ()
{
//access_action("Editor/toggle_monitor_dim"); ToDo
}
void
BasicUI::toggle_monitor_mono ()
{
//access_action("Editor/toggle_monitor_mono"); ToDo
}
void
BasicUI::quick_snapshot_stay ()
{
access_action("Main/QuickSnapshotStay");
}
void
BasicUI::quick_snapshot_switch ()
{
access_action("Main/QuickSnapshotSwitch");
}
bool bool

View file

@ -106,6 +106,26 @@ class LIBCONTROLCP_API BasicUI {
void set_record_enable (bool yn); void set_record_enable (bool yn);
bool get_record_enabled (); bool get_record_enabled ();
//editor visibility stuff (why do we have to make explicit numbers here? because "gui actions" don't accept args
void fit_1_track();
void fit_2_tracks();
void fit_4_tracks();
void fit_8_tracks();
void fit_16_tracks();
void fit_32_tracks();
void fit_all_tracks();
void zoom_10_ms();
void zoom_100_ms();
void zoom_1_sec();
void zoom_10_sec();
void zoom_1_min();
void zoom_5_min();
void zoom_10_min();
void zoom_to_session();
void scroll_up_1_track();
void scroll_dn_1_track();
void rec_enable_toggle (); void rec_enable_toggle ();
void toggle_all_rec_enables (); void toggle_all_rec_enables ();

View file

@ -376,6 +376,19 @@ OSC::register_callbacks()
REGISTER_CALLBACK (serv, "/ardour/toggle_monitor_mono", "", toggle_monitor_mono); REGISTER_CALLBACK (serv, "/ardour/toggle_monitor_mono", "", toggle_monitor_mono);
REGISTER_CALLBACK (serv, "/ardour/quick_snapshot_switch", "", quick_snapshot_switch); REGISTER_CALLBACK (serv, "/ardour/quick_snapshot_switch", "", quick_snapshot_switch);
REGISTER_CALLBACK (serv, "/ardour/quick_snapshot_stay", "", quick_snapshot_stay); REGISTER_CALLBACK (serv, "/ardour/quick_snapshot_stay", "", quick_snapshot_stay);
REGISTER_CALLBACK (serv, "/ardour/fit_1_track", "", fit_1_track);
REGISTER_CALLBACK (serv, "/ardour/fit_2_tracks", "", fit_2_tracks);
REGISTER_CALLBACK (serv, "/ardour/fit_4_tracks", "", fit_4_tracks);
REGISTER_CALLBACK (serv, "/ardour/fit_8_tracks", "", fit_8_tracks);
REGISTER_CALLBACK (serv, "/ardour/fit_16_tracks", "", fit_16_tracks);
REGISTER_CALLBACK (serv, "/ardour/fit_32_tracks", "", fit_32_tracks);
REGISTER_CALLBACK (serv, "/ardour/fit_all_tracks", "", fit_all_tracks);
REGISTER_CALLBACK (serv, "/ardour/zoom_100_ms", "", zoom_100_ms);
REGISTER_CALLBACK (serv, "/ardour/zoom_1_sec", "", zoom_1_sec);
REGISTER_CALLBACK (serv, "/ardour/zoom_1_min", "", zoom_1_min);
REGISTER_CALLBACK (serv, "/ardour/zoom_5_min", "", zoom_5_min);
REGISTER_CALLBACK (serv, "/ardour/zoom_10_min", "", zoom_10_min);
REGISTER_CALLBACK (serv, "/ardour/zoom_to_session", "", zoom_to_session);
/* /*
@ -420,6 +433,21 @@ OSC::register_callbacks()
REGISTER_CALLBACK (serv, "/ardour/pushbutton/toggle_monitor_mono", "f", toggle_monitor_mono); REGISTER_CALLBACK (serv, "/ardour/pushbutton/toggle_monitor_mono", "f", toggle_monitor_mono);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/quick_snapshot_switch", "f", quick_snapshot_switch); REGISTER_CALLBACK (serv, "/ardour/pushbutton/quick_snapshot_switch", "f", quick_snapshot_switch);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/quick_snapshot_stay", "f", quick_snapshot_stay); REGISTER_CALLBACK (serv, "/ardour/pushbutton/quick_snapshot_stay", "f", quick_snapshot_stay);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/fit_1_track", "f", fit_1_track);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/fit_2_tracks", "f", fit_2_tracks);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/fit_4_tracks", "f", fit_4_tracks);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/fit_8_tracks", "f", fit_8_tracks);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/fit_16_tracks", "f", fit_16_tracks);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/fit_32_tracks", "f", fit_32_tracks);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/fit_all_tracks", "f", fit_all_tracks);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/zoom_100_ms", "f", zoom_100_ms);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/zoom_1_sec", "f", zoom_1_sec);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/zoom_1_min", "f", zoom_1_min);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/zoom_5_min", "f", zoom_5_min);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/zoom_10_min", "f", zoom_10_min);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/zoom_to_session", "f", zoom_to_session);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/scroll_up_1_track", "f", scroll_up_1_track);
REGISTER_CALLBACK (serv, "/ardour/pushbutton/scroll_dn_1_track", "f", scroll_dn_1_track);
/* These commands require the route index in addition to the arg; TouchOSC (et al) can't use these */ /* These commands require the route index in addition to the arg; TouchOSC (et al) can't use these */
REGISTER_CALLBACK (serv, "/ardour/routes/mute", "ii", route_mute); REGISTER_CALLBACK (serv, "/ardour/routes/mute", "ii", route_mute);

View file

@ -206,6 +206,21 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
PATH_CALLBACK(toggle_monitor_mono); PATH_CALLBACK(toggle_monitor_mono);
PATH_CALLBACK(quick_snapshot_stay); PATH_CALLBACK(quick_snapshot_stay);
PATH_CALLBACK(quick_snapshot_switch); PATH_CALLBACK(quick_snapshot_switch);
PATH_CALLBACK(fit_1_track);
PATH_CALLBACK(fit_2_tracks);
PATH_CALLBACK(fit_4_tracks);
PATH_CALLBACK(fit_8_tracks);
PATH_CALLBACK(fit_16_tracks);
PATH_CALLBACK(fit_32_tracks);
PATH_CALLBACK(fit_all_tracks);
PATH_CALLBACK(zoom_100_ms);
PATH_CALLBACK(zoom_1_sec);
PATH_CALLBACK(zoom_1_min);
PATH_CALLBACK(zoom_5_min);
PATH_CALLBACK(zoom_10_min);
PATH_CALLBACK(zoom_to_session);
PATH_CALLBACK(scroll_up_1_track);
PATH_CALLBACK(scroll_dn_1_track);
#define PATH_CALLBACK1(name,type,optional) \ #define PATH_CALLBACK1(name,type,optional) \
static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \ static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \