ifdef dbus stuff for X11 only.
This commit is contained in:
parent
a8a37264f7
commit
f9972183c5
@ -64,7 +64,6 @@ set(CLEMENTINE-SOURCES
|
|||||||
globalshortcuts/globalshortcuts.cpp
|
globalshortcuts/globalshortcuts.cpp
|
||||||
fixlastfm.cpp
|
fixlastfm.cpp
|
||||||
backgroundthread.cpp
|
backgroundthread.cpp
|
||||||
mpris.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Header files that have Q_OBJECT in
|
# Header files that have Q_OBJECT in
|
||||||
@ -121,7 +120,6 @@ set(CLEMENTINE-MOC-HEADERS
|
|||||||
analyzers/sonogram.h
|
analyzers/sonogram.h
|
||||||
analyzers/turbine.h
|
analyzers/turbine.h
|
||||||
globalshortcuts/globalshortcuts.h
|
globalshortcuts/globalshortcuts.h
|
||||||
mpris.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# UI files
|
# UI files
|
||||||
@ -178,7 +176,7 @@ else(WIN32)
|
|||||||
set(CLEMENTINE-MOC-HEADERS ${CLEMENTINE-MOC-HEADERS} xine-engine.h)
|
set(CLEMENTINE-MOC-HEADERS ${CLEMENTINE-MOC-HEADERS} xine-engine.h)
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
# OSD
|
# OSD and DBus.
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_mac.mm)
|
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_mac.mm)
|
||||||
else(APPLE)
|
else(APPLE)
|
||||||
@ -195,6 +193,13 @@ else(APPLE)
|
|||||||
qt4_add_dbus_adaptor(MPRIS-TRACKLIST-SOURCES
|
qt4_add_dbus_adaptor(MPRIS-TRACKLIST-SOURCES
|
||||||
../data/org.freedesktop.MediaPlayer.tracklist.xml
|
../data/org.freedesktop.MediaPlayer.tracklist.xml
|
||||||
player.h Player mpris_tracklist MprisTrackList)
|
player.h Player mpris_tracklist MprisTrackList)
|
||||||
|
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES}
|
||||||
|
${MPRIS-PLAYER-SOURCES}
|
||||||
|
${MPRIS-ROOT-SOURCES}
|
||||||
|
${MPRIS-TRACKLIST-SOURCES}
|
||||||
|
mpris.cpp
|
||||||
|
)
|
||||||
|
set(CLEMENTINE-MOC-HEADERS ${CLEMENTINE-MOC-HEADERS} mpris.h)
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
@ -220,9 +225,6 @@ add_library(clementine_lib
|
|||||||
${CLEMENTINE-SOURCES-UI}
|
${CLEMENTINE-SOURCES-UI}
|
||||||
${CLEMENTINE-SOURCES-RESOURCE}
|
${CLEMENTINE-SOURCES-RESOURCE}
|
||||||
${CLEMENTINE-QM-FILES}
|
${CLEMENTINE-QM-FILES}
|
||||||
${MPRIS-ROOT-SOURCES}
|
|
||||||
${MPRIS-PLAYER-SOURCES}
|
|
||||||
${MPRIS-TRACKLIST-SOURCES}
|
|
||||||
)
|
)
|
||||||
target_link_libraries(clementine_lib
|
target_link_libraries(clementine_lib
|
||||||
qtsingleapplication
|
qtsingleapplication
|
||||||
|
@ -65,8 +65,6 @@ int main(int argc, char *argv[]) {
|
|||||||
qRegisterMetaType<DirectoryList>("DirectoryList");
|
qRegisterMetaType<DirectoryList>("DirectoryList");
|
||||||
qRegisterMetaType<SongList>("SongList");
|
qRegisterMetaType<SongList>("SongList");
|
||||||
|
|
||||||
qDBusRegisterMetaType<DBusStatus>();
|
|
||||||
qDBusRegisterMetaType<Version>();
|
|
||||||
|
|
||||||
lastfm::ws::ApiKey = LastFMService::kApiKey;
|
lastfm::ws::ApiKey = LastFMService::kApiKey;
|
||||||
lastfm::ws::SharedSecret = LastFMService::kSecret;
|
lastfm::ws::SharedSecret = LastFMService::kSecret;
|
||||||
@ -92,8 +90,13 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
QNetworkAccessManager network;
|
QNetworkAccessManager network;
|
||||||
|
|
||||||
|
// MPRIS DBus interface.
|
||||||
|
#ifdef Q_WS_X11
|
||||||
|
qDBusRegisterMetaType<DBusStatus>();
|
||||||
|
qDBusRegisterMetaType<Version>();
|
||||||
QDBusConnection::sessionBus().registerService("org.mpris.clementine");
|
QDBusConnection::sessionBus().registerService("org.mpris.clementine");
|
||||||
MPRIS mpris;
|
MPRIS mpris;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Window
|
// Window
|
||||||
MainWindow w(&network);;
|
MainWindow w(&network);;
|
||||||
|
@ -17,8 +17,12 @@
|
|||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "playlist.h"
|
#include "playlist.h"
|
||||||
#include "lastfmservice.h"
|
#include "lastfmservice.h"
|
||||||
#include "mpris_player.h"
|
|
||||||
#include "mpris_tracklist.h"
|
#ifdef Q_WS_X11
|
||||||
|
# include "mpris_player.h"
|
||||||
|
# include "mpris_tracklist.h"
|
||||||
|
# include <QDBusConnection>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
# include "phononengine.h"
|
# include "phononengine.h"
|
||||||
@ -28,7 +32,6 @@
|
|||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
#include <QtConcurrentRun>
|
#include <QtConcurrentRun>
|
||||||
#include <QDBusConnection>
|
|
||||||
|
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
|
||||||
@ -73,12 +76,15 @@ Player::Player(Playlist* playlist, LastFMService* lastfm, QObject* parent)
|
|||||||
connect(init_engine_watcher_, SIGNAL(finished()), SLOT(EngineInitFinished()));
|
connect(init_engine_watcher_, SIGNAL(finished()), SLOT(EngineInitFinished()));
|
||||||
connect(engine_, SIGNAL(error(QString)), SIGNAL(Error(QString)));
|
connect(engine_, SIGNAL(error(QString)), SIGNAL(Error(QString)));
|
||||||
|
|
||||||
|
// MPRIS DBus interface.
|
||||||
|
#ifdef Q_WS_X11
|
||||||
MprisPlayer* mpris = new MprisPlayer(this);
|
MprisPlayer* mpris = new MprisPlayer(this);
|
||||||
// Hack so the next registerObject() doesn't override this one.
|
// Hack so the next registerObject() doesn't override this one.
|
||||||
QDBusConnection::sessionBus().registerObject(
|
QDBusConnection::sessionBus().registerObject(
|
||||||
"/Player", mpris, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals);
|
"/Player", mpris, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals);
|
||||||
new MprisTrackList(this);
|
new MprisTrackList(this);
|
||||||
QDBusConnection::sessionBus().registerObject("/TrackList", this);
|
QDBusConnection::sessionBus().registerObject("/TrackList", this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Init() {
|
void Player::Init() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user