merge 12436:12607 from svn+ssh://ardoursvn@subversion.ardour.org/ardour2/branches/3.0

git-svn-id: svn://localhost/ardour2/branches/3.0-SG@12608 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-06-08 14:03:30 +00:00
parent 6ef90ffe5c
commit f228d2c68e
86 changed files with 6512 additions and 4626 deletions

View file

@ -71,6 +71,10 @@ public:
virtual bool clamp_width (double&) { return true; }
virtual bool clamp_elevation (double&) { return true; }
virtual std::pair<double, double> position_range () const { return std::make_pair (-DBL_MAX, DBL_MAX); }
virtual std::pair<double, double> width_range () const { return std::make_pair (-DBL_MAX, DBL_MAX); }
virtual std::pair<double, double> elevation_range () const { return std::make_pair (-DBL_MAX, DBL_MAX); }
virtual void set_position (double) { }
virtual void set_width (double) { }
virtual void set_elevation (double) { }

View file

@ -177,9 +177,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
const SessionDirectory& session_directory () const { return *(_session_dir.get()); }
static PBD::Signal0<void> AutoBindingOn;
static PBD::Signal0<void> AutoBindingOff;
static PBD::Signal1<void,std::string> Dialog;
int ensure_subdirs ();

View file

@ -1019,7 +1019,8 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out) con
vector<pair<int,int> >& io_configs = pinfo->cache.io_configs;
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("%1 has %2 IO configurations\n", name(), io_configs.size()));
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("%1 has %2 IO configurations, looking for %3 in, %4 out\n",
name(), io_configs.size(), in, out));
//Ardour expects the plugin to tell it the output
//configuration but AU plugins can have multiple I/O
@ -1034,7 +1035,13 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out) con
int32_t possible_out = i->second;
if ((possible_in == audio_in) && (possible_out == audio_out)) {
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("\tCHOSEN: in %1 out %2\n", in, out));
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("\tCHOSEN: %1 in %2 out to match in %3 out %4\n",
possible_in, possible_out,
in, out));
out.set (DataType::MIDI, 0);
out.set (DataType::AUDIO, audio_out);
return 1;
}
}
@ -1300,9 +1307,14 @@ AUPlugin::connect_and_run (BufferSet& bufs, ChanMapping in_map, ChanMapping out_
_last_nframes = nframes;
}
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("%1 in %2 out %3 MIDI %4 bufs %5 (available %6)\n",
name(), input_channels, output_channels, _has_midi_input,
bufs.count(), bufs.available()));
/* the apparent number of buffers matches our input configuration, but we know that the bufferset
has the capacity to handle our outputs.
*/
assert (bufs.available() >= ChanCount (DataType::AUDIO, output_channels));
input_buffers = &bufs;
@ -1310,10 +1322,6 @@ AUPlugin::connect_and_run (BufferSet& bufs, ChanMapping in_map, ChanMapping out_
input_offset = offset;
cb_offset = 0;
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("%1 in %2 out %3 MIDI %4 bufs %5 (available %6)\n",
name(), input_channels, output_channels, _has_midi_input,
bufs.count(), bufs.available()));
buffers->mNumberBuffers = output_channels;
for (int32_t i = 0; i < output_channels; ++i) {

View file

@ -381,6 +381,7 @@ AutomationList::deserialize_events (const XMLNode& node)
int
AutomationList::set_state (const XMLNode& node, int version)
{
LocaleGuard lg (X_("POSIX"));
XMLNodeList nlist = node.children();
XMLNode* nsos;
XMLNodeIterator niter;

View file

@ -382,6 +382,7 @@ ARDOUR::cleanup ()
#ifdef LXVST_SUPPORT
vstfx_exit();
#endif
EnumWriter::destroy ();
return 0;
}

File diff suppressed because it is too large Load diff

View file

@ -388,8 +388,6 @@ RBEffect::run (boost::shared_ptr<Region> r, Progress* progress)
}
}
tsr.done = true;
return ret;
}

View file

@ -116,8 +116,6 @@ PBD::Signal3<int,Session*,std::string,DataType> Session::MissingFile;
PBD::Signal1<void, framepos_t> Session::StartTimeChanged;
PBD::Signal1<void, framepos_t> Session::EndTimeChanged;
PBD::Signal0<void> Session::AutoBindingOn;
PBD::Signal0<void> Session::AutoBindingOff;
PBD::Signal2<void,std::string, std::string> Session::Exported;
PBD::Signal1<int,boost::shared_ptr<Playlist> > Session::AskAboutPlaylistDeletion;
PBD::Signal0<void> Session::Quit;

View file

@ -203,7 +203,5 @@ STStretch::run (boost::shared_ptr<Region> a_region, Progress* progress)
}
}
tsr.done = true;
return ret;
}

View file

@ -6,8 +6,6 @@
#include "ardour/audioengine.h"
#include "test_needing_session.h"
extern void setup_libpbd_enums ();
using namespace std;
using namespace ARDOUR;
using namespace PBD;
@ -56,11 +54,8 @@ TestNeedingSession::setUp ()
string const test_session_path = "libs/ardour/test/test_session";
system (string_compose ("rm -rf %1", test_session_path).c_str());
init (false, true);
SessionEvent::create_per_thread_pool ("test", 512);
setup_libpbd_enums ();
test_receiver.listen_to (error);
test_receiver.listen_to (info);
test_receiver.listen_to (fatal);
@ -83,7 +78,6 @@ TestNeedingSession::tearDown ()
delete _session;
EnumWriter::destroy ();
MIDI::Manager::destroy ();
AudioEngine::destroy ();
}

View file

@ -60,6 +60,8 @@ main(int argc, char* argv[])
CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
compileroutputter.write ();
ARDOUR::cleanup ();
return collectedresults.wasSuccessful () ? 0 : 1;
}

View file

@ -344,8 +344,20 @@ ActionManager::set_sensitive (vector<RefPtr<Action> >& actions, bool state)
}
}
void
ActionManager::check_toggleaction (string n)
{
set_toggleaction_state (n, true);
}
void
ActionManager::uncheck_toggleaction (string n)
{
set_toggleaction_state (n, false);
}
void
ActionManager::set_toggleaction_state (string n, bool s)
{
char const * name = n.c_str ();
@ -369,7 +381,7 @@ ActionManager::uncheck_toggleaction (string n)
RefPtr<Action> act = get_action (group_name, action_name);
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
tact->set_active (false);
tact->set_active (s);
} else {
error << string_compose (_("Unknown action name: %1"), name) << endmsg;
}

View file

@ -86,7 +86,9 @@ namespace ActionManager {
std::vector<std::string>& tooltips,
std::vector<Gtk::AccelKey>& bindings);
extern void check_toggleaction (std::string);
extern void uncheck_toggleaction (std::string);
extern void set_toggleaction_state (std::string, bool);
};
#endif /* __libgtkmm2ext_actions_h__ */

View file

@ -106,6 +106,8 @@ namespace Gtkmm2ext {
void rounded_top_half_rectangle (cairo_t*, double x, double y, double w, double h, double r=10);
void rounded_bottom_half_rectangle (cairo_t*, double x, double y, double w, double h, double r=10);
Gtk::Label* left_aligned_label (std::string const &);
};
#endif /* __gtkmm2ext_utils_h__ */

View file

@ -6,23 +6,22 @@ msgid ""
msgstr ""
"Project-Id-Version: gtkmm2ext\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-11-21 16:11-0500\n"
"PO-Revision-Date: 2004-02-13 00:35+0300\n"
"Last-Translator: Alex Krohn alexkrohn@fastmail.fm\n"
"POT-Creation-Date: 2012-06-06 18:02+0200\n"
"PO-Revision-Date: 2012-06-06 19:00+0100\n"
"Last-Translator: Pablo Fernández <pablo.fbus@gmail.com>\n"
"Language-Team: Spanish\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#: actions.cc:327
#: actions.cc:374
msgid "Unknown action name: %1"
msgstr ""
#: binding_proxy.cc:84
#, fuzzy
msgid "operate controller now"
msgstr "Operar controladora de MIDI ahora"
msgstr "Operar controlador ahora"
#: bindable_button.cc:48
msgid "button cannot watch state of non-existing Controllable\n"
@ -30,31 +29,44 @@ msgstr ""
#: gtk_ui.cc:105
msgid "Log"
msgstr "Log"
#: gtk_ui.cc:361
msgid ""
"\n"
"\n"
"Key: "
msgstr ""
#: gtk_ui.cc:624
#: gtk_ui.cc:634
msgid "Press To Exit"
msgstr ""
msgstr "Pulse para salir"
#: gtk_ui.cc:660
#: gtk_ui.cc:670
msgid "I'm sorry %1, I can't do that"
msgstr ""
msgstr "Lo siento %1, no puedo hacer eso"
#: keyboard.cc:68
msgid "Command"
msgstr ""
#: keyboard.cc:69 keyboard.cc:72 keyboard.cc:85 keyboard.cc:89
#: keyboard.cc:69
#: keyboard.cc:72
#: keyboard.cc:85
#: keyboard.cc:89
msgid "Control"
msgstr ""
#: keyboard.cc:70 keyboard.cc:73 keyboard.cc:87 keyboard.cc:90
msgid "Shift"
#: keyboard.cc:70
#: keyboard.cc:73
#: keyboard.cc:87
#: keyboard.cc:90
msgid "Key|Shift"
msgstr ""
#: keyboard.cc:71
msgid "Option"
msgstr ""
msgstr "Opción"
#: keyboard.cc:86
msgid "Alt"
@ -64,26 +76,30 @@ msgstr ""
msgid "Meta"
msgstr ""
#: keyboard.cc:131 keyboard.cc:506
#: keyboard.cc:134
#: keyboard.cc:515
msgid "Unknown"
msgstr ""
#: keyboard.cc:517
#: keyboard.cc:526
msgid "Ardour key bindings file not found at \"%1\" or contains errors."
msgstr ""
msgstr "El archivo de Ardour combinaciones de teclas de ardour no se encontró en \"%1\" o contiene errores."
#: tearoff.cc:57
msgid "Click to tear this into its own window"
msgstr ""
msgstr "Pulsa para tener esto en su propia ventana"
#: tearoff.cc:63
msgid "Click to put this back in the main window"
msgstr ""
msgstr "Pulsa para llevarlo a la ventana principal"
#: textviewer.cc:34
msgid "Close"
msgstr "Cerrar"
#~ msgid "Error"
#~ msgstr "Error"
#~ msgid "OK"
#~ msgstr "ACEPTAR"

View file

@ -624,3 +624,10 @@ Gtkmm2ext::fit_to_pixels (cairo_t* cr, std::string name, double avail)
return std::make_pair (name, width);
}
Gtk::Label *
Gtkmm2ext::left_aligned_label (string const & t)
{
Gtk::Label* l = new Gtk::Label (t);
l->set_alignment (0, 0.5);
return l;
}

View file

@ -236,7 +236,7 @@ PatchBank::set_state (const XMLTree& tree, const XMLNode& node)
} else {
XMLNode* use_patch_name_list = node.child ("UsesPatchNameList");
if (use_patch_name_list) {
_patch_list_name = node.property ("Name")->value();
_patch_list_name = use_patch_name_list->property ("Name")->value();
} else {
error << "Patch without patch name list - patchfile will be ignored" << endmsg;
return -1;
@ -475,7 +475,7 @@ MIDINameDocument::MIDINameDocument (const string& filename)
if (!_document.read (filename)) {
throw failed_constructor ();
}
set_state (_document, *_document.root());
}

View file

@ -121,6 +121,12 @@ Panner1in2out::clamp_position (double& p)
return true;
}
pair<double, double>
Panner1in2out::position_range () const
{
return make_pair (0, 1);
}
double
Panner1in2out::position () const
{

View file

@ -43,6 +43,7 @@ class Panner1in2out : public Panner
void set_position (double);
bool clamp_position (double&);
std::pair<double, double> position_range () const;
double position() const;

View file

@ -152,8 +152,8 @@ Panner2in2out::update ()
*/
float pos[2];
double width = _pannable->pan_width_control->get_value();
const double direction_as_lr_fract = _pannable->pan_azimuth_control->get_value();
double width = this->width ();
const double direction_as_lr_fract = position ();
if (width < 0.0) {
width = -width;
@ -189,17 +189,30 @@ Panner2in2out::update ()
bool
Panner2in2out::clamp_position (double& p)
{
double w = _pannable->pan_width_control->get_value();
double w = width ();
return clamp_stereo_pan (p, w);
}
bool
Panner2in2out::clamp_width (double& w)
{
double p = _pannable->pan_azimuth_control->get_value();
double p = position ();
return clamp_stereo_pan (p, w);
}
pair<double, double>
Panner2in2out::position_range () const
{
return make_pair (0.5 - (1 - width()) / 2, 0.5 + (1 - width()) / 2);
}
pair<double, double>
Panner2in2out::width_range () const
{
double const w = min (position(), (1 - position())) * 2;
return make_pair (-w, w);
}
bool
Panner2in2out::clamp_stereo_pan (double& direction_as_lr_fract, double& width)
{

View file

@ -49,6 +49,9 @@ class Panner2in2out : public Panner
bool clamp_position (double&);
bool clamp_width (double&);
std::pair<double, double> position_range () const;
std::pair<double, double> width_range () const;
void set_position (double);
void set_width (double);

View file

@ -95,7 +95,7 @@ WMSDErr
WMSD_SurfaceDisplayUpdate (const WSDSurfaceHandle /*surfaceHandle*/,
const struct WSControlID* /*pControlID*/)
{
DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
// DEBUG_TRACE (DEBUG::SoundGrid, string_compose ("SurfaceDriver:%1\n", __FUNCTION__));
return eNoErr;
}

View file

@ -61,46 +61,35 @@ DeviceInfo::~DeviceInfo()
{
}
std::string&
DeviceInfo::get_global_button_name(Button::ID id)
{
std::map<Button::ID,GlobalButtonInfo>::iterator it;
it = _global_buttons.find (id);
if (it == _global_buttons.end ()) {
_global_button_name = "";
return _global_button_name;
} else {
return it->second.label;
}
}
void
DeviceInfo::mackie_control_buttons ()
{
_global_buttons.clear ();
shared_buttons ();
_global_buttons[Button::Edit] = GlobalButtonInfo ("edit", "none", 0x33);
_global_buttons[Button::F9] = GlobalButtonInfo ("F9", "none", 0x3e);
_global_buttons[Button::F10] = GlobalButtonInfo ("F10", "none", 0x3f);
_global_buttons[Button::F11] = GlobalButtonInfo ("F11", "none", 0x40);
_global_buttons[Button::F12] = GlobalButtonInfo ("F12", "none", 0x41);
_global_buttons[Button::F13] = GlobalButtonInfo ("F13", "none", 0x42);
_global_buttons[Button::F14] = GlobalButtonInfo ("F14", "none", 0x43);
_global_buttons[Button::F15] = GlobalButtonInfo ("F15", "none", 0x44);
_global_buttons[Button::F16] = GlobalButtonInfo ("F16", "none", 0x45);
_global_buttons[Button::Ctrl] = GlobalButtonInfo ("ctrl", "modifiers", 0x46);
_global_buttons[Button::Option] = GlobalButtonInfo ("option", "modifiers", 0x47);
_global_buttons[Button::Snapshot] = GlobalButtonInfo ("snapshot", "modifiers", 0x48);
_global_buttons[Button::Shift] = GlobalButtonInfo ("shift", "modifiers", 0x49);
_global_buttons[Button::Read] = GlobalButtonInfo ("read", "automation", 0x4a);
_global_buttons[Button::Write] = GlobalButtonInfo ("write", "automation", 0x4b);
_global_buttons[Button::Undo] = GlobalButtonInfo ("undo", "functions", 0x4c);
_global_buttons[Button::Save] = GlobalButtonInfo ("save", "automation", 0x4d);
_global_buttons[Button::Touch] = GlobalButtonInfo ("touch", "automation", 0x4e);
_global_buttons[Button::Redo] = GlobalButtonInfo ("redo", "functions", 0x4f);
_global_buttons[Button::FdrGroup] = GlobalButtonInfo ("fader group", "functions", 0x50);
_global_buttons[Button::ClearSolo] = GlobalButtonInfo ("clear solo", "functions", 0x51);
_global_buttons[Button::Cancel] = GlobalButtonInfo ("cancel", "functions", 0x52);
_global_buttons[Button::Marker] = GlobalButtonInfo ("marker", "functions", 0x53);
_global_buttons[Button::Mixer] = GlobalButtonInfo ("mixer", "transport", 0x54);
_global_buttons[Button::FrmLeft] = GlobalButtonInfo ("frm left", "transport", 0x55);
_global_buttons[Button::FrmRight] = GlobalButtonInfo ("frm right", "transport", 0x56);
_global_buttons[Button::End] = GlobalButtonInfo ("end", "transport", 0x57);
_global_buttons[Button::PunchIn] = GlobalButtonInfo ("punch in", "transport", 0x58);
_global_buttons[Button::PunchOut] = GlobalButtonInfo ("punch out", "transport", 0x59);
_global_buttons[Button::Loop] = GlobalButtonInfo ("loop", "transport", 0x59);
_global_buttons[Button::Home] = GlobalButtonInfo ("home", "transport", 0x5a);
_strip_buttons[Button::FaderTouch] = StripButtonInfo (0xe0, "fader touch");
_global_buttons[Button::UserA] = GlobalButtonInfo ("Rear Panel User Switch 1", "user", 0x66);
_global_buttons[Button::UserB] = GlobalButtonInfo ("Rear Panel User Switch 2", "user", 0x67);
//TODO Implement "rear panel external control": a connection for a resistive
//TODO element expression pedal . Message: 0xb0 0x2e 0xVV where 0xVV = external
//TODO controller position value (0x00 to 0x7f)
_strip_buttons[Button::RecEnable] = StripButtonInfo (0x0, "Rec");
_strip_buttons[Button::FaderTouch] = StripButtonInfo (0xe0, "Fader Touch");
}
void
@ -108,87 +97,94 @@ DeviceInfo::logic_control_buttons ()
{
_global_buttons.clear ();
shared_buttons ();
_global_buttons[Button::UserA] = GlobalButtonInfo ("User Switch A", "user", 0x66);
_global_buttons[Button::UserB] = GlobalButtonInfo ("User Switch B", "user", 0x67);
_global_buttons[Button::View] = GlobalButtonInfo ("view", "view", 0x33);
_global_buttons[Button::MidiTracks] = GlobalButtonInfo ("miditracks", "view", 0x3e);
_global_buttons[Button::Inputs] = GlobalButtonInfo ("inputs", "view", 0x3f);
_global_buttons[Button::AudioTracks] = GlobalButtonInfo ("audiotracks", "view", 0x40);
_global_buttons[Button::AudioInstruments] = GlobalButtonInfo ("audio instruments", "view", 0x41);
_global_buttons[Button::Aux] = GlobalButtonInfo ("aux", "view", 0x42);
_global_buttons[Button::Busses] = GlobalButtonInfo ("busses", "view", 0x43);
_global_buttons[Button::Outputs] = GlobalButtonInfo ("outputs", "view", 0x44);
_global_buttons[Button::User] = GlobalButtonInfo ("user", "view", 0x45);
_global_buttons[Button::Shift] = GlobalButtonInfo ("shift", "modifiers", 0x46);
_global_buttons[Button::Option] = GlobalButtonInfo ("option", "modifiers", 0x47);
_global_buttons[Button::Ctrl] = GlobalButtonInfo ("ctrl", "modifiers", 0x48);
_global_buttons[Button::CmdAlt] = GlobalButtonInfo ("cmdalt", "modifiers", 0x49);
_global_buttons[Button::Read] = GlobalButtonInfo ("read", "automation", 0x4a);
_global_buttons[Button::Write] = GlobalButtonInfo ("write", "automation", 0x4b);
_global_buttons[Button::Trim] = GlobalButtonInfo ("trim", "automation", 0x4c);
_global_buttons[Button::Touch] = GlobalButtonInfo ("touch", "functions", 0x4d);
_global_buttons[Button::Latch] = GlobalButtonInfo ("latch", "functions", 0x4e);
_global_buttons[Button::Grp] = GlobalButtonInfo ("group", "functions", 0x4f);
_global_buttons[Button::Save] = GlobalButtonInfo ("save", "functions", 0x50);
_global_buttons[Button::Undo] = GlobalButtonInfo ("undo", "functions", 0x51);
_global_buttons[Button::Cancel] = GlobalButtonInfo ("cancel", "transport", 0x52);
_global_buttons[Button::Enter] = GlobalButtonInfo ("enter right", "transport", 0x53);
_global_buttons[Button::Marker] = GlobalButtonInfo ("marker", "transport", 0x54);
_global_buttons[Button::Nudge] = GlobalButtonInfo ("nudge", "transport", 0x55);
_global_buttons[Button::Loop] = GlobalButtonInfo ("cycle", "transport", 0x56);
_global_buttons[Button::Drop] = GlobalButtonInfo ("drop", "transport", 0x57);
_global_buttons[Button::Replace] = GlobalButtonInfo ("replace", "transport", 0x58);
_global_buttons[Button::Click] = GlobalButtonInfo ("click", "transport", 0x59);
_global_buttons[Button::Solo] = GlobalButtonInfo ("solo", "transport", 0x5a);
_strip_buttons[Button::FaderTouch] = StripButtonInfo (0x68, "fader touch");
_strip_buttons[Button::RecEnable] = StripButtonInfo (0x0, "Rec/Rdy");
_strip_buttons[Button::FaderTouch] = StripButtonInfo (0x68, "Fader Touch");
}
void
DeviceInfo::shared_buttons ()
{
_global_buttons[Button::Track] = GlobalButtonInfo ("track", "assignment", 0x28);
_global_buttons[Button::Send] = GlobalButtonInfo ("send", "assignment", 0x29);
_global_buttons[Button::Pan] = GlobalButtonInfo ("pan", "assignment", 0x2a);
_global_buttons[Button::Plugin] = GlobalButtonInfo ("plugin", "assignment", 0x2b);
_global_buttons[Button::Eq] = GlobalButtonInfo ("eq", "assignment", 0x2c);
_global_buttons[Button::Dyn] = GlobalButtonInfo ("dyn", "assignment", 0x2d);
_global_buttons[Button::Left] = GlobalButtonInfo ("left", "bank", 0x2e);
_global_buttons[Button::Right] = GlobalButtonInfo ("right", "bank", 0x2f);
_global_buttons[Button::ChannelLeft] = GlobalButtonInfo ("channelleft", "bank", 0x30);
_global_buttons[Button::ChannelRight] = GlobalButtonInfo ("channelright", "bank", 0x31);
_global_buttons[Button::Flip] = GlobalButtonInfo ("flip", "none", 0x32);
_global_buttons[Button::Track] = GlobalButtonInfo ("Track", "assignment", 0x28);
_global_buttons[Button::Send] = GlobalButtonInfo ("Send", "assignment", 0x29);
_global_buttons[Button::Pan] = GlobalButtonInfo ("Pan/Surround", "assignment", 0x2a);
_global_buttons[Button::Plugin] = GlobalButtonInfo ("Plugin", "assignment", 0x2b);
_global_buttons[Button::Eq] = GlobalButtonInfo ("Eq", "assignment", 0x2c);
_global_buttons[Button::Dyn] = GlobalButtonInfo ("Instrument", "assignment", 0x2d);
_global_buttons[Button::Left] = GlobalButtonInfo ("Bank Left", "bank", 0x2e);
_global_buttons[Button::Right] = GlobalButtonInfo ("Bank Right", "bank", 0x2f);
_global_buttons[Button::ChannelLeft] = GlobalButtonInfo ("Channel Left", "bank", 0x30);
_global_buttons[Button::ChannelRight] = GlobalButtonInfo ("Channel Right", "bank", 0x31);
_global_buttons[Button::Flip] = GlobalButtonInfo ("Flip", "assignment", 0x32);
_global_buttons[Button::View] = GlobalButtonInfo ("Global View", "global view", 0x33);
_global_buttons[Button::NameValue] = GlobalButtonInfo ("name/value", "display", 0x34);
_global_buttons[Button::TimecodeBeats] = GlobalButtonInfo ("timecode/beats", "display", 0x35);
_global_buttons[Button::F1] = GlobalButtonInfo ("F1", "none", 0x36);
_global_buttons[Button::F2] = GlobalButtonInfo ("F2", "none", 0x37);
_global_buttons[Button::F3] = GlobalButtonInfo ("F3", "none", 0x38);
_global_buttons[Button::F4] = GlobalButtonInfo ("F4", "none", 0x39);
_global_buttons[Button::F5] = GlobalButtonInfo ("F5", "none", 0x3a);
_global_buttons[Button::F6] = GlobalButtonInfo ("F6", "none", 0x3b);
_global_buttons[Button::F7] = GlobalButtonInfo ("F7", "none", 0x3c);
_global_buttons[Button::F8] = GlobalButtonInfo ("F8", "none", 0x3d);
_global_buttons[Button::NameValue] = GlobalButtonInfo ("Name/Value", "display", 0x34);
_global_buttons[Button::TimecodeBeats] = GlobalButtonInfo ("Timecode/Beats", "display", 0x35);
_global_buttons[Button::F1] = GlobalButtonInfo ("F1", "function select", 0x36);
_global_buttons[Button::F2] = GlobalButtonInfo ("F2", "function select", 0x37);
_global_buttons[Button::F3] = GlobalButtonInfo ("F3", "function select", 0x38);
_global_buttons[Button::F4] = GlobalButtonInfo ("F4", "function select", 0x39);
_global_buttons[Button::F5] = GlobalButtonInfo ("F5", "function select", 0x3a);
_global_buttons[Button::F6] = GlobalButtonInfo ("F6", "function select", 0x3b);
_global_buttons[Button::F7] = GlobalButtonInfo ("F7", "function select", 0x3c);
_global_buttons[Button::F8] = GlobalButtonInfo ("F8", "function select", 0x3d);
_global_buttons[Button::MidiTracks] = GlobalButtonInfo ("MIDI Tracks", "global view", 0x3e);
_global_buttons[Button::Inputs] = GlobalButtonInfo ("Inputs", "global view", 0x3f);
_global_buttons[Button::AudioTracks] = GlobalButtonInfo ("Audio Tracks", "global view", 0x40);
_global_buttons[Button::AudioInstruments] = GlobalButtonInfo ("Audio Instruments", "global view", 0x41);
_global_buttons[Button::Aux] = GlobalButtonInfo ("Aux", "global view", 0x42);
_global_buttons[Button::Busses] = GlobalButtonInfo ("Busses", "global view", 0x43);
_global_buttons[Button::Outputs] = GlobalButtonInfo ("Outputs", "global view", 0x44);
_global_buttons[Button::User] = GlobalButtonInfo ("User", "global view", 0x45);
_global_buttons[Button::Shift] = GlobalButtonInfo ("Shift", "modifiers", 0x46);
_global_buttons[Button::Option] = GlobalButtonInfo ("Option", "modifiers", 0x47);
_global_buttons[Button::Ctrl] = GlobalButtonInfo ("Ctrl", "modifiers", 0x48);
_global_buttons[Button::CmdAlt] = GlobalButtonInfo ("Cmd/Alt", "modifiers", 0x49);
_global_buttons[Button::Read] = GlobalButtonInfo ("Read/Off", "automation", 0x4a);
_global_buttons[Button::Write] = GlobalButtonInfo ("Write", "automation", 0x4b);
_global_buttons[Button::Trim] = GlobalButtonInfo ("Trim", "automation", 0x4c);
_global_buttons[Button::Touch] = GlobalButtonInfo ("Touch", "automation", 0x4d);
_global_buttons[Button::Latch] = GlobalButtonInfo ("Latch", "automation", 0x4e);
_global_buttons[Button::Grp] = GlobalButtonInfo ("Group", "automation", 0x4f);
_global_buttons[Button::Save] = GlobalButtonInfo ("Save", "utilities", 0x50);
_global_buttons[Button::Undo] = GlobalButtonInfo ("Undo", "utilities", 0x51);
_global_buttons[Button::Cancel] = GlobalButtonInfo ("Cancel", "utilities", 0x52);
_global_buttons[Button::Enter] = GlobalButtonInfo ("Enter", "utilities", 0x53);
_global_buttons[Button::Rewind] = GlobalButtonInfo ("rewind", "transport", 0x5b);
_global_buttons[Button::Ffwd] = GlobalButtonInfo ("ffwd", "transport", 0x5c);
_global_buttons[Button::Stop] = GlobalButtonInfo ("stop", "transport", 0x5d);
_global_buttons[Button::Play] = GlobalButtonInfo ("play", "transport", 0x5e);
_global_buttons[Button::Record] = GlobalButtonInfo ("record", "transport", 0x5f);
_global_buttons[Button::CursorUp] = GlobalButtonInfo ("cursor up", "cursor", 0x60);
_global_buttons[Button::CursorDown] = GlobalButtonInfo ("cursor down", "cursor", 0x61);
_global_buttons[Button::CursorLeft] = GlobalButtonInfo ("cursor left", "cursor", 0x62);
_global_buttons[Button::CursorRight] = GlobalButtonInfo ("cursor right", "cursor", 0x63);
_global_buttons[Button::Zoom] = GlobalButtonInfo ("zoom", "none", 0x64);
_global_buttons[Button::Scrub] = GlobalButtonInfo ("scrub", "none", 0x65);
_global_buttons[Button::UserA] = GlobalButtonInfo ("user a", "user", 0x66);
_global_buttons[Button::UserB] = GlobalButtonInfo ("user b", "user", 0x67);
_global_buttons[Button::Marker] = GlobalButtonInfo ("Marker", "transport", 0x54);
_global_buttons[Button::Nudge] = GlobalButtonInfo ("Nudge", "transport", 0x55);
_global_buttons[Button::Loop] = GlobalButtonInfo ("Cycle", "transport", 0x56);
_global_buttons[Button::Drop] = GlobalButtonInfo ("Drop", "transport", 0x57);
_global_buttons[Button::Replace] = GlobalButtonInfo ("Replace", "transport", 0x58);
_global_buttons[Button::Click] = GlobalButtonInfo ("Click", "transport", 0x59);
_global_buttons[Button::Solo] = GlobalButtonInfo ("Solo", "transport", 0x5a);
_global_buttons[Button::Rewind] = GlobalButtonInfo ("Rewind", "transport", 0x5b);
_global_buttons[Button::Ffwd] = GlobalButtonInfo ("Fast Fwd", "transport", 0x5c);
_global_buttons[Button::Stop] = GlobalButtonInfo ("Stop", "transport", 0x5d);
_global_buttons[Button::Play] = GlobalButtonInfo ("Play", "transport", 0x5e);
_global_buttons[Button::Record] = GlobalButtonInfo ("Record", "transport", 0x5f);
_global_buttons[Button::CursorUp] = GlobalButtonInfo ("Cursor Up", "cursor", 0x60);
_global_buttons[Button::CursorDown] = GlobalButtonInfo ("Cursor Down", "cursor", 0x61);
_global_buttons[Button::CursorLeft] = GlobalButtonInfo ("Cursor Left", "cursor", 0x62);
_global_buttons[Button::CursorRight] = GlobalButtonInfo ("Cursor Right", "cursor", 0x63);
_global_buttons[Button::Zoom] = GlobalButtonInfo ("Zoom", "cursor", 0x64);
_global_buttons[Button::Scrub] = GlobalButtonInfo ("Scrub", "cursor", 0x65);
_strip_buttons[Button::RecEnable] = StripButtonInfo (0x0, "recenable");
_strip_buttons[Button::Solo] = StripButtonInfo (0x08, "solo");
_strip_buttons[Button::Mute] = StripButtonInfo (0x10, "mute");
_strip_buttons[Button::Select] = StripButtonInfo (0x18, "select");
_strip_buttons[Button::VSelect] = StripButtonInfo (0x20, "vselect");
_strip_buttons[Button::Solo] = StripButtonInfo (0x08, "Solo");
_strip_buttons[Button::Mute] = StripButtonInfo (0x10, "Mute");
_strip_buttons[Button::Select] = StripButtonInfo (0x18, "Select");
_strip_buttons[Button::VSelect] = StripButtonInfo (0x20, "V-Select");
}
int

View file

@ -73,6 +73,8 @@ class DeviceInfo
static std::map<std::string,DeviceInfo> device_info;
static void reload_device_info();
std::string& get_global_button_name(Button::ID);
const std::map<Button::ID,GlobalButtonInfo>& global_buttons() const { return _global_buttons; }
const std::map<Button::ID,StripButtonInfo>& strip_buttons() const { return _strip_buttons; }
@ -91,6 +93,7 @@ class DeviceInfo
bool _no_handshake;
bool _has_meters;
std::string _name;
std::string _global_button_name;
std::map<Button::ID,GlobalButtonInfo> _global_buttons;
std::map<Button::ID,StripButtonInfo> _strip_buttons;

View file

@ -167,15 +167,20 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
VBox* fkey_packer = manage (new VBox);
HBox* profile_packer = manage (new HBox);
HBox* observation_packer = manage (new HBox);
l = manage (new Gtk::Label (_("Profile/Settings:")));
profile_packer->pack_start (*l, false, false);
profile_packer->pack_start (_profile_combo, true, true);
profile_packer->set_spacing (12);
profile_packer->set_border_width (12);
l = manage (new Gtk::Label (_("* Button available at the original Mackie MCU PRO or current device if enabled (NOT implemented yet). Device specific name presented.")));
observation_packer->pack_start (*l, false, false);
fkey_packer->pack_start (*profile_packer, false, false);
fkey_packer->pack_start (function_key_scroller, true, true);
fkey_packer->pack_start (*observation_packer, false, false);
fkey_packer->set_spacing (12);
function_key_scroller.set_size_request (700,700);
function_key_scroller.property_shadow_type() = Gtk::SHADOW_NONE;
@ -340,13 +345,18 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
TreeModel::Row row;
DeviceProfile dp (_cp.device_profile());
DeviceInfo di;
for (int n = 0; n < Mackie::Button::FinalGlobalButton; ++n) {
Mackie::Button::ID bid = (Mackie::Button::ID) n;
row = *(function_key_model->append());
row[function_key_columns.name] = Mackie::Button::id_to_name (bid);
if (di.global_buttons().find (bid) == di.global_buttons().end()) {
row[function_key_columns.name] = Mackie::Button::id_to_name (bid);
} else {
row[function_key_columns.name] = di.get_global_button_name (bid) + "*";
}
row[function_key_columns.id] = bid;
Glib::RefPtr<Gtk::Action> act;

View file

@ -108,6 +108,7 @@ MackieControlProtocol::MackieControlProtocol (Session& session)
, _ipmidi_base (MIDI::IPMIDIPort::lowest_ipmidi_port_default)
, needs_ipmidi_restart (false)
, _metering_active (true)
, _initialized (false)
{
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::MackieControlProtocol\n");
@ -414,6 +415,10 @@ MackieControlProtocol::periodic ()
ipmidi_restart ();
return true;
}
if (!_initialized) {
initialize();
}
struct timeval now;
uint64_t now_usecs;
@ -430,10 +435,10 @@ MackieControlProtocol::periodic ()
return true;
}
void
MackieControlProtocol::update_timecode_beats_led()
{
DEBUG_TRACE (DEBUG::MackieControl, string_compose("MackieControlProtocol::update_timecode_beats_led(): %1\n", _timecode_type));
switch (_timecode_type) {
case ARDOUR::AnyTime::BBT:
update_global_led (Led::Beats, on);
@ -473,6 +478,8 @@ MackieControlProtocol::update_global_led (int id, LedState ls)
{
boost::shared_ptr<Surface> surface = surfaces.front();
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("MackieControlProtocol::update_global_led (%1, %2)\n", id, ls));
if (surface->type() != mcu) {
return;
}
@ -480,6 +487,7 @@ MackieControlProtocol::update_global_led (int id, LedState ls)
map<int,Control*>::iterator x = surface->controls_by_device_independent_id.find (id);
if (x != surface->controls_by_device_independent_id.end()) {
Led * led = dynamic_cast<Led*> (x->second);
DEBUG_TRACE (DEBUG::MackieControl, "Writing LedState\n");
surface->write (led->set_state (ls));
} else {
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Led %1 not found\n", id));
@ -490,6 +498,7 @@ MackieControlProtocol::update_global_led (int id, LedState ls)
void
MackieControlProtocol::update_surfaces()
{
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::update_surfaces() init\n");
if (!_active) {
return;
}
@ -498,6 +507,15 @@ MackieControlProtocol::update_surfaces()
// _current_initial_bank is initialised by set_state
switch_banks (_current_initial_bank, true);
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::update_surfaces() finished\n");
}
void
MackieControlProtocol::initialize()
{
if (!surfaces.front()->active ()) {
return;
}
// sometimes the jog wheel is a pot
surfaces.front()->blank_jog_ring ();
@ -506,6 +524,8 @@ MackieControlProtocol::update_surfaces()
notify_record_state_changed();
notify_transport_state_changed();
update_timecode_beats_led();
_initialized = true;
}
void
@ -755,8 +775,8 @@ MackieControlProtocol::format_timecode_timecode (framepos_t now_frame)
os << setw(2) << setfill('0') << timecode.hours;
os << setw(2) << setfill('0') << timecode.minutes;
os << setw(2) << setfill('0') << timecode.seconds;
os << ' ';
os << setw(2) << setfill('0') << timecode.frames;
os << ' ';
return os.str();
}
@ -881,7 +901,7 @@ MackieControlProtocol::notify_transport_state_changed()
// switch various play and stop buttons on / off
update_global_button (Button::Loop, session->get_play_loop());
update_global_button (Button::Play, session->transport_speed() == 1.0);
update_global_button (Button::Stop, !session->transport_rolling());
update_global_button (Button::Stop, session->transport_stopped ());
update_global_button (Button::Rewind, session->transport_speed() < 0.0);
update_global_button (Button::Ffwd, session->transport_speed() > 1.0);
@ -925,7 +945,7 @@ MackieControlProtocol::notify_record_state_changed ()
ls = flashing;
break;
}
surface->write (rec->set_state (ls));
}
}

View file

@ -289,6 +289,7 @@ class MackieControlProtocol
int16_t _ipmidi_base;
bool needs_ipmidi_restart;
bool _metering_active;
bool _initialized;
ARDOUR::RouteNotificationList _last_selected_routes;
@ -302,6 +303,7 @@ class MackieControlProtocol
void gui_track_selection_changed (ARDOUR::RouteNotificationListPtr, bool save_list);
void _gui_track_selection_changed (ARDOUR::RouteNotificationList*, bool save_list);
void ipmidi_restart ();
void initialize ();
/* BUTTON HANDLING */

View file

@ -71,12 +71,15 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
/* only the first Surface object has global controls */
if (_number == 0) {
DEBUG_TRACE (DEBUG::MackieControl, "Surface has global controls\n");
if (_mcp.device_info().has_global_controls()) {
init_controls ();
DEBUG_TRACE (DEBUG::MackieControl, "init_controls done\n");
}
if (_mcp.device_info().has_master_fader()) {
setup_master ();
DEBUG_TRACE (DEBUG::MackieControl, "setup_master done\n");
}
}
@ -84,6 +87,7 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
if (n) {
init_strips (n);
DEBUG_TRACE (DEBUG::MackieControl, "init_strips done\n");
}
connect_to_signals ();
@ -136,24 +140,28 @@ void
Surface::init_controls()
{
Group* group;
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating groups\n");
groups["assignment"] = new Group ("assignment");
groups["automation"] = new Group ("automation");
groups["bank"] = new Group ("bank");
groups["cursor"] = new Group ("cursor");
groups["display"] = new Group ("display");
groups["functions"] = new Group ("functions");
groups["function select"] = new Group ("function select");
groups["global view"] = new Group ("global view");
groups["master"] = new Group ("master");
groups["modifiers"] = new Group ("modifiers");
groups["none"] = new Group ("none");
groups["transport"] = new Group ("transport");
groups["user"] = new Group ("user");
groups["master"] = new Group ("master");
groups["view"] = new Group ("view");
groups["utilities"] = new Group ("utilities");
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating jog wheel\n");
if (_mcp.device_info().has_jog_wheel()) {
_jog_wheel = new Mackie::JogWheel (_mcp);
}
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating global controls\n");
for (uint32_t n = 0; mackie_global_controls[n].name[0]; ++n) {
group = groups[mackie_global_controls[n].group_name];
Control* control = mackie_global_controls[n].factory (*this, mackie_global_controls[n].id, mackie_global_controls[n].name, *group);
@ -161,7 +169,7 @@ Surface::init_controls()
}
/* add global buttons */
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: adding global buttons\n");
const map<Button::ID,GlobalButtonInfo>& global_buttons (_mcp.device_info().global_buttons());
for (map<Button::ID,GlobalButtonInfo>::const_iterator b = global_buttons.begin(); b != global_buttons.end(); ++b){
@ -508,13 +516,8 @@ Surface::host_connection_confirmation (const MidiByteArray & bytes)
void
Surface::turn_it_on ()
{
if (!_active) {
_active = true;
zero_controls ();
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
(*s)->notify_all ();
}
update_view_mode_display ();
if (_active) {
return;
if (_mcp.device_info ().has_master_fader ()) {
master_gain_changed ();
}
@ -525,6 +528,20 @@ Surface::turn_it_on ()
_mcp.update_global_button (Button::Play, (_mcp.get_session ().transport_speed () == 1.0f));
}
}
_active = true;
zero_controls ();
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
(*s)->notify_all ();
}
update_view_mode_display ();
if (_mcp.device_info ().has_master_fader ()) {
master_gain_changed ();
}
if (_mcp.device_info ().has_global_controls ()) {
_mcp.update_global_button (Button::Read, _mcp.metering_active ());
}
}
void
@ -635,7 +652,9 @@ Surface::periodic (uint64_t now_usecs)
void
Surface::write (const MidiByteArray& data)
{
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface::write for %1\n", data));
if (_active) {
DEBUG_TRACE (DEBUG::MackieControl, "Surface::write surface active\n");
_port->write (data);
}
}