content/media/webspeech/synth/pico/PicoModule.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/media/webspeech/synth/pico/PicoModule.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "mozilla/ModuleUtils.h"
     1.9 +#include "nsIClassInfoImpl.h"
    1.10 +
    1.11 +#ifdef MOZ_WEBRTC
    1.12 +
    1.13 +#include "nsPicoService.h"
    1.14 +
    1.15 +using namespace mozilla::dom;
    1.16 +
    1.17 +#define PICOSERVICE_CID \
    1.18 +  {0x346c4fc8, 0x12fe, 0x459c, {0x81, 0x19, 0x9a, 0xa7, 0x73, 0x37, 0x7f, 0xf4}}
    1.19 +
    1.20 +#define PICOSERVICE_CONTRACTID "@mozilla.org/synthpico;1"
    1.21 +
    1.22 +// Defines nsPicoServiceConstructor
    1.23 +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPicoService,
    1.24 +                                         nsPicoService::GetInstanceForService)
    1.25 +
    1.26 +// Defines kPICOSERVICE_CID
    1.27 +NS_DEFINE_NAMED_CID(PICOSERVICE_CID);
    1.28 +
    1.29 +static const mozilla::Module::CIDEntry kCIDs[] = {
    1.30 +  { &kPICOSERVICE_CID, true, nullptr, nsPicoServiceConstructor },
    1.31 +  { nullptr }
    1.32 +};
    1.33 +
    1.34 +static const mozilla::Module::ContractIDEntry kContracts[] = {
    1.35 +  { PICOSERVICE_CONTRACTID, &kPICOSERVICE_CID },
    1.36 +  { nullptr }
    1.37 +};
    1.38 +
    1.39 +static const mozilla::Module::CategoryEntry kCategories[] = {
    1.40 +  { "profile-after-change", "Pico Speech Synth", PICOSERVICE_CONTRACTID },
    1.41 +  { nullptr }
    1.42 +};
    1.43 +
    1.44 +static void
    1.45 +UnloadPicoModule()
    1.46 +{
    1.47 +  nsPicoService::Shutdown();
    1.48 +}
    1.49 +
    1.50 +static const mozilla::Module kModule = {
    1.51 +  mozilla::Module::kVersion,
    1.52 +  kCIDs,
    1.53 +  kContracts,
    1.54 +  kCategories,
    1.55 +  nullptr,
    1.56 +  nullptr,
    1.57 +  UnloadPicoModule
    1.58 +};
    1.59 +
    1.60 +NSMODULE_DEFN(synthpico) = &kModule;
    1.61 +#endif

mercurial