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 <Mpris>
0008 #include <MprisPlayer>
0009 
0010 #include <QtQuick>
0011 
0012 #include <QGuiApplication>
0013 
0014 static QObject * api_factory(QQmlEngine *, QJSEngine *)
0015 {
0016     return new Mpris;
0017 }
0018 
0019 int main(int argc, char *argv[])
0020 {
0021     QGuiApplication *app = new QGuiApplication(argc, argv);
0022     QQuickView *view = new QQuickView;
0023 
0024     qmlRegisterSingletonType<Mpris>("org.nemomobile.qtmpris", 1, 0, "Mpris", api_factory);
0025     qmlRegisterType<MprisPlayer>("org.nemomobile.qtmpris", 1, 0, "MprisPlayer");
0026 
0027     view->setSource(app->applicationDirPath().append("/../qml/player.qml"));
0028     view->show();
0029 
0030     int retVal = app->exec();
0031 
0032     return retVal;
0033 }