#include <errno.h>
#include <boost/shared_array.hpp>
+#include <glibmm/miscutils.h>
#include "midi++/types.h"
#include "midi++/port.h"
#include "ardour/panner.h"
#include "ardour/panner_shell.h"
#include "ardour/route.h"
+#include "ardour/route_group.h"
#include "ardour/session.h"
#include "ardour/tempo.h"
#include "ardour/track.h"
: ControlProtocol (session, X_("Mackie"))
, AbstractUI<MackieControlUIRequest> ("mackie")
, _current_initial_bank (0)
+ , _frame_last (0)
, _timecode_type (ARDOUR::AnyTime::BBT)
, _gui (0)
, _scrub_mode (false)
switch (_view_mode) {
case Mixer:
- sorted.push_back (*it);
+ if (route->route_group()) {
+ route->route_group()->set_active (true, this);
+ }
+ sorted.push_back (route);
remote_ids.insert (route->remote_control_id());
break;
case AudioTracks:
- if (is_audio_track(*it)) {
- sorted.push_back (*it);
+ if (is_audio_track(route)) {
+ if (route->route_group()) {
+ route->route_group()->set_active (true, this);
+ }
+ sorted.push_back (route);
remote_ids.insert (route->remote_control_id());
}
break;
case Busses:
- if (!is_track(*it)) {
- sorted.push_back (*it);
+ if (!is_track(route)) {
+ if (route->route_group()) {
+ route->route_group()->set_active (true, this);
+ }
+ sorted.push_back (route);
remote_ids.insert (route->remote_control_id());
}
break;
- case MidiTracks: // for now aux and buss are same
- if (is_midi_track(*it)) {
- sorted.push_back (*it);
+ case MidiTracks:
+ if (is_midi_track(route)) {
+ if (route->route_group()) {
+ route->route_group()->set_active (true, this);
+ }
+ sorted.push_back (route);
remote_ids.insert (route->remote_control_id());
}
break;
case Plugins:
break;
case Auxes: // for now aux and buss are same
- if (!is_track(*it)) {
- sorted.push_back (*it);
+ if (!is_track(route)) {
+ if (route->route_group()) {
+ route->route_group()->set_active (true, this);
+ }
+ sorted.push_back (route);
remote_ids.insert (route->remote_control_id());
}
break;
case Selected: // For example: a group
- if (selected(*it)) {
- sorted.push_back (*it);
+ if (selected(route)) {
+ /* Selected may be a group in which case we want to
+ * control each track separately.
+ */
+ if (route->route_group()) {
+ route->route_group()->set_active (false, this);
+ }
+ sorted.push_back (route);
remote_ids.insert (route->remote_control_id());
}
break;
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("device ready init (active=%1)\n", active()));
update_surfaces ();
+ set_pot_mode (_pot_mode);
}
// send messages to surface to set controls to correct values
void
MackieControlProtocol::set_profile (const string& profile_name)
{
- if (profile_name == "default") {
- /* reset to default */
- _device_profile = DeviceProfile (profile_name);
- }
-
map<string,DeviceProfile>::iterator d = DeviceProfile::device_profiles.find (profile_name);
if (d == DeviceProfile::device_profiles.end()) {
+ _device_profile = DeviceProfile (profile_name);
return;
}
}
if ((prop = node.property (X_("device-profile"))) != 0) {
- set_profile (prop->value());
+ if (prop->value().empty()) {
+ string default_profile_name;
+
+ default_profile_name = Glib::get_user_name();
+ default_profile_name += ' ';
+ default_profile_name += _device_info.name();
+
+ set_profile (default_profile_name);
+ } else {
+ set_profile (prop->value());
+ }
}
XMLNode* dnode = node.child (X_("Configurations"));
// do assignment here so current_frame is fixed
framepos_t current_frame = session->transport_frame();
string timecode;
+ // For large jumps in play head possition do full reset
+ int moved = (current_frame - _frame_last) / session->frame_rate ();
+ if (moved) {
+ DEBUG_TRACE (DEBUG::MackieControl, "Timecode reset\n");
+ _timecode_last = string (10, ' ');
+ }
+ _frame_last = current_frame;
switch (_timecode_type) {
case ARDOUR::AnyTime::BBT: