Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ ⎇ branch:  streamtuner2


Check-in [2a364e20fd]

Overview
Comment:Minor updates to category: field (now displayed in config dialog.)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2a364e20fdaa8b3af318e88e79ca798b7d87d78b
User & Date: mario on 2015-03-29 14:49:33
Other Links: manifest | tags
Context
2015-03-29
14:51
Mirror updates to Mallard help pages. check-in: 73b73dd933 user: mario tags: trunk
14:49
Minor updates to category: field (now displayed in config dialog.) check-in: 2a364e20fd user: mario tags: trunk
14:49
Prepare for genre matching into RadioTray groups/folders. check-in: e22c0e1c5a user: mario tags: trunk
Changes

Modified channels/bookmarks.py from [145c80c0b6] to [1622338506].

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
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


-
+



-
+














-
+







# encoding: UTF-8
# api: streamtuner2
# title: bookmarks
# title: Bookmarks
# description: For collecting favourites. And provides some feature/category plugins.
# type: channel
# version: 1.5
# category: channel
# category: builtin
# priority: core
# config: { name: like_my_bookmarks,  type: boolean, value: 0, description: "I like my bookmarks" }
# 
# Favourite lists.
#
# This module lists static content from ~/.config/streamtuner2/bookmarks.json.
# Any bookmarked station will appear with a star ★ icon in other channels.
#
# Some feature extensions inject custom subcategories here. For example the
# "search" feature adds its own result list here, as does the "timer" plugin.
#
#

from config import *
from mygtk import mygtk
from uikit import uikit
from channels import *



# The bookmarks tab is a core feature and built into the GtkBuilder
# layout. Which is why it derives from GenericChannel, and requires
# less setup.
︙
113
114
115
116
117
118
119
120

121
122
123
124
125
126
127
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127







-
+









        # simplified gtk TreeStore display logic (just one category for the moment, always rebuilt)
        def load(self, category, force=False):
            __print__(dbg.UI, category, self.streams.keys())
            self.streams[category] = self.update_streams(category)
            #self.liststore[category] = \
            mygtk.columns(self.gtk_list, self.datamap, self.prepare(self.streams[category]))
            uikit.columns(self.gtk_list, self.datamap, self.prepare(self.streams[category]))


        # add a categories[]/streams{} subcategory, update treeview
        def add_category(self, cat, plugin=None):
            if cat not in self.categories: # add category if missing
                self.categories.append(cat)
                self.display_categories()
︙

Modified channels/file.py from [6ec2a8db67] to [1ae0a2679f].

1
2
3
4
5
6

7
8
9
10
11
12
13
1
2
3
4
5

6
7
8
9
10
11
12
13





-
+







#
# api: streamtuner2
# title: File browser
# description: Displays mp3/oggs or m3u/pls files from local media file directories.
# type: channel
# category: media
# category: local
# version: 0.1
# priority: optional
# depends: mutagen
# config:  
#   { name: file_browser_dir, type: text, value: "~/Music, /media/music", description: "List of directories to scan for audio files." },
#   { name: file_browser_ext, type: text, value: "mp3,ogg, m3u,pls,xspf, avi,flv,mpg,mp4", description: "File type/extension filter." },
#
︙

Modified channels/history.py from [dff5e057f5] to [8bb9924983].

1
2
3
4
5
6

7
8
9
10
11
12
13
1
2
3
4
5

6
7
8
9
10
11
12
13





-
+







#
# api: streamtuner2
# title: History
# description: List recently played stations under favourites > history.
# version: 1.0
# type: category
# type: group
# category: ui
# config:
#     { name: history,  type: int,  value: 20,  description: Number of last played streams to keep in history list.,  category: limit }
# priority: optional
#
# 
# Lists last activated streams in a new [history] tab in the favourites
︙

Modified channels/links.py from [574a0e1823] to [c5baaec29d].

1
2
3
4
5

6
7
8
9
10
11
12
1
2
3
4

5
6
7
8
9
10
11
12




-
+







#
# api: streamtuner2
# title: Links to directory services
# description: Static list of various music directory websites.
# type: category
# type: group
# category: web
# version: 0.2
# priority: default
# config: -
#
# Simply adds a "links" entry in bookmarks tab, where known services
# are listed with homepage links.
︙

Modified channels/live365.py from [2e2986e12a] to [f9cb99d01d].

︙
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32







-
+







#
#    /cgi-bin/play.pls?stationid=%s&direct=1&file=%s.pls
#


# streamtuner2 modules
from config import conf
from mygtk import mygtk
from uikit import uikit
import ahttp as http
from channels import *
from config import __print__, dbg
import action

# python modules
import re
︙

Modified channels/modarchive.py from [681b28ed63] to [6105d250d0].

1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
17









-
+








# api: streamtuner2
# title: MODarchive
# description: Collection of module / tracker audio files (MOD, S3M, XM, etc.)
# type: channel
# version: 0.2
# url: http://www.modarchive.org/
# priority: extra
# config: -
# category: music
# category: collection
#
#
# Just a genre browser.
#
# MOD files dodn't work with all audio players. And with the default
# download method, it'll receive a .zip archive with embeded .mod file.
# VLC in */* seems to work fine however.
︙

Modified channels/myoggradio.py from [cdc167a1f7] to [a6b1955e45].

︙
22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36







-
+







#



from channels import *
from config import conf
from action import action
from mygtk import mygtk
from uikit import uikit
import ahttp as http

import re
import json
from compat2and3 import StringIO
import copy

︙
57
58
59
60
61
62
63
64

65
66
67
68
69
70
71
57
58
59
60
61
62
63

64
65
66
67
68
69
70
71







-
+







    
    
    
    # prepare GUI
    def __init__(self, parent):
        ChannelPlugin.__init__(self, parent)
        if parent:
            mygtk.add_menu(parent.extensions, "Share in MyOggRadio", self.share)
            uikit.add_menu(parent.extensions, "Share in MyOggRadio", self.share)



    # this is simple, there are no categories
    def update_categories(self):
        pass

︙

Modified channels/timer.py from [446fecc94b] to [185461bc28].

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"]
        
︙

Modified channels/xiph.py from [f757c3da36] to [5e3d628269].

︙
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42







-
+







#
#



# streamtuner2 modules
from config import conf
from mygtk import mygtk
from uikit import uikit
import ahttp as http
from channels import *
from config import __print__, dbg
import json

# python modules
import re
︙