mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Only display Trim for tracks that have Trim. On the way:
-fixed flip mode. -fixed no controlable for vpot or fader
This commit is contained in:
parent
601d51ce71
commit
f7e3117c3b
4 changed files with 82 additions and 96 deletions
|
|
@ -340,7 +340,6 @@ MackieControlProtocol::switch_banks (uint32_t initial, bool force)
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
set_flip_mode (Normal);
|
|
||||||
_current_initial_bank = initial;
|
_current_initial_bank = initial;
|
||||||
_current_selected_track = -1;
|
_current_selected_track = -1;
|
||||||
|
|
||||||
|
|
@ -1563,6 +1562,10 @@ MackieControlProtocol::set_flip_mode (FlipMode fm)
|
||||||
void
|
void
|
||||||
MackieControlProtocol::set_pot_mode (PotMode m)
|
MackieControlProtocol::set_pot_mode (PotMode m)
|
||||||
{
|
{
|
||||||
|
// maybe not in flip mode.
|
||||||
|
if (flip_mode()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
_pot_mode = m;
|
_pot_mode = m;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
#include "ardour/send.h"
|
#include "ardour/send.h"
|
||||||
#include "ardour/track.h"
|
#include "ardour/track.h"
|
||||||
|
#include "ardour/midi_track.h"
|
||||||
#include "ardour/user_bundle.h"
|
#include "ardour/user_bundle.h"
|
||||||
|
|
||||||
#include "mackie_control_protocol.h"
|
#include "mackie_control_protocol.h"
|
||||||
|
|
@ -205,7 +206,7 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/)
|
||||||
|
|
||||||
_route->mute_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_mute_changed, this), ui_context());
|
_route->mute_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_mute_changed, this), ui_context());
|
||||||
|
|
||||||
if (_route->trim()) {
|
if (_route->trim() && !is_midi_track()) {
|
||||||
_route->trim_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_trim_changed, this, false), ui_context());
|
_route->trim_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_trim_changed, this, false), ui_context());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -257,7 +258,7 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_route->trim()) {
|
if (_route->trim() && !is_midi_track()) {
|
||||||
possible_pot_parameters.push_back (TrimAutomation);
|
possible_pot_parameters.push_back (TrimAutomation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -363,7 +364,7 @@ Strip::notify_trim_changed (bool force_update)
|
||||||
{
|
{
|
||||||
if (_route) {
|
if (_route) {
|
||||||
|
|
||||||
if (!_route->trim()) {
|
if (!_route->trim() || is_midi_track()) {
|
||||||
_surface->write (_vpot->zero());
|
_surface->write (_vpot->zero());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -755,6 +756,10 @@ void
|
||||||
Strip::handle_fader (Fader& fader, float position)
|
Strip::handle_fader (Fader& fader, float position)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("fader to %1\n", position));
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("fader to %1\n", position));
|
||||||
|
boost::shared_ptr<AutomationControl> ac = fader.control();
|
||||||
|
if (!ac) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fader.set_value (position);
|
fader.set_value (position);
|
||||||
|
|
||||||
|
|
@ -779,6 +784,9 @@ Strip::handle_pot (Pot& pot, float delta)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
boost::shared_ptr<AutomationControl> ac = pot.control();
|
boost::shared_ptr<AutomationControl> ac = pot.control();
|
||||||
|
if (!ac) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
double p = pot.get_value ();
|
double p = pot.get_value ();
|
||||||
p += delta;
|
p += delta;
|
||||||
p = max (ac->lower(), p);
|
p = max (ac->lower(), p);
|
||||||
|
|
@ -874,7 +882,7 @@ Strip::update_automation ()
|
||||||
notify_panner_width_changed (false);
|
notify_panner_width_changed (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_route->trim()) {
|
if (_route->trim() && !is_midi_track()) {
|
||||||
ARDOUR::AutoState trim_state = _route->trim_control()->automation_state();
|
ARDOUR::AutoState trim_state = _route->trim_control()->automation_state();
|
||||||
if (trim_state == Touch || trim_state == Play) {
|
if (trim_state == Touch || trim_state == Play) {
|
||||||
notify_trim_changed (false);
|
notify_trim_changed (false);
|
||||||
|
|
@ -1010,14 +1018,6 @@ Strip::potmode_changed (bool notify)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
|
|
||||||
/* do not change vpot mode while in flipped mode */
|
|
||||||
DEBUG_TRACE (DEBUG::MackieControl, "not stepping pot mode - in flip mode\n");
|
|
||||||
_surface->write (display (1, "Flip"));
|
|
||||||
block_vpot_mode_display_for (1000);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// WIP
|
// WIP
|
||||||
int pm = _surface->mcp().pot_mode();
|
int pm = _surface->mcp().pot_mode();
|
||||||
switch (pm) {
|
switch (pm) {
|
||||||
|
|
@ -1041,31 +1041,6 @@ Strip::potmode_changed (bool notify)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Strip::flip_mode_changed (bool notify)
|
|
||||||
{
|
|
||||||
if (!_route) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
reset_saved_values ();
|
|
||||||
|
|
||||||
boost::shared_ptr<AutomationControl> fader_controllable = _fader->control ();
|
|
||||||
boost::shared_ptr<AutomationControl> vpot_controllable = _vpot->control ();
|
|
||||||
|
|
||||||
_fader->set_control (vpot_controllable);
|
|
||||||
_vpot->set_control (fader_controllable);
|
|
||||||
|
|
||||||
control_by_parameter[fader_controllable->parameter()] = _vpot;
|
|
||||||
control_by_parameter[vpot_controllable->parameter()] = _fader;
|
|
||||||
|
|
||||||
_surface->write (display (1, vpot_mode_string ()));
|
|
||||||
|
|
||||||
if (notify) {
|
|
||||||
notify_all ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Strip::block_screen_display_for (uint32_t msecs)
|
Strip::block_screen_display_for (uint32_t msecs)
|
||||||
{
|
{
|
||||||
|
|
@ -1159,7 +1134,6 @@ Strip::set_vpot_parameter (Evoral::Parameter p)
|
||||||
case PanAzimuthAutomation:
|
case PanAzimuthAutomation:
|
||||||
_pan_mode = PanAzimuthAutomation;
|
_pan_mode = PanAzimuthAutomation;
|
||||||
pannable = _route->pannable ();
|
pannable = _route->pannable ();
|
||||||
if (pannable) {
|
|
||||||
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
|
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
|
||||||
/* gain to vpot, pan azi to fader */
|
/* gain to vpot, pan azi to fader */
|
||||||
_vpot->set_control (_route->gain_control());
|
_vpot->set_control (_route->gain_control());
|
||||||
|
|
@ -1183,12 +1157,10 @@ Strip::set_vpot_parameter (Evoral::Parameter p)
|
||||||
control_by_parameter[PanAzimuthAutomation] = 0;
|
control_by_parameter[PanAzimuthAutomation] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PanWidthAutomation:
|
case PanWidthAutomation:
|
||||||
_pan_mode = PanWidthAutomation;
|
_pan_mode = PanWidthAutomation;
|
||||||
pannable = _route->pannable ();
|
pannable = _route->pannable ();
|
||||||
if (pannable) {
|
|
||||||
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
|
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
|
||||||
/* gain to vpot, pan width to fader */
|
/* gain to vpot, pan width to fader */
|
||||||
_vpot->set_control (_route->gain_control());
|
_vpot->set_control (_route->gain_control());
|
||||||
|
|
@ -1212,7 +1184,6 @@ Strip::set_vpot_parameter (Evoral::Parameter p)
|
||||||
control_by_parameter[PanWidthAutomation] = 0;
|
control_by_parameter[PanWidthAutomation] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PanElevationAutomation:
|
case PanElevationAutomation:
|
||||||
break;
|
break;
|
||||||
|
|
@ -1221,24 +1192,29 @@ Strip::set_vpot_parameter (Evoral::Parameter p)
|
||||||
case PanLFEAutomation:
|
case PanLFEAutomation:
|
||||||
break;
|
break;
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
if (_route->trim()) {
|
|
||||||
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
|
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
|
||||||
/* gain to vpot, trim to fader */
|
/* gain to vpot, trim to fader */
|
||||||
_vpot->set_control (_route->gain_control());
|
_vpot->set_control (_route->gain_control());
|
||||||
control_by_parameter[GainAutomation] = _vpot;
|
control_by_parameter[GainAutomation] = _vpot;
|
||||||
|
if (_route->trim() && !is_midi_track()) {
|
||||||
_fader->set_control (_route->trim_control());
|
_fader->set_control (_route->trim_control());
|
||||||
control_by_parameter[TrimAutomation] = _fader;
|
control_by_parameter[TrimAutomation] = _fader;
|
||||||
|
} else {
|
||||||
|
_fader->set_control (boost::shared_ptr<AutomationControl>());
|
||||||
|
control_by_parameter[TrimAutomation] = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* gain to fader, trim to vpot */
|
/* gain to fader, trim to vpot */
|
||||||
_fader->set_control (_route->gain_control());
|
_fader->set_control (_route->gain_control());
|
||||||
control_by_parameter[GainAutomation] = _fader;
|
control_by_parameter[GainAutomation] = _fader;
|
||||||
|
if (_route->trim() && !is_midi_track()) {
|
||||||
_vpot->set_control (_route->trim_control());
|
_vpot->set_control (_route->trim_control());
|
||||||
control_by_parameter[TrimAutomation] = _vpot;
|
control_by_parameter[TrimAutomation] = _vpot;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
_vpot->set_control (boost::shared_ptr<AutomationControl>());
|
_vpot->set_control (boost::shared_ptr<AutomationControl>());
|
||||||
control_by_parameter[TrimAutomation] = 0;
|
control_by_parameter[TrimAutomation] = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("vpot mode %1 not known.\n", p));
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("vpot mode %1 not known.\n", p));
|
||||||
|
|
@ -1249,6 +1225,12 @@ Strip::set_vpot_parameter (Evoral::Parameter p)
|
||||||
_surface->write (display (1, vpot_mode_string()));
|
_surface->write (display (1, vpot_mode_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Strip::is_midi_track () const
|
||||||
|
{
|
||||||
|
return boost::dynamic_pointer_cast<MidiTrack>(_route) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Strip::reset_saved_values ()
|
Strip::reset_saved_values ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@ public:
|
||||||
|
|
||||||
void zero ();
|
void zero ();
|
||||||
|
|
||||||
void flip_mode_changed (bool notify=false);
|
|
||||||
void potmode_changed (bool notify=false);
|
void potmode_changed (bool notify=false);
|
||||||
|
|
||||||
void lock_controls ();
|
void lock_controls ();
|
||||||
|
|
@ -155,6 +154,8 @@ private:
|
||||||
|
|
||||||
void reset_saved_values ();
|
void reset_saved_values ();
|
||||||
|
|
||||||
|
bool is_midi_track() const;
|
||||||
|
|
||||||
typedef std::map<Evoral::Parameter,Control*> ControlParameterMap;
|
typedef std::map<Evoral::Parameter,Control*> ControlParameterMap;
|
||||||
ControlParameterMap control_by_parameter;
|
ControlParameterMap control_by_parameter;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1009,7 +1009,7 @@ void
|
||||||
Surface::update_flip_mode_display ()
|
Surface::update_flip_mode_display ()
|
||||||
{
|
{
|
||||||
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
|
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
|
||||||
(*s)->flip_mode_changed (true);
|
(*s)->potmode_changed (true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue