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

⌈⌋ branch:  streamtuner2


Check-in [9933677f41]

Overview
SHA1 Hash:9933677f41e9e9f91f48e067ef1da211a325f8ef
Date: 2017-02-14 16:33:53
User: mario
Comment:Shorten format comparison in postprocess_filter, remove original *gtkrc* stock item binding.
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2017-02-14
17:52
[b3defb1227] Minor fix for extraction regexp (http: prefix to station urls). (user: mario, tags: trunk)
16:33
[9933677f41] Shorten format comparison in postprocess_filter, remove original *gtkrc* stock item binding. (user: mario, tags: trunk)
2017-02-13
21:55
[71b6a7785e] New plugin: Vorbis and Opus icons for OGG streams (user: mario, tags: trunk)
Changes

Modified c/plugins/oggicon.py from [7236873b7f] to [50ddd1a129].

1
2
3
4
5
6
7
8
9
10
11
12
..
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# encoding: UTF-8
# api: streamtuner2
# title: OGG icon
# description: highlights OGG Vorbis and Opus stations with icons
# version: 0.1
# depends: uikit
# type: feature
# category: ui
# priority: extra
#
# Adds a Gtk icon for OGG Vorbis and Opus streams, which get displayed
# leftmost (to the genre) as state icon.
................................................................................
            DhIYWENBgBVMQTgMUMoFCBwYGFhANIwDoYyBwICBGUIZIwADgxICMDAwIbEZGAWhAOw0ICUAdzKj
            ILIHBEn1MQBjViBd1YYkTgAAAABJRU5ErkJggg=="""
    }

    # hook filter, set gtk icons
    def init2(self, parent):
        GenericChannel.postprocess_filters.append(self.row_icon)
        #uikit.gtk.rc_parse_string(gtkrc)
        #uikit.gtk.rc_reset_styles(uikit.gtk.settings_get_for_screen(uikit.gtk.gdk.screen_get_default()))
        self.add_icons()
 
    # adds gtk.IconFactory and one IconSet/Pixbuf each
    def add_icons(self):
        fact = uikit.gtk.IconFactory()
        for stock_id, b64_png in self.png.items():
            img = uikit.gtk.IconSet(uikit.uikit.pixbuf(b64_png))
            fact.add(stock_id, img)
        fact.add_default()

    # filter: add `state` icon name depending on audio format
    def row_icon(self, row, channel):
        if row.get("format") == "audio/ogg":
            row["state"] = "ogg"
        if row.get("format") == "audio/opus":
            row["state"] = "opus"
        return True





|







 







<
<










|

|
|
<
|


1
2
3
4
5
6
7
8
9
10
11
12
..
40
41
42
43
44
45
46


47
48
49
50
51
52
53
54
55
56
57
58
59
60

61
62
63
# encoding: UTF-8
# api: streamtuner2
# title: OGG icon
# description: highlights OGG Vorbis and Opus stations with icons
# version: 0.2
# depends: uikit
# type: feature
# category: ui
# priority: extra
#
# Adds a Gtk icon for OGG Vorbis and Opus streams, which get displayed
# leftmost (to the genre) as state icon.
................................................................................
            DhIYWENBgBVMQTgMUMoFCBwYGFhANIwDoYyBwICBGUIZIwADgxICMDAwIbEZGAWhAOw0ICUAdzKj
            ILIHBEn1MQBjViBd1YYkTgAAAABJRU5ErkJggg=="""
    }

    # hook filter, set gtk icons
    def init2(self, parent):
        GenericChannel.postprocess_filters.append(self.row_icon)


        self.add_icons()
 
    # adds gtk.IconFactory and one IconSet/Pixbuf each
    def add_icons(self):
        fact = uikit.gtk.IconFactory()
        for stock_id, b64_png in self.png.items():
            img = uikit.gtk.IconSet(uikit.uikit.pixbuf(b64_png))
            fact.add(stock_id, img)
        fact.add_default()

    # postprocess_filter: add `state` icon name depending on audio format
    def row_icon(self, row, channel):
        fmt = str(row.get("format", channel.audioformat))[6:]
        if fmt in ("ogg", "opus"):

            row["state"] = fmt
        return True