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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [aa264c28e2]

Overview
Comment:Simplify uikit.do() callback for GUI updates from within threads. Search plugin led to a memory corruption due to not using it for updates.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: aa264c28e268863688a857c3e2d0c4af8cae3122
User & Date: mario on 2015-04-19 16:31:02
Other Links: manifest | tags
Context
2015-04-19
16:31
Bring back .base_url instead of .homepage property for HTTP requests. check-in: c6416a18df user: mario tags: trunk
16:31
Simplify uikit.do() callback for GUI updates from within threads. Search plugin led to a memory corruption due to not using it for updates. check-in: aa264c28e2 user: mario tags: trunk
2015-04-18
20:41
Add [feeds] support for Jamendo. (Pretty much only albums, so track lookup works.) Better support for configured audio format/mime. Ogg Vorbis now works in albums and playlists. check-in: 90b1672010 user: mario tags: trunk
Changes

Modified channels/search.py from [ed74d1d852] to [e665e21e39].

78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92







-
+







                    for row in cn.streams[cat]:
                        # assemble text fields to compare
                        text = " ".join([str(row.get(f, " ")) for f in fields])
                        if text.lower().find(self.q) >= 0:
                            row = copy(row)
                            row["genre"] = "%s %s" % (c or "", row.get("genre")  or "")
                            entries.append(row)
        self.show_results(entries)
        uikit.do(self.show_results, entries)

    # display "search" in "bookmarks"
    def show_results(self, entries):
        self.main.status(1.0)
        self.main.status("")
        self.main.channel_switch_by_name("bookmarks")
        self.main.bookmarks.set_category("search")
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121







-
+







                    add = cn.update_streams(cat=None, search=self.q)
                    for row in add:
                        row["genre"] = cn.meta["title"] + " " + row.get("genre", "")
                    entries += add
                except:
                    continue
            #main.status(main, 1.0 * i / 15)
        self.show_results(entries)
        uikit.do(self.show_results, entries)


    # search text edited in text entry box
    def quicksearch_set(self, w, *eat, **up):
        
        # keep query string
        self.main.q = self.search_quick.get_text().lower()

Modified uikit.py from [ef50a93d22] to [59736bfdc8].

399
400
401
402
403
404
405
406
407


408
409
410
411
412
413
414
399
400
401
402
403
404
405


406
407
408
409
410
411
412
413
414







-
-
+
+







            c.set_current_name(re.sub(r"\.(m3u|pls|xspf|jspf|asx|json|smil|wpl)$", ext.strip("*"), fn))
        
    
    
    
    # pass updates from another thread, ensures that it is called just once
    @staticmethod
    def do(lambda_func):
        gobject.idle_add(lambda: lambda_func() and False)
    def do(callback, *args, **kwargs):
        gobject.idle_add(lambda: callback(*args, **kwargs) and False)


    # adds background color to widget,
    # eventually wraps it into a gtk.Window, if it needs a container
    @staticmethod
    def bg(w, color="", where=["bg"]):
        """ this method should be called after widget creation, and before .add()ing it to container """