--- a/mmserv/tms/tmscallserver/src/tmscsuplink.cpp Fri May 14 18:19:45 2010 -0500
+++ b/mmserv/tms/tmscallserver/src/tmscsuplink.cpp Fri May 28 19:26:28 2010 -0500
@@ -16,23 +16,40 @@
*/
#include <AudioPreference.h>
+#include "tmsutility.h"
#include "tmscsuplink.h"
#include "tmscsdevsoundobserver.h"
using namespace TMS;
-// Mute value
-const gint KSetMuteToDevSound = 0;
+// -----------------------------------------------------------------------------
+// Constructor
+// -----------------------------------------------------------------------------
+//
+TMSCSUplink::TMSCSUplink(TMSCSDevSoundObserver& observer) :
+ TMSCSDevSound(observer)
+ {
+ }
// -----------------------------------------------------------------------------
-// Static constructor.
+// Second phase constructor
// -----------------------------------------------------------------------------
//
-TMSCSUplink* TMSCSUplink::NewL(TMSCSPDevSoundObserver& aObserver)
+void TMSCSUplink::ConstructL(const gint retrytime)
{
- TMSCSUplink* self = new (ELeave) TMSCSUplink(aObserver);
+ TMSCSDevSound::ConstructL(TMS_STREAM_UPLINK, retrytime);
+ }
+
+// -----------------------------------------------------------------------------
+// Static constructor
+// -----------------------------------------------------------------------------
+//
+TMSCSUplink* TMSCSUplink::NewL(TMSCSDevSoundObserver& observer,
+ const gint retrytime)
+ {
+ TMSCSUplink* self = new (ELeave) TMSCSUplink(observer);
CleanupStack::PushL(self);
- self->ConstructL();
+ self->ConstructL(retrytime);
CleanupStack::Pop(self);
return self;
}
@@ -49,61 +66,31 @@
// Gives mic mute state
// -----------------------------------------------------------------------------
//
-TBool TMSCSUplink::IsMuted()
+gboolean TMSCSUplink::IsMuted()
{
- TBool isMuted = EFalse;
- gint gain = 0;
+ gint gain(0);
+
if (iDevSound)
{
gain = iDevSound->Gain();
}
- if (!gain)
- {
- // Mute is on
- isMuted = ETrue;
- }
- // CSPLOGSTRING( CSPINT, "TMSCSUplink::IsMuted" );
- return isMuted;
+ return ((!gain)? TRUE : FALSE);
}
// -----------------------------------------------------------------------------
-// Set mic muted.
+// Sets mic gain
// -----------------------------------------------------------------------------
//
-void TMSCSUplink::SetMuted()
+void TMSCSUplink::SetGain(gint gain)
{
if (iDevSound)
{
- iDevSound->SetGain(KSetMuteToDevSound);
+ iDevSound->SetGain(gain);
}
}
// -----------------------------------------------------------------------------
-// Set mic unmuted
-// -----------------------------------------------------------------------------
-//
-void TMSCSUplink::SetUnmuted()
- {
- if (iDevSound)
- {
- iDevSound->SetGain(iDevSound->MaxGain());
- }
- }
-
-// -----------------------------------------------------------------------------
-// Sets gain
-// -----------------------------------------------------------------------------
-//
-void TMSCSUplink::SetGain(gint aGain)
- {
- if (iDevSound)
- {
- iDevSound->SetGain(aGain);
- }
- }
-
-// -----------------------------------------------------------------------------
-// Gives volume
+// Returns mic gain
// -----------------------------------------------------------------------------
//
gint TMSCSUplink::Gain()
@@ -117,7 +104,7 @@
}
// -----------------------------------------------------------------------------
-// Gives max gain
+// Returns max mic gain
// -----------------------------------------------------------------------------
//
gint TMSCSUplink::MaxGain()
@@ -132,46 +119,50 @@
// -----------------------------------------------------------------------------
// From class MDevSoundObserver
-// Activation was successfull.
+// Uplink stream has been activated successfully.
// -----------------------------------------------------------------------------
//
void TMSCSUplink::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/)
{
- // CSPLOGSTRING( CSPINT, "TMSCSUplink::BufferToBeEmptied" );
+ TRACE_PRN_N(_L("TMSCSUplink::BufferToBeEmptied"));
// We dont react to devsound messages unless we are activating.
- if (IsActivationOngoing())
+ if (iActivationOngoing)
{
iActive = ETrue;
iActivationOngoing = EFalse;
- iObserver.UplinkActivatedSuccessfully();
+ iObserver.UplinkActivationCompleted(KErrNone);
}
}
// -----------------------------------------------------------------------------
// From class MDevSoundObserver
-// Activation feiled
+// Uplink stream activation failed
// -----------------------------------------------------------------------------
//
void TMSCSUplink::RecordError(TInt aError)
{
- // CSPLOGSTRING( CSPINT, "TMSCSUplink::RecordError" );
+ TRACE_PRN_N1(_L("TMSCSUplink::RecordError[%d]"), aError);
// We dont react to devsound messages unless we are activating.
- if (IsActivationOngoing())
+ if (iActivationOngoing && aError == KErrAccessDenied)
{
- if (aError == KErrAccessDenied)
+ if (iStartRetryTime != 0)
{
+ StartTimer();
+ }
+ else
+ {
+ CancelTimer();
iActivationOngoing = EFalse;
- iObserver.UplinkActivationFailed();
+ iObserver.UplinkActivationCompleted(aError);
}
}
}
// -----------------------------------------------------------------------------
-// From class TMSCSPDevSound
-// Tries to activate mic stream. Stream becomes active when BufferToBeFilled
-// gets called.
+// From class TMSCSDevSound
+// Activates Uplink stream.
// -----------------------------------------------------------------------------
//
void TMSCSUplink::DoActivateL()
@@ -182,23 +173,4 @@
}
}
-// -----------------------------------------------------------------------------
-// Constructor
-// -----------------------------------------------------------------------------
-//
-TMSCSUplink::TMSCSUplink(TMSCSPDevSoundObserver& aObserver) :
- TMSCSPDevSound(aObserver)
- {
- }
-
-// -----------------------------------------------------------------------------
-// Second phase constructor
-// -----------------------------------------------------------------------------
-//
-void TMSCSUplink::ConstructL()
- {
- TMSCSPDevSound::ConstructL(EMMFStateRecording, KAudioPrefCSCallUplink,
- KAudioPriorityCSCallUplink);
- }
-
// End of File