made some description options in the darkice config file optional

This commit is contained in:
darkeye 2001-08-29 21:08:30 +00:00
parent 5bdf95de9f
commit c14d9259c1
6 changed files with 93 additions and 62 deletions

View File

@ -146,6 +146,10 @@ server
.TP .TP
.I mountPoint .I mountPoint
Mount point for the stream on the server Mount point for the stream on the server
.PP
Optional values:
.TP .TP
.I name .I name
Name of the stream Name of the stream
@ -161,10 +165,6 @@ Genre of the stream
.TP .TP
.I public .I public
"yes" or "no", wether the stream is public "yes" or "no", wether the stream is public
.PP
Optional values:
.TP .TP
.I remoteDumpFile .I remoteDumpFile
The file the The file the

View File

@ -57,26 +57,26 @@ void
CastSink :: init ( TcpSocket * socket, CastSink :: init ( TcpSocket * socket,
const char * password, const char * password,
const char * mountPoint, const char * mountPoint,
const char * remoteDumpFile, unsigned int bitRate,
const char * name, const char * name,
const char * description, const char * description,
const char * url, const char * url,
const char * genre, const char * genre,
unsigned int bitRate,
bool isPublic, bool isPublic,
const char * remoteDumpFile,
unsigned int bufferDuration ) unsigned int bufferDuration )
throw ( Exception ) throw ( Exception )
{ {
this->socket = socket; this->socket = socket;
this->password = Util::strDup( password); this->password = Util::strDup( password);
this->mountPoint = Util::strDup( mountPoint); this->mountPoint = Util::strDup( mountPoint);
this->remoteDumpFile = remoteDumpFile ? Util::strDup( remoteDumpFile) : 0;
this->name = Util::strDup( name);
this->description = Util::strDup( description);
this->url = Util::strDup( url);
this->genre = Util::strDup( genre);
this->bitRate = bitRate; this->bitRate = bitRate;
this->name = name ? Util::strDup( name) : 0;
this->description = description ? Util::strDup( description) : 0;
this->url = url ? Util::strDup( url) : 0;
this->genre = genre ? Util::strDup( genre) : 0;
this->isPublic = isPublic; this->isPublic = isPublic;
this->remoteDumpFile = remoteDumpFile ? Util::strDup( remoteDumpFile) : 0;
this->bufferDuration = bufferDuration; this->bufferDuration = bufferDuration;
bufferedSink = new BufferedSink( socket, bufferedSink = new BufferedSink( socket,
@ -97,13 +97,21 @@ CastSink :: strip ( void ) throw ( Exception )
delete[] password; delete[] password;
delete[] mountPoint; delete[] mountPoint;
if ( name ) {
delete[] name;
}
if ( description ) {
delete[] description;
}
if ( url ) {
delete[] url;
}
if ( genre ) {
delete[] genre;
}
if ( remoteDumpFile ) { if ( remoteDumpFile ) {
delete[] remoteDumpFile; delete[] remoteDumpFile;
} }
delete[] name;
delete[] description;
delete[] url;
delete[] genre;
} }
@ -136,6 +144,9 @@ CastSink :: open ( void ) throw ( Exception )
$Source$ $Source$
$Log$ $Log$
Revision 1.4 2001/08/29 21:08:30 darkeye
made some description options in the darkice config file optional
Revision 1.3 2000/11/12 14:54:50 darkeye Revision 1.3 2000/11/12 14:54:50 darkeye
added kdoc-style documentation comments added kdoc-style documentation comments

View File

@ -143,13 +143,13 @@ class CastSink : public Sink
init ( TcpSocket * socket, init ( TcpSocket * socket,
const char * password, const char * password,
const char * mountPoint, const char * mountPoint,
const char * remoteDumpFile, unsigned int bitRate,
const char * name, const char * name,
const char * description, const char * description,
const char * url, const char * url,
const char * genre, const char * genre,
unsigned int bitRate,
bool isPublic, bool isPublic,
const char * remoteDumpFile,
unsigned int bufferDuration ) unsigned int bufferDuration )
throw ( Exception ); throw ( Exception );
@ -230,26 +230,26 @@ class CastSink : public Sink
CastSink ( TcpSocket * socket, CastSink ( TcpSocket * socket,
const char * password, const char * password,
const char * mountPoint, const char * mountPoint,
const char * remoteDumpFile,
const char * name,
const char * description,
const char * url,
const char * genre,
unsigned int bitRate, unsigned int bitRate,
bool isPublic, const char * name = 0,
const char * description = 0,
const char * url = 0,
const char * genre = 0,
bool isPublic = false,
const char * remoteDumpFile = 0,
unsigned int bufferDuration = 10 ) unsigned int bufferDuration = 10 )
throw ( Exception ) throw ( Exception )
{ {
init( socket, init( socket,
password, password,
mountPoint, mountPoint,
remoteDumpFile, bitRate,
name, name,
description, description,
url, url,
genre, genre,
bitRate,
isPublic, isPublic,
remoteDumpFile,
bufferDuration ); bufferDuration );
} }
@ -265,13 +265,13 @@ class CastSink : public Sink
init( cs.socket.get(), init( cs.socket.get(),
cs.password, cs.password,
cs.mountPoint, cs.mountPoint,
cs.remoteDumpFile, cs.bitRate,
cs.name, cs.name,
cs.description, cs.description,
cs.url, cs.url,
cs.genre, cs.genre,
cs.bitRate,
cs.isPublic, cs.isPublic,
cs.remoteDumpFile,
cs.bufferDuration ); cs.bufferDuration );
} }
@ -302,13 +302,13 @@ class CastSink : public Sink
init( cs.socket.get(), init( cs.socket.get(),
cs.password, cs.password,
cs.mountPoint, cs.mountPoint,
cs.remoteDumpFile, cs.bitRate,
cs.name, cs.name,
cs.description, cs.description,
cs.url, cs.url,
cs.genre, cs.genre,
cs.bitRate,
cs.isPublic, cs.isPublic,
cs.remoteDumpFile,
cs.bufferDuration ); cs.bufferDuration );
} }
return *this; return *this;
@ -516,6 +516,9 @@ class CastSink : public Sink
$Source$ $Source$
$Log$ $Log$
Revision 1.5 2001/08/29 21:08:30 darkeye
made some description options in the darkice config file optional
Revision 1.4 2000/11/12 14:54:50 darkeye Revision 1.4 2000/11/12 14:54:50 darkeye
added kdoc-style documentation comments added kdoc-style documentation comments

View File

@ -200,12 +200,12 @@ DarkIce :: configLameLib ( const Config & config,
password = cs->getForSure( "password", " missing in section ", lame); password = cs->getForSure( "password", " missing in section ", lame);
mountPoint = cs->getForSure( "mountPoint"," missing in section ",lame); mountPoint = cs->getForSure( "mountPoint"," missing in section ",lame);
remoteDumpFile = cs->get( "remoteDumpFile"); remoteDumpFile = cs->get( "remoteDumpFile");
name = cs->getForSure( "name", " missing in section ", lame); name = cs->get( "name");
description = cs->getForSure("description"," missing in section ",lame); description = cs->get("description");
url = cs->getForSure( "url", " missing in section ", lame); url = cs->get( "url");
genre = cs->getForSure( "genre", " missing in section ", lame); genre = cs->get( "genre");
str = cs->getForSure( "public", " missing in section ", lame); str = cs->get( "public");
isPublic = Util::strEq( str, "yes") ? true : false; isPublic = str ? (Util::strEq( str, "yes") ? true : false) : false;
str = cs->get( "lowpass"); str = cs->get( "lowpass");
lowpass = str ? Util::strToL( str) : 0; lowpass = str ? Util::strToL( str) : 0;
str = cs->get( "highpass"); str = cs->get( "highpass");
@ -225,13 +225,13 @@ DarkIce :: configLameLib ( const Config & config,
lameLibOuts[u].ice = new IceCast( lameLibOuts[u].socket.get(), lameLibOuts[u].ice = new IceCast( lameLibOuts[u].socket.get(),
password, password,
mountPoint, mountPoint,
remoteDumpFile, bitrate,
name, name,
description, description,
url, url,
genre, genre,
bitrate, isPublic,
isPublic ); remoteDumpFile );
lameLibOuts[u].encoder = new LameLibEncoder( lameLibOuts[u].ice.get(), lameLibOuts[u].encoder = new LameLibEncoder( lameLibOuts[u].ice.get(),
dsp.get(), dsp.get(),
@ -380,6 +380,9 @@ DarkIce :: run ( void ) throw ( Exception )
$Source$ $Source$
$Log$ $Log$
Revision 1.14 2001/08/29 21:08:30 darkeye
made some description options in the darkice config file optional
Revision 1.13 2001/08/26 20:44:30 darkeye Revision 1.13 2001/08/26 20:44:30 darkeye
removed external command-line encoder support removed external command-line encoder support
replaced it with a shared-object support for lame with the possibility replaced it with a shared-object support for lame with the possibility

View File

@ -120,25 +120,33 @@ IceCast :: sendLogin ( void ) throw ( Exception )
} }
/* send the x-audiocast headers */ /* send the x-audiocast headers */
if ( getName() ) {
str = "x-audiocast-name: "; str = "x-audiocast-name: ";
sink->write( str, strlen( str)); sink->write( str, strlen( str));
str = getName(); str = getName();
sink->write( str, strlen( str)); sink->write( str, strlen( str));
}
if ( getDescription() ) {
str = "\nx-audiocast-description: "; str = "\nx-audiocast-description: ";
sink->write( str, strlen( str)); sink->write( str, strlen( str));
str = getDescription(); str = getDescription();
sink->write( str, strlen( str)); sink->write( str, strlen( str));
}
if ( getUrl() ) {
str = "\nx-audiocast-url: "; str = "\nx-audiocast-url: ";
sink->write( str, strlen( str)); sink->write( str, strlen( str));
str = getUrl(); str = getUrl();
sink->write( str, strlen( str)); sink->write( str, strlen( str));
}
if ( getGenre() ) {
str = "\nx-audiocast-genre: "; str = "\nx-audiocast-genre: ";
sink->write( str, strlen( str)); sink->write( str, strlen( str));
str = getGenre(); str = getGenre();
sink->write( str, strlen( str)); sink->write( str, strlen( str));
}
str = "\nx-audiocast-bitrate: "; str = "\nx-audiocast-bitrate: ";
sink->write( str, strlen( str)); sink->write( str, strlen( str));
@ -186,6 +194,9 @@ IceCast :: sendLogin ( void ) throw ( Exception )
$Source$ $Source$
$Log$ $Log$
Revision 1.5 2001/08/29 21:08:30 darkeye
made some description options in the darkice config file optional
Revision 1.4 2000/11/12 14:54:50 darkeye Revision 1.4 2000/11/12 14:54:50 darkeye
added kdoc-style documentation comments added kdoc-style documentation comments

View File

@ -107,25 +107,25 @@ class IceCast : public CastSink
IceCast ( TcpSocket * socket, IceCast ( TcpSocket * socket,
const char * password, const char * password,
const char * mountPoint, const char * mountPoint,
const char * remoteDumpFile,
const char * name,
const char * description,
const char * url,
const char * genre,
unsigned int bitRate, unsigned int bitRate,
bool isPublic, const char * name = 0,
const char * description = 0,
const char * url = 0,
const char * genre = 0,
bool isPublic = false,
const char * remoteDumpFile = 0,
unsigned int bufferDuration = 10 ) unsigned int bufferDuration = 10 )
throw ( Exception ) throw ( Exception )
: CastSink( socket, : CastSink( socket,
password, password,
mountPoint, mountPoint,
remoteDumpFile, bitRate,
name, name,
description, description,
url, url,
genre, genre,
bitRate,
isPublic, isPublic,
remoteDumpFile,
bufferDuration ) bufferDuration )
{ {
} }
@ -184,6 +184,9 @@ class IceCast : public CastSink
$Source$ $Source$
$Log$ $Log$
Revision 1.5 2001/08/29 21:08:30 darkeye
made some description options in the darkice config file optional
Revision 1.4 2000/11/12 14:54:50 darkeye Revision 1.4 2000/11/12 14:54:50 darkeye
added kdoc-style documentation comments added kdoc-style documentation comments