Merge branch 'ardour'
This commit is contained in:
commit
2eef7bff8b
@ -179,6 +179,8 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
|
||||
if (PBD::parse_debug_options (optarg)) {
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
#else
|
||||
cerr << "This is not a debug build - igoring '-D " << optarg << "'" << endl;
|
||||
#endif /* NDEBUG */
|
||||
break;
|
||||
|
||||
|
@ -43,9 +43,9 @@ using namespace PBD;
|
||||
|
||||
RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new)
|
||||
#ifndef LIVETRAX
|
||||
: ArdourDialog (_("Track/bus Group"))
|
||||
: ArdourDialog (_("Track/bus Group"), creating_new)
|
||||
#else
|
||||
: ArdourDialog (_("Track Group"))
|
||||
: ArdourDialog (_("Track Group"), creating_new)
|
||||
#endif
|
||||
, _group (g)
|
||||
, _initial_name (g->name ())
|
||||
|
@ -273,6 +273,7 @@ TransportMastersWidget::rebuild ()
|
||||
}
|
||||
|
||||
update_usability ();
|
||||
allow_master_select (_session && !_session->config.get_external_sync());
|
||||
}
|
||||
|
||||
bool
|
||||
@ -682,7 +683,6 @@ TransportMastersWidget::set_session (ARDOUR::Session* s)
|
||||
|
||||
if (_session) {
|
||||
_session->config.ParameterChanged.connect (session_config_connection, invalidator (*this), boost::bind (&TransportMastersWidget::param_changed, this, _1), gui_context());
|
||||
allow_master_select (!_session->config.get_external_sync());
|
||||
rebuild ();
|
||||
} else {
|
||||
clear ();
|
||||
|
@ -301,8 +301,8 @@ public:
|
||||
|
||||
void set_clock_origin (Location*, void *src);
|
||||
|
||||
timepos_t first_mark_before_flagged (timepos_t const &, bool include_special_ranges = false, Location::Flags whitelist = Location::Flags (0), Location::Flags blacklist = Location::Flags (0), Location::Flags equalist = Location::Flags (0));
|
||||
timepos_t first_mark_after_flagged (timepos_t const &, bool include_special_ranges = false, Location::Flags whitelist = Location::Flags (0), Location::Flags blacklist = Location::Flags (0), Location::Flags equalist = Location::Flags (0));
|
||||
timepos_t first_mark_before_flagged (timepos_t const &, bool include_special_ranges = false, Location::Flags whitelist = Location::Flags (0), Location::Flags blacklist = Location::Flags (0), Location::Flags equalist = Location::Flags (0), Location** retval = nullptr);
|
||||
timepos_t first_mark_after_flagged (timepos_t const &, bool include_special_ranges = false, Location::Flags whitelist = Location::Flags (0), Location::Flags blacklist = Location::Flags (0), Location::Flags equalist = Location::Flags (0), Location** retval = nullptr);
|
||||
|
||||
timepos_t first_mark_after (timepos_t const & t, bool include_special_ranges = false) {
|
||||
return first_mark_after_flagged (t, include_special_ranges);
|
||||
|
@ -1417,7 +1417,7 @@ struct LocationStartLaterComparison
|
||||
};
|
||||
|
||||
timepos_t
|
||||
Locations::first_mark_before_flagged (timepos_t const & pos, bool include_special_ranges, Location::Flags whitelist, Location::Flags blacklist, Location::Flags equalist)
|
||||
Locations::first_mark_before_flagged (timepos_t const & pos, bool include_special_ranges, Location::Flags whitelist, Location::Flags blacklist, Location::Flags equalist, Location** retval)
|
||||
{
|
||||
vector<LocationPair> locs;
|
||||
{
|
||||
@ -1436,30 +1436,33 @@ Locations::first_mark_before_flagged (timepos_t const & pos, bool include_specia
|
||||
|
||||
/* locs is sorted in ascending order */
|
||||
|
||||
for (vector<LocationPair>::iterator i = locs.begin(); i != locs.end(); ++i) {
|
||||
if ((*i).second->is_hidden()) {
|
||||
for (auto & loc : locs) {
|
||||
if (loc.second->is_hidden()) {
|
||||
continue;
|
||||
}
|
||||
if (!include_special_ranges && ((*i).second->is_auto_loop() || (*i).second->is_auto_punch())) {
|
||||
if (!include_special_ranges && (loc.second->is_auto_loop() || loc.second->is_auto_punch())) {
|
||||
continue;
|
||||
}
|
||||
if (whitelist != Location::Flags (0)) {
|
||||
if (!((*i).second->flags() & whitelist)) {
|
||||
if (!(loc.second->flags() & whitelist)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (blacklist != Location::Flags (0)) {
|
||||
if ((*i).second->flags() & blacklist) {
|
||||
if (loc.second->flags() & blacklist) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (equalist != Location::Flags (0)) {
|
||||
if (!((*i).second->flags() == equalist)) {
|
||||
if (!(loc.second->flags() == equalist)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((*i).first < pos) {
|
||||
return (*i).first;
|
||||
if (loc.first < pos) {
|
||||
if (retval) {
|
||||
*retval = loc.second;
|
||||
}
|
||||
return loc.first;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1480,7 +1483,7 @@ Locations::mark_at (timepos_t const & pos, timecnt_t const & slop, Location::Fla
|
||||
Glib::Threads::RWLock::ReaderLock lm (_lock);
|
||||
for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
|
||||
|
||||
if ((*i)->is_mark() && (flags && ((*i)->flags() == flags))) {
|
||||
if ((*i)->is_mark() && (!flags || ((*i)->flags() == flags))) {
|
||||
if (pos > (*i)->start()) {
|
||||
delta = (*i)->start().distance (pos);
|
||||
} else {
|
||||
@ -1505,7 +1508,7 @@ Locations::mark_at (timepos_t const & pos, timecnt_t const & slop, Location::Fla
|
||||
}
|
||||
|
||||
timepos_t
|
||||
Locations::first_mark_after_flagged (timepos_t const & pos, bool include_special_ranges, Location::Flags whitelist, Location::Flags blacklist, Location::Flags equalist)
|
||||
Locations::first_mark_after_flagged (timepos_t const & pos, bool include_special_ranges, Location::Flags whitelist, Location::Flags blacklist, Location::Flags equalist, Location** retval)
|
||||
{
|
||||
vector<LocationPair> locs;
|
||||
|
||||
@ -1525,30 +1528,33 @@ Locations::first_mark_after_flagged (timepos_t const & pos, bool include_special
|
||||
|
||||
/* locs is sorted in reverse order */
|
||||
|
||||
for (vector<LocationPair>::iterator i = locs.begin(); i != locs.end(); ++i) {
|
||||
if ((*i).second->is_hidden()) {
|
||||
for (auto & loc : locs) {
|
||||
if (loc.second->is_hidden()) {
|
||||
continue;
|
||||
}
|
||||
if (!include_special_ranges && ((*i).second->is_auto_loop() || (*i).second->is_auto_punch())) {
|
||||
if (!include_special_ranges && (loc.second->is_auto_loop() || loc.second->is_auto_punch())) {
|
||||
continue;
|
||||
}
|
||||
if (whitelist != Location::Flags (0)) {
|
||||
if (!((*i).second->flags() & whitelist)) {
|
||||
if (!(loc.second->flags() & whitelist)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (blacklist != Location::Flags (0)) {
|
||||
if ((*i).second->flags() & blacklist) {
|
||||
if (loc.second->flags() & blacklist) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (equalist != Location::Flags (0)) {
|
||||
if (!((*i).second->flags() == equalist)) {
|
||||
if (!(loc.second->flags() == equalist)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((*i).first > pos) {
|
||||
return (*i).first;
|
||||
if (loc.first > pos) {
|
||||
if (retval) {
|
||||
*retval = loc.second;
|
||||
}
|
||||
return loc.first;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,6 @@ PBD::parse_debug_options (const char* str)
|
||||
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
|
||||
boost::char_separator<char> sep (",");
|
||||
tokenizer tokens (in_str, sep);
|
||||
DebugBits bits;
|
||||
|
||||
for (tokenizer::iterator tok_iter = tokens.begin(); tok_iter != tokens.end(); ++tok_iter) {
|
||||
if (*tok_iter == "list") {
|
||||
@ -148,15 +147,13 @@ PBD::parse_debug_options (const char* str)
|
||||
for (map<const char*,DebugBits>::iterator i = _debug_bit_map().begin(); i != _debug_bit_map().end(); ++i) {
|
||||
const char* cstr = (*tok_iter).c_str();
|
||||
|
||||
if (strncasecmp (cstr, i->first, strlen (cstr)) == 0) {
|
||||
bits |= i->second;
|
||||
cout << string_compose (X_("Debug flag '%1' set\n"), i->first);
|
||||
}
|
||||
}
|
||||
if (strncasecmp (cstr, i->first, strlen (cstr)) == 0) {
|
||||
debug_bits |= i->second;
|
||||
cout << string_compose (X_("Debug flag '%1' set\n"), i->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debug_bits = bits;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -107,26 +107,36 @@ FaderPort8::probe (std::string& i, std::string& o)
|
||||
AudioEngine::instance()->get_ports ("", DataType::MIDI, PortFlags (IsOutput|IsTerminal), midi_inputs);
|
||||
AudioEngine::instance()->get_ports ("", DataType::MIDI, PortFlags (IsInput|IsTerminal), midi_outputs);
|
||||
|
||||
auto has_fp8 = [](string const& s) {
|
||||
std::string pn = AudioEngine::instance()->get_hardware_port_name_by_name (s);
|
||||
if (midi_outputs.size () == 0)
|
||||
DEBUG_TRACE (DEBUG::FaderPort8, "prope got no output midi ports at all - perhaps an audio backend problem?\n");
|
||||
// midi_inputs will never be empty - there is always at least x-virtual-keyboard
|
||||
|
||||
const string needle =
|
||||
#ifdef FADERPORT16
|
||||
return pn.find ("PreSonus FP16 Port 1") != string::npos;
|
||||
"PreSonus FP16 Port 1"
|
||||
#elif defined FADERPORT2
|
||||
return pn.find ("PreSonus FP2") != string::npos;
|
||||
"PreSonus FP2"
|
||||
#else
|
||||
return pn.find ("PreSonus FP8") != string::npos;
|
||||
"PreSonus FP8"
|
||||
#endif
|
||||
;
|
||||
|
||||
auto has_fp8 = [&needle] (string const& s) {
|
||||
std::string pn = AudioEngine::instance ()->get_hardware_port_name_by_name (s);
|
||||
return pn.find (needle) != string::npos;
|
||||
};
|
||||
|
||||
auto pi = std::find_if (midi_inputs.begin (), midi_inputs.end (), has_fp8);
|
||||
auto po = std::find_if (midi_outputs.begin (), midi_outputs.end (), has_fp8);
|
||||
|
||||
if (pi == midi_inputs.end () || po == midi_outputs.end ()) {
|
||||
DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("prope did not find the '%1' midi ports\n", needle));
|
||||
return false;
|
||||
}
|
||||
|
||||
i = *pi;
|
||||
o = *po;
|
||||
DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("prope found midi ports '%1' and '%2'\n", i, o));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user