summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Anderson <ardour@semiosix.com>2007-08-01 09:48:42 +0000
committerJohn Anderson <ardour@semiosix.com>2007-08-01 09:48:42 +0000
commit4b6986816f6c4830e8b5fb112e356ceb5b1aa192 (patch)
treef162c4fc1b797285811e3e38a0b83c16c1541be4
parent0b53f44373804f85151a51186b4c222dd5ee244f (diff)
#ifdef around debug cout calls. Make sure -DDEBUG is passed to compiler.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2209 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/surfaces/mackie/SConscript6
-rw-r--r--libs/surfaces/mackie/TODO41
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc2
-rw-r--r--libs/surfaces/mackie/mackie_midi_builder.cc8
-rw-r--r--libs/surfaces/mackie/mackie_port.cc65
-rw-r--r--libs/surfaces/mackie/surface_port.cc9
6 files changed, 84 insertions, 47 deletions
diff --git a/libs/surfaces/mackie/SConscript b/libs/surfaces/mackie/SConscript
index 4f5e6c0404..ead34f23cc 100644
--- a/libs/surfaces/mackie/SConscript
+++ b/libs/surfaces/mackie/SConscript
@@ -14,12 +14,16 @@ mackie = env.Copy()
domain = 'ardour_mackie'
-mackie.Append(DOMAIN = domain, MAJOR = 1, MINOR = 0, MICRO = 0)
+mackie.Append(DOMAIN = domain, MAJOR = 1, MINOR = 1, MICRO = 0)
mackie.Append(CXXFLAGS = "-DPACKAGE=\\\"" + domain + "\\\"")
mackie.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
mackie.Append(PACKAGE = domain)
mackie.Append(POTFILE = domain + '.pot')
+if mackie['DEBUG'] == 1:
+ mackie.Append(CXXFLAGS="-DDEBUG")
+ #mackie.Append(CXXFLAGS="-DPORT_DEBUG")
+
mackie_files=Split("""
interface.cc
midi_byte_array.cc
diff --git a/libs/surfaces/mackie/TODO b/libs/surfaces/mackie/TODO
index f05552b42c..bc01baecdc 100644
--- a/libs/surfaces/mackie/TODO
+++ b/libs/surfaces/mackie/TODO
@@ -1,21 +1,25 @@
-* if mackie wheel moves too fast, it's ignored.
-* update manual with jog wheel states
-* alsa/sequencer ports unstable. possibly problems with use of ::poll
-* use glib::Timer instead of mine
-* crash when mmc port set to mcu?
* remappable buttons
-* how long can UI signal callbacks take to execute? What happens if they block?
- where ENSURE_CORRECT_THREAD is a macro that is modelled on ENSURE_GUI_THREAD
- if the handler is not called in the "correct thread", it will use a pseudo-RT-safe-enough technique to get the correct thread to recall "handler" later on, and return.
-
+* 7/1 configurable to 8
* finish button implementations.
* concurrency for bank switching? And make sure "old" events aren't sent to "new" faders
* TODOs in code
* removal of a route results in a strip that isn't dead, but doesn't have any effect on the session
* use i18n. see string_compose
+MCU
+---
+* if mackie wheel moves too fast, it's ignored.
+* timecode displays
+* midi bandwidth?
+
Later
-----
+* how long can UI signal callbacks take to execute? What happens if they block?
+ where ENSURE_CORRECT_THREAD is a macro that is modelled on ENSURE_GUI_THREAD
+ if the handler is not called in the "correct thread", it will use a pseudo-RT-safe-enough technique to get the correct thread to recall "handler" later on, and return.
+* alsa/sequencer ports unstable. possibly problems with use of ::poll
+* use glib::Timer instead of mine. Actually don't because it's not very useable.
+* crash when mmc port set to mcu?
* remove commented couts
* Perhaps MackieControlProtocol shouldn't implement MackieButtonHandler
* Need a HostAdapter class to encapsulate ardour calls
@@ -31,20 +35,9 @@ Later
* mix busses and/or a "bus-only" bank/mode
* what about surfaces like Mackie C4 and BCR2000?
-Need UI integration
--------------------
+UI integration
+--------------
+
+* maybe use current snap state for jog wheel and ffwd/rew
* Some indication on the UI of currently bank-switched-in routes?
Useful for surfaces that don't have a scribble strip.
-* use current snap state for jog wheel and ffwd/rew
-
-Actual Mackie
--------------
-* test Mackie surface object. Apparently led rings don't work. Stereo busses?
-* timecode & 55 char displays
-* midi bandwidth
-
-Bugs
-----
-
-* definitely something wrong with remote_id assignment on session create
- (master strip assigned 0).
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index 56bec6ecbc..0612d6aed5 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -331,7 +331,7 @@ void MackieControlProtocol::switch_banks( int initial )
void MackieControlProtocol::zero_all()
{
- // TODO turn off 55-char and SMPTE displays
+ // TODO turn off SMPTE displays
if ( mcu_port().emulation() == MackiePort::bcf2000 )
{
diff --git a/libs/surfaces/mackie/mackie_midi_builder.cc b/libs/surfaces/mackie/mackie_midi_builder.cc
index d16aecf5e1..872b63d02a 100644
--- a/libs/surfaces/mackie/mackie_midi_builder.cc
+++ b/libs/surfaces/mackie/mackie_midi_builder.cc
@@ -191,9 +191,11 @@ MidiByteArray MackieMidiBuilder::strip_display( const Strip & strip, unsigned in
{
throw runtime_error( "strip.index() must be between 0 and 7" );
}
-
+
+#ifdef DEBUG
cout << "MackieMidiBuilder::strip_display index: " << strip.index() << ", line " << line_number << ": " << line << endl;
-
+#endif
+
MidiByteArray retval;
// code for display
retval << 0x12;
@@ -207,7 +209,9 @@ MidiByteArray MackieMidiBuilder::strip_display( const Strip & strip, unsigned in
retval << ' ';
}
+#ifdef DEBUG
cout << "MackieMidiBuilder::strip_display midi: " << retval << endl;
+#endif
return retval;
}
diff --git a/libs/surfaces/mackie/mackie_port.cc b/libs/surfaces/mackie/mackie_port.cc
index c78021ed91..c5f855975a 100644
--- a/libs/surfaces/mackie/mackie_port.cc
+++ b/libs/surfaces/mackie/mackie_port.cc
@@ -51,14 +51,20 @@ MackiePort::MackiePort( MackieControlProtocol & mcp, MIDI::Port & port, int numb
, _emulation( none )
, _initialising( true )
{
- //cout << "MackiePort::MackiePort" <<endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::MackiePort" <<endl;
+#endif
}
MackiePort::~MackiePort()
{
- //cout << "~MackiePort" << endl;
+#ifdef PORT_DEBUG
+ cout << "~MackiePort" << endl;
+#endif
close();
- //cout << "~MackiePort finished" << endl;
+#ifdef PORT_DEBUG
+ cout << "~MackiePort finished" << endl;
+#endif
}
int MackiePort::strips() const
@@ -85,7 +91,9 @@ int MackiePort::strips() const
// should really be in MackiePort
void MackiePort::open()
{
- //cout << "MackiePort::open " << *this << endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::open " << *this << endl;
+#endif
_sysex = port().input()->sysex.connect( ( mem_fun (*this, &MackiePort::handle_midi_sysex) ) );
// make sure the device is connected
@@ -94,14 +102,18 @@ void MackiePort::open()
void MackiePort::close()
{
- //cout << "MackiePort::close" << endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::close" << endl;
+#endif
// disconnect signals
_any.disconnect();
_sysex.disconnect();
// TODO emit a "closing" signal?
- //cout << "MackiePort::close finished" << endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::close finished" << endl;
+#endif
}
const MidiByteArray & MackiePort::sysex_hdr() const
@@ -137,7 +149,9 @@ MidiByteArray calculate_challenge_response( MidiByteArray::iterator begin, MidiB
MidiByteArray MackiePort::host_connection_query( MidiByteArray & bytes )
{
// handle host connection query
- //cout << "host connection query: " << bytes << endl;
+#ifdef PORT_DEBUG
+ cout << "host connection query: " << bytes << endl;
+#endif
if ( bytes.size() != 18 )
{
@@ -158,7 +172,9 @@ MidiByteArray MackiePort::host_connection_query( MidiByteArray & bytes )
// not used right now
MidiByteArray MackiePort::host_connection_confirmation( const MidiByteArray & bytes )
{
- //cout << "host_connection_confirmation: " << bytes << endl;
+#ifdef PORT_DEBUG
+ cout << "host_connection_confirmation: " << bytes << endl;
+#endif
// decode host connection confirmation
if ( bytes.size() != 14 )
@@ -175,10 +191,15 @@ MidiByteArray MackiePort::host_connection_confirmation( const MidiByteArray & by
void MackiePort::probe_emulation( const MidiByteArray & bytes )
{
- //cout << "MackiePort::probe_emulation: " << bytes.size() << ", " << bytes << endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::probe_emulation: " << bytes.size() << ", " << bytes << endl;
+#endif
+
string version_string;
for ( int i = 6; i < 11; ++i ) version_string.append( 1, (char)bytes[i] );
- //cout << "version_string: " << version_string << endl;
+#ifdef PORT_DEBUG
+ cout << "version_string: " << version_string << endl;
+#endif
// TODO investigate using serial number. Also, possibly size of bytes might
// give an indication. Also, apparently MCU sends non-documented messages
@@ -194,11 +215,15 @@ void MackiePort::probe_emulation( const MidiByteArray & bytes )
void MackiePort::init()
{
- //cout << "MackiePort::init" << endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::init" << endl;
+#endif
init_mutex.lock();
_initialising = true;
- //cout << "MackiePort::lock acquired" << endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::lock acquired" << endl;
+#endif
// emit pre-init signal
init_event();
@@ -289,18 +314,26 @@ bool MackiePort::wait_for_init()
Glib::Mutex::Lock lock( init_mutex );
while ( _initialising )
{
- //cout << "MackiePort::wait_for_active waiting" << endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::wait_for_active waiting" << endl;
+#endif
init_cond.wait( init_mutex );
- //cout << "MackiePort::wait_for_active released" << endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::wait_for_active released" << endl;
+#endif
}
- //cout << "MackiePort::wait_for_active returning" << endl;
+#ifdef PORT_DEBUG
+ cout << "MackiePort::wait_for_active returning" << endl;
+#endif
return SurfacePort::active();
}
void MackiePort::handle_midi_sysex (MIDI::Parser & parser, MIDI::byte * raw_bytes, size_t count )
{
MidiByteArray bytes( count, raw_bytes );
- //cout << "handle_midi_sysex: " << bytes << endl;
+#ifdef PORT_DEBUG
+ cout << "handle_midi_sysex: " << bytes << endl;
+#endif
switch( bytes[5] )
{
case 0x01:
diff --git a/libs/surfaces/mackie/surface_port.cc b/libs/surfaces/mackie/surface_port.cc
index 5354e71df6..bba9ab2402 100644
--- a/libs/surfaces/mackie/surface_port.cc
+++ b/libs/surfaces/mackie/surface_port.cc
@@ -42,11 +42,15 @@ SurfacePort::SurfacePort( MIDI::Port & port, int number )
SurfacePort::~SurfacePort()
{
- //cout << "~SurfacePort::SurfacePort()" << endl;
+#ifdef PORT_DEBUG
+ cout << "~SurfacePort::SurfacePort()" << endl;
+#endif
// make sure another thread isn't reading or writing as we close the port
Glib::RecMutex::Lock lock( _rwlock );
_active = false;
- //cout << "~SurfacePort::SurfacePort() finished" << endl;
+#ifdef PORT_DEBUG
+ cout << "~SurfacePort::SurfacePort() finished" << endl;
+#endif
}
// wrapper for one day when strerror_r is working properly
@@ -115,7 +119,6 @@ MidiByteArray SurfacePort::read()
void SurfacePort::write( const MidiByteArray & mba )
{
#ifdef PORT_DEBUG
- //if ( mba[0] == 0xf0 ) cout << "SurfacePort::write: " << mba << endl;
cout << "SurfacePort::write: " << mba << endl;
#endif