- default to /dev/audio for the audio device, but allow other
devices to be used as well - add jack output. these patches are back ported from hydrogen subversion. discussed with MAINTAINER
This commit is contained in:
parent
e48bbfab1c
commit
756b4a6473
@ -1,8 +1,8 @@
|
||||
# $OpenBSD: Makefile,v 1.5 2007/09/18 18:30:35 mgrimm Exp $
|
||||
# $OpenBSD: Makefile,v 1.6 2008/03/24 03:09:42 jakemsr Exp $
|
||||
|
||||
COMMENT= software drum machine
|
||||
DISTNAME= hydrogen-0.9.3
|
||||
PKGNAME= ${DISTNAME}p2
|
||||
PKGNAME= ${DISTNAME}p3
|
||||
CATEGORIES= audio
|
||||
HOMEPAGE= http://www.hydrogen-music.org/
|
||||
MAINTAINER= Alexander Yurchenko <grange@openbsd.org>
|
||||
@ -18,12 +18,14 @@ WANTLIB= c m ogg ossaudio pthread stdc++ X11 Xext
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=hydrogen/}
|
||||
|
||||
LIB_DEPENDS= sndfile.>=1::audio/libsndfile \
|
||||
FLAC.>=8,FLAC++.>=7::audio/flac
|
||||
FLAC.>=8,FLAC++.>=7::audio/flac \
|
||||
jack::audio/jack
|
||||
|
||||
USE_X11= Yes
|
||||
MODULES= x11/qt3
|
||||
|
||||
CONFIGURE_STYLE= gnu
|
||||
CONFIGURE_ARGS+= --disable-lrdf-support
|
||||
CONFIGURE_ENV= QTDIR="${MODQT_LIBDIR}" \
|
||||
CPPFLAGS="-I${LOCALBASE}/include" \
|
||||
LDFLAGS="-L${LOCALBASE}/lib"
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-configure,v 1.2 2007/09/18 18:30:35 mgrimm Exp $
|
||||
--- configure.orig Wed Jan 18 23:03:01 2006
|
||||
+++ configure Sun Sep 9 19:10:26 2007
|
||||
$OpenBSD: patch-configure,v 1.3 2008/03/24 03:09:42 jakemsr Exp $
|
||||
--- configure.orig Wed Jan 18 14:03:01 2006
|
||||
+++ configure Fri Feb 29 15:30:23 2008
|
||||
@@ -4583,7 +4583,7 @@ cat >>confdefs.h <<\_ACEOF
|
||||
#define FLAC_SUPPORT 1
|
||||
_ACEOF
|
||||
@ -10,6 +10,15 @@ $OpenBSD: patch-configure,v 1.2 2007/09/18 18:30:35 mgrimm Exp $
|
||||
features_list="${features_list} (FLAC)"
|
||||
fi
|
||||
else
|
||||
@@ -4620,7 +4620,7 @@ if test "${ac_cv_lib_jack_main+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
-LIBS="-ljack $LIBS"
|
||||
+LIBS="-ljack -pthread $LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
@@ -4971,6 +4971,7 @@ cat >>confdefs.h <<\_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
19
audio/hydrogen/patches/patch-data_hydrogen_default_conf
Normal file
19
audio/hydrogen/patches/patch-data_hydrogen_default_conf
Normal file
@ -0,0 +1,19 @@
|
||||
$OpenBSD: patch-data_hydrogen_default_conf,v 1.1 2008/03/24 03:09:42 jakemsr Exp $
|
||||
--- data/hydrogen.default.conf.orig Fri Feb 29 19:07:57 2008
|
||||
+++ data/hydrogen.default.conf Fri Feb 29 19:08:41 2008
|
||||
@@ -17,12 +17,12 @@
|
||||
<samplerate>44100</samplerate>
|
||||
|
||||
<oss_driver>
|
||||
- <ossDevice>/dev/dsp</ossDevice>
|
||||
+ <ossDevice>/dev/audio</ossDevice>
|
||||
</oss_driver>
|
||||
|
||||
<jack_driver>
|
||||
- <jack_port_name_1>alsa_pcm:playback_1</jack_port_name_1>
|
||||
- <jack_port_name_2>alsa_pcm:playback_2</jack_port_name_2>
|
||||
+ <jack_port_name_1>system:playback_1</jack_port_name_1>
|
||||
+ <jack_port_name_2>system:playback_2</jack_port_name_2>
|
||||
<jack_transport_mode>USE_JACK_TRANSPORT</jack_transport_mode>
|
||||
<jack_connect_defaults>true</jack_connect_defaults>
|
||||
<jack_track_outs>false</jack_track_outs>
|
111
audio/hydrogen/patches/patch-src_lib_Hydrogen_cpp
Normal file
111
audio/hydrogen/patches/patch-src_lib_Hydrogen_cpp
Normal file
@ -0,0 +1,111 @@
|
||||
$OpenBSD: patch-src_lib_Hydrogen_cpp,v 1.1 2008/03/24 03:09:42 jakemsr Exp $
|
||||
--- src/lib/Hydrogen.cpp.orig Fri Feb 29 18:26:51 2008
|
||||
+++ src/lib/Hydrogen.cpp Sat Mar 1 00:19:56 2008
|
||||
@@ -511,6 +511,11 @@ inline void audioEngine_process_checkBPMChanged()
|
||||
// update tickSize
|
||||
m_pAudioDriver->m_transport.m_nFrames = fNewFrames;
|
||||
|
||||
+#ifdef JACK_SUPORT
|
||||
+ if ( "JackDriver" == m_pAudioDriver->getClassName() && m_audioEngineState == STATE_PLAYING ) {
|
||||
+ static_cast< JackDriver* >( m_pAudioDriver )->calculateFrameOffset();
|
||||
+ }
|
||||
+#endif
|
||||
fTickNumber = (float)m_pAudioDriver->m_transport.m_nFrames / (float)m_pAudioDriver->m_transport.m_nTickSize;
|
||||
// hydrogenInstance->infoLog("[audioEngine_process_checkBPMChanged] New tick number: " + toString( fTickNumber ) );
|
||||
|
||||
@@ -1789,10 +1794,6 @@ GenericDriver* createDriver(const std::string& sDriver
|
||||
}
|
||||
else {
|
||||
#ifdef JACK_SUPPORT
|
||||
- // set use track outputs flag
|
||||
- m_bUseTrackOuts = pPref->m_bJackTrackOuts;
|
||||
- ((JackDriver *) pDriver)->setTrackOuts( m_bUseTrackOuts );
|
||||
-
|
||||
m_bUseDefaultOuts = pPref->m_bJackConnectDefaults;
|
||||
((JackDriver *) pDriver)->setConnectDefaults( m_bUseDefaultOuts );
|
||||
#endif
|
||||
@@ -1923,7 +1924,7 @@ void audioEngine_startAudioDrivers() {
|
||||
m_pAudioDriver->setBpm( m_pSong->m_fBPM );
|
||||
}
|
||||
|
||||
- audioEngine_unlock(); // test...
|
||||
+ // audioEngine_unlock(); // test...
|
||||
|
||||
if ( m_pAudioDriver ) {
|
||||
int res = m_pAudioDriver->connect();
|
||||
@@ -1946,15 +1947,6 @@ void audioEngine_startAudioDrivers() {
|
||||
hydrogenInstance->errorLog( "[audioEngine_startAudioDrivers] m_pMainBuffer_R == NULL" );
|
||||
}
|
||||
|
||||
-#ifdef JACK_SUPPORT
|
||||
- if (m_bUseTrackOuts) {
|
||||
- for (unsigned i = 0; i < MAX_INSTRUMENTS; ++i) {
|
||||
- m_pTrackBuffers_L[i] = ((JackDriver*)m_pAudioDriver)->getTrackOut_L(i);
|
||||
- m_pTrackBuffers_R[i] = ((JackDriver*)m_pAudioDriver)->getTrackOut_R(i);
|
||||
- }
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
audioEngine_setupLadspaFX( m_pAudioDriver->getBufferSize() );
|
||||
}
|
||||
|
||||
@@ -1966,6 +1958,8 @@ void audioEngine_startAudioDrivers() {
|
||||
else if ( m_audioEngineState == STATE_READY ) {
|
||||
EventQueue::getInstance()->pushEvent( EVENT_STATE, STATE_READY );
|
||||
}
|
||||
+
|
||||
+ audioEngine_unlock(); // Unlocking earlier might execute he jack process() callback before we are fully initialized.
|
||||
}
|
||||
|
||||
|
||||
@@ -2568,21 +2562,20 @@ unsigned long Hydrogen::getTotalFrames()
|
||||
}
|
||||
|
||||
|
||||
-
|
||||
-/// Set the position in the song
|
||||
-void Hydrogen::setPatternPos( int pos )
|
||||
+long Hydrogen::getTickForPosition( int pos )
|
||||
{
|
||||
- audioEngine_lock( "Hydrogen::setPatternPos" );
|
||||
-
|
||||
int nPatternGroups = (m_pSong->getPatternGroupVector())->size();
|
||||
if ( pos >= nPatternGroups ) {
|
||||
- hydrogenInstance->warningLog( "[Hydrogen::setPatternPos()] patternPos > nPatternGroups. pos: " + toString(pos) + ", nPatternGroups: " + toString(nPatternGroups) );
|
||||
- audioEngine_unlock();
|
||||
- return;
|
||||
+ if (m_pSong->isLoopEnabled() ) {
|
||||
+ pos = pos % nPatternGroups;
|
||||
+ } else {
|
||||
+ hydrogenInstance->warningLog( "[Hydrogen::setPatternPos()] patternPos > nPatternGroups. pos: " + toString(pos) + ", nPatternGroups: " + toString(nPatternGroups) );
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
|
||||
vector<PatternList*> *pColumns = m_pSong->getPatternGroupVector();
|
||||
- int totalTick = 0;
|
||||
+ long totalTick = 0;
|
||||
int nPatternSize;
|
||||
Pattern *pPattern = NULL;
|
||||
for ( int i = 0; i < pos; ++i ) {
|
||||
@@ -2596,6 +2589,20 @@ void Hydrogen::setPatternPos( int pos )
|
||||
}
|
||||
|
||||
totalTick += nPatternSize;
|
||||
+ }
|
||||
+ return totalTick;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/// Set the position in the song
|
||||
+void Hydrogen::setPatternPos( int pos )
|
||||
+{
|
||||
+ audioEngine_lock( "Hydrogen::setPatternPos" );
|
||||
+
|
||||
+ long totalTick = getTickForPosition (pos );
|
||||
+ if ( totalTick < 0 ) {
|
||||
+ audioEngine_unlock();
|
||||
+ return;
|
||||
}
|
||||
|
||||
if (getState() != STATE_PLAYING) {
|
11
audio/hydrogen/patches/patch-src_lib_Hydrogen_h
Normal file
11
audio/hydrogen/patches/patch-src_lib_Hydrogen_h
Normal file
@ -0,0 +1,11 @@
|
||||
$OpenBSD: patch-src_lib_Hydrogen_h,v 1.1 2008/03/24 03:09:42 jakemsr Exp $
|
||||
--- src/lib/Hydrogen.h.orig Sat Mar 1 01:24:50 2008
|
||||
+++ src/lib/Hydrogen.h Sat Mar 1 01:25:46 2008
|
||||
@@ -119,6 +119,7 @@ class Hydrogen : public Object
|
||||
void raiseError(unsigned nErrorCode);
|
||||
|
||||
unsigned long getTotalFrames();
|
||||
+ long getTickForPosition( int pos );
|
||||
|
||||
void previewSample( Sample *pSample );
|
||||
|
11
audio/hydrogen/patches/patch-src_lib_Preferences_cpp
Normal file
11
audio/hydrogen/patches/patch-src_lib_Preferences_cpp
Normal file
@ -0,0 +1,11 @@
|
||||
$OpenBSD: patch-src_lib_Preferences_cpp,v 1.1 2008/03/24 03:09:42 jakemsr Exp $
|
||||
--- src/lib/Preferences.cpp.orig Sat Mar 1 00:41:22 2008
|
||||
+++ src/lib/Preferences.cpp Sat Mar 1 00:44:00 2008
|
||||
@@ -82,6 +82,7 @@ Preferences::Preferences()
|
||||
m_ladspaPathVect.push_back( "/usr/lib/ladspa" );
|
||||
m_ladspaPathVect.push_back( string( CONFIG_PREFIX ).append( "/lib/hydrogen/plugins" ) );
|
||||
m_ladspaPathVect.push_back( "/usr/local/lib/ladspa" );
|
||||
+ m_ladspaPathVect.push_back( string( CONFIG_PREFIX ).append( "/lib/ladspa" ) );
|
||||
}
|
||||
|
||||
m_pDefaultUIStyle = new UIStyle();
|
229
audio/hydrogen/patches/patch-src_lib_drivers_JackDriver_cpp
Normal file
229
audio/hydrogen/patches/patch-src_lib_drivers_JackDriver_cpp
Normal file
@ -0,0 +1,229 @@
|
||||
$OpenBSD: patch-src_lib_drivers_JackDriver_cpp,v 1.1 2008/03/24 03:09:42 jakemsr Exp $
|
||||
--- src/lib/drivers/JackDriver.cpp.orig Fri Feb 29 17:46:02 2008
|
||||
+++ src/lib/drivers/JackDriver.cpp Sat Mar 1 00:21:04 2008
|
||||
@@ -59,8 +59,10 @@ JackDriver::JackDriver(JackProcessCallback processCall
|
||||
{
|
||||
infoLog( "INIT" );
|
||||
jackDriverInstance = this;
|
||||
- track_out_flag = true;
|
||||
this->processCallback = processCallback;
|
||||
+
|
||||
+ must_relocate = 0;
|
||||
+ bbt_frame_offset = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,14 +96,25 @@ int JackDriver::connect()
|
||||
|
||||
if ( connect_out_flag ) {
|
||||
// connect the ports
|
||||
- if ( jack_connect ( client, jack_port_name( output_port_1 ), output_port_name_1.c_str() ) ) {
|
||||
- ( Hydrogen::getInstance() )->raiseError( Hydrogen::JACK_CANNOT_CONNECT_OUTPUT_PORT );
|
||||
+ if ( jack_connect ( client, jack_port_name( output_port_1 ), output_port_name_1.c_str() ) == 0 &&
|
||||
+ jack_connect ( client, jack_port_name( output_port_2 ), output_port_name_2.c_str() ) == 0 ) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ infoLog("Could not connect to saved out-ports. Connecting to first pair of in-ports");
|
||||
+ const char ** portnames = jack_get_ports ( client, NULL, NULL, JackPortIsInput );
|
||||
+ if ( !portnames || !portnames[0] || !portnames[1] ) {
|
||||
+ errorLog( "Couldn't locate two Jack input ports" );
|
||||
+ Hydrogen::getInstance()->raiseError( Hydrogen::JACK_CANNOT_CONNECT_OUTPUT_PORT );
|
||||
return 2;
|
||||
}
|
||||
- if ( jack_connect ( client, jack_port_name( output_port_2 ), output_port_name_2.c_str() ) ) {
|
||||
- ( Hydrogen::getInstance() )->raiseError( Hydrogen::JACK_CANNOT_CONNECT_OUTPUT_PORT );
|
||||
+ if ( jack_connect ( client, jack_port_name( output_port_1 ), portnames[0] ) != 0 ||
|
||||
+ jack_connect ( client, jack_port_name( output_port_2 ), portnames[1] ) != 0 ) {
|
||||
+ errorLog( "Couldn't connect to first pair of Jack input ports" );
|
||||
+ Hydrogen::getInstance()->raiseError( Hydrogen::JACK_CANNOT_CONNECT_OUTPUT_PORT );
|
||||
return 2;
|
||||
}
|
||||
+ free( portnames );
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -159,9 +172,61 @@ unsigned JackDriver::getSampleRate()
|
||||
return jack_server_sampleRate;
|
||||
}
|
||||
|
||||
+void JackDriver::calculateFrameOffset()
|
||||
+{
|
||||
+ bbt_frame_offset = m_JackTransportPos.frame - m_transport.m_nFrames;
|
||||
+}
|
||||
|
||||
|
||||
|
||||
+/// Take beat-bar-tick info from the Jack system, and translate it to a new internal frame position and ticksize.
|
||||
+void JackDriver::relocateBBT()
|
||||
+{
|
||||
+ if ( m_transport.m_status != TransportInfo::ROLLING || !( m_JackTransportPos.valid & JackPositionBBT ) /**the last check is *probably* redundant*/ ) return;
|
||||
+
|
||||
+ Hydrogen * H = Hydrogen::getInstance();
|
||||
+ Song * S = H->getSong();
|
||||
+
|
||||
+ float hydrogen_TPB = ( float )S->m_nResolution;
|
||||
+
|
||||
+ long bar_ticks = 0;
|
||||
+ if ( S->getMode() == Song::SONG_MODE ) {
|
||||
+ bar_ticks = H->getTickForPosition( m_JackTransportPos.bar ); // (Reasonable?) assumption that one pattern is _always_ 1 bar long!
|
||||
+ if ( bar_ticks < 0 ) bar_ticks = 0; // ignore error NOTE This is wrong -- if loop state is off, transport should just stop ??
|
||||
+ }
|
||||
+ float hydrogen_ticks_to_locate = bar_ticks + ( m_JackTransportPos.beat-1 )*hydrogen_TPB + m_JackTransportPos.tick*( hydrogen_TPB/m_JackTransportPos.ticks_per_beat );
|
||||
+
|
||||
+ // char bbt[15];
|
||||
+ // sprintf( bbt, "[%d,%d,%d]", m_JackTransportPos.bar, m_JackTransportPos.beat, m_JackTransportPos.tick );
|
||||
+ string bbt;
|
||||
+ bbt = "[" + toString(m_JackTransportPos.bar) +
|
||||
+ "," + toString(m_JackTransportPos.beat) +
|
||||
+ "," + toString(m_JackTransportPos.tick) + "]";
|
||||
+ warningLog( "Locating BBT: " + bbt + /*" -- Tx/Beat = "+toString(m_JackTransportPos.ticks_per_beat)+", Meter "+toString(m_JackTransportPos.beats_per_bar)+"/"+toString(m_JackTransportPos.beat_type)+*/" =>tick " + toString( hydrogen_ticks_to_locate ) );
|
||||
+
|
||||
+ float fNewTickSize = getSampleRate() * 60.0 / m_transport.m_nBPM / S->m_nResolution;;
|
||||
+ // not S->m_fBPM !??
|
||||
+
|
||||
+ if ( fNewTickSize == 0 ) return; // ??!?
|
||||
+
|
||||
+ // NOTE this _should_ prevent audioEngine_process_checkBPMChanged in Hydrogen.cpp from recalculating things.
|
||||
+ m_transport.m_nTickSize = fNewTickSize;
|
||||
+
|
||||
+ long long nNewFrames = ( long long )( hydrogen_ticks_to_locate * fNewTickSize );
|
||||
+ if ( m_JackTransportPos.valid & JackBBTFrameOffset )
|
||||
+ nNewFrames += m_JackTransportPos.bbt_offset;
|
||||
+ m_transport.m_nFrames = nNewFrames;
|
||||
+
|
||||
+ /// offset between jack- and internal position
|
||||
+ calculateFrameOffset();
|
||||
+
|
||||
+}
|
||||
+
|
||||
+///
|
||||
+/// When jack_transport_start() is called, it takes effect from the next processing cycle.
|
||||
+/// The location info from the timebase_master, if there is one, will not be available until the _next_ next cycle.
|
||||
+/// The code must therefore wait one cycle before syncing up with timebase_master.
|
||||
+///
|
||||
void JackDriver::updateTransportInfo()
|
||||
{
|
||||
if (Preferences::getInstance()->m_bJackTransportMode == Preferences::USE_JACK_TRANSPORT) {
|
||||
@@ -175,6 +240,10 @@ void JackDriver::updateTransportInfo()
|
||||
break;
|
||||
|
||||
case JackTransportRolling:
|
||||
+ if ( m_transport.m_status != TransportInfo::ROLLING && ( m_JackTransportPos.valid & JackPositionBBT ) ) {
|
||||
+ must_relocate = 2;
|
||||
+ warningLog( "Jack transport starting: Resyncing in 2 x Buffersize!!" );
|
||||
+ }
|
||||
m_transport.m_status = TransportInfo::ROLLING;
|
||||
//infoLog( "[updateTransportInfo] ROLLING - frames: " + toString(m_transportPos.frame) );
|
||||
break;
|
||||
@@ -189,22 +258,37 @@ void JackDriver::updateTransportInfo()
|
||||
}
|
||||
|
||||
|
||||
-/*
|
||||
// FIXME
|
||||
// TickSize and BPM
|
||||
if ( m_JackTransportPos.valid & JackPositionBBT ) {
|
||||
- if ( m_transport.m_nBPM != m_JackTransportPos.beats_per_minute ) {
|
||||
- m_transport.m_nBPM = m_JackTransportPos.beats_per_minute;
|
||||
- (Hydrogen::getInstance())->getSong()->m_fBPM = m_JackTransportPos.beats_per_minute;
|
||||
- warningLog( "[updateTransportInfo] new BPM from jack-transport: " + toString(m_JackTransportPos.beats_per_minute) );
|
||||
+ float bpm = ( float )m_JackTransportPos.beats_per_minute;
|
||||
+ if ( m_transport.m_nBPM != bpm ) {
|
||||
+
|
||||
+ warningLog( "Tempo change from jack-transport: " + toString( bpm ) );
|
||||
+
|
||||
+ m_transport.m_nBPM = bpm;
|
||||
+
|
||||
+ must_relocate = 1; // The tempo change has happened somewhere during the previous cycle; relocate right away.
|
||||
+
|
||||
+ // Hydrogen::getInstance()->setBPM( m_JackTransportPos.beats_per_minute ); // unnecessary, as Song->m_BPM gets updated in audioEngine_process_transport (after calling this function)
|
||||
}
|
||||
}
|
||||
-*/
|
||||
|
||||
- if ( m_transport.m_nFrames != m_JackTransportPos.frame ) {
|
||||
- m_transport.m_nFrames = m_JackTransportPos.frame;
|
||||
- warningLog( "[updateTransportInfo] internal frames != jack transport frames. resync!" );
|
||||
+ if ( m_transport.m_nFrames + bbt_frame_offset != m_JackTransportPos.frame ) {
|
||||
+ if ( ( m_JackTransportPos.valid & JackPositionBBT ) && must_relocate == 0 ) {
|
||||
+ warningLog( "Frame offset mismatch; triggering resync in 2 cycles" );
|
||||
+ must_relocate = 2;
|
||||
+ } else { // NOTE There's no timebase_master. If audioEngine_process_checkBPMChanged handled a tempo change during last cycle, the offset doesn't match.
|
||||
+ m_transport.m_nFrames = m_JackTransportPos.frame - bbt_frame_offset;
|
||||
+// bbt_frame_offset = 0;
|
||||
+ }
|
||||
}
|
||||
+ if ( must_relocate == 1 ) {
|
||||
+ warningLog( "Resyncing!" );
|
||||
+ relocateBBT();
|
||||
+ }
|
||||
+
|
||||
+ if ( must_relocate > 0 ) must_relocate--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +326,11 @@ int JackDriver::init(unsigned nBufferSize)
|
||||
output_port_name_1 = Preferences::getInstance()->m_sJackPortName1;
|
||||
output_port_name_2 = Preferences::getInstance()->m_sJackPortName2;
|
||||
|
||||
+ if ( ( client = jack_client_open( "hydrogen", JackNullOption, NULL ) ) == NULL ) {
|
||||
+ warningLog( "Error: can't start JACK server" );
|
||||
+ return 3;
|
||||
+ }
|
||||
+
|
||||
// check if another hydrogen instance is connected to jack
|
||||
if ( (client = jack_client_new( "hydrogen-tmp" ) ) == 0 ) {
|
||||
warningLog("Jack server not running?");
|
||||
@@ -256,7 +345,7 @@ int JackDriver::init(unsigned nBufferSize)
|
||||
int nColonPos = sPort.find( ":" );
|
||||
string sClient = sPort.substr( 0, nColonPos );
|
||||
bool bClientExist = false;
|
||||
- for ( int j = 0; j < clientList.size(); j++ ) {
|
||||
+ for ( int j = 0; j < (int)clientList.size(); j++ ) {
|
||||
if ( sClient == clientList[ j ] ) {
|
||||
bClientExist = true;
|
||||
break;
|
||||
@@ -267,6 +356,7 @@ int JackDriver::init(unsigned nBufferSize)
|
||||
}
|
||||
nPort++;
|
||||
}
|
||||
+ free(readports);
|
||||
jack_client_close( client );
|
||||
|
||||
string sClientName = "";
|
||||
@@ -275,7 +365,7 @@ int JackDriver::init(unsigned nBufferSize)
|
||||
// sprintf( clientName, "Hydrogen-%d", getpid() );
|
||||
sClientName = "Hydrogen-" + toString( nInstance );
|
||||
bool bExist = false;
|
||||
- for ( int i = 0; i < clientList.size(); i++ ) {
|
||||
+ for ( int i = 0; i < (int)clientList.size(); i++ ) {
|
||||
if ( sClientName == clientList[ i ] ){
|
||||
bExist = true;
|
||||
break;
|
||||
@@ -325,25 +415,6 @@ int JackDriver::init(unsigned nBufferSize)
|
||||
return 4;
|
||||
}
|
||||
|
||||
-
|
||||
- /* create MAX_INSTRUMENTS dedicated channel output ports */
|
||||
- if (track_out_flag) {
|
||||
- char tmpbuf[255];
|
||||
-
|
||||
- for (unsigned int n=0; n < MAX_INSTRUMENTS; ++n) {
|
||||
- snprintf (tmpbuf, sizeof(tmpbuf), "track_out_%d_L", n+1);
|
||||
- track_output_ports_L[n] = jack_port_register ( client, tmpbuf, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 );
|
||||
- if (track_output_ports_L[n] == NULL) {
|
||||
- ( Hydrogen::getInstance() )->raiseError( Hydrogen::JACK_ERROR_IN_PORT_REGISTER );
|
||||
- }
|
||||
-
|
||||
- snprintf (tmpbuf, sizeof(tmpbuf), "track_out_%d_R", n+1);
|
||||
- track_output_ports_R[n] = jack_port_register ( client, tmpbuf, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 );
|
||||
- if (track_output_ports_R[n] == NULL) {
|
||||
- ( Hydrogen::getInstance() )->raiseError( Hydrogen::JACK_ERROR_IN_PORT_REGISTER );
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
|
||||
// clear buffers
|
||||
// jack_default_audio_sample_t *out_L = (jack_default_audio_sample_t *) jack_port_get_buffer (output_port_1, jack_server_bufferSize);
|
41
audio/hydrogen/patches/patch-src_lib_drivers_JackDriver_h
Normal file
41
audio/hydrogen/patches/patch-src_lib_drivers_JackDriver_h
Normal file
@ -0,0 +1,41 @@
|
||||
$OpenBSD: patch-src_lib_drivers_JackDriver_h,v 1.1 2008/03/24 03:09:42 jakemsr Exp $
|
||||
--- src/lib/drivers/JackDriver.h.orig Fri Feb 29 18:19:39 2008
|
||||
+++ src/lib/drivers/JackDriver.h Sat Mar 1 00:07:56 2008
|
||||
@@ -36,7 +36,8 @@
|
||||
#include <jack/jack.h>
|
||||
#include <jack/transport.h>
|
||||
|
||||
-#include "../Globals.h"\
|
||||
+#include "../Globals.h"
|
||||
+#include "lib/Hydrogen.h"
|
||||
|
||||
///
|
||||
/// Jack (Jack Audio Connection Kit) server driver
|
||||
@@ -59,7 +60,6 @@ class JackDriver : public GenericDriver
|
||||
|
||||
unsigned getSampleRate();
|
||||
|
||||
-
|
||||
jack_transport_state_t getTransportState() { return m_JackTransportState; }
|
||||
jack_position_t getTransportPos() { return m_JackTransportPos; }
|
||||
|
||||
@@ -81,13 +81,19 @@ class JackDriver : public GenericDriver
|
||||
virtual void locate( unsigned long nFrame );
|
||||
virtual void updateTransportInfo();
|
||||
virtual void setBpm(float fBPM);
|
||||
+ void calculateFrameOffset();
|
||||
|
||||
private:
|
||||
+ void relocateBBT();
|
||||
+ long long bbt_frame_offset;
|
||||
+ int must_relocate;
|
||||
+
|
||||
JackProcessCallback processCallback;
|
||||
jack_port_t *output_port_1;
|
||||
jack_port_t *output_port_2;
|
||||
string output_port_name_1;
|
||||
string output_port_name_2;
|
||||
+ int track_port_count;
|
||||
jack_port_t *track_output_ports_L[MAX_INSTRUMENTS];
|
||||
jack_port_t *track_output_ports_R[MAX_INSTRUMENTS];
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-src_lib_drivers_OssDriver_cpp,v 1.2 2007/05/02 17:51:16 grange Exp $
|
||||
--- src/lib/drivers/OssDriver.cpp.orig Tue Oct 18 02:32:04 2005
|
||||
+++ src/lib/drivers/OssDriver.cpp Wed May 2 21:36:46 2007
|
||||
$OpenBSD: patch-src_lib_drivers_OssDriver_cpp,v 1.3 2008/03/24 03:09:42 jakemsr Exp $
|
||||
--- src/lib/drivers/OssDriver.cpp.orig Mon Oct 17 15:32:04 2005
|
||||
+++ src/lib/drivers/OssDriver.cpp Sat Mar 1 00:48:07 2008
|
||||
@@ -41,6 +41,7 @@ unsigned nNextFrames = 0;
|
||||
|
||||
void* ossDriver_processCaller(void* param)
|
||||
@ -22,7 +22,7 @@ $OpenBSD: patch-src_lib_drivers_OssDriver_cpp,v 1.2 2007/05/02 17:51:16 grange E
|
||||
|
||||
string audioDevice;
|
||||
-#ifdef __NetBSD__
|
||||
+#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
+#if defined(__NetBSD__)
|
||||
audioDevice = "/dev/audio";
|
||||
#else
|
||||
audioDevice = preferencesMng->m_sOSSDevice;
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-src_lib_fx_LadspaFX_cpp,v 1.2 2007/05/02 17:51:16 grange Exp $
|
||||
--- src/lib/fx/LadspaFX.cpp.orig Wed Nov 23 01:57:34 2005
|
||||
+++ src/lib/fx/LadspaFX.cpp Wed May 2 21:23:27 2007
|
||||
$OpenBSD: patch-src_lib_fx_LadspaFX_cpp,v 1.3 2008/03/24 03:09:42 jakemsr Exp $
|
||||
--- src/lib/fx/LadspaFX.cpp.orig Tue Nov 22 14:57:34 2005
|
||||
+++ src/lib/fx/LadspaFX.cpp Sat Mar 1 00:55:49 2008
|
||||
@@ -449,7 +449,7 @@ vector<LadspaFXInfo*> LadspaFX::getPluginList()
|
||||
QDir dir( QString( sPluginDir.c_str() ) );
|
||||
if (!dir.exists()) {
|
||||
@ -10,3 +10,12 @@ $OpenBSD: patch-src_lib_fx_LadspaFX_cpp,v 1.2 2007/05/02 17:51:16 grange Exp $
|
||||
}
|
||||
|
||||
Logger::getInstance()->log( "[LadspaFX::getPluginList] reading directory: " + sPluginDir );
|
||||
@@ -592,7 +592,7 @@ void LadspaFX::getRDF(LadspaFXGroup *pGroup, vector<La
|
||||
{
|
||||
lrdf_init();
|
||||
|
||||
- string sDir = "/usr/share/ladspa/rdf";
|
||||
+ string sDir = string(CONFIG_PREFIX) + "/share/ladspa/rdf";
|
||||
|
||||
QDir dir( QString( sDir.c_str() ) );
|
||||
if (!dir.exists()) {
|
||||
|
Loading…
Reference in New Issue
Block a user