change file permission to bitake epydial correct

git-svn-id: http://www.neo1973-germany.de/svn@237 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
fgau 2009-02-02 13:50:32 +00:00
parent b54ad19759
commit f8344c8971
6 changed files with 39 additions and 8 deletions

View file

@ -16,11 +16,13 @@ from httplib import HTTPConnection
from urllib import urlencode from urllib import urlencode
from urlparse import urlparse, urlunparse from urlparse import urlparse, urlunparse
from xml.dom.minidom import parseString from xml.dom.minidom import parseString
from pyneo.dns_support import DNSCache #require: export PYTHONPATH=/usr/share/pyneod from pyneo.dns_support import DNSCache #require: 'export PYTHONPATH=/usr/share/pyneod'
class AudioScreen(EdjeGroup): class AudioScreen(EdjeGroup):
toggle = 0 toggle = 0
volume = 0.1 volume = 0.1
position_timer = None
e_timer = None
def __init__(self, screen_manager): def __init__(self, screen_manager):
EdjeGroup.__init__(self, screen_manager, AUDIO_SCREEN_NAME) EdjeGroup.__init__(self, screen_manager, AUDIO_SCREEN_NAME)
@ -72,7 +74,12 @@ class AudioScreen(EdjeGroup):
def register_pyneo_callbacks(self): def register_pyneo_callbacks(self):
PyneoController.register_callback("on_get_mp3_tags", self.on_get_mp3_tags) PyneoController.register_callback("on_get_mp3_tags", self.on_get_mp3_tags)
PyneoController.register_callback("on_get_song_duration", self.on_get_song_duration) PyneoController.register_callback("on_get_song_duration", self.on_get_song_duration)
# PyneoController.register_callback("on_get_song_position", self.on_get_song_position) PyneoController.register_callback("on_get_song_position", self.on_get_song_position)
def on_get_song_position(self, status):
self.position_timer = status = time.time()
self.e_timer = ecore.timer_add(1.0, self.display_position)
self.display_position()
def on_get_song_duration(self, status): def on_get_song_duration(self, status):
self.part_text_set("duration", "%s" % time.ctime(status)[14:][:5]) self.part_text_set("duration", "%s" % time.ctime(status)[14:][:5])
@ -80,6 +87,7 @@ class AudioScreen(EdjeGroup):
def on_get_mp3_tags(self, status): def on_get_mp3_tags(self, status):
PyneoController.get_song_duration() PyneoController.get_song_duration()
PyneoController.get_song_position()
try: try:
self.image.delete() self.image.delete()
except: except:
@ -108,6 +116,11 @@ class AudioScreen(EdjeGroup):
self.obj.size = x, y self.obj.size = x, y
self.obj.show() self.obj.show()
def display_position(self):
elapsed = (time.time() - self.position_timer)
self.part_text_set("position", "%s" % (time.ctime(elapsed)[14:][:5]))
return True
@edje.decorators.signal_callback("music_player_send", "*") @edje.decorators.signal_callback("music_player_send", "*")
def on_edje_signal_audio_screen_triggered(self, emission, source): def on_edje_signal_audio_screen_triggered(self, emission, source):
if source == "headline": if source == "headline":
@ -117,12 +130,14 @@ class AudioScreen(EdjeGroup):
if self.toggle == 0: if self.toggle == 0:
self.signal_emit("key1", "") self.signal_emit("key1", "")
PyneoController.play_music() PyneoController.play_music()
PyneoController.get_mp3_tags()
self.toggle = 1 self.toggle = 1
elif self.toggle == 1: elif self.toggle == 1:
print '--- timer stoppen'
self.e_timer.delete()
self.signal_emit("key2", "") self.signal_emit("key2", "")
PyneoController.pause_music() PyneoController.pause_music()
self.toggle = 0 self.toggle = 0
PyneoController.get_mp3_tags()
if source == "stop": if source == "stop":
self.signal_emit("key2", "") self.signal_emit("key2", "")
self.toggle = 0 self.toggle = 0

Binary file not shown.

Binary file not shown.

View file

@ -305,6 +305,22 @@ collections {
} }
} }
} }
part {
name: "position";
type: TEXT;
mouse_events: 0;
description {
state: "default" 0;
color_class: "button_inactive";
rel1 { relative: 0 3/8; }
rel2 { relative: 2/8 4/8; }
text {
size: 20;
font: "VeraBd";
fit: 1 1;
}
}
}
key("track_left", 0, 2) key("track_left", 0, 2)
key("stop", 1, 2) key("stop", 1, 2)
key_play_pause("play_pause", "play", "pause", 2, 2) key_play_pause("play_pause", "play", "pause", 2, 2)

View file

@ -556,11 +556,11 @@ class PyneoController(object):
@classmethod @classmethod
def get_song_duration(class_): def get_song_duration(class_):
class_.notify_callbacks("on_get_song_duration", class_.mp3.GetSongDuration(dbus_interface='org.pyneo.Music')) class_.notify_callbacks('on_get_song_duration', class_.mp3.GetSongDuration(dbus_interface='org.pyneo.Music'))
@classmethod @classmethod
def get_song_position(class_): def get_song_position(class_):
class_mp3.GetSongPosition(dbus_interface='org.pyneo,Music') class_.notify_callbacks('on_get_song_position', class_.mp3.GetSongPosition(dbus_interface='org.pyneo.Music'))
@classmethod @classmethod
def db_check(class_): def db_check(class_):

View file

@ -18,7 +18,7 @@ class InCallScreen(EdjeGroup):
connection = connect(DB_FILE_PATH) connection = connect(DB_FILE_PATH)
cursor = connection.cursor() cursor = connection.cursor()
try: try:
cursor.execute("SELECT * FROM contacts WHERE mobil LIKE '%" + str(number) + "' OR home LIKE '%" + str(number) + "' OR work LIKE '%" + str(number) + "'") cursor.execute("SELECT * FROM contacts WHERE mobil LIKE %s OR home LIKE %s OR work LIKE %s" % (number, number, number))
for row in cursor: for row in cursor:
CallerNamemap = row[0], row[1], row[2], row[3], row[4] CallerNamemap = row[0], row[1], row[2], row[3], row[4]
@ -27,9 +27,9 @@ class InCallScreen(EdjeGroup):
elif CallerNamemap[4] == str(number): source = 'work' elif CallerNamemap[4] == str(number): source = 'work'
if CallerNamemap[1] and CallerNamemap[0]: if CallerNamemap[1] and CallerNamemap[0]:
self.part_text_set("incall_number_text", "%s: %s"% (source, CallerNamemap[1] + ', ' + CallerNamemap[0])) self.part_text_set("incall_number_text", "%s: %s, %s" % (source, CallerNamemap[1], CallerNamemap[0]))
except: except:
self.part_text_set("incall_number_text", "unknown") self.part_text_set("incall_number_text", "??? %s ???" % number)
@edje.decorators.signal_callback("dialer_incall_send", "*") @edje.decorators.signal_callback("dialer_incall_send", "*")
def on_edje_signal_dialer_incall_triggered(self, emission, source): def on_edje_signal_dialer_incall_triggered(self, emission, source):