From 03e0f9d0d423059738d1b3417e708affb300b6a4 Mon Sep 17 00:00:00 2001 From: darkeye Date: Sat, 18 Nov 2000 11:13:27 +0000 Subject: [PATCH] removed direct reference to cout, except from main.cpp all class use the Reporter interface to report events --- darkice/trunk/src/DarkIce.cpp | 16 ++++++++++------ darkice/trunk/src/ExternalEncoder.cpp | 8 ++++++-- darkice/trunk/src/ExternalEncoder.h | 7 ++++++- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/darkice/trunk/src/DarkIce.cpp b/darkice/trunk/src/DarkIce.cpp index 1744b66..24ab35e 100644 --- a/darkice/trunk/src/DarkIce.cpp +++ b/darkice/trunk/src/DarkIce.cpp @@ -294,7 +294,7 @@ DarkIce :: encode ( void ) throw ( Exception ) 1, 0 ); - cout << len << " bytes transfered" << endl; + reportEvent( 1, len, "bytes transfered to the encoders"); encConnector->close(); @@ -326,7 +326,7 @@ DarkIce :: shout ( unsigned int ix ) throw ( Exception ) bytes = outputs[ix].encoder->getOutBitrate() * (1024UL / 8UL) * duration; 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(); @@ -353,9 +353,9 @@ DarkIce :: run ( void ) throw ( Exception ) sleep ( 1 ); - cout << "shouting " << u << endl << flush; + reportEvent( 3, "shouting", u); shout( u); - cout << "shouting ends " << u << endl << flush; + reportEvent( 3, "shouting ends", u); exit(0); } @@ -363,9 +363,9 @@ DarkIce :: run ( void ) throw ( Exception ) // this is the parent - cout << "encoding" << endl << flush; + reportEvent( 3, "encoding"); encode(); - cout << "encoding ends" << endl << flush; + reportEvent( 3, "encoding ends"); for ( u = 0; u < noOutputs; ++u ) { int status; @@ -387,6 +387,10 @@ DarkIce :: run ( void ) throw ( Exception ) $Source$ $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 added -Wall flag to compiler and eleminated new warnings diff --git a/darkice/trunk/src/ExternalEncoder.cpp b/darkice/trunk/src/ExternalEncoder.cpp index 331ab67..0a4fb89 100644 --- a/darkice/trunk/src/ExternalEncoder.cpp +++ b/darkice/trunk/src/ExternalEncoder.cpp @@ -163,7 +163,7 @@ ExternalEncoder :: start ( void ) throw ( Exception ) if ( pid == -1 ) { throw Exception( __FILE__, __LINE__, "fork error"); } else if ( pid == 0 ) { - cout << "wow, I'm a voodoo child!" << endl; + reportEvent( 5, "child process", getpid(), "started"); makeArgs(); execvp( getEncoderName(), cmdArgs); @@ -171,7 +171,7 @@ ExternalEncoder :: start ( void ) throw ( Exception ) throw Exception( __FILE__, __LINE__, "exec returned"); } else { child = pid; - cout << "I'm a parent, the child's pid is " << child << endl; + reportEvent( 5, "parent", getpid(), "started child process", child); return true; } @@ -200,6 +200,10 @@ ExternalEncoder :: stop ( void ) throw ( Exception ) $Source$ $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 added kdoc-style documentation comments diff --git a/darkice/trunk/src/ExternalEncoder.h b/darkice/trunk/src/ExternalEncoder.h index 51d763f..008fa5f 100644 --- a/darkice/trunk/src/ExternalEncoder.h +++ b/darkice/trunk/src/ExternalEncoder.h @@ -48,6 +48,7 @@ #include "Exception.h" +#include "Reporter.h" #include "AudioEncoder.h" @@ -66,7 +67,7 @@ * @author $Author$ * @version $Revision$ */ -class ExternalEncoder : public AudioEncoder +class ExternalEncoder : public AudioEncoder, public virtual Reporter { private: @@ -360,6 +361,10 @@ class ExternalEncoder : public AudioEncoder $Source$ $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 added kdoc-style documentation comments