phoneplugins/csplugin/src/tmshandler.cpp
author hgs
Mon, 04 Oct 2010 16:06:10 +0300
changeset 76 cfea66083b62
parent 65 2a5d4ab426d3
permissions -rw-r--r--
201039
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
 * All rights reserved.
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
 *
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
 * Initial Contributors:
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
 *
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
 * Contributors:
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
 *
65
hgs
parents: 27
diff changeset
    14
 * Description: Activates TMS call audio control streams.
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
 *
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
 */
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include <tmsfactory.h>
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include <tmscall.h>
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include <tmsstream.h>
76
hgs
parents: 65
diff changeset
    21
#include <tmsver.h>
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include "tmshandler.h"
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include "csplogger.h"
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include "csppanic.pan"
65
hgs
parents: 27
diff changeset
    25
#include "mtmshandlerobserver.h"
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
65
hgs
parents: 27
diff changeset
    27
const TInt KStreamInitRetry = 1000000; //1 sec
hgs
parents: 27
diff changeset
    28
const TInt KRetryForever = -1;
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
// Static constructor
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
//
65
hgs
parents: 27
diff changeset
    34
TmsHandler* TmsHandler::NewL(MTmsHandlerObserver& aObserver)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
    {
65
hgs
parents: 27
diff changeset
    36
    TmsHandler* self = TmsHandler::NewLC(aObserver);
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
    CleanupStack::Pop(self);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
    return self;
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
// Static constructor
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
//
65
hgs
parents: 27
diff changeset
    45
TmsHandler* TmsHandler::NewLC(MTmsHandlerObserver& aObserver)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
    {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
    TmsHandler* self = new (ELeave) TmsHandler();
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
    CleanupStack::PushL(self);
65
hgs
parents: 27
diff changeset
    49
    self->ConstructL(aObserver);
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
    return self;
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
// Destructor
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
//
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
TmsHandler::~TmsHandler()
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
    {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
    if (iTmsUplink && iTmsCall)
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
        {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
        iTmsCall->DeleteStream(iTmsUplink);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
    if (iTmsDnlink && iTmsCall)
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
        {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
        iTmsCall->DeleteStream(iTmsDnlink);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
    if (iFactory && iTmsCall)
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
        {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
        iFactory->DeleteCall(iTmsCall);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
    if (iFactory && iTmsMicSource)
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
        {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
        iFactory->DeleteSource(iTmsMicSource);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
    if (iFactory && iTmsModemSource)
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
        {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
        iFactory->DeleteSource(iTmsModemSource);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
    if (iFactory && iTmsSpeakerSink)
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
        {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
        iFactory->DeleteSink(iTmsSpeakerSink);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
    if (iFactory && iTmsModemSink)
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
        {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
        iFactory->DeleteSink(iTmsModemSink);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
    delete iFactory;
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
// ---------------------------------------------------------------------------
65
hgs
parents: 27
diff changeset
    91
// TmsHandler::StartStreams
hgs
parents: 27
diff changeset
    92
// Activates TMS call audio control streams. If called in the middle of an
hgs
parents: 27
diff changeset
    93
// ongoing stream initialization, the request is cashed in until both streams
hgs
parents: 27
diff changeset
    94
// transition to initialized state.
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
//
65
hgs
parents: 27
diff changeset
    97
TInt TmsHandler::StartStreams()
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
    {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
    CSPLOGSTRING(CSPINT, "TmsHandler::StartStreams");
65
hgs
parents: 27
diff changeset
   100
    TInt status(TMS_RESULT_SUCCESS);
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
65
hgs
parents: 27
diff changeset
   102
    if (iTmsUplink)
hgs
parents: 27
diff changeset
   103
        {
hgs
parents: 27
diff changeset
   104
        if (iTmsUplink->GetState() == TMS_STREAM_INITIALIZED)
hgs
parents: 27
diff changeset
   105
            {
hgs
parents: 27
diff changeset
   106
            status = iTmsUplink->Start(KRetryForever);
hgs
parents: 27
diff changeset
   107
            }
hgs
parents: 27
diff changeset
   108
        else if (iUplInitializing)
hgs
parents: 27
diff changeset
   109
            {
hgs
parents: 27
diff changeset
   110
            iStartAfterInitComplete = ETrue;
hgs
parents: 27
diff changeset
   111
            }
hgs
parents: 27
diff changeset
   112
        }
hgs
parents: 27
diff changeset
   113
hgs
parents: 27
diff changeset
   114
    if (iTmsDnlink && status == TMS_RESULT_SUCCESS)
hgs
parents: 27
diff changeset
   115
        {
hgs
parents: 27
diff changeset
   116
        if (iTmsDnlink->GetState() == TMS_STREAM_INITIALIZED)
hgs
parents: 27
diff changeset
   117
            {
hgs
parents: 27
diff changeset
   118
            status = iTmsDnlink->Start(KRetryForever);
hgs
parents: 27
diff changeset
   119
            }
hgs
parents: 27
diff changeset
   120
        else if (iDnlInitializing)
hgs
parents: 27
diff changeset
   121
            {
hgs
parents: 27
diff changeset
   122
            iStartAfterInitComplete = ETrue;
hgs
parents: 27
diff changeset
   123
            }
hgs
parents: 27
diff changeset
   124
        }
hgs
parents: 27
diff changeset
   125
hgs
parents: 27
diff changeset
   126
    CSPLOGSTRING2(CSPINT, "TmsHandler::StartStreams status %d", status);
hgs
parents: 27
diff changeset
   127
hgs
parents: 27
diff changeset
   128
    if (status != TMS_RESULT_SUCCESS)
hgs
parents: 27
diff changeset
   129
        {
hgs
parents: 27
diff changeset
   130
        // Cancel any pending retry and cancel.
hgs
parents: 27
diff changeset
   131
        StopStreams();
hgs
parents: 27
diff changeset
   132
        status = KErrCancel;
hgs
parents: 27
diff changeset
   133
        }
hgs
parents: 27
diff changeset
   134
    return status;
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
// ---------------------------------------------------------------------------
65
hgs
parents: 27
diff changeset
   138
// TmsHandler::StopStreams
hgs
parents: 27
diff changeset
   139
// Deactivates TMS call audio control streams. If streams are not started yet,
hgs
parents: 27
diff changeset
   140
// any pending request on TMS streams will be canceled.
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
//
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
void TmsHandler::StopStreams()
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
    {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
    CSPLOGSTRING(CSPINT, "TmsHandler::StopStreams");
65
hgs
parents: 27
diff changeset
   146
hgs
parents: 27
diff changeset
   147
    if (iTmsUplink)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
        {
65
hgs
parents: 27
diff changeset
   149
        iTmsUplink->Stop();
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
        }
65
hgs
parents: 27
diff changeset
   151
    if (iTmsDnlink)
hgs
parents: 27
diff changeset
   152
        {
hgs
parents: 27
diff changeset
   153
        iTmsDnlink->Stop();
hgs
parents: 27
diff changeset
   154
        }
hgs
parents: 27
diff changeset
   155
    iUplInitializing = EFalse;
hgs
parents: 27
diff changeset
   156
    iDnlInitializing = EFalse;
hgs
parents: 27
diff changeset
   157
    iStartAfterInitComplete = EFalse;
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
// ---------------------------------------------------------------------------
65
hgs
parents: 27
diff changeset
   161
// TmsHandler::AreStreamsStarted
hgs
parents: 27
diff changeset
   162
// Indicates whether both audio control streams have been started.
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
//
65
hgs
parents: 27
diff changeset
   165
TBool TmsHandler::AreStreamsStarted()
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
    {
65
hgs
parents: 27
diff changeset
   167
    TBool status(EFalse);
hgs
parents: 27
diff changeset
   168
hgs
parents: 27
diff changeset
   169
    if (iTmsUplink && iTmsDnlink)
hgs
parents: 27
diff changeset
   170
        {
hgs
parents: 27
diff changeset
   171
        if (iTmsUplink->GetState() == TMS_STREAM_STARTED &&
hgs
parents: 27
diff changeset
   172
                iTmsDnlink->GetState() == TMS_STREAM_STARTED)
hgs
parents: 27
diff changeset
   173
            {
hgs
parents: 27
diff changeset
   174
            status = ETrue;
hgs
parents: 27
diff changeset
   175
            }
hgs
parents: 27
diff changeset
   176
        }
hgs
parents: 27
diff changeset
   177
    return status;
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
// Constructor
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
//
65
hgs
parents: 27
diff changeset
   184
TmsHandler::TmsHandler()
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
    {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
// Second phase constructor
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
//
65
hgs
parents: 27
diff changeset
   192
void TmsHandler::ConstructL(MTmsHandlerObserver& aObserver)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
    {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
    CSPLOGSTRING(CSPINT, "TmsHandler::ConstructL");
65
hgs
parents: 27
diff changeset
   195
    iObserver = &aObserver;
hgs
parents: 27
diff changeset
   196
    User::LeaveIfError(CreateTMSCallControl());
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
// TmsHandler::CreateTMSCallControl()
65
hgs
parents: 27
diff changeset
   201
// Allocates and initializes all TMS resources needed for call audio control.
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
// ---------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
//
65
hgs
parents: 27
diff changeset
   204
TInt TmsHandler::CreateTMSCallControl()
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
    {
65
hgs
parents: 27
diff changeset
   206
    CSPLOGSTRING(CSPINT, "TmsHandler::CreateTMSCallControl");
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
    TInt status;
76
hgs
parents: 65
diff changeset
   208
    TMSVer v(2,0,0);
hgs
parents: 65
diff changeset
   209
    status = TMSFactory::CreateFactory(iFactory, v);
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
65
hgs
parents: 27
diff changeset
   211
    __ASSERT_ALWAYS(iFactory, Panic(ECSPPanicBadHandle));
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
    status = iFactory->CreateCall(TMS_CALL_CS, iTmsCall, 0);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
65
hgs
parents: 27
diff changeset
   215
    if (iTmsCall && status == TMS_RESULT_SUCCESS)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
        {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
        status = iTmsCall->CreateStream(TMS_STREAM_UPLINK, iTmsUplink);
65
hgs
parents: 27
diff changeset
   218
        status |= iTmsCall->CreateStream(TMS_STREAM_DOWNLINK, iTmsDnlink);
hgs
parents: 27
diff changeset
   219
        status |= iFactory->CreateSource(TMS_SOURCE_MIC, iTmsMicSource);
hgs
parents: 27
diff changeset
   220
        status |= iFactory->CreateSink(TMS_SINK_MODEM, iTmsModemSink);
hgs
parents: 27
diff changeset
   221
        status |= iFactory->CreateSource(TMS_SOURCE_MODEM, iTmsModemSource);
hgs
parents: 27
diff changeset
   222
        status |= iFactory->CreateSink(TMS_SINK_SPEAKER, iTmsSpeakerSink);
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
        }
65
hgs
parents: 27
diff changeset
   224
    if (iTmsUplink && iTmsMicSource && iTmsModemSink &&
hgs
parents: 27
diff changeset
   225
            status == TMS_RESULT_SUCCESS)
hgs
parents: 27
diff changeset
   226
        {
hgs
parents: 27
diff changeset
   227
        status = iTmsUplink->AddSource(iTmsMicSource);
hgs
parents: 27
diff changeset
   228
        status |= iTmsUplink->AddSink(iTmsModemSink);
hgs
parents: 27
diff changeset
   229
        status |= iTmsUplink->AddObserver(*this, NULL);
hgs
parents: 27
diff changeset
   230
        status |= iTmsUplink->Init(KStreamInitRetry);
hgs
parents: 27
diff changeset
   231
        }
hgs
parents: 27
diff changeset
   232
    if (iTmsDnlink && iTmsModemSource && iTmsSpeakerSink &&
hgs
parents: 27
diff changeset
   233
            status == TMS_RESULT_SUCCESS)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
        {
65
hgs
parents: 27
diff changeset
   235
        status = iTmsDnlink->AddSource(iTmsModemSource);
hgs
parents: 27
diff changeset
   236
        status |= iTmsDnlink->AddSink(iTmsSpeakerSink);
hgs
parents: 27
diff changeset
   237
        status |= iTmsDnlink->AddObserver(*this, NULL);
hgs
parents: 27
diff changeset
   238
        status |= iTmsDnlink->Init(KStreamInitRetry);
hgs
parents: 27
diff changeset
   239
        }
hgs
parents: 27
diff changeset
   240
    if (status == TMS_RESULT_SUCCESS)
hgs
parents: 27
diff changeset
   241
        {
hgs
parents: 27
diff changeset
   242
        iUplInitializing = ETrue;
hgs
parents: 27
diff changeset
   243
        iDnlInitializing = ETrue;
hgs
parents: 27
diff changeset
   244
        }
hgs
parents: 27
diff changeset
   245
    else
hgs
parents: 27
diff changeset
   246
        {
hgs
parents: 27
diff changeset
   247
        status = KErrCancel; // Convert to Symbian error and cancel
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
    return status;
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
// ----------------------------------------------------------------------------
65
hgs
parents: 27
diff changeset
   253
// TmsHandler::ProcessUplinkStreamChangeEvent
hgs
parents: 27
diff changeset
   254
// Processes Uplink stream state change events.
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
// ----------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
//
65
hgs
parents: 27
diff changeset
   257
void TmsHandler::ProcessUplinkStreamChangeEvent(TInt aState)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
    {
65
hgs
parents: 27
diff changeset
   259
    CSPLOGSTRING(CSPINT, "TmsHandler::ProcessUplinkStreamChangeEvent");
hgs
parents: 27
diff changeset
   260
    switch (aState)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
        {
65
hgs
parents: 27
diff changeset
   262
        case TMS_STREAM_INITIALIZED:
hgs
parents: 27
diff changeset
   263
            iUplInitializing = EFalse;
hgs
parents: 27
diff changeset
   264
            if (iStartAfterInitComplete)
hgs
parents: 27
diff changeset
   265
                {
hgs
parents: 27
diff changeset
   266
                iStartAfterInitComplete = EFalse;
hgs
parents: 27
diff changeset
   267
                TInt status = StartStreams();
hgs
parents: 27
diff changeset
   268
                if (status != TMS_RESULT_SUCCESS)
hgs
parents: 27
diff changeset
   269
                    {
hgs
parents: 27
diff changeset
   270
                    iObserver->AudioStreamsError(status);
hgs
parents: 27
diff changeset
   271
                    }
hgs
parents: 27
diff changeset
   272
                }
hgs
parents: 27
diff changeset
   273
            break;
hgs
parents: 27
diff changeset
   274
        case TMS_STREAM_UNINITIALIZED:
hgs
parents: 27
diff changeset
   275
            // As result of Deinit() or error
hgs
parents: 27
diff changeset
   276
            iUplInitializing = EFalse;
hgs
parents: 27
diff changeset
   277
            iStartAfterInitComplete = EFalse;
hgs
parents: 27
diff changeset
   278
            break;
hgs
parents: 27
diff changeset
   279
        case TMS_STREAM_PAUSED:
hgs
parents: 27
diff changeset
   280
            break;
hgs
parents: 27
diff changeset
   281
        case TMS_STREAM_STARTED:
hgs
parents: 27
diff changeset
   282
            if (AreStreamsStarted())
hgs
parents: 27
diff changeset
   283
                {
hgs
parents: 27
diff changeset
   284
                iObserver->AudioStreamsStarted();
hgs
parents: 27
diff changeset
   285
                }
hgs
parents: 27
diff changeset
   286
            break;
hgs
parents: 27
diff changeset
   287
        default:
hgs
parents: 27
diff changeset
   288
            break;
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   289
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   290
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   291
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   292
// ----------------------------------------------------------------------------
65
hgs
parents: 27
diff changeset
   293
// TmsHandler::ProcessDownlinkStreamChangeEvent
hgs
parents: 27
diff changeset
   294
// Processes Downlink stream state change events.
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   295
// ----------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   296
//
65
hgs
parents: 27
diff changeset
   297
void TmsHandler::ProcessDownlinkStreamChangeEvent(TInt aState)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   298
    {
65
hgs
parents: 27
diff changeset
   299
    CSPLOGSTRING(CSPINT, "TmsHandler::ProcessDownlinkStreamChangeEvent");
hgs
parents: 27
diff changeset
   300
    switch (aState)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
        {
65
hgs
parents: 27
diff changeset
   302
        case TMS_STREAM_INITIALIZED:
hgs
parents: 27
diff changeset
   303
            iDnlInitializing = EFalse;
hgs
parents: 27
diff changeset
   304
            if (iStartAfterInitComplete)
hgs
parents: 27
diff changeset
   305
                {
hgs
parents: 27
diff changeset
   306
                iStartAfterInitComplete = EFalse;
hgs
parents: 27
diff changeset
   307
                TInt status = StartStreams();
hgs
parents: 27
diff changeset
   308
                if (status != TMS_RESULT_SUCCESS)
hgs
parents: 27
diff changeset
   309
                    {
hgs
parents: 27
diff changeset
   310
                    iObserver->AudioStreamsError(status);
hgs
parents: 27
diff changeset
   311
                    }
hgs
parents: 27
diff changeset
   312
                }
hgs
parents: 27
diff changeset
   313
            break;
hgs
parents: 27
diff changeset
   314
        case TMS_STREAM_UNINITIALIZED:
hgs
parents: 27
diff changeset
   315
            // As result of Deinit() or error
hgs
parents: 27
diff changeset
   316
            iDnlInitializing = EFalse;
hgs
parents: 27
diff changeset
   317
            iStartAfterInitComplete = EFalse;
hgs
parents: 27
diff changeset
   318
            break;
hgs
parents: 27
diff changeset
   319
        case TMS_STREAM_PAUSED:
hgs
parents: 27
diff changeset
   320
            break;
hgs
parents: 27
diff changeset
   321
        case TMS_STREAM_STARTED:
hgs
parents: 27
diff changeset
   322
            if (AreStreamsStarted())
hgs
parents: 27
diff changeset
   323
                {
hgs
parents: 27
diff changeset
   324
                iObserver->AudioStreamsStarted();
hgs
parents: 27
diff changeset
   325
                }
hgs
parents: 27
diff changeset
   326
            break;
hgs
parents: 27
diff changeset
   327
        default:
hgs
parents: 27
diff changeset
   328
            break;
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332
// TMS CALLBACKS
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   333
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   334
// ----------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   335
// TmsHandler::TMSStreamEvent
65
hgs
parents: 27
diff changeset
   336
// From TMSStreamObserver
hgs
parents: 27
diff changeset
   337
// TMS call audio stream control event handler.
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   338
// ----------------------------------------------------------------------------
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   339
//
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   340
void TmsHandler::TMSStreamEvent(const TMSStream& stream, TMSSignalEvent event)
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   341
    {
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   342
    CSPLOGSTRING2(CSPINT, "TmsHandler::TMSStreamEvent status %d", event.reason);
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   343
65
hgs
parents: 27
diff changeset
   344
    TMSStreamType strmType = const_cast<TMSStream&> (stream).GetStreamType();
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   345
65
hgs
parents: 27
diff changeset
   346
    if (strmType == TMS_STREAM_UPLINK)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   347
        {
65
hgs
parents: 27
diff changeset
   348
        if (event.type == TMS_EVENT_STREAM_STATE_CHANGED)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   349
            {
65
hgs
parents: 27
diff changeset
   350
            ProcessUplinkStreamChangeEvent(event.curr_state);
hgs
parents: 27
diff changeset
   351
            }
hgs
parents: 27
diff changeset
   352
        else if (event.type == TMS_EVENT_STREAM_STATE_CHANGE_ERROR)
hgs
parents: 27
diff changeset
   353
            {
hgs
parents: 27
diff changeset
   354
            Panic( ECSPPanicAudioStreamInitFailure );
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
            }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
        }
65
hgs
parents: 27
diff changeset
   357
    else if (strmType == TMS_STREAM_DOWNLINK)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   358
        {
65
hgs
parents: 27
diff changeset
   359
        if (event.type == TMS_EVENT_STREAM_STATE_CHANGED)
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
            {
65
hgs
parents: 27
diff changeset
   361
            ProcessDownlinkStreamChangeEvent(event.curr_state);
hgs
parents: 27
diff changeset
   362
            }
hgs
parents: 27
diff changeset
   363
        else if (event.type == TMS_EVENT_STREAM_STATE_CHANGE_ERROR)
hgs
parents: 27
diff changeset
   364
            {
hgs
parents: 27
diff changeset
   365
            Panic( ECSPPanicAudioStreamInitFailure );
27
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
            }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
        }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
    }
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
2f8f8080a020 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
//  End of File