zeroconf/zeroconfsharing/musicprovider.h
author guru.kini@nokia.com
Wed, 21 Jul 2010 14:28:48 +0530
changeset 21 ff5174af067c
permissions -rw-r--r--
ZeroConf Sharing Application
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     1
/*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     3
* All rights reserved.
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     4
* This component and the accompanying materials are made available
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     6
* which accompanies this distribution, and is available
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     8
*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     9
* Initial Contributors:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    11
*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    12
* Contributors:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    13
*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    14
* Description: 
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    15
*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    16
*/
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    17
#ifndef MUSICPROVIDER_H_
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    18
#define MUSICPROVIDER_H_
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    19
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    20
#include <e32base.h>
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    21
#include <mpxplaybackobserver.h>
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    22
#include <mpxplaybackutility.h>
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    23
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    24
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    25
class MNowPlayObserver;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    26
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    27
class CMusicProvider: public MMPXPlaybackObserver, 
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    28
                      public MMPXPlaybackCallback
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    29
    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    30
public:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    31
    static CMusicProvider* NewL(MNowPlayObserver* aOb);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    32
    ~CMusicProvider();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    33
    void StartTestL();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    34
    void RequestMediaL();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    35
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    36
private:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    37
    CMusicProvider(MNowPlayObserver* aOb);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    38
    void ConstructL();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    39
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    40
public:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    41
    //From MMPXPlaybackObserver
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    42
    void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    43
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    44
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    45
    //Callbacks from MMPXPlaybackCallback
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    46
    void HandlePropertyL(TMPXPlaybackProperty aProperty,
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    47
                                 TInt aValue, 
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    48
                                 TInt aError);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    49
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    50
    void HandleSubPlayerNamesL(TUid aPlayer, 
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    51
                                       const MDesCArray* aSubPlayers,
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    52
                                       TBool aComplete,
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    53
                                       TInt aError
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    54
                                       );
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    55
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    56
    void HandleMediaL(const CMPXMedia& aProperties,
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    57
                              TInt aError);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    58
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    59
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    60
    void DoHandlePlaybackMessageL( const CMPXMessage& aMessage );
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    61
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    62
private:    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    63
    MMPXPlaybackUtility*               iPlaybackUtility;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    64
    RBuf                               iBuf;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    65
    MNowPlayObserver*                  iObserver;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    66
    RBuf                               iPreviousTrack;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    67
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    68
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    69
    };
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    70
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    71
#endif /* MUSICPROVIDER_H_ */