mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp
branchRCL_3
changeset 10 3d8c721bf319
parent 3 4f62049db6ac
child 13 f5c5c82a163e
equal deleted inserted replaced
8:e35735ece90c 10:3d8c721bf319
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include <tms.h>
    18 #include <tms.h>
    19 #include <tmseffectobsrvr.h>
    19 #include <tmseffectobsrvr.h>
       
    20 #include "tmsutility.h"
    20 #include "tmscallproxy.h"
    21 #include "tmscallproxy.h"
    21 #include "tmsqueuehandler.h"
    22 #include "tmsqueuehandler.h"
    22 #include "tmsvolumeeffectbodyimpl.h"
    23 #include "tmsvolumeeffectbodyimpl.h"
    23 
    24 
    24 using namespace TMS;
    25 using namespace TMS;
    25 
    26 
    26 TMSVolumeEffectBodyImpl::TMSVolumeEffectBodyImpl() :
    27 TMSVolumeEffectBodyImpl::TMSVolumeEffectBodyImpl() :
    27     iObserver(NULL),
    28     iObserver(NULL),
    28     iProxy(NULL),
    29     iProxy(NULL),
    29     iParentEffect(NULL)
    30     iParent(NULL)
    30     {
    31     {
    31     }
    32     }
    32 
    33 
    33 TMSVolumeEffectBodyImpl::~TMSVolumeEffectBodyImpl()
    34 TMSVolumeEffectBodyImpl::~TMSVolumeEffectBodyImpl()
    34     {
    35     {
       
    36     TRACE_PRN_FN_ENT;
       
    37     TRACE_PRN_FN_EXT;
    35     }
    38     }
    36 
    39 
    37 gint TMSVolumeEffectBodyImpl::Create(TMSVolumeEffectBody*& bodyimpl)
    40 gint TMSVolumeEffectBodyImpl::Create(TMSVolumeEffectBody*& bodyimpl)
    38     {
    41     {
    39     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
    42     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
   134     gint ret(TMS_RESULT_SUCCESS);
   137     gint ret(TMS_RESULT_SUCCESS);
   135     effecttype = TMS_EFFECT_VOLUME;
   138     effecttype = TMS_EFFECT_VOLUME;
   136     return ret;
   139     return ret;
   137     }
   140     }
   138 
   141 
   139 gint TMSVolumeEffectBodyImpl::SetParentEffect(TMSEffect*& parenteffect)
   142 void TMSVolumeEffectBodyImpl::SetParent(TMSEffect*& parent)
   140     {
   143     {
   141     gint ret(TMS_RESULT_SUCCESS);
   144     iParent = parent;
   142     iParentEffect = NULL;
       
   143     iParentEffect = parenteffect;
       
   144     return ret;
       
   145     }
   145     }
   146 
   146 
   147 void TMSVolumeEffectBodyImpl::SetProxy(TMSCallProxy* aProxy,
   147 void TMSVolumeEffectBodyImpl::SetProxy(TMSCallProxy* aProxy,
   148         gpointer queuehandler)
   148         gpointer queuehandler)
   149     {
   149     {
   150     iProxy = aProxy;
   150     iProxy = aProxy;
   151     if (queuehandler)
   151     if (queuehandler)
   152         {
   152         {
   153         ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_EFFECT_VOLUME);
   153         ((TMSQueueHandler*) queuehandler)->AddObserver(*this,
       
   154                 TMS_EFFECT_VOLUME);
   154         }
   155         }
   155     }
   156     }
   156 
   157 
   157 void TMSVolumeEffectBodyImpl::QueueEvent(TInt aEventType, TInt aError,
   158 void TMSVolumeEffectBodyImpl::QueueEvent(TInt aEventType, TInt aError,
   158         void* /*user_data*/)
   159         void* /*user_data*/)
   159     {
   160     {
   160     TMSSignalEvent event;
   161     TMSSignalEvent event;
   161 
       
   162     event.type = TMS_EVENT_EFFECT_VOL_CHANGED;
   162     event.type = TMS_EVENT_EFFECT_VOL_CHANGED;
   163     event.reason = aError;
   163     event.reason = aError;
   164 
   164 
   165     switch (aEventType)
   165     switch (aEventType)
   166         {
   166         {
   167         case TMS_EVENT_EFFECT_VOL_CHANGED:
   167         case TMS_EVENT_EFFECT_VOL_CHANGED:
   168             {
   168             {
   169             if (iObserver && iParentEffect)
   169             if (iObserver && iParent)
   170                 {
   170                 {
   171                 iObserver->EffectsEvent(iParentEffect, event);
   171                 iObserver->EffectsEvent(iParent, event);
   172                 }
   172                 }
   173             }
   173             }
   174             break;
   174             break;
   175         default:
   175         default:
   176             break;
   176             break;
   177         }
   177         }
   178     }
   178     }
   179 
   179 
   180 // End of file