Dear visitor, welcome to VDR Portal. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Das ist allerdings limitiert auf 1 Aktion pro Sekunde. Hat jemand ne Idee wie man dem Beine machen koennte ?
ut ? Kann man vielleicht mehr als eine Taste pro Call übergeben (wenn nicht von Put kommt) und woher kommt die Einsicht das es nur eine Taste pro Sekunde gibt ? Das ist allerdings limitiert auf 1 Aktion pro Sekunde. Hat jemand ne Idee wie man dem Beine machen koennte ?
|
|
Source code |
1 |
for i in $(seq 1 10) ; do svdrpsend chan ; done |
|
|
Source code |
1 |
for i in $(seq 1 10) ; do /usr/bin/dbus-send --system --type=method_call --dest=de.tvdr.vdr /Remote de.tvdr.vdr.remote.HitKey string:'right'; done |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 |
#!/usr/bin/env python
# coding=utf-8
import dbus
bus = dbus.SystemBus()
HitKey = bus.get_object('de.tvdr.vdr', '/Remote')
a = 0
while a < 10 :
a += 1
HitKey.HitKey("right",dbus_interface = 'de.tvdr.vdr.remote')
|
This post has been edited 5 times, last edit by "Keine_Ahnung" (Apr 3rd 2012, 12:09pm)
Also das
![]()
Source code
1 for i in $(seq 1 10) ; do /usr/bin/dbus-send --system --type=method_call --dest=de.tvdr.vdr /Remote de.tvdr.vdr.remote.HitKey string:'right'; done
läuft bei mir mit gefühlten 15 Anschlägen pro Sekunde. Getestet in nen Edit Feld (Da rast der Cursor nach Rechts).

Quoted
dbus2vdr benutzt intern "cRemote:: Put", siehe https://github.com/flensrocker/vdr-plugi…r/remote.c#L175
Keine Ahnung, wie "schnell" das geht oder nicht.
Quoted
Probier doch mal das restfulapi, vielleicht ist das ja schneller.
Bei Dir fehlt der Parameter --print-reply , da werde ich heute abend mal testen ob das den Ausschlag macht.
This post has been edited 1 times, last edit by "Keine_Ahnung" (Apr 3rd 2012, 12:54pm)



|
|
Source code |
1 2 3 4 5 6 7 8 9 |
#!/usr/bin/env python
# coding=utf-8
import os
a = 0
while a < 10 :
a += 1
os.system("/usr/bin/dbus-send --system --type=method_call --dest=de.tvdr.vdr /Remote de.tvdr.vdr.remote.HitKey string:'right' &")
|
Ich würde mich freuen das mal zu sehen.
Irgendwie wollte die dbus Loop nicht so in nen extra Thread so wie ich das wollte.|
|
Source code |
1 |
vdr-dbus-send /Remote remote.HitKey string:'Menu' string:'Down' string:'Down' string:'Ok' ... |

) kann ich eine Lösung für nicht-blockierende Aufrufe per dbus in Python präsentieren:|
|
Source code |
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 |
#!/bin/python
# -*- coding:"utf-8" -*-
import sys
import traceback
import gobject
import dbus
import dbus.mainloop.glib
# Callbacks for asynchronous calls
def handle_reply(r,*args):
print "replied", str(r)
return True
def handle_error(e):
print "dbus-handler raised an exception! That's not meant to happen..."
print "\t", str(e)
def make_calls(remote,key):
remote.send_key(key)
return True
class dbusVDRremote():
def __init__(self):
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
try:
proxy_obj = bus.get_object("de.tvdr.vdr", "/Remote")
self.remote = dbus.Interface(proxy_obj, "de.tvdr.vdr.remote")
except dbus.DBusException:
traceback.print_exc()
print usage
sys.exit(1)
def send_key(self, key):
self.remote.HitKey(str(key),reply_handler=handle_reply,
error_handler=handle_error)
return True
def main():
remote = dbusVDRremote()
key = "DOWN"
gobject.timeout_add(150, make_calls, remote, key) # Sends a "HitKey DOWN" every 150ms - replace by another gobject-event to do something useful... (have a look at lircd2uinput if you want to know how to read a lircd-socket using event-polling together with gobject https://github.com/yavdr/yavdr-utils/blob/master/lircd2uinput/lircd2uinput ;)
loop = gobject.MainLoop(is_running=True)
while loop.is_running():
try:
loop.run()
except:
print "Unexpected error:", sys.exc_info()[0]
raise
mainloop.quit()
if __name__ == '__main__':
main()
|
This post has been edited 6 times, last edit by "seahawk1986" (May 24th 2012, 7:23am)