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
|
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
|
-
+
-
-
+
+
|
#
# api: streamtuner2
# title: Recording timer
# description: Schedules play/record events for bookmarked radio stations.
# type: feature
# category: ui
# category: hook
# depends: kronos
# version: 0.5
# config: -
# priority: optional
# support: unsupported
#
# Okay, while programming this, I missed the broadcast I wanted to hear. Again(!)
# But still this is a useful extension, as it allows recording and playing specific
# stations at a programmed time and interval. It accepts a natural language time
# string when registering a stream. (Via streams menu > extension > add timer)
#
# Programmed events are visible in "timer" under the "bookmarks" channel. Times
# are stored in the description field, and can thus be edited. However, after editing
# times manually, streamtuner2 must be restarted for the changes to take effect.
#
from config import *
from channels import *
import kronos # Doesn't work with Python3
from mygtk import mygtk
import bundle.kronos as kronos # Doesn't work with Python3
from uikit import uikit
from action import action
import copy
import re
# timed events (play/record) within bookmarks tab
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
-
+
|
if parent:
# keep reference to main window
self.parent = parent
self.bookmarks = parent.bookmarks
# add menu
mygtk.add_menu(self.parent.extensions, "Add timer for station", self.edit_timer)
uikit.add_menu(self.parent.extensions, "Add timer for station", self.edit_timer)
# target channel
if not self.bookmarks.streams.get("timer"):
self.bookmarks.streams["timer"] = [{"title":"--- timer events ---"}]
self.bookmarks.add_category("timer")
self.streams = self.bookmarks.streams["timer"]
|