mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-28 09:47:09 +02:00
Reformat cmake and python
This commit is contained in:
parent
d5677b6f78
commit
c7d301e1d7
2 changed files with 21 additions and 22 deletions
|
@ -828,32 +828,32 @@ class MPRISInterface(dbus.service.Object):
|
||||||
__root_interface: __root_props,
|
__root_interface: __root_props,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ dbus.service.method(__introspect_interface)
|
@dbus.service.method(__introspect_interface)
|
||||||
def Introspect(self):
|
def Introspect(self):
|
||||||
return MPRIS2_INTROSPECTION
|
return MPRIS2_INTROSPECTION
|
||||||
|
|
||||||
@ dbus.service.signal(__prop_interface, signature="sa{sv}as")
|
@dbus.service.signal(__prop_interface, signature="sa{sv}as")
|
||||||
def PropertiesChanged(self, interface, changed_properties,
|
def PropertiesChanged(self, interface, changed_properties,
|
||||||
invalidated_properties):
|
invalidated_properties):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ dbus.service.method(__prop_interface,
|
@dbus.service.method(__prop_interface,
|
||||||
in_signature="ss", out_signature="v")
|
in_signature="ss", out_signature="v")
|
||||||
def Get(self, interface, prop):
|
def Get(self, interface, prop):
|
||||||
getter, setter = self.__prop_mapping[interface][prop]
|
getter, setter = self.__prop_mapping[interface][prop]
|
||||||
if callable(getter):
|
if callable(getter):
|
||||||
return getter()
|
return getter()
|
||||||
return getter
|
return getter
|
||||||
|
|
||||||
@ dbus.service.method(__prop_interface,
|
@dbus.service.method(__prop_interface,
|
||||||
in_signature="ssv", out_signature="")
|
in_signature="ssv", out_signature="")
|
||||||
def Set(self, interface, prop, value):
|
def Set(self, interface, prop, value):
|
||||||
getter, setter = self.__prop_mapping[interface][prop]
|
getter, setter = self.__prop_mapping[interface][prop]
|
||||||
if setter is not None:
|
if setter is not None:
|
||||||
setter(value)
|
setter(value)
|
||||||
|
|
||||||
@ dbus.service.method(__prop_interface,
|
@dbus.service.method(__prop_interface,
|
||||||
in_signature="s", out_signature="a{sv}")
|
in_signature="s", out_signature="a{sv}")
|
||||||
def GetAll(self, interface):
|
def GetAll(self, interface):
|
||||||
read_props = {}
|
read_props = {}
|
||||||
props = self.__prop_mapping[interface]
|
props = self.__prop_mapping[interface]
|
||||||
|
@ -874,49 +874,49 @@ class MPRISInterface(dbus.service.Object):
|
||||||
return value
|
return value
|
||||||
|
|
||||||
# Root methods
|
# Root methods
|
||||||
@ dbus.service.method(__root_interface, in_signature='', out_signature='')
|
@dbus.service.method(__root_interface, in_signature='', out_signature='')
|
||||||
def Raise(self):
|
def Raise(self):
|
||||||
logger.debug('Raise')
|
logger.debug('Raise')
|
||||||
webbrowser.open(url=f'http://{params["host"]}:{params["port"]}', new=1)
|
webbrowser.open(url=f'http://{params["host"]}:{params["port"]}', new=1)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ dbus.service.method(__root_interface, in_signature='', out_signature='')
|
@dbus.service.method(__root_interface, in_signature='', out_signature='')
|
||||||
def Quit(self):
|
def Quit(self):
|
||||||
logger.debug('Quit')
|
logger.debug('Quit')
|
||||||
return
|
return
|
||||||
|
|
||||||
# Player methods
|
# Player methods
|
||||||
@ dbus.service.method(__player_interface, in_signature='', out_signature='')
|
@dbus.service.method(__player_interface, in_signature='', out_signature='')
|
||||||
def Next(self):
|
def Next(self):
|
||||||
snapcast_wrapper.control("next")
|
snapcast_wrapper.control("next")
|
||||||
return
|
return
|
||||||
|
|
||||||
@ dbus.service.method(__player_interface, in_signature='', out_signature='')
|
@dbus.service.method(__player_interface, in_signature='', out_signature='')
|
||||||
def Previous(self):
|
def Previous(self):
|
||||||
snapcast_wrapper.control("previous")
|
snapcast_wrapper.control("previous")
|
||||||
return
|
return
|
||||||
|
|
||||||
@ dbus.service.method(__player_interface, in_signature='', out_signature='')
|
@dbus.service.method(__player_interface, in_signature='', out_signature='')
|
||||||
def Pause(self):
|
def Pause(self):
|
||||||
snapcast_wrapper.control("pause")
|
snapcast_wrapper.control("pause")
|
||||||
return
|
return
|
||||||
|
|
||||||
@ dbus.service.method(__player_interface, in_signature='', out_signature='')
|
@dbus.service.method(__player_interface, in_signature='', out_signature='')
|
||||||
def PlayPause(self):
|
def PlayPause(self):
|
||||||
snapcast_wrapper.control("playPause")
|
snapcast_wrapper.control("playPause")
|
||||||
return
|
return
|
||||||
|
|
||||||
@ dbus.service.method(__player_interface, in_signature='', out_signature='')
|
@dbus.service.method(__player_interface, in_signature='', out_signature='')
|
||||||
def Stop(self):
|
def Stop(self):
|
||||||
snapcast_wrapper.control("stop")
|
snapcast_wrapper.control("stop")
|
||||||
return
|
return
|
||||||
|
|
||||||
@ dbus.service.method(__player_interface, in_signature='', out_signature='')
|
@dbus.service.method(__player_interface, in_signature='', out_signature='')
|
||||||
def Play(self):
|
def Play(self):
|
||||||
snapcast_wrapper.control("play")
|
snapcast_wrapper.control("play")
|
||||||
return
|
return
|
||||||
|
|
||||||
@ dbus.service.method(__player_interface, in_signature='x', out_signature='')
|
@dbus.service.method(__player_interface, in_signature='x', out_signature='')
|
||||||
def Seek(self, offset):
|
def Seek(self, offset):
|
||||||
logger.debug(f'Seek {offset}')
|
logger.debug(f'Seek {offset}')
|
||||||
snapcast_wrapper.control("seek", {"offset": float(offset) / 1000000})
|
snapcast_wrapper.control("seek", {"offset": float(offset) / 1000000})
|
||||||
|
@ -933,7 +933,7 @@ class MPRISInterface(dbus.service.Object):
|
||||||
# self.Seeked(position * 1000000)
|
# self.Seeked(position * 1000000)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ dbus.service.method(__player_interface, in_signature='ox', out_signature='')
|
@dbus.service.method(__player_interface, in_signature='ox', out_signature='')
|
||||||
def SetPosition(self, trackid, position):
|
def SetPosition(self, trackid, position):
|
||||||
logger.debug(f'setPosition trackId: {trackid}, position: {position}')
|
logger.debug(f'setPosition trackId: {trackid}, position: {position}')
|
||||||
snapcast_wrapper.control(
|
snapcast_wrapper.control(
|
||||||
|
@ -951,14 +951,14 @@ class MPRISInterface(dbus.service.Object):
|
||||||
# self.Seeked(position * 1000000)
|
# self.Seeked(position * 1000000)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ dbus.service.method(__player_interface, in_signature='', out_signature='')
|
@dbus.service.method(__player_interface, in_signature='', out_signature='')
|
||||||
def OpenUri(self):
|
def OpenUri(self):
|
||||||
logger.debug('OpenUri')
|
logger.debug('OpenUri')
|
||||||
# TODO
|
# TODO
|
||||||
return
|
return
|
||||||
|
|
||||||
# Player signals
|
# Player signals
|
||||||
@ dbus.service.signal(__player_interface, signature='x')
|
@dbus.service.signal(__player_interface, signature='x')
|
||||||
def Seeked(self, position):
|
def Seeked(self, position):
|
||||||
logger.debug(f'Seeked to {position}')
|
logger.debug(f'Seeked to {position}')
|
||||||
snapcast_wrapper.properties['position'] = float(position) / 1000000
|
snapcast_wrapper.properties['position'] = float(position) / 1000000
|
||||||
|
|
|
@ -37,7 +37,6 @@ include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/server)
|
||||||
|
|
||||||
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
|
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
|
||||||
|
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
find_package(vorbis REQUIRED CONFIG)
|
find_package(vorbis REQUIRED CONFIG)
|
||||||
list(APPEND SERVER_LIBRARIES boost::boost)
|
list(APPEND SERVER_LIBRARIES boost::boost)
|
||||||
|
@ -70,7 +69,7 @@ else()
|
||||||
list(APPEND SERVER_LIBRARIES ${VORBIS_LIBRARIES} ${VORBISENC_LIBRARIES}
|
list(APPEND SERVER_LIBRARIES ${VORBIS_LIBRARIES} ${VORBISENC_LIBRARIES}
|
||||||
${OGG_LIBRARIES})
|
${OGG_LIBRARIES})
|
||||||
include_directories(${OGG_INCLUDE_DIRS} ${VORBIS_INCLUDE_DIRS}
|
include_directories(${OGG_INCLUDE_DIRS} ${VORBIS_INCLUDE_DIRS}
|
||||||
${VORBISENC_INCLUDE_DIRS})
|
${VORBISENC_INCLUDE_DIRS})
|
||||||
link_directories(${VORBIS_LIBRARY_DIRS})
|
link_directories(${VORBIS_LIBRARY_DIRS})
|
||||||
link_directories(${VORBISENC_LIBRARY_DIRS})
|
link_directories(${VORBISENC_LIBRARY_DIRS})
|
||||||
link_directories(${OGG_LIBRARY_DIRS})
|
link_directories(${OGG_LIBRARY_DIRS})
|
||||||
|
|
Loading…
Add table
Reference in a new issue