/usr/share/veromix/dbus-service/VeromixDbus.py is in veromix-common 0.18.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2012 Nik Lutz <nik.lutz@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import signal
import sys
import dbus
import dbus.service
#from PulseAudio import *
from pulseaudio.PulseVolume import *
###
# The DBUS interface we offer
###
class VeromixDbus(dbus.service.Object):
#interface = "org.veromix.pulseaudioservice"
def __init__(self, pulseaudio, conn , object_path='/org/veromix/pulseaudio'):
dbus.service.Object.__init__(self, conn, object_path)
self.pulse = pulseaudio
self.VERSION = 15
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='')
def veromix_startup(self):
pass
## ----------------------------- source -----------------------------------------
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='isba{ia{si}}a{ss}a{ss}s')
def source_info(self, index, name , mute, volume , dictProperties, ports, active_port):
pass
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='d')
def source_remove(self, index ):
pass
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='id')
def volume_meter_source(self, index,value ):
pass
@dbus.service.method("org.veromix.pulseaudio", in_signature='s', out_signature='')
def set_default_source(self, index):
self.pulse.pulse_set_default_source(index)
## ----------------------------- source output-----------------------------------------
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='isa{ss}')
def source_output_info(self, index, name , dictProperties):
pass
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='i')
def source_output_remove(self, index ):
pass
@dbus.service.method("org.veromix.pulseaudio", in_signature='ib', out_signature='')
def source_mute(self, index, mute):
self.pulse.pulse_source_mute(int(index), int(mute))
@dbus.service.method("org.veromix.pulseaudio", in_signature='is', out_signature='')
def source_port(self, index, portstr):
self.pulse.pulse_set_source_port(int(index), portstr)
@dbus.service.method("org.veromix.pulseaudio", in_signature='iai', out_signature='')
def source_volume(self, index, vol):
self.pulse.pulse_set_source_volume(index, PulseVolume(vol))
@dbus.service.method("org.veromix.pulseaudio", in_signature='ii', out_signature='')
def move_source_output(self, index, output):
self.pulse.pulse_move_source_output( index, output)
@dbus.service.method("org.veromix.pulseaudio", in_signature='is', out_signature='')
def toggle_monitor_of_source(self, source_index, named ):
self.pulse.pulse_toggle_monitor_of_source( source_index, named)
## -----------------------------sink -----------------------------------------
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='isba{ia{si}}a{ss}a{ss}s')
def sink_info(self, index, name , mute, volume , dictProperties, ports, active_port):
pass
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='i')
def sink_remove(self, index ):
pass
@dbus.service.method("org.veromix.pulseaudio", in_signature='ib', out_signature='')
def sink_mute(self, index, mute):
self.pulse.pulse_sink_mute(int(index), int(mute))
@dbus.service.method("org.veromix.pulseaudio", in_signature='is', out_signature='')
def sink_port(self, index, portstr):
self.pulse.pulse_set_sink_port(int(index), portstr)
@dbus.service.method("org.veromix.pulseaudio", in_signature='iai', out_signature='')
def sink_volume(self, index, vol):
self.pulse.pulse_set_sink_volume(int(index), PulseVolume(vol))
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='id')
def volume_meter_sink(self, index,value ):
pass
@dbus.service.method("org.veromix.pulseaudio", in_signature='is', out_signature='')
def toggle_monitor_of_sink(self, sink_index,named ):
self.pulse.pulse_toggle_monitor_of_sink( sink_index, named)
@dbus.service.method("org.veromix.pulseaudio", in_signature='s', out_signature='')
def set_default_sink(self, index):
self.pulse.pulse_set_default_sink(index)
@dbus.service.method("org.veromix.pulseaudio", in_signature='ii', out_signature='')
def create_combined_sink(self, fist_sink_index, second_sink_index):
self.pulse.create_combined_sink(fist_sink_index, second_sink_index)
## -----------------------------sink input-----------------------------------------
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='isba{ia{si}}a{ss}')
def sink_input_info(self, index, name , mute, volume , dictProperties):
pass
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='i')
def sink_input_remove(self, index ):
pass
@dbus.service.method("org.veromix.pulseaudio", in_signature='i', out_signature='')
def sink_input_kill(self, index):
self.pulse.pulse_sink_input_kill(int(index))
@dbus.service.method("org.veromix.pulseaudio", in_signature='ib', out_signature='')
def sink_input_mute(self, index, mute):
self.pulse.pulse_sink_input_mute(int(index), int(mute))
@dbus.service.method("org.veromix.pulseaudio", in_signature='iai', out_signature='')
def sink_input_volume(self, index, vol):
v = PulseVolume(vol)
self.pulse.pulse_set_sink_input_volume( index , v)
@dbus.service.method("org.veromix.pulseaudio", in_signature='ii', out_signature='')
def move_sink_input(self, index, output):
self.pulse.pulse_move_sink_input( index, output)
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='id')
def volume_meter_sink_input(self, index,value ):
pass
@dbus.service.method("org.veromix.pulseaudio", in_signature='iis', out_signature='')
def toggle_monitor_of_sinkinput(self, sink_input_index, sink_index, named ):
self.pulse.pulse_toggle_monitor_of_sinkinput( sink_input_index, sink_index, named)
## ----------------------------- card info -----------------------------------------
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='isa{ss}sa{sa{ss}}')
def card_info(self, index, name , properties, active_profile_name , profiles):
pass
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='i')
def card_remove(self, index ):
pass
@dbus.service.method("org.veromix.pulseaudio", in_signature='is', out_signature='')
def set_card_profile(self, index, value):
self.pulse.pulse_set_card_profile(index, value)
## ----------------------------- Modules -----------------------------------------
@dbus.service.signal(dbus_interface="org.veromix.notification", signature='issss')
def module_info(self, index, name, argument, n_used, auto_unload):
pass
@dbus.service.method("org.veromix.pulseaudio", in_signature='iis', out_signature='')
def set_ladspa_sink(self, sink_index, module_index, parameters):
self.pulse.set_ladspa_sink(sink_index, module_index, parameters)
@dbus.service.method("org.veromix.pulseaudio", in_signature='i', out_signature='')
def remove_ladspa_sink(self, sink_index):
self.pulse.remove_ladspa_sink(sink_index)
@dbus.service.method("org.veromix.pulseaudio", in_signature='i', out_signature='')
def remove_combined_sink(self, sink_index):
self.pulse.remove_combined_sink(sink_index)
## ----------------------------- generic -----------------------------------------
@dbus.service.method("org.veromix.pulseaudio", in_signature='', out_signature='')
def requestInfo(self):
self.pulse.requestInfo()
@dbus.service.method("org.veromix.pulseaudio", in_signature='', out_signature='i')
def veromix_service_version(self):
return self.VERSION
@dbus.service.method("org.veromix.pulseaudio", in_signature='b', out_signature='')
def set_autostart_meters(self, aboolean):
self.pulse.set_autostart_meters(aboolean)
@dbus.service.method("org.veromix.pulseaudio", in_signature='', out_signature='')
def veromix_service_quit(self):
sys.exit(0)
|