Author: derek
Date: Wed May 20 20:50:20 2009
New Revision: 443
Log:
Tidy up args to use more consts. This makes it consistant with the args
in the ancestor class of MessageFrame.
Get the layout more correct.
Make the distclean make target less verbose.
Modified:
sofaswitch/trunk/sound/Makefile
sofaswitch/trunk/sound/audio.cxx
sofaswitch/trunk/sound/comms.cxx
sofaswitch/trunk/sound/comms.h
sofaswitch/trunk/sound/main.cxx
Modified: sofaswitch/trunk/sound/Makefile
==============================================================================
--- sofaswitch/trunk/sound/Makefile (original)
+++ sofaswitch/trunk/sound/Makefile Wed May 20 20:50:20 2009
@@ -26,13 +26,14 @@
################################################################################
distclean:
- make clean
- rm -f *~;
- rm -f core*
- rm -f log*
- rm -fR html
- rm -fR obj*
-
+ @rm -f *~ &>/dev/null
+ @rm -f core* &>/dev/null
+ @rm -f log* &>/dev/null
+ @rm -fR html &>/dev/null
+ @rm -fR obj* &>/dev/null
+ @echo "Removing all object files and directories"
+ @echo "Removing html directories and files"
+ @echo "Removing log + core and editor files "
##################################################
docs:
Modified: sofaswitch/trunk/sound/audio.cxx
==============================================================================
--- sofaswitch/trunk/sound/audio.cxx (original)
+++ sofaswitch/trunk/sound/audio.cxx Wed May 20 20:50:20 2009
@@ -41,6 +41,7 @@
PTRACE(6, "TestAudioRead\tREAD. Pre. Get " << oneChunk << " bytes");
sound.Read(data.GetPointer(), oneChunk);
+
PTRACE(6, "TestAudioRead\tREAD. Post. Send " << oneChunk << " bytes");
if (socket.IsOpen()) {
@@ -93,7 +94,7 @@
while (keepGoing) {
socket.Read(data.GetPointer(), data.GetSize());
PINDEX readSize = socket.GetLastReadCount();
-
+
PTRACE(6, "Post Read of data from the socket. have "
<< readSize << " bytes");
if (!socket.IsOpen()) {
Modified: sofaswitch/trunk/sound/comms.cxx
==============================================================================
--- sofaswitch/trunk/sound/comms.cxx (original)
+++ sofaswitch/trunk/sound/comms.cxx Wed May 20 20:50:20 2009
@@ -118,7 +118,7 @@
}
-void Comms::ProcessRequestNewId(PStringArray &cmds, PString & sender)
+void Comms::ProcessRequestNewId(const PStringArray &cmds, const PString & sender)
{
SetRemoteController(sender);
PString answer = PString("REQUESTNEWID ") + Audio::Current().GetNodeId();
@@ -126,14 +126,14 @@
return;
}
-void Comms::ProcessHangup(PStringArray &cmds, PString & sender)
+void Comms::ProcessHangup(const PStringArray &cmds, const PString & sender)
{
stopByExit = true;
SetRemoteController(sender);
Terminate();
}
-void Comms::ProcessCallNode(PStringArray &cmds, PString & sender)
+void Comms::ProcessCallNode(const PStringArray &cmds, const PString & sender)
{
SendThisMessageTo("Failed to do " + cmds[0] + " as we are a sound handler", "", sender);
return;
@@ -158,36 +158,36 @@
statusInfo= countMessage;
}
-void Comms::ProcessStatusQuery(PStringArray &cmds, PString & sender)
+void Comms::ProcessStatusQuery(const PStringArray &cmds, const PString & sender)
{
PString statusInfo;
GetStatusInformation(statusInfo);
SendThisMessageTo(statusInfo, sender);
}
-void Comms::ProcessDuration(PStringArray &cmds, PString & sender)
+void Comms::ProcessDuration(const PStringArray &cmds, const PString & sender)
{
SendThisMessageTo(cmds[0] + PString(" sorry, duration not implemented "), "", sender);
}
-void Comms::ProcessIdentify(PStringArray &cmds, PString & sender)
+void Comms::ProcessIdentify(const PStringArray &cmds, const PString & sender)
{
SendThisMessageTo(cmds[0] + PString(" node for handling sound port comms"), "", sender);
}
-void Comms::ProcessDebug(PStringArray &cmds, PString & sender)
+void Comms::ProcessDebug(const PStringArray &cmds, const PString & sender)
{
SendThisMessageTo(cmds[0] + PString(" sorry, debug not implemented "), "", sender);
}
-void Comms::ProcessAnswer(PStringArray &cmds, PString & sender)
+void Comms::ProcessAnswer(const PStringArray &cmds, const PString & sender)
{
SendThisMessageTo(cmds[0] + PString(" sorry, answer not implemented "), "", sender);
}
-void Comms::ProcessQuitNow(PStringArray &cmds, PString & sender)
+void Comms::ProcessQuitNow(const PStringArray &cmds, const PString & sender)
{
stopByExit = true;
SetRemoteController(sender);
Modified: sofaswitch/trunk/sound/comms.h
==============================================================================
--- sofaswitch/trunk/sound/comms.h (original)
+++ sofaswitch/trunk/sound/comms.h Wed May 20 20:50:20 2009
@@ -51,7 +51,7 @@
device */
class Comms : public MessageFrame
{
-
+ PCLASSINFO(Comms, MessageFrame);
public:
/**Constuctor */
Comms(LaunchNewId & lid, PSoundChannel & _soundPlayer, PSoundChannel & _soundRecorder);
@@ -89,6 +89,7 @@
{ return AlterVolume(dir, false); }
protected:
+
/**Increase or decrease the volume on the specified device */
PString AlterVolume(PSoundChannel::Directions dir, bool doRaise);
@@ -99,7 +100,7 @@
/**we have received a command asking us to provide the id of a new
communications nodes, that will be controlled only by the remote
node */
- virtual void ProcessRequestNewId(PStringArray &cmds, PString & sender);
+ virtual void ProcessRequestNewId(const PStringArray &cmds, const PString & sender);
/**The supervisor has completed. This method is called when this
supervisor instance terminates. Since there is only one
@@ -107,33 +108,33 @@
virtual void OnTermination();
/**we have received a hangup message, so end the call */
- virtual void ProcessHangup(PStringArray &cmds, PString & sender);
+ virtual void ProcessHangup(const PStringArray &cmds, const PString & sender);
/**we have received a Call other Node command, so do it and reply
accordingly*/
- virtual void ProcessCallNode(PStringArray &cmds, PString & sender);
+ virtual void ProcessCallNode(const PStringArray &cmds, const PString & sender);
/**we have received a query status command, so do it and reply accordingly*/
- virtual void ProcessStatusQuery(PStringArray &cmds, PString & sender);
+ virtual void ProcessStatusQuery(const PStringArray &cmds, const PString & sender);
/**we have received a command queryig the current call duration ,
so extract information & answer */
- virtual void ProcessDuration(PStringArray &cmds, PString & sender);
+ virtual void ProcessDuration(const PStringArray &cmds, const PString & sender);
/**we have received a command requesting that we identify ourselves
so do it and reply accordingly*/
- virtual void ProcessIdentify(PStringArray &cmds, PString & sender);
+ virtual void ProcessIdentify(const PStringArray &cmds, const PString & sender);
/**we have received a command which enables/disables debug
information so install as required and reply accordingly*/
- virtual void ProcessDebug(PStringArray &cmds, PString & sender);
+ virtual void ProcessDebug(const PStringArray &cmds, const PString & sender);
/**we have received a command advising us how to answer to the
incoming call, so we act as required and reply accordingly*/
- virtual void ProcessAnswer(PStringArray &cmds, PString & sender);
+ virtual void ProcessAnswer(const PStringArray &cmds, const PString & sender);
/**we have received a command advising us that we are to end now */
- virtual void ProcessQuitNow(PStringArray &cmds, PString & sender);
+ virtual void ProcessQuitNow(const PStringArray &cmds, const PString & sender);
/**Some MessageFrame instances do not have the permission to quit
now. This virtual method determines if this instance is permitted to
Modified: sofaswitch/trunk/sound/main.cxx
==============================================================================
--- sofaswitch/trunk/sound/main.cxx (original)
+++ sofaswitch/trunk/sound/main.cxx Wed May 20 20:50:20 2009
@@ -223,10 +223,10 @@
PStringArray namesPlay;
dir = PSoundChannel::Player;
namesPlay = PSoundChannel::GetDeviceNames(dir);
-
-
+
if (namesPlay.GetStringsIndex(devName) == P_MAX_INDEX) {
- cout << "could not find " << devName << " in list of available play devices - abort program" << endl;
+ cout << "could not find " << devName
+ << " in list of available play devices - abort program" << endl;
cout << "available device names are " << endl;
for(PINDEX i = 0; i < namesPlay.GetSize(); i++)
cout << namesPlay[i] << endl;