added ability to specify jack device name created by darkice,
thanks to Alessandro Baretta <alessandro.baretta@radiomaria.org> re #24
This commit is contained in:
parent
d82cd56ffa
commit
aa27bf95c0
|
@ -33,4 +33,5 @@ with contributions by:
|
||||||
Elod Horvath <elod@itfais.com>
|
Elod Horvath <elod@itfais.com>
|
||||||
Pierre Souchay <pierre@souchay.net>
|
Pierre Souchay <pierre@souchay.net>
|
||||||
Daniel Hazelbaker <daniel@highdesertchurch.com>
|
Daniel Hazelbaker <daniel@highdesertchurch.com>
|
||||||
|
Alessandro Beretta <alessandro.baretta@radiomaria.org>
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ Darkice 0.19 to be released
|
||||||
thanks to Pierre Souchay <pierre@souchay.net>
|
thanks to Pierre Souchay <pierre@souchay.net>
|
||||||
o enable easier finding of jack libraries on MacOS X,
|
o enable easier finding of jack libraries on MacOS X,
|
||||||
thanks to Daniel Hazelbaker <daniel@highdesertchurch.com>
|
thanks to Daniel Hazelbaker <daniel@highdesertchurch.com>
|
||||||
|
o added ability to specify name of jack device created by darkice,
|
||||||
|
thanks to Alessandro Beretta <alessandro.baretta@radiomaria.org>
|
||||||
|
|
||||||
26-04-2007 DarkIce 0.18.1 released
|
26-04-2007 DarkIce 0.18.1 released
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,7 @@ Developed with contributions by
|
||||||
Elod Horvath <elod@itfais.com>
|
Elod Horvath <elod@itfais.com>
|
||||||
Pierre Souchay <pierre@souchay.net>
|
Pierre Souchay <pierre@souchay.net>
|
||||||
Daniel Hazelbaker <daniel@highdesertchurch.com>
|
Daniel Hazelbaker <daniel@highdesertchurch.com>
|
||||||
|
Alessandro Beretta <alessandro.baretta@radiomaria.org>
|
||||||
|
|
||||||
.SH LINKS
|
.SH LINKS
|
||||||
Project homepage:
|
Project homepage:
|
||||||
|
|
|
@ -90,6 +90,10 @@ Number of bits to use for each sample (e.g. 8 bits or 16 bits)
|
||||||
.TP
|
.TP
|
||||||
.I channel
|
.I channel
|
||||||
Number of channels to record (e.g. 1 for mono, 2 for stereo)
|
Number of channels to record (e.g. 1 for mono, 2 for stereo)
|
||||||
|
.TP
|
||||||
|
.I jackClientName
|
||||||
|
The name of the jack input channel created by darkice if device=jack
|
||||||
|
is specified.
|
||||||
|
|
||||||
.PP
|
.PP
|
||||||
.B [icecast-x]
|
.B [icecast-x]
|
||||||
|
|
|
@ -60,6 +60,7 @@ static const char fileid[] = "$Id$";
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
AudioSource *
|
AudioSource *
|
||||||
AudioSource :: createDspSource( const char * deviceName,
|
AudioSource :: createDspSource( const char * deviceName,
|
||||||
|
const char * jackClientName,
|
||||||
int sampleRate,
|
int sampleRate,
|
||||||
int bitsPerSample,
|
int bitsPerSample,
|
||||||
int channel)
|
int channel)
|
||||||
|
@ -101,6 +102,7 @@ AudioSource :: createDspSource( const char * deviceName,
|
||||||
#if defined( SUPPORT_JACK_DSP )
|
#if defined( SUPPORT_JACK_DSP )
|
||||||
Reporter::reportEvent( 1, "Using JACK audio server as input device.");
|
Reporter::reportEvent( 1, "Using JACK audio server as input device.");
|
||||||
return new JackDspSource( deviceName,
|
return new JackDspSource( deviceName,
|
||||||
|
jackClientName,
|
||||||
sampleRate,
|
sampleRate,
|
||||||
bitsPerSample,
|
bitsPerSample,
|
||||||
channel);
|
channel);
|
||||||
|
|
|
@ -272,6 +272,7 @@ class AudioSource : public Source, public virtual Reporter
|
||||||
*/
|
*/
|
||||||
static AudioSource *
|
static AudioSource *
|
||||||
createDspSource( const char * deviceName,
|
createDspSource( const char * deviceName,
|
||||||
|
const char * jackClientName,
|
||||||
int sampleRate = 44100,
|
int sampleRate = 44100,
|
||||||
int bitsPerSample = 16,
|
int bitsPerSample = 16,
|
||||||
int channel = 2) throw ( Exception );
|
int channel = 2) throw ( Exception );
|
||||||
|
|
|
@ -139,6 +139,7 @@ DarkIce :: init ( const Config & config ) throw ( Exception )
|
||||||
unsigned int channel;
|
unsigned int channel;
|
||||||
bool reconnect;
|
bool reconnect;
|
||||||
const char * device;
|
const char * device;
|
||||||
|
const char * jackClientName;
|
||||||
|
|
||||||
// the [general] section
|
// the [general] section
|
||||||
if ( !(cs = config.get( "general")) ) {
|
if ( !(cs = config.get( "general")) ) {
|
||||||
|
@ -172,8 +173,10 @@ DarkIce :: init ( const Config & config ) throw ( Exception )
|
||||||
str = cs->getForSure( "channel", " missing in section [input]");
|
str = cs->getForSure( "channel", " missing in section [input]");
|
||||||
channel = Util::strToL( str);
|
channel = Util::strToL( str);
|
||||||
device = cs->getForSure( "device", " missing in section [input]");
|
device = cs->getForSure( "device", " missing in section [input]");
|
||||||
|
jackClientName = cs->get ( "jackClientName");
|
||||||
|
|
||||||
dsp = AudioSource::createDspSource( device,
|
dsp = AudioSource::createDspSource( device,
|
||||||
|
jackClientName,
|
||||||
sampleRate,
|
sampleRate,
|
||||||
bitsPerSample,
|
bitsPerSample,
|
||||||
channel );
|
channel );
|
||||||
|
|
|
@ -188,7 +188,12 @@ JackDspSource :: open ( void ) throw ( Exception )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register client with Jack
|
// Register client with Jack
|
||||||
snprintf(client_name, 255, "darkice-%d", getpid());
|
if ( jack_client_name != NULL ) {
|
||||||
|
snprintf(client_name, 255, "%s", jack_client_name);
|
||||||
|
} else {
|
||||||
|
snprintf(client_name, 255, "darkice-%d", getpid());
|
||||||
|
}
|
||||||
|
|
||||||
if ((client = jack_client_new(client_name)) == NULL) {
|
if ((client = jack_client_new(client_name)) == NULL) {
|
||||||
throw Exception( __FILE__, __LINE__, "JACK server not running?");
|
throw Exception( __FILE__, __LINE__, "JACK server not running?");
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,10 @@
|
||||||
class JackDspSource : public AudioSource, public virtual Reporter
|
class JackDspSource : public AudioSource, public virtual Reporter
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
/**
|
||||||
|
* The jack client name.
|
||||||
|
*/
|
||||||
|
const char * jack_client_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The jack port
|
* The jack port
|
||||||
|
@ -156,6 +160,7 @@ class JackDspSource : public AudioSource, public virtual Reporter
|
||||||
*/
|
*/
|
||||||
inline
|
inline
|
||||||
JackDspSource ( const char * name,
|
JackDspSource ( const char * name,
|
||||||
|
const char * jackClientName,
|
||||||
int sampleRate = 44100,
|
int sampleRate = 44100,
|
||||||
int bitsPerSample = 16,
|
int bitsPerSample = 16,
|
||||||
int channels = 2 )
|
int channels = 2 )
|
||||||
|
@ -163,6 +168,7 @@ class JackDspSource : public AudioSource, public virtual Reporter
|
||||||
|
|
||||||
: AudioSource( sampleRate, bitsPerSample, channels )
|
: AudioSource( sampleRate, bitsPerSample, channels )
|
||||||
{
|
{
|
||||||
|
jack_client_name = jackClientName;
|
||||||
init( name );
|
init( name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue