13
0

Moved test for jack_port_ensure_monitor from SConstruct into

libs/ardour/SConscript.

Renamed define WITH_JACK_PORT_ENSURE_MONITOR to HAVE_etc to 
be more consistant.

Added a test in libs/ardour/SConscript for jack video support and 
ifdef'd the small code blocks in audioengine.cc and session_time.cc
where it was used.


git-svn-id: svn://localhost/ardour2/trunk@882 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Tim Mayberry 2006-09-01 02:58:33 +00:00
parent 78e13c37f4
commit c1e5842565
5 changed files with 35 additions and 13 deletions

View File

@ -468,17 +468,6 @@ if conf.CheckHeader ('boost/shared_ptr.hpp', language='CXX') == 0:
libraries['boost'] = conf.Finish ()
conf = env.Configure ()
# jack_port_ensure_monitor available
if conf.CheckFunc('jack_port_ensure_monitor'):
env.Append(CCFLAGS='-DWITH_JACK_PORT_ENSURE_MONITOR')
else:
print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
env = conf.Finish()
#
# Check for liblo

View File

@ -157,9 +157,27 @@ def CheckJackRecomputeLatencies(context):
context.Result(result)
return result
jack_video_frame_offset_test = """
#include <jack/transport.h>
int main(int argc, char** argv)
{
jack_position_t pos;
pos.valid & JackVideoFrameOffset;
return 0;
}
"""
def CheckJackVideoFrameOffset(context):
context.Message('Checking for JackVideoFrameOffset in jack_position_bits_t enum...')
result = context.TryLink(jack_video_frame_offset_test, '.c')
context.Result(result)
return result
conf = Configure(ardour, custom_tests = {
'CheckJackClientOpen' : CheckJackClientOpen,
'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies
'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
})
if conf.CheckJackClientOpen():
@ -168,6 +186,14 @@ if conf.CheckJackClientOpen():
if conf.CheckJackRecomputeLatencies():
ardour.Append(CXXFLAGS="-DHAVE_JACK_RECOMPUTE_LATENCIES")
if conf.CheckJackVideoFrameOffset():
ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
if conf.CheckFunc('jack_port_ensure_monitor'):
env.Append(CCFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
else:
print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
#
# Optional header files
#

View File

@ -137,7 +137,7 @@ class Port : public sigc::trackable {
void ensure_monitor_input (bool yn) {
#ifdef WITH_JACK_PORT_ENSURE_MONITOR
#ifdef HAVE_JACK_PORT_ENSURE_MONITOR
jack_port_ensure_monitor (_port, yn);
#else
jack_port_request_monitor(_port, yn);

View File

@ -167,6 +167,9 @@ AudioEngine::stop ()
bool
AudioEngine::get_sync_offset (jack_nframes_t& offset) const
{
#ifdef HAVE_JACK_VIDEO_SUPPORT
jack_position_t pos;
(void) jack_transport_query (_jack, &pos);
@ -176,6 +179,8 @@ AudioEngine::get_sync_offset (jack_nframes_t& offset) const
return true;
}
#endif
return false;
}

View File

@ -428,9 +428,11 @@ Session::jack_timebase_callback (jack_transport_state_t state,
pos->valid = jack_position_bits_t (pos->valid | JackPositionBBT);
}
#ifdef HAVE_JACK_VIDEO_SUPPORT
//poke audio video ratio so Ardour can track Video Sync
pos->audio_frames_per_video_frame = frame_rate() / smpte_frames_per_second;
pos->valid = jack_position_bits_t (pos->valid | JackAudioVideoRatio);
#endif
#if 0
/* SMPTE info */