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

⌈⌋ branch:  streamtuner2


Check-in [199c0ad425]

Overview
Comment:conf.record{} array is back, settings dialog now shows a separate editable table; default options prepared for `youtube-dl` video downloading. Action module now more orderly tries alternative media/* placeholders.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 199c0ad4257129bc8feb34b46cbc0a316e254b9b
User & Date: mario on 2014-05-27 00:44:38
Other Links: manifest | tags
Context
2014-05-27
12:37
ListStore row editing callback unified via lambda-funcs as signal handlers. Recording hook adapted to pass actual MIME type. Python3 try/except for json file writing (still breaks due to gzip handler being optional). check-in: af5ae3f5be user: mario tags: trunk
00:44
conf.record{} array is back, settings dialog now shows a separate editable table; default options prepared for `youtube-dl` video downloading. Action module now more orderly tries alternative media/* placeholders. check-in: 199c0ad425 user: mario tags: trunk
00:42
Jamendo stream format selection now uses dropdown too. check-in: 53b4c85039 user: mario tags: trunk
Changes

Modified action.py from [9506eb9e76] to [6e1dac85dc].

1
2
3
4
5
6

7
8
9

10
11
12
13
14
15

16
17
18
19
20
21
22
#
# encoding: UTF-8
# api: streamtuner2
# type: functions
# title: play/record actions
# description: Starts audio applications, guesses MIME types for URLs

#
#
#  Multimedia interface for starting audio players or browser.

#
#
#  Each channel plugin has a .listtype which describes the linked
#  audio playlist format. It's audio/x-scpls mostly, seldomly m3u,
#  but sometimes url/direct if the entry[url] directly leads to the
#  streaming server.

#  As fallback there is a regex which just looks for URLs in the
#  given resource (works for m3u/pls/xspf/asx/...). There is no
#  actual url "filename" extension guessing.
#
#
#







>


|
>






>







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
#
# encoding: UTF-8
# api: streamtuner2
# type: functions
# title: play/record actions
# description: Starts audio applications, guesses MIME types for URLs
# version: 0.7
#
#
#  Multimedia interface for starting audio players, recording app,
#  or web browser (listed as "url/http" association in players).
#
#
#  Each channel plugin has a .listtype which describes the linked
#  audio playlist format. It's audio/x-scpls mostly, seldomly m3u,
#  but sometimes url/direct if the entry[url] directly leads to the
#  streaming server.
#
#  As fallback there is a regex which just looks for URLs in the
#  given resource (works for m3u/pls/xspf/asx/...). There is no
#  actual url "filename" extension guessing.
#
#
#

63
64
65
66
67
68
69
70
71
72
73
74
75

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97








98
99
100
101
102
103
104


        # calls player for stream url and format
        @staticmethod
        def play(url, audioformat="audio/mpeg", listformat="text/x-href"):
            if (url):
                url = action.url(url, listformat)
            if (audioformat):
                if audioformat == "audio/mp3":
                    audioformat = "audio/mpeg"
                cmd = conf.play.get(audioformat, conf.play.get("*/*", "vlc %u"))
                __print__( dbg.PROC,"play", url, cmd )
            try:

                action.run( action.interpol(cmd, url) )
            except:
                pass

        
        # exec wrapper
        @staticmethod
        def run(cmd):
            if conf.windows:
                os.system("start \"%s\"")
            else:
                os.system(cmd + " &")


        # streamripper
        @staticmethod
        def record(url, audioformat="audio/mpeg", listformat="text/x-href", append="", row={}):
            __print__( dbg.PROC, "record", url )
            cmd = conf.record.get(audioformat, conf.play.get("record", None))
            try: action.run( action.interpol(cmd, url, row) + append )
            except: pass










        # save as .m3u
        @staticmethod
        def save(row, fn, listformat="audio/x-scpls"):
            # modify stream url
            row["url"] = action.url(row["url"], listformat)
            stream_urls = action.extract_urls(row["url"], listformat)







<
|
|
|
<

>


















|



>
>
>
>
>
>
>
>







66
67
68
69
70
71
72

73
74
75

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114


        # calls player for stream url and format
        @staticmethod
        def play(url, audioformat="audio/mpeg", listformat="text/x-href"):
            if (url):
                url = action.url(url, listformat)

            if audioformat == "audio/mp3":
                audioformat = "audio/mpeg"
            cmd = action.mime_match(audioformat, conf.play)

            try:
                __print__( dbg.PROC, "play", url, cmd )
                action.run( action.interpol(cmd, url) )
            except:
                pass

        
        # exec wrapper
        @staticmethod
        def run(cmd):
            if conf.windows:
                os.system("start \"%s\"")
            else:
                os.system(cmd + " &")


        # streamripper
        @staticmethod
        def record(url, audioformat="audio/mpeg", listformat="text/x-href", append="", row={}):
            __print__( dbg.PROC, "record", url )
            cmd = action.mime_match(audioformat, conf.record)
            try: action.run( action.interpol(cmd, url, row) + append )
            except: pass


        # Convert MIME type into list of ["audio/xyz", "audio/*", "*/*"] for comparison against record/play association
        @staticmethod
        def mime_match(fmt, cmd_list):
            for match in [ fmt, fmt[:fmt.find("/")] + "/*", "*/*" ]:
                if cmd_list.get(match, None):
                    return cmd_list[match]


        # save as .m3u
        @staticmethod
        def save(row, fn, listformat="audio/x-scpls"):
            # modify stream url
            row["url"] = action.url(row["url"], listformat)
            stream_urls = action.extract_urls(row["url"], listformat)

Modified config.py from [f00713448d] to [1b0bc1277f].

63
64
65
66
67
68
69
70
71
72
73
74


75
76
77
78
79
80
81
        # some defaults
        def defaults(self):
            self.play = {
               "audio/mpeg": "audacious ",	# %u for url to .pls, %g for downloaded .m3u
               "audio/ogg": "audacious ",
               "audio/*": "totem ",
               "video/*": "vlc --one-instance %srv",
               "record": "x-terminal-emulator -e streamripper %srv",
                    #  x-terminal-emulator -e streamripper %srv -d /home/***USERNAME***/Musik
               "url/http": "sensible-browser",
            }
            self.record = {


            }
            self.plugins = {
                "bookmarks": 1,  # built-in plugins, cannot be disabled
                "shoutcast": 1,
                "xiph": 1,
                "file": 0,   # disable per default
                "punkcast": 0,   # disable per default







<
<



>
>







63
64
65
66
67
68
69


70
71
72
73
74
75
76
77
78
79
80
81
        # some defaults
        def defaults(self):
            self.play = {
               "audio/mpeg": "audacious ",	# %u for url to .pls, %g for downloaded .m3u
               "audio/ogg": "audacious ",
               "audio/*": "totem ",
               "video/*": "vlc --one-instance %srv",


               "url/http": "sensible-browser",
            }
            self.record = {
               "audio/*": "xterm -e streamripper %srv",   # -d /home/***USERNAME***/Musik
               "video/youtube": "xterm -e youtube-dl %srv",
            }
            self.plugins = {
                "bookmarks": 1,  # built-in plugins, cannot be disabled
                "shoutcast": 1,
                "xiph": 1,
                "file": 0,   # disable per default
                "punkcast": 0,   # disable per default

Modified gtk2.xml from [9c90c1413f] to [325cdc9c7f].

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










14
15
16
17
18
19
20
<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="2.20"/>
  <!-- interface-naming-policy toplevel-contextual -->
  <object class="GtkListStore" id="config_play">
    <columns>
      <!-- column-name type -->
      <column type="gchararray"/>
      <!-- column-name app -->
      <column type="gchararray"/>
      <!-- column-name gboolean1 -->
      <column type="gboolean"/>
    </columns>










  </object>
  <object class="GtkWindow" id="win_config">
    <property name="width_request">565</property>
    <property name="can_focus">False</property>
    <property name="title" translatable="yes">streamtuner settings</property>
    <property name="window_position">center</property>
    <property name="destroy_with_parent">True</property>













>
>
>
>
>
>
>
>
>
>







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
<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk+" version="2.20"/>
  <!-- interface-naming-policy toplevel-contextual -->
  <object class="GtkListStore" id="config_play">
    <columns>
      <!-- column-name type -->
      <column type="gchararray"/>
      <!-- column-name app -->
      <column type="gchararray"/>
      <!-- column-name gboolean1 -->
      <column type="gboolean"/>
    </columns>
  </object>
  <object class="GtkListStore" id="config_record">
    <columns>
      <!-- column-name type -->
      <column type="gchararray"/>
      <!-- column-name app -->
      <column type="gchararray"/>
      <!-- column-name gboolean1 -->
      <column type="gboolean"/>
    </columns>
  </object>
  <object class="GtkWindow" id="win_config">
    <property name="width_request">565</property>
    <property name="can_focus">False</property>
    <property name="title" translatable="yes">streamtuner settings</property>
    <property name="window_position">center</property>
    <property name="destroy_with_parent">True</property>
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <child>
                              <object class="GtkLabel" id="label_player">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="xalign">0</property>
                                <property name="label" translatable="yes">&lt;b&gt;Audio player&lt;/b&gt; and &lt;b&gt;recording&lt;/b&gt; applications.</property>
                                <property name="use_markup">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">0</property>
                              </packing>







|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <child>
                              <object class="GtkLabel" id="label_player">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="xalign">0</property>
                                <property name="label" translatable="yes">&lt;b&gt;Audio player&lt;/b&gt; association.</property>
                                <property name="use_markup">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">0</property>
                              </packing>
140
141
142
143
144
145
146

147
148
149
















































































































150
151
152
153
154
155
156
and &lt;b&gt;%srv&lt;/b&gt; to use direct streaming URLs.</property>
                                <property name="use_markup">True</property>
                                <property name="wrap">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>

                                <property name="position">2</property>
                              </packing>
                            </child>
















































































































                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
                <child type="tab">







>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
and &lt;b&gt;%srv&lt;/b&gt; to use direct streaming URLs.</property>
                                <property name="use_markup">True</property>
                                <property name="wrap">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="padding">5</property>
                                <property name="position">2</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkLabel" id="label_record3">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="xalign">0</property>
                                <property name="use_markup">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">3</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkLabel" id="label_record1">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="xalign">0</property>
                                <property name="label" translatable="yes">&lt;b&gt;Recording&lt;/b&gt; applications.</property>
                                <property name="use_markup">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">4</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkScrolledWindow" id="scrolledwindow5">
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="hscrollbar_policy">automatic</property>
                                <property name="vscrollbar_policy">automatic</property>
                                <child>
                                  <object class="GtkTreeView" id="tv_config_record">
                                    <property name="width_request">0</property>
                                    <property name="height_request">100</property>
                                    <property name="visible">True</property>
                                    <property name="can_focus">True</property>
                                    <property name="border_width">5</property>
                                    <property name="model">config_record</property>
                                    <property name="headers_clickable">False</property>
                                    <property name="rules_hint">True</property>
                                    <property name="search_column">0</property>
                                    <property name="level_indentation">8</property>
                                    <property name="enable_grid_lines">both</property>
                                    <child>
                                      <object class="GtkTreeViewColumn" id="tvc_config_record_type">
                                        <property name="spacing">10</property>
                                        <property name="min_width">125</property>
                                        <property name="title" translatable="yes">Format</property>
                                        <property name="sort_indicator">True</property>
                                        <child>
                                          <object class="GtkCellRendererText" id="tvcr_config_record_type">
                                            <signal name="edited" handler="config_record_edited" swapped="no"/>
                                          </object>
                                          <attributes>
                                            <attribute name="editable">2</attribute>
                                            <attribute name="text">0</attribute>
                                          </attributes>
                                        </child>
                                      </object>
                                    </child>
                                    <child>
                                      <object class="GtkTreeViewColumn" id="tvc_config_record_app">
                                        <property name="spacing">10</property>
                                        <property name="min_width">300</property>
                                        <property name="title" translatable="yes">Application</property>
                                        <child>
                                          <object class="GtkCellRendererText" id="tvcr_config_record_app">
                                            <signal name="edited" handler="config_record_edited_2" swapped="no"/>
                                          </object>
                                          <attributes>
                                            <attribute name="editable">2</attribute>
                                            <attribute name="text">1</attribute>
                                          </attributes>
                                        </child>
                                      </object>
                                    </child>
                                  </object>
                                </child>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">5</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkLabel" id="label_record2">
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="xalign">0.019999999552965164</property>
                                <property name="yalign">0.49000000953674316</property>
                                <property name="label" translatable="yes">You usually want to run recording applications in a
terminal window, as they're commandline tools.</property>
                                <property name="use_markup">True</property>
                                <property name="wrap">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="padding">15</property>
                                <property name="position">6</property>
                              </packing>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
                <child type="tab">
1641
1642
1643
1644
1645
1646
1647


























































































1648
1649
1650
1651
1652
1653
1654
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>


























































































                <child>
                  <object class="GtkCheckButton" id="search_channel_all">
                    <property name="label" translatable="yes">all channels</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">False</property>
                    <property name="active">True</property>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <object class="GtkCheckButton" id="search_channel_all">
                    <property name="label" translatable="yes">all channels</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">False</property>
                    <property name="active">True</property>
2271
2272
2273
2274
2275
2276
2277




































2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295






2296
2297
2298
2299
2300
2301
2302
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>




































            <child>
              <object class="GtkEntry" id="timer_value">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="invisible_char">●</property>
                <property name="text" translatable="yes">Fri,Sat 20:00-21:00</property>
                <property name="primary_icon_activatable">False</property>
                <property name="secondary_icon_activatable">False</property>
                <property name="primary_icon_sensitive">True</property>
                <property name="secondary_icon_sensitive">True</property>
              </object>
              <packing>
                <property name="left_attach">1</property>
                <property name="right_attach">2</property>
                <property name="top_attach">1</property>
                <property name="bottom_attach">2</property>
              </packing>
            </child>






            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


















>
>
>
>
>
>







2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <object class="GtkEntry" id="timer_value">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="invisible_char">●</property>
                <property name="text" translatable="yes">Fri,Sat 20:00-21:00</property>
                <property name="primary_icon_activatable">False</property>
                <property name="secondary_icon_activatable">False</property>
                <property name="primary_icon_sensitive">True</property>
                <property name="secondary_icon_sensitive">True</property>
              </object>
              <packing>
                <property name="left_attach">1</property>
                <property name="right_attach">2</property>
                <property name="top_attach">1</property>
                <property name="bottom_attach">2</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>

Modified gtk3.xml from [15b8b002fb] to [ef399438fb].

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










14
15
16
17
18
19
20
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
  <requires lib="gtk+" version="3.0"/>
  <object class="GtkListStore" id="config_play">
    <columns>
      <!-- column-name type -->
      <column type="gchararray"/>
      <!-- column-name app -->
      <column type="gchararray"/>
      <!-- column-name gboolean1 -->
      <column type="gboolean"/>
    </columns>










  </object>
  <object class="GtkWindow" id="win_config">
    <property name="width_request">565</property>
    <property name="can_focus">False</property>
    <property name="title" translatable="yes">streamtuner settings</property>
    <property name="window_position">center</property>
    <property name="destroy_with_parent">True</property>













>
>
>
>
>
>
>
>
>
>







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
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
  <requires lib="gtk+" version="3.0"/>
  <object class="GtkListStore" id="config_play">
    <columns>
      <!-- column-name type -->
      <column type="gchararray"/>
      <!-- column-name app -->
      <column type="gchararray"/>
      <!-- column-name gboolean1 -->
      <column type="gboolean"/>
    </columns>
  </object>
  <object class="GtkListStore" id="config_record">
    <columns>
      <!-- column-name type -->
      <column type="gchararray"/>
      <!-- column-name app -->
      <column type="gchararray"/>
      <!-- column-name gboolean1 -->
      <column type="gboolean"/>
    </columns>
  </object>
  <object class="GtkWindow" id="win_config">
    <property name="width_request">565</property>
    <property name="can_focus">False</property>
    <property name="title" translatable="yes">streamtuner settings</property>
    <property name="window_position">center</property>
    <property name="destroy_with_parent">True</property>
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <child>
                              <object class="GtkLabel" id="label_player">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="xalign">0</property>
                                <property name="label" translatable="yes">&lt;b&gt;Audio player&lt;/b&gt; and &lt;b&gt;recording&lt;/b&gt; applications.</property>
                                <property name="use_markup">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">0</property>
                              </packing>







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <child>
                              <object class="GtkLabel" id="label_player">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="xalign">0</property>
                                <property name="label" translatable="yes">&lt;b&gt;Audio player&lt;/b&gt; association.</property>
                                <property name="use_markup">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">0</property>
                              </packing>
138
139
140
141
142
143
144

145
146
147

















































































































148
149
150
151
152
153
154
and &lt;b&gt;%srv&lt;/b&gt; to use direct streaming URLs.</property>
                                <property name="use_markup">True</property>
                                <property name="wrap">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>

                                <property name="position">2</property>
                              </packing>
                            </child>

















































































































                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
                <child type="tab">







>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
and &lt;b&gt;%srv&lt;/b&gt; to use direct streaming URLs.</property>
                                <property name="use_markup">True</property>
                                <property name="wrap">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="padding">5</property>
                                <property name="position">2</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkLabel" id="label_record3">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="xalign">0</property>
                                <property name="use_markup">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">3</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkLabel" id="label_record1">
                                <property name="visible">True</property>
                                <property name="can_focus">False</property>
                                <property name="xalign">0</property>
                                <property name="label" translatable="yes">&lt;b&gt;Recording&lt;/b&gt; applications.</property>
                                <property name="use_markup">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">4</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkScrolledWindow" id="scrolledwindow5">
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <child>
                                  <object class="GtkTreeView" id="tv_config_record">
                                    <property name="width_request">0</property>
                                    <property name="height_request">100</property>
                                    <property name="visible">True</property>
                                    <property name="can_focus">True</property>
                                    <property name="border_width">5</property>
                                    <property name="model">config_record</property>
                                    <property name="headers_clickable">False</property>
                                    <property name="rules_hint">True</property>
                                    <property name="search_column">0</property>
                                    <property name="level_indentation">8</property>
                                    <property name="enable_grid_lines">both</property>
                                    <child internal-child="selection">
                                      <object class="GtkTreeSelection" id="treeview-selection2"/>
                                    </child>
                                    <child>
                                      <object class="GtkTreeViewColumn" id="tvc_config_record_type">
                                        <property name="spacing">10</property>
                                        <property name="min_width">125</property>
                                        <property name="title" translatable="yes">Format</property>
                                        <property name="sort_indicator">True</property>
                                        <child>
                                          <object class="GtkCellRendererText" id="tvcr_config_record_type">
                                            <signal name="edited" handler="config_record_edited" swapped="no"/>
                                          </object>
                                          <attributes>
                                            <attribute name="editable">2</attribute>
                                            <attribute name="text">0</attribute>
                                          </attributes>
                                        </child>
                                      </object>
                                    </child>
                                    <child>
                                      <object class="GtkTreeViewColumn" id="tvc_config_record_app">
                                        <property name="spacing">10</property>
                                        <property name="min_width">300</property>
                                        <property name="title" translatable="yes">Application</property>
                                        <child>
                                          <object class="GtkCellRendererText" id="tvcr_config_record_app">
                                            <signal name="edited" handler="config_record_edited_2" swapped="no"/>
                                          </object>
                                          <attributes>
                                            <attribute name="editable">2</attribute>
                                            <attribute name="text">1</attribute>
                                          </attributes>
                                        </child>
                                      </object>
                                    </child>
                                  </object>
                                </child>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="position">5</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkLabel" id="label_record2">
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="xalign">0.019999999552965164</property>
                                <property name="yalign">0.49000000953674316</property>
                                <property name="label" translatable="yes">You usually want to run recording applications in a
terminal window, as they're commandline tools.</property>
                                <property name="use_markup">True</property>
                                <property name="wrap">True</property>
                              </object>
                              <packing>
                                <property name="expand">True</property>
                                <property name="fill">True</property>
                                <property name="padding">15</property>
                                <property name="position">6</property>
                              </packing>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                            <child>
                              <placeholder/>
                            </child>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
                <child type="tab">
1672
1673
1674
1675
1676
1677
1678


























































































1679
1680
1681
1682
1683
1684
1685
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>


























































































                <child>
                  <object class="GtkCheckButton" id="search_channel_all">
                    <property name="label" translatable="yes">all channels</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">False</property>
                    <property name="xalign">0.5</property>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <object class="GtkCheckButton" id="search_channel_all">
                    <property name="label" translatable="yes">all channels</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">False</property>
                    <property name="xalign">0.5</property>
2325
2326
2327
2328
2329
2330
2331




































2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347






2348
2349
2350
2351
2352
2353
2354
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>




































            <child>
              <object class="GtkEntry" id="timer_value">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="invisible_char">●</property>
                <property name="text" translatable="yes">Fri,Sat 20:00-21:00</property>
                <property name="primary_icon_activatable">False</property>
                <property name="secondary_icon_activatable">False</property>
              </object>
              <packing>
                <property name="left_attach">1</property>
                <property name="right_attach">2</property>
                <property name="top_attach">1</property>
                <property name="bottom_attach">2</property>
              </packing>
            </child>






            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
















>
>
>
>
>
>







2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <object class="GtkEntry" id="timer_value">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="invisible_char">●</property>
                <property name="text" translatable="yes">Fri,Sat 20:00-21:00</property>
                <property name="primary_icon_activatable">False</property>
                <property name="secondary_icon_activatable">False</property>
              </object>
              <packing>
                <property name="left_attach">1</property>
                <property name="right_attach">2</property>
                <property name="top_attach">1</property>
                <property name="bottom_attach">2</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
                      <object class="GtkTreeView" id="bookmarks_cat">
                        <property name="width_request">75</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="enable_tree_lines">True</property>
                        <signal name="button-release-event" handler="on_category_clicked" swapped="no"/>
                        <child internal-child="selection">
                          <object class="GtkTreeSelection" id="treeview-selection2"/>
                        </child>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="resize">False</property>
                    <property name="shrink">True</property>







|







3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
                      <object class="GtkTreeView" id="bookmarks_cat">
                        <property name="width_request">75</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="enable_tree_lines">True</property>
                        <signal name="button-release-event" handler="on_category_clicked" swapped="no"/>
                        <child internal-child="selection">
                          <object class="GtkTreeSelection" id="treeview-selection3"/>
                        </child>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="resize">False</property>
                    <property name="shrink">True</property>
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
                      <object class="GtkTreeView" id="bookmarks_list">
                        <property name="width_request">200</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <signal name="button-press-event" handler="station_context_menu" swapped="no"/>
                        <signal name="row-activated" handler="on_stream_row_activated" swapped="no"/>
                        <child internal-child="selection">
                          <object class="GtkTreeSelection" id="treeview-selection3"/>
                        </child>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="resize">True</property>
                    <property name="shrink">True</property>







|







3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
                      <object class="GtkTreeView" id="bookmarks_list">
                        <property name="width_request">200</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <signal name="button-press-event" handler="station_context_menu" swapped="no"/>
                        <signal name="row-activated" handler="on_stream_row_activated" swapped="no"/>
                        <child internal-child="selection">
                          <object class="GtkTreeSelection" id="treeview-selection4"/>
                        </child>
                      </object>
                    </child>
                  </object>
                  <packing>
                    <property name="resize">True</property>
                    <property name="shrink">True</property>

Modified st2.py from [131924495a] to [6c5e20937c].

186
187
188
189
190
191
192


193
194
195
196
197
198
199
                "menu_toolbar_size_large": lambda w: (self.toolbar.set_icon_size(gtk.ICON_SIZE_DIALOG)),
                # else
                "menu_properties": config_dialog.open,
                "config_cancel": config_dialog.hide,
                "config_save": config_dialog.save,
                "config_player_edited": config_dialog.edited_player_row,
                "config_player_edited_2": config_dialog.edited_player_row_2,


                "update_categories": self.update_categories,
                "update_favicons": self.update_favicons,
                "app_state": self.app_state,
                "bookmark": self.bookmark,
                "save_as": self.save_as,
                "menu_about": lambda w: AboutStreamtuner2(),
                "menu_help": action.action.help,







>
>







186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
                "menu_toolbar_size_large": lambda w: (self.toolbar.set_icon_size(gtk.ICON_SIZE_DIALOG)),
                # else
                "menu_properties": config_dialog.open,
                "config_cancel": config_dialog.hide,
                "config_save": config_dialog.save,
                "config_player_edited": config_dialog.edited_player_row,
                "config_player_edited_2": config_dialog.edited_player_row_2,
                "config_record_edited": config_dialog.edited_record_row,
                "config_record_edited_2": config_dialog.edited_record_row_2,
                "update_categories": self.update_categories,
                "update_favicons": self.update_favicons,
                "app_state": self.app_state,
                "bookmark": self.bookmark,
                "save_as": self.save_as,
                "menu_about": lambda w: AboutStreamtuner2(),
                "menu_help": action.action.help,
797
798
799
800
801
802
803




804
805
806
807
808
809
810

        
        # Gtk callback to update ListStore when entries get edited
        def edited_player_row(self, cell, path, new_text, user_data=None, column=0):
            main.config_play[path][column] = new_text
        def edited_player_row_2(self, cell, path, new_text, user_data=None):
            self.edited_player_row(cell, path, new_text, column=1)






        # list of Gtk themes in dropdown
        def combobox_theme(self):
            # find themes
            themedirs = (conf.share+"/themes", conf.dir+"/themes", "/usr/share/themes")
            themes = ["no theme"]







>
>
>
>







799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816

        
        # Gtk callback to update ListStore when entries get edited
        def edited_player_row(self, cell, path, new_text, user_data=None, column=0):
            main.config_play[path][column] = new_text
        def edited_player_row_2(self, cell, path, new_text, user_data=None):
            self.edited_player_row(cell, path, new_text, column=1)
        def edited_record_row(self, cell, path, new_text, user_data=None, column=0):
            main.config_record[path][column] = new_text
        def edited_record_row_2(self, cell, path, new_text, user_data=None):
            self.edited_record_row(cell, path, new_text, column=1)


        # list of Gtk themes in dropdown
        def combobox_theme(self):
            # find themes
            themedirs = (conf.share+"/themes", conf.dir+"/themes", "/usr/share/themes")
            themes = ["no theme"]