removed direct reference to cout, except from main.cpp
all class use the Reporter interface to report events
This commit is contained in:
parent
6136206150
commit
03e0f9d0d4
|
@ -294,7 +294,7 @@ DarkIce :: encode ( void ) throw ( Exception )
|
||||||
1,
|
1,
|
||||||
0 );
|
0 );
|
||||||
|
|
||||||
cout << len << " bytes transfered" << endl;
|
reportEvent( 1, len, "bytes transfered to the encoders");
|
||||||
|
|
||||||
encConnector->close();
|
encConnector->close();
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ DarkIce :: shout ( unsigned int ix ) throw ( Exception )
|
||||||
bytes = outputs[ix].encoder->getOutBitrate() * (1024UL / 8UL) * duration;
|
bytes = outputs[ix].encoder->getOutBitrate() * (1024UL / 8UL) * duration;
|
||||||
len = outputs[ix].shoutConnector->transfer ( bytes, 4096, 10, 0 );
|
len = outputs[ix].shoutConnector->transfer ( bytes, 4096, 10, 0 );
|
||||||
|
|
||||||
cout << len << " bytes transfered" << endl;
|
reportEvent( 1, len, "bytes transfered to stream", ix);
|
||||||
|
|
||||||
outputs[ix].shoutConnector->close();
|
outputs[ix].shoutConnector->close();
|
||||||
|
|
||||||
|
@ -353,9 +353,9 @@ DarkIce :: run ( void ) throw ( Exception )
|
||||||
|
|
||||||
sleep ( 1 );
|
sleep ( 1 );
|
||||||
|
|
||||||
cout << "shouting " << u << endl << flush;
|
reportEvent( 3, "shouting", u);
|
||||||
shout( u);
|
shout( u);
|
||||||
cout << "shouting ends " << u << endl << flush;
|
reportEvent( 3, "shouting ends", u);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
@ -363,9 +363,9 @@ DarkIce :: run ( void ) throw ( Exception )
|
||||||
|
|
||||||
// this is the parent
|
// this is the parent
|
||||||
|
|
||||||
cout << "encoding" << endl << flush;
|
reportEvent( 3, "encoding");
|
||||||
encode();
|
encode();
|
||||||
cout << "encoding ends" << endl << flush;
|
reportEvent( 3, "encoding ends");
|
||||||
|
|
||||||
for ( u = 0; u < noOutputs; ++u ) {
|
for ( u = 0; u < noOutputs; ++u ) {
|
||||||
int status;
|
int status;
|
||||||
|
@ -387,6 +387,10 @@ DarkIce :: run ( void ) throw ( Exception )
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.11 2000/11/18 11:13:27 darkeye
|
||||||
|
removed direct reference to cout, except from main.cpp
|
||||||
|
all class use the Reporter interface to report events
|
||||||
|
|
||||||
Revision 1.10 2000/11/17 15:50:48 darkeye
|
Revision 1.10 2000/11/17 15:50:48 darkeye
|
||||||
added -Wall flag to compiler and eleminated new warnings
|
added -Wall flag to compiler and eleminated new warnings
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ ExternalEncoder :: start ( void ) throw ( Exception )
|
||||||
if ( pid == -1 ) {
|
if ( pid == -1 ) {
|
||||||
throw Exception( __FILE__, __LINE__, "fork error");
|
throw Exception( __FILE__, __LINE__, "fork error");
|
||||||
} else if ( pid == 0 ) {
|
} else if ( pid == 0 ) {
|
||||||
cout << "wow, I'm a voodoo child!" << endl;
|
reportEvent( 5, "child process", getpid(), "started");
|
||||||
|
|
||||||
makeArgs();
|
makeArgs();
|
||||||
execvp( getEncoderName(), cmdArgs);
|
execvp( getEncoderName(), cmdArgs);
|
||||||
|
@ -171,7 +171,7 @@ ExternalEncoder :: start ( void ) throw ( Exception )
|
||||||
throw Exception( __FILE__, __LINE__, "exec returned");
|
throw Exception( __FILE__, __LINE__, "exec returned");
|
||||||
} else {
|
} else {
|
||||||
child = pid;
|
child = pid;
|
||||||
cout << "I'm a parent, the child's pid is " << child << endl;
|
reportEvent( 5, "parent", getpid(), "started child process", child);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -200,6 +200,10 @@ ExternalEncoder :: stop ( void ) throw ( Exception )
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.4 2000/11/18 11:13:27 darkeye
|
||||||
|
removed direct reference to cout, except from main.cpp
|
||||||
|
all class use the Reporter interface to report events
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "Exception.h"
|
#include "Exception.h"
|
||||||
|
#include "Reporter.h"
|
||||||
#include "AudioEncoder.h"
|
#include "AudioEncoder.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,7 +67,7 @@
|
||||||
* @author $Author$
|
* @author $Author$
|
||||||
* @version $Revision$
|
* @version $Revision$
|
||||||
*/
|
*/
|
||||||
class ExternalEncoder : public AudioEncoder
|
class ExternalEncoder : public AudioEncoder, public virtual Reporter
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -360,6 +361,10 @@ class ExternalEncoder : public AudioEncoder
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.5 2000/11/18 11:13:27 darkeye
|
||||||
|
removed direct reference to cout, except from main.cpp
|
||||||
|
all class use the Reporter interface to report events
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue