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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [a872fb7d36]

Overview
Comment:Split up Extensions› submenus. Register major plugins (timer, myoggradio, radiotray) as direct menu entries, but complex extensions (exportcat) as subentry still.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a872fb7d36a84d1c530768f2ce41b5482eaa825e
User & Date: mario on 2015-04-07 19:49:25
Other Links: manifest | tags
Context
2015-04-07
22:19
Added some notes about "Export all" plugin. List streams#actions as topic in index.page check-in: 97bb4bbfe9 user: mario tags: trunk
19:49
Split up Extensions› submenus. Register major plugins (timer, myoggradio, radiotray) as direct menu entries, but complex extensions (exportcat) as subentry still. check-in: a872fb7d36 user: mario tags: trunk
19:48
Fix main. references from bookmarks callback. check-in: 5a772b3c64 user: mario tags: trunk
Changes

Makefile became a regular file with contents [d3f05bad3b].

Modified channels/myoggradio.py from [cdf48de82f] to [acdf73781d].

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

# api: streamtuner2
# title: MyOggRadio
# description: Open source internet radio directory.
# type: channel
# category: radio
# version: 0.6
# url: http://www.myoggradio.org/
# depends: json, StringIO
# config:
#    { name: myoggradio_login,  type: text,  value: "user:password", description: "Account for storing personal favourites." }
#    { name: myoggradio_morph,  type: boolean, value: 0,  description: "Convert pls/m3u into direct shoutcast url." }
# priority: standard
# png:






|







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

# api: streamtuner2
# title: MyOggRadio
# description: Open source internet radio directory.
# type: channel
# category: radio
# version: 0.7
# url: http://www.myoggradio.org/
# depends: json, StringIO
# config:
#    { name: myoggradio_login,  type: text,  value: "user:password", description: "Account for storing personal favourites." }
#    { name: myoggradio_morph,  type: boolean, value: 0,  description: "Convert pls/m3u into direct shoutcast url." }
# priority: standard
# png:
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Beforehand an account needs to be configured in the settings. (Registration
# on myoggradio doesn't require an email address or personal information.)
#


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

import re
import json
from compat2and3 import StringIO
import copy



# open source radio sharing stie
class myoggradio(ChannelPlugin):

    # settings
    title ="MOR"







|








|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Beforehand an account needs to be configured in the settings. (Registration
# on myoggradio doesn't require an email address or personal information.)
#


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

import re
import json
from compat2and3 import StringIO
import copy
from uikit import gtk


# open source radio sharing stie
class myoggradio(ChannelPlugin):

    # settings
    title ="MOR"
62
63
64
65
66
67
68
69

70
71
72
73
74
75
76
    
    
    
    # prepare GUI
    def __init__(self, parent):
        ChannelPlugin.__init__(self, parent)
        if parent:
            uikit.add_menu([parent.extensions, parent.extensions_context], "Share in MyOggRadio", self.share)




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








|
>







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
    
    
    
    # prepare GUI
    def __init__(self, parent):
        ChannelPlugin.__init__(self, parent)
        if parent:
            #uikit.add_menu([parent.extensions, parent.extensions_context], "Share in MyOggRadio", self.share)
            uikit.add_menu([parent.streammenu, parent.streamactions], "Share in MyOggRadio", self.share, insert=4)



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

180
181
182
183
184
185
186


187
188
189
190
    def user_pw(self):
        if len(conf.myoggradio_login) and conf.myoggradio_login != "user:password":
            return conf.myoggradio_login.split(":")
        else:
            lap =  conf.netrc(["myoggradio", "myoggradio.org", "www.myoggradio.org"])
            if lap:
                return [lap[0] or lap[1], lap[2]]


        pass        










>
>




181
182
183
184
185
186
187
188
189
190
191
192
193
    def user_pw(self):
        if len(conf.myoggradio_login) and conf.myoggradio_login != "user:password":
            return conf.myoggradio_login.split(":")
        else:
            lap =  conf.netrc(["myoggradio", "myoggradio.org", "www.myoggradio.org"])
            if lap:
                return [lap[0] or lap[1], lap[2]]
            else:
                self.parent.status("No login data for MyOggRadio configured. See F12 for setup, or F1 for help.");
        pass        



Modified channels/radiotray.py from [f93c102d40] to [6a4e939185].

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

        # create category
        self.bm.add_category("radiotray", plugin=self);
        self.bm.streams["radiotray"] = self.update_streams(cat="radiotray")
        self.bm.reload_if_current(self.module)

        # add context menu
        if parent:
            uikit.add_menu([parent.extensions, parent.extensions_context], "Keep in RadioTray", self.share)
        

    # load RadioTray bookmarks
    def update_streams(self, cat):
        r = []
        try:
            for group in ElementTree.parse(self.rt_xml).findall(".//group"):







<
|







71
72
73
74
75
76
77

78
79
80
81
82
83
84
85

        # create category
        self.bm.add_category("radiotray", plugin=self);
        self.bm.streams["radiotray"] = self.update_streams(cat="radiotray")
        self.bm.reload_if_current(self.module)

        # add context menu

        uikit.add_menu([parent.streammenu, parent.streamactions], "Keep in RadioTray", self.share, insert=4)
        

    # load RadioTray bookmarks
    def update_streams(self, cat):
        r = []
        try:
            for group in ElementTree.parse(self.rt_xml).findall(".//group"):

Modified channels/timer.py from [0dc91cdebf] to [242512e240].

45
46
47
48
49
50
51
52

53
54
55
56
57
58
59
60
61
62
63
64
65
66
    # kronos scheduler list
    sched = None
    
    
    
    # prepare gui
    def __init__(self, parent):
      if parent:

          
        # keep reference to main window
        self.parent = parent
        self.bookmarks = parent.bookmarks
        
        # add menu
        uikit.add_menu([parent.extensions, parent.extensions_context], "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"]
        







|
>






|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
    # kronos scheduler list
    sched = None
    
    
    
    # prepare gui
    def __init__(self, parent):
        if not parent:
            return
          
        # keep reference to main window
        self.parent = parent
        self.bookmarks = parent.bookmarks
        
        # add menu
        uikit.add_menu([parent.streammenu, parent.streamactions], "Add timer for station", self.edit_timer, insert=4)
        
        # 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 gtk3.xml.gz from [4a4edf99dd] to [636af55d84].

cannot compute difference between binary files

Modified uikit.py from [594d66e076] to [0158bdc6ec].

431
432
433
434
435
436
437
438
439
440
441
442



443
444
445
446
447
448
449
450
        b.pack_start(w1, expand=not exr, fill=not exr)
        b.pack_start(w2, expand=exr, fill=exr)
        return b


    # Attach textual menu entry and callback
    @staticmethod
    def add_menu(menuwidget, label, action):
        for where in list(menuwidget):
            m = gtk.MenuItem(label)
            m.connect("activate", action)
            m.show()



            where.add(m)
        

    # gtk.messagebox
    @staticmethod
    def msg(text, style=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_CLOSE):
        m = gtk.MessageDialog(None, 0, style, buttons, message_format=text)
        m.show()







|




>
>
>
|







431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
        b.pack_start(w1, expand=not exr, fill=not exr)
        b.pack_start(w2, expand=exr, fill=exr)
        return b


    # Attach textual menu entry and callback
    @staticmethod
    def add_menu(menuwidget, label, action, insert=None):
        for where in list(menuwidget):
            m = gtk.MenuItem(label)
            m.connect("activate", action)
            m.show()
            if insert:
                where.insert(m, insert)
            else:
                where.add(m)
        

    # gtk.messagebox
    @staticmethod
    def msg(text, style=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_CLOSE):
        m = gtk.MessageDialog(None, 0, style, buttons, message_format=text)
        m.show()