Sha256: 08c0dcb67c04ee8b003c394b2d9c28c03221745fa5f42acd40f7f41cc9951ed4

Contents?: true

Size: 1.86 KB

Versions: 17

Compression:

Stored size: 1.86 KB

Contents

#include "../../../shared/generated/cpp/MediaplayerBase.h"

namespace rho {

using namespace apiGenerator;

class CMediaplayerImpl: public CMediaplayerBase
{
public:
    CMediaplayerImpl(const rho::String& strID): CMediaplayerBase()
    {
        /*m_hashProps.put( "display", "LCD");
        m_hashProps.put( "sound", "Dolby");*/
    }

    virtual void enable( const rho::Hashtable<rho::String, rho::String>& propertyMap, CMethodResult& oResult){}
    virtual void start(CMethodResult& oResult){}
    virtual void stop(CMethodResult& oResult){}
    virtual void disable(CMethodResult& oResult){}
    virtual void take( const rho::Hashtable<rho::String, rho::String>& propertyMap, CMethodResult& oResult){}

};

class CMediaplayerSingleton: public CMediaplayerSingletonBase
{
    ~CMediaplayerSingleton(){}
    virtual rho::String getInitialDefaultID();
    virtual void enumerate(CMethodResult& oResult);
};

class CMediaplayerFactory: public CMediaplayerFactoryBase
{
    ~CMediaplayerFactory(){}
    virtual IMediaplayerSingleton* createModuleSingleton();
    virtual IMediaplayer* createModuleByID(const rho::String& strID);
};

extern "C" void Init_Mediaplayer_extension()
{
    CMediaplayerFactory::setInstance( new CMediaplayerFactory() );
    Init_Mediaplayer_API();
}

IMediaplayer* CMediaplayerFactory::createModuleByID(const rho::String& strID)
{
    return new CMediaplayerImpl(strID);
}

IMediaplayerSingleton* CMediaplayerFactory::createModuleSingleton()
{
    return new CMediaplayerSingleton();
}

void CMediaplayerSingleton::enumerate(CMethodResult& oResult)
{
    rho::Vector<rho::String> arIDs;
    arIDs.addElement("SC1");
    arIDs.addElement("SC2");

    oResult.set(arIDs);
}

rho::String CMediaplayerSingleton::getInitialDefaultID()
{
    CMethodResult oRes;
    enumerate(oRes);

    rho::Vector<rho::String>& arIDs = oRes.getStringArray();
        
    return arIDs[0];
}

}

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
rhodes-7.6.0 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-7.5.1 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-7.4.1 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-7.1.17 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-6.2.0 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-6.0.11 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-5.5.18 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-5.5.17 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-5.5.15 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-5.5.0.22 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-5.5.2 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-5.5.0.7 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-5.5.0.3 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
rhodes-5.5.0 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
tauplatform-1.0.3 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
tauplatform-1.0.2 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp
tauplatform-1.0.1 lib/commonAPI/mediaplayer/ext/platform/wp8/src/Mediaplayer_impl.cpp