File indexing completed on 2024-12-22 04:33:56

0001 //SPDX-FileCopyrightText: 2015 Jolla Ltd. <valerio.valerio@jolla.com>
0002 //SPDX-FileContributor: Andres Gomez
0003 //
0004 //SPDX-License-Identifier: LGPL-2.1-or-later
0005 
0006 
0007 #include "mprisplugin.h"
0008 
0009 #include "mpris.h"
0010 #include "mprisplayer.h"
0011 #include "mprismanager.h"
0012 
0013 #include <qqml.h>
0014 
0015 static QObject * api_factory(QQmlEngine *, QJSEngine *)
0016 {
0017     return new Mpris;
0018 }
0019 
0020 MprisPlugin::MprisPlugin(QObject *parent) :
0021     QQmlExtensionPlugin(parent)
0022 {
0023 }
0024 
0025 MprisPlugin::~MprisPlugin()
0026 {
0027 }
0028 
0029 void MprisPlugin::registerTypes(const char *uri)
0030 {
0031     qmlRegisterSingletonType<Mpris>(uri, 1, 0, "Mpris", api_factory);
0032     qmlRegisterType<MprisPlayer>(uri, 1, 0, "MprisPlayer");
0033     qmlRegisterType<MprisManager>(uri, 1, 0, "MprisManager");
0034 }