Skip to content

Commit b79ca46

Browse files
committed
- Selecting errorenous field in station editor
- Updating docs
1 parent 7b09038 commit b79ca46

File tree

5 files changed

+76
-60
lines changed

5 files changed

+76
-60
lines changed

Changelog

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
2019-08-30 s-n-g
1+
2019-00-01 s-n-g
2+
* Adding station editor ("a" and "A" to add a station, "e" to edit)
3+
* Main help window separated to two pages (navigation with "n" / "p")
24
* Changing "e" to "E" to change a station's encoding
35
* Changing "p" to "P" to jump to playing station / loaded playlist
46
* Changing volume, saving volume and muting is now available on most

README.html

+32-27
Original file line numberDiff line numberDiff line change
@@ -96,31 +96,35 @@ <h2 id="command-line-options">Command line options <span style="padding-left: 10
9696
<li><strong>-t</strong> - parameter <strong>theme</strong> (default value: <strong>dark</strong>)</li>
9797
</ul>
9898
<h2 id="controls">Controls <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
99-
<pre> Main window Playlists window Themes window
100-
------------------------------------------------------------------------------------------------------------------------------
99+
<pre> Main window Playlists window Themes window
100+
-------------------------------------------------------------------------------------------------------------------------------------
101101
Up/Down/j/k/
102-
PgUp/PgDown Change station selection Change station playlist Change station theme
103-
g Jump to first station Jump to first playlist Jump to first theme
104-
&lt;n&gt;G Jump to n-th / last station Jump to n-th / last playlist Jump to n-th / last theme
105-
M Jump to the middle of the playlist Jump to the middle of the list -
106-
P Jump to playing station Jump to playing playlist -
107-
Enter/Right/l Play selected station Open selected playlist Apply selected theme
108-
r Select and play a random station Re-read playlists from disk -
109-
Space/Left/h Stop/start playing selected station - -
110-
Space - - Apply theme and make it default
111-
-/+ or ,/. Change volume [Valid] [Valid]
112-
m Mute / unmute player [Valid] [Valid]
113-
v Save volume (not applicable for vlc) [Valid] [Valid]
114-
o s R Open / Save / Reload playlist - -
115-
E Change station&#39;s encoding
116-
DEL,x Delete selected station - -
117-
t T Load theme / Toggle transparency [Valid] [Valid]
118-
c Open Configuration window. - -
119-
/ n N Search, go to next / previous result [Valid] [Valid]
120-
? Show keys help [Valid] [Valid]
121-
# Redraw window [Valid] [Valid]
122-
Esc/q Quit - -
123-
Esc/q/Left/h - Cancel / close window Cancel / close window</pre>
102+
PgUp/PgDown Change station selection Change station playlist Change station theme
103+
g Jump to first station Jump to first playlist Jump to first theme
104+
&lt;n&gt;G Jump to n-th / last station Jump to n-th / last playlist Jump to n-th / last theme
105+
H M L Jump to the top / middle bottom of the list [Valid] -
106+
P Jump to playing station Jump to playing playlist -
107+
Enter/Right/l Play selected station Open selected playlist Apply selected theme
108+
r Select and play a random station Re-read playlists from disk -
109+
Space/Left/h Stop/start playing selected station - -
110+
Space - - Apply theme and make it default
111+
-/+ or ,/. Change volume [Valid] [Valid]
112+
m Mute / unmute player [Valid] [Valid]
113+
v Save volume (not applicable for vlc) [Valid] [Valid]
114+
o s R Open / Save / Reload playlist - -
115+
a A Add / append a new station - -
116+
e Edit current station - -
117+
E Change station&#39;s encoding - -
118+
DEL,x Delete selected station - -
119+
t T Load theme / Toggle transparency [Valid] [Valid]
120+
c Open Configuration window. - -
121+
/ n N Search, go to next / previous result [Valid] [Valid]
122+
J Create a jump tag
123+
&lt;n&gt;^U &lt;n&gt;^D Move station up / down. - -
124+
? Show keys help [Valid] [Valid]
125+
# Redraw window [Valid] [Valid]
126+
Esc/q Quit - -
127+
Esc/q/Left/h - Cancel / close window Cancel / close window</pre>
124128
<p>The same logic applies to all <strong>PyRadio</strong> windows.</p>
125129
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> All windows - except the <em>Search window</em> - support changing the volume and muting / unmuting the player (provided that <strong>PyRadio</strong> is actually connected to a station).</p>
126130
<h2 id="config-file">Config file <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
@@ -163,9 +167,10 @@ <h3 id="specifying-a-playlist-to-load-command-line">Specifying a playlist to loa
163167
<h3 id="managing-playlists-within-pyradio">Managing playlists (within PyRadio)</h3>
164168
<p>Once <strong>PyRadio</strong> has been loaded, one can perform a series of actions on the current playlist and set of playlists saved in its configuration directory.</p>
165169
<p>Currently, the following actions are available:</p>
166-
<p>One thing you may want to do is remove a station from a playlist, e.g. when found that it not longer works. You can do that by pressing <strong><em>DEL</em></strong>or “<strong><em>x</em></strong>”.</p>
167-
<p>Pressing “<strong><em>e</em></strong>” will enable you to change the encoding of the selected station. If the station is currently playing, playback will be restarted so that the encoding’s change takes effect (hopefully correctly displaying the station/song title).</p>
170+
<p>Pressing “<strong>a</strong>” or “<strong>A</strong>” will enable you to add a new station (either below the currently selected station or at the end of the list), while <strong>e</strong>will edit the currently selected station. All of these actions will open the “<em>Station Editor</em>”.</p>
171+
<p>If you just want to change the encoding of the selected station, just press “<strong><em>E</em></strong>. If the station is currently playing, playback will be restarted so that the encoding’s change takes effect (hopefully correctly displaying the station/song title).</p>
168172
<p>Then, when this is done, you can either save the modified playlist, by pressing “<strong><em>s</em></strong>”, or reload the playlist from disk, by pressing “<strong><em>R</em></strong>”. A modified playlist will automatically be saved when <strong>PyRadio</strong> exits (or Ctrl-C is pressed).</p>
173+
<p>One thing you may also want to do is remove a station from a playlist, e.g. when found that it not longer works. You can do that by pressing “<strong><em>DEL</em></strong>” or “<strong><em>x</em></strong>”.</p>
169174
<p>Finally, opening another playlist is also possible. Just press “<strong><em>o</em></strong>” and you will be presented with a list of saved playlists to choose from. These playlists must be saved beforehand in <strong>PyRadio</strong>’s configuration directory.</p>
170175
<p>While executing any of the previous actions, you may get confirmation messages (when opening a playlist while the current one is modified but not saved, for example) or error messages (when an action fails). Just follow the on screen information, keeping in mind that a capital letter as an answer will save this answer in <strong>PyRadio</strong>’s configuration file for future reference.</p>
171176
<h3 id="managing-foreign-playlists">Managing “foreign” playlists</h3>
@@ -290,7 +295,7 @@ <h2 id="cleaning-up">Cleaning up <span style="padding-left: 10px;"><sup style="f
290295
Finished processing dependencies for pyradio==0.7.8</pre>
291296
<p>From this we get that the installation directory is <strong>/usr/lib/python3.7/site-packages</strong>. This may be different though, depending on the distribution and python version used.</p>
292297
<p>Let’s see what <strong>PyRadio</strong> files exist there:</p>
293-
<pre>$ ls -d /usr/lib/python3.7/site-packages
298+
<pre>$ ls -d /usr/lib/python3.7/site-packages/pyradio*
294299

295300
/usr/lib/python3.7/site-packages/pyradio-0.7.6.2-py3.7.egg
296301
/usr/lib/python3.7/site-packages/pyradio-0.7.7-py3.7.egg

README.md

+33-28
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,35 @@ The following options can also be set in **PyRadio**'s [configuration file](#con
8181
## Controls
8282

8383
```
84-
Main window Playlists window Themes window
85-
------------------------------------------------------------------------------------------------------------------------------
84+
Main window Playlists window Themes window
85+
-------------------------------------------------------------------------------------------------------------------------------------
8686
Up/Down/j/k/
87-
PgUp/PgDown Change station selection Change station playlist Change station theme
88-
g Jump to first station Jump to first playlist Jump to first theme
89-
<n>G Jump to n-th / last station Jump to n-th / last playlist Jump to n-th / last theme
90-
M Jump to the middle of the playlist Jump to the middle of the list -
91-
P Jump to playing station Jump to playing playlist -
92-
Enter/Right/l Play selected station Open selected playlist Apply selected theme
93-
r Select and play a random station Re-read playlists from disk -
94-
Space/Left/h Stop/start playing selected station - -
95-
Space - - Apply theme and make it default
96-
-/+ or ,/. Change volume [Valid] [Valid]
97-
m Mute / unmute player [Valid] [Valid]
98-
v Save volume (not applicable for vlc) [Valid] [Valid]
99-
o s R Open / Save / Reload playlist - -
100-
E Change station's encoding
101-
DEL,x Delete selected station - -
102-
t T Load theme / Toggle transparency [Valid] [Valid]
103-
c Open Configuration window. - -
104-
/ n N Search, go to next / previous result [Valid] [Valid]
105-
? Show keys help [Valid] [Valid]
106-
# Redraw window [Valid] [Valid]
107-
Esc/q Quit - -
108-
Esc/q/Left/h - Cancel / close window Cancel / close window
87+
PgUp/PgDown Change station selection Change station playlist Change station theme
88+
g Jump to first station Jump to first playlist Jump to first theme
89+
<n>G Jump to n-th / last station Jump to n-th / last playlist Jump to n-th / last theme
90+
H M L Jump to the top / middle bottom of the list [Valid] -
91+
P Jump to playing station Jump to playing playlist -
92+
Enter/Right/l Play selected station Open selected playlist Apply selected theme
93+
r Select and play a random station Re-read playlists from disk -
94+
Space/Left/h Stop/start playing selected station - -
95+
Space - - Apply theme and make it default
96+
-/+ or ,/. Change volume [Valid] [Valid]
97+
m Mute / unmute player [Valid] [Valid]
98+
v Save volume (not applicable for vlc) [Valid] [Valid]
99+
o s R Open / Save / Reload playlist - -
100+
a A Add / append a new station - -
101+
e Edit current station - -
102+
E Change station's encoding - -
103+
DEL,x Delete selected station - -
104+
t T Load theme / Toggle transparency [Valid] [Valid]
105+
c Open Configuration window. - -
106+
/ n N Search, go to next / previous result [Valid] [Valid]
107+
J Create a jump tag
108+
<n>^U <n>^D Move station up / down. - -
109+
? Show keys help [Valid] [Valid]
110+
# Redraw window [Valid] [Valid]
111+
Esc/q Quit - -
112+
Esc/q/Left/h - Cancel / close window Cancel / close window
109113
```
110114

111115
The same logic applies to all **PyRadio** windows.
@@ -185,12 +189,14 @@ Once **PyRadio** has been loaded, one can perform a series of actions on the cur
185189

186190
Currently, the following actions are available:
187191

188-
One thing you may want to do is remove a station from a playlist, e.g. when found that it not longer works. You can do that by pressing "***DEL***" or "***x***".
192+
Pressing "**a**" or "**A**" will enable you to add a new station (either below the currently selected station or at the end of the list), while "**e**" will edit the currently selected station. All of these actions will open the "*Station Editor*".
189193

190-
Pressing "***e***" will enable you to change the encoding of the selected station. If the station is currently playing, playback will be restarted so that the encoding's change takes effect (hopefully correctly displaying the station/song title).
194+
If you just want to change the encoding of the selected station, just press "***E***". If the station is currently playing, playback will be restarted so that the encoding's change takes effect (hopefully correctly displaying the station/song title).
191195

192196
Then, when this is done, you can either save the modified playlist, by pressing "***s***", or reload the playlist from disk, by pressing "***R***". A modified playlist will automatically be saved when **PyRadio** exits (or Ctrl-C is pressed).
193197

198+
One thing you may also want to do is remove a station from a playlist, e.g. when found that it not longer works. You can do that by pressing "***DEL***" or "***x***".
199+
194200
Finally, opening another playlist is also possible. Just press "***o***" and you will be presented with a list of saved playlists to choose from. These playlists must be saved beforehand in **PyRadio**'s configuration directory.
195201

196202
While executing any of the previous actions, you may get confirmation messages (when opening a playlist while the current one is modified but not saved, for example) or error messages (when an action fails). Just follow the on screen information, keeping in mind that a capital letter as an answer will save this answer in **PyRadio**'s configuration file for future reference.
@@ -423,7 +429,7 @@ From this we get that the installation directory is **/usr/lib/python3.7/site-pa
423429
Let's see what **PyRadio** files exist there:
424430

425431

426-
$ ls -d /usr/lib/python3.7/site-packages
432+
$ ls -d /usr/lib/python3.7/site-packages/pyradio*
427433

428434
/usr/lib/python3.7/site-packages/pyradio-0.7.6.2-py3.7.egg
429435
/usr/lib/python3.7/site-packages/pyradio-0.7.7-py3.7.egg
@@ -435,7 +441,6 @@ As we see, previous versions still exist in this system: **0.7.6.2** and **0.7.7
435441
$ sudo rm -rf /usr/lib/python3.7/site-packages/pyradio-0.7.7-py3.7.egg
436442

437443

438-
439444
## Debug mode
440445

441446
Adding the ***-d*** option to the command line will instruct **PyRadio** to enter *Debug mode*, which means that it will print debug messages to a file. This file will always reside in the user's home directory and will be named *pyradio.log*.

pyradio/edit.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ def keypress(self, char):
464464
return 3
465465
elif self._focus == 3:
466466
# ok
467-
return self._return_station()
467+
ret = self._return_station()
468+
self.focus = abs(ret + 2)
468469
elif self._focus == 4:
469470
# cancel
470471
self.new_station = None
@@ -473,7 +474,8 @@ def keypress(self, char):
473474
self.new_station = None
474475
ret = -1
475476
elif char == ord('s') and self._focus > 1:
476-
return self._return_station()
477+
ret = self._return_station()
478+
self.focus = abs(ret + 2)
477479
elif char == ord('q') and self._focus > 1:
478480
self.new_station = None
479481
ret = -1

0 commit comments

Comments
 (0)