summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-02-18 20:57:58 +0000
committerDavid Robillard <d@drobilla.net>2009-02-18 20:57:58 +0000
commit3ccd34ec7e6c5bd68a0d68db57fc8047b6c9ee7e (patch)
treeba4dd77cdfcdd91a1415f4eb23196fc3a6816765 /libs/surfaces
parent1f9c3f34d95ecc148b2e796e6361d1c16f533d6c (diff)
Style.
git-svn-id: svn://localhost/ardour2/branches/3.0@4626 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc42
1 files changed, 21 insertions, 21 deletions
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index fbf27e18c7..9001b0d823 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -40,7 +40,7 @@ using namespace PBD;
#include "i18n.h"
GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s)
- : ControlProtocol (s, _("Generic MIDI"))
+ : ControlProtocol (s, _("Generic MIDI"))
{
MIDI::Manager* mm = MIDI::Manager::instance();
@@ -235,56 +235,56 @@ GenericMidiControlProtocol::stop_learning (Controllable* c)
}
void
-GenericMidiControlProtocol::delete_binding ( PBD::Controllable* control )
+GenericMidiControlProtocol::delete_binding (PBD::Controllable* control)
{
- if( control != 0 ) {
+ if (control != 0) {
Glib::Mutex::Lock lm2 (controllables_lock);
- for( MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end(); ++iter) {
+ for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end(); ++iter) {
MIDIControllable* existingBinding = (*iter);
- if( control == &(existingBinding->get_controllable()) ) {
+ if (control == &(existingBinding->get_controllable())) {
delete existingBinding;
controllables.erase (iter);
}
- } // end for midi controllables
- } // end null check
+ }
+ }
}
+
void
GenericMidiControlProtocol::create_binding (PBD::Controllable* control, int pos, int control_number)
{
- if( control != NULL ) {
+ if (control != NULL) {
Glib::Mutex::Lock lm2 (controllables_lock);
MIDI::channel_t channel = (pos & 0xf);
MIDI::byte value = control_number;
- // Create a MIDIControllable::
+ // Create a MIDIControllable
MIDIControllable* mc = new MIDIControllable (*_port, *control);
// Remove any old binding for this midi channel/type/value pair
// Note: can't use delete_binding() here because we don't know the specific controllable we want to remove, only the midi information
- for( MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end(); ++iter) {
+ for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end(); ++iter) {
MIDIControllable* existingBinding = (*iter);
- if( (existingBinding->get_control_channel() & 0xf ) == channel &&
+ if ((existingBinding->get_control_channel() & 0xf ) == channel &&
existingBinding->get_control_additional() == value &&
- (existingBinding->get_control_type() & 0xf0 ) == MIDI::controller ) {
+ (existingBinding->get_control_type() & 0xf0 ) == MIDI::controller) {
delete existingBinding;
controllables.erase (iter);
}
- } // end for midi controllables
-
+ }
// Update the MIDI Controllable based on the the pos param
// Here is where a table lookup for user mappings could go; for now we'll just wing it...
- mc->bind_midi( channel, MIDI::controller, value );
+ mc->bind_midi(channel, MIDI::controller, value);
controllables.insert (mc);
- } // end null test
+ }
}
void
@@ -343,7 +343,6 @@ GenericMidiControlProtocol::set_state (const XMLNode& node)
_feedback_interval = 10000;
}
- // Are we using the autobinding feature? If so skip this part
if ( !auto_binding ) {
boost::shared_ptr<Controllable> c;
@@ -377,13 +376,13 @@ GenericMidiControlProtocol::set_state (const XMLNode& node)
}
} else {
- warning << string_compose (_("Generic MIDI control: controllable %1 not found in session (ignored)"),
- id)
- << endmsg;
+ warning << string_compose (
+ _("Generic MIDI control: controllable %1 not found in session (ignored)"),
+ id) << endmsg;
}
}
}
- } // end autobinding check
+ }
return 0;
}
@@ -400,3 +399,4 @@ GenericMidiControlProtocol::get_feedback () const
{
return do_feedback;
}
+