Skip to content

Commit 46ff54d

Browse files
committed
- Version 0.8.8.3
- Fixing displaying help for parameters editor - Updating documentation
1 parent c72360f commit 46ff54d

9 files changed

+86
-46
lines changed

Changelog

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
2021-02-12 s-n-g
1+
2021-02-26 s-n-g
22
* Basic mouse support implemented
33
* Config option to enable mouse support added
4+
* Implementing players extra parameters set.
5+
* Player selection Config window redesigned.
6+
* Adding -ep. -ap, -lp command line parameters.
47
* Fixing a bug which would lead to a crash when "r"
58
would be pressed in the config window.
6-
* When altering connection type either from the config
7-
or from the dialog ('z'), playback will be restarted
9+
* Playback will be restarted when vital parameters are
10+
changes (encoding, connection type, player parameters).
811
* When restarting playback, play the correct station
912
not the selected one.
13+
* Fixing several minor bugs.
1014

1115
2021-01-09 s-n-g
1216
* adding autostart BAT file on Windows to

README.html

+32-20
Large diffs are not rendered by default.

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ This way, 10 sets of parameters can be inserted and made available for selection
435435

436436
#### Using the command line
437437

438-
When the command line parameter (**-epp** or **--extra_player_parameters**) is used, the parameters specified must be of a specific format, and will be added to the list of parameters and made default for the player.
438+
When the command line parameter (**-epp** or **--extra_player_parameters**) is used, the parameters specified must be of a specific format, and will be added to the list of parameters and made default for the player for the current session.
439439

440440
The format of the parameter is the following: **[player_name:parameters]**
441441

@@ -477,6 +477,8 @@ The user can add ("**a**") a new parameter, edit ("**e**") an existing set and d
477477

478478
### Changing parameters set
479479

480+
When all desired parameter sets are already defined, using the **-ap** (**--active-player-param-id**) command line parameter can activate the set that corresponds to the number specified. The number to use for any given set can be retrieved using the **-lp** (**--list-player-parameters**) command line parameter.
481+
480482
While **PyRadio** is running, the user can change the parameters set used by the player using the "*Player Extra Parameters*" window, by pressing "**Z**".
481483

482484
If playback is on, changing the player's parameters will make the player restart the playback so that the new parameters get used.
@@ -740,11 +742,12 @@ Finally, include the file produced in your report.
740742
## TODO
741743

742744
- [ ] Any user request I find interesting :)
743-
- [x] Basic mouse support ([#119](https://github.com/coderholic/pyradio/issues/119))
744-
- [x] New player selection configuration window ([#118](https://github.com/coderholic/pyradio/issues/118))
745-
- [ ] Use Radio Browser service ([#80](https://github.com/coderholic/pyradio/issues/80) [#93](https://github.com/coderholic/pyradio/issues/93) [#112](https://github.com/coderholic/pyradio/issues/112))
745+
- [x] Basic mouse support ([#119](https://github.com/coderholic/pyradio/issues/119)) - v. 0.8.8.3
746+
- [x] Players extra parameters ([#118](https://github.com/coderholic/pyradio/issues/118)) - v. 0.8.8.3
747+
- [x] New player selection configuration window ([#118](https://github.com/coderholic/pyradio/issues/118)) - v. 0.8.8.3
746748
- [ ] Notify the user that the package's stations.csv has changed
747749
- [ ] Update / uninstall using command line parameters (-U / -R)
750+
- [ ] Use Radio Browser service ([#80](https://github.com/coderholic/pyradio/issues/80) [#93](https://github.com/coderholic/pyradio/issues/93) [#112](https://github.com/coderholic/pyradio/issues/112))
748751

749752
## Acknowledgment
750753

build.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@
2121
a{ color: SaddleBrown;}
2222
a:visited{color: SaddleBrown;}
2323
</style>
24+
<!--[if lt IE 9]>
25+
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
26+
<![endif]-->
2427
</head>
2528
<body>
26-
<header>
29+
<header id="title-block-header">
2730
</header>
2831
<h1 style="color: SaddleBrown"id="pyradio-build-instructions">PyRadio Build Instructions</h1>
2932
<p><strong>PyRadio</strong>: Command line internet radio player.</p>
30-
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic" class="uri">https://github.com/coderholic</a></p>
33+
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic">https://github.com/coderholic</a></p>
3134
<h2 id="table-of-contents">Table of contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
3235
<ul>
3336
<li><a href="#building-from-source">Building from source</a>
@@ -52,7 +55,7 @@ <h2 id="building-from-source">Building from source <span style="padding-left: 10
5255
<li>A pre-built package is not available to you.</li>
5356
<li>You want to use a particular python version. For example, most pre-built packages nowadays are built using python 3.x. If for any reason you have to use python 2.x, this is the way to go.</li>
5457
</ul>
55-
<p>For the installation you will need <strong><em>git</em></strong> and <strong><em>setuptools</em></strong> (e.g. <em>python-setuptools</em>, <em>python3-setuptools</em> or <em>python2-setuptools</em>) to be already installed.</p>
58+
<p>For the installation you will need <strong><em>git</em></strong> and <strong><em>setuptools</em></strong> (e.g. <em>python-setuptools</em>, <em>python3-setuptools</em> or <em>python2-setuptools</em>) to be already installed.</p>
5659
<p>Finally, you will use the <strong><em>build_install_pyradio</em></strong> script, located int the <strong><em>devel</em></strong> directory.</p>
5760
<p>To see your options, execute:</p>
5861
<pre>devel/build_install_pyradio -h</pre>

pyradio.1

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,10 @@ Print config directory (\fI[CONFIG DIR]\fR) location and exit.
4040
Open config directory (\fI[CONFIG DIR]\fR) with default file manager.
4141
.IP \fB-ep\ \fIEXTRA_PLAYER_PARAMETERS\fR,\ \fB--extra_player_parameters\ \fIEXTRA_PLAYER_PARAMETERS\fR
4242
Provide extra player parameters as a string. For more information, refer to the \fBEXTRA PLAYER PARAMETERS\fR section.
43-
4443
.IP \fB-ap\fR\ \fIACTIVE_PLAYER_PARAM_ID\fR,\ \fB--active-player-param-id\fR\ \fIACTIVE_PLAYER_PARAM_ID\fR
4544
Specify the extra player parameter set to be used with the default player. \fIACTIVE_PLAYER_PARAM_ID\fR is 1-11.
46-
4745
.IP \fB-lp
4846
List extra players parameters.
49-
5047
.IP \fB--unlock
5148
Remove sessions' lock file.
5249
.IP \fB-d\fR,\fB\ \--debug
@@ -500,7 +497,7 @@ This way, 10 sets of parameters can be inserted and made available for selection
500497

501498
\fBUSING THE COMMAND LINE\fR
502499

503-
When the command line parameter (\fB-epp\fR or \fB-extra_player_parameters\fR) is used, the parameters specified must be of a specific format, and will be added to the list of parameters and made default for the player.
500+
When the command line parameter (\fB-epp\fR or \fB-extra_player_parameters\fR) is used, the parameters specified must be of a specific format, and will be added to the list of parameters and made default for the player for the current session.
504501

505502
The format of the parameter is the following: \fI[\fBplayer_name\fR:\fBparameters\fI]\fR.
506503

@@ -542,6 +539,7 @@ Example:
542539

543540
\fIpyradio -epp "mpv:profile:second_sound_card"
544541

542+
545543
.P
546544
\fBUSING THE CONFIGURATION WINDOW\fR
547545

@@ -555,14 +553,16 @@ The user can add ("\fBa\fR") a new parameter, edit ("\fBe\fR") an existing set a
555553

556554
\fBCHANGING PARAMETERS' SET\fR
557555

556+
.P
557+
When all desired parameter sets are already defined, using the \fB-ap\fR (\fB--active-player-param-id\fR) command line parameter can activate the set that corresponds to the number specified. The number to use for any given set can be retrieved using the \fB-lp\fR (\fB--list-player-parameters\fR) command line parameter.
558+
558559
While \fBpyradio\fR is running, the user can change the parameters' set used by the player using the "\fIPlayer Extra Parameters\fR" window, by pressing "\fBZ\fR".
559560

560561
If playback is on, changing the player's parameters will make the player restart the playback so that the new parameters is used.
561562

562563
.IP \fBNote\fR
563564
Any changes made this way will not be saved but will be in effect until \fBpyradio\fR terminates.
564565

565-
566566
.SH PLAYER CONNECTION PROTOCOL
567567

568568
Most radio stations use plain old http protocol to broadcast, but some of them use https.

pyradio/config_window.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,9 @@ def keypress(self, char):
725725
2: Display line editor help
726726
'''
727727
ret = 1
728-
if char in (curses.KEY_EXIT, 27, ord('q')) and \
728+
if char == ord('?') and self._focus > 0:
729+
return 2
730+
elif char in (curses.KEY_EXIT, 27, ord('q')) and \
729731
self._focus > 0:
730732
self.edit_string = ''
731733
ret = 0
@@ -805,7 +807,7 @@ def _update_focus(self):
805807

806808
class ExtraParameters(object):
807809
''' display player's extra parameters
808-
in a foreign curses window
810+
in a foreign curses window ('Z')
809811
'''
810812

811813
def __init__(self,
@@ -835,6 +837,9 @@ def __init__(self,
835837
self.max_lines = max_lines
836838

837839
self.reset(saved=False)
840+
''' set cursor to active item '''
841+
for a_key in self._selections.keys():
842+
self._selections[a_key][0] = self._selections[a_key][2]
838843
self._get_width()
839844

840845
def check_parameters(self):
@@ -942,7 +947,7 @@ def _dict_to_list(self):
942947
self._selections[a_param_set][2] = int(a_param) - 1
943948
else:
944949
self._items_dict[a_param_set].append(a_param)
945-
# logger.error('DE selections = {}'.format(self._selections))
950+
logger.error('DE selections = {}'.format(self._selections))
946951

947952
def _list_to_dict(self):
948953
''' convert self._items_dict to self._working_params '''
@@ -1086,6 +1091,7 @@ def keypress(self, char):
10861091
3 - error, cannot edit or delete first item
10871092
4 - edit parameter
10881093
5 - add parameter
1094+
6 - line editor help
10891095
'''
10901096
if char in (
10911097
curses.KEY_ENTER, ord('\n'),
@@ -1382,6 +1388,7 @@ def keypress(self, char):
13821388
4 - Editor exited
13831389
'''
13841390
if self.editing == 0:
1391+
''' focus on players '''
13851392
if char in (9, ):
13861393
if self._players[self.selection][1]:
13871394
self._switch_column()
@@ -1461,6 +1468,7 @@ def keypress(self, char):
14611468
self._extra.set_player(self.selected_player_name())
14621469

14631470
else:
1471+
''' focus on parameters '''
14641472
ret = self._extra.keypress(char)
14651473
if ret == 2:
14661474
''' error, number of max lines reached '''

pyradio/radio.py

+4
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def __init__(self, pyradio_config, play=False, req_player='', theme=''):
339339
self.ws.MOUSE_RESTART_INFO_MODE: self._print_mouse_restart_info,
340340
self.ws.IN_PLAYER_PARAMS_EDITOR: self._redisplay_player_select_win_refresh_and_resize,
341341
self.ws.USER_PARAMETER_ERROR: self._print_user_parameter_error,
342+
self.ws.IN_PLAYER_PARAMS_EDITOR_HELP_MODE: self._show_params_ediror_help,
342343
}
343344

344345
''' list of help functions '''
@@ -4263,6 +4264,9 @@ def keypress(self, char):
42634264
or parameters will be lost!!!
42644265
self._player_select_win = None
42654266
'''
4267+
elif ret == 2:
4268+
''' display line editor help '''
4269+
self._show_params_ediror_help()
42664270
elif ret == 3:
42674271
''' Got into paramater editor '''
42684272
self.ws.operation_mode = self.ws.IN_PLAYER_PARAMS_EDITOR

windows-mplayer.html

+7-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@
2121
a{ color: SaddleBrown;}
2222
a:visited{color: SaddleBrown;}
2323
</style>
24+
<!--[if lt IE 9]>
25+
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
26+
<![endif]-->
2427
</head>
2528
<body>
26-
<header>
29+
<header id="title-block-header">
2730
</header>
2831
<h1 style="color: SaddleBrown"id="mplayer-installation-on-windows">MPlayer Installation on Windows</h1>
2932
<p><strong>PyRadio</strong>: Command line internet radio player.</p>
30-
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic" class="uri">https://github.com/coderholic</a></p>
33+
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic">https://github.com/coderholic</a></p>
3134
<h2 id="table-of-contents">Table of contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
3235
<ul>
3336
<li><a href="#mplayer-installation">MPlayer installation</a>
@@ -47,11 +50,11 @@ <h2 id="mplayer-installation">MPlayer installation <span style="padding-left: 10
4750
<ol type="a">
4851
<li><strong>%USERPROFILE%</strong></p>
4952
<p>This is actually your “<em>Home</em>” directory.</p>
50-
<p>Please make a note that you will add &quot;<strong>%USERPROFILE%\mplayer</strong> to PATH.</p></li>
53+
<p>Please make a note that you will add "<strong>%USERPROFILE%\mplayer</strong> to PATH.</p></li>
5154
<li><strong>%APPDATA%\pyradio</strong></p>
5255
<p>This is (or will be) “<em>PyRadio’s configuration directory</em>”.</p>
5356
<p>In case the <strong>pyradio</strong> directory does not exit, you just go ahead and create it.</p>
54-
<p>(Make a note that you will add &quot;<strong>%APPDATA%\pyradio\mplayer</strong> to PATH)</p></li>
57+
<p>(Make a note that you will add "<strong>%APPDATA%\pyradio\mplayer</strong> to PATH)</p></li>
5558
</ol>
5659
<p>In either case, in order to do that, open an <strong>Explorer File Manager</strong> window, and enter at its location field <strong>%USERPROFILE%</strong> or <strong>%APPDATA%</strong>.</p>
5760
<p>If you are unsure on how to do that, please refer to the following image (you can ENTER <strong>%USERPROFILE%</strong> or <strong>%APPDATA%</strong> or any other Windows System Variable this way).</p>

windows.html

+7-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@
2121
a{ color: SaddleBrown;}
2222
a:visited{color: SaddleBrown;}
2323
</style>
24+
<!--[if lt IE 9]>
25+
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
26+
<![endif]-->
2427
</head>
2528
<body>
26-
<header>
29+
<header id="title-block-header">
2730
</header>
2831
<h1 style="color: SaddleBrown"id="pyradio-on-windows">PyRadio on Windows</h1>
2932
<p><strong>PyRadio</strong>: Command line internet radio player.</p>
30-
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic" class="uri">https://github.com/coderholic</a></p>
33+
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic">https://github.com/coderholic</a></p>
3134
<h2 id="table-of-contents">Table of contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
3235
<ul>
3336
<li><a href="#running-pyradio-on-windows">Running PyRadio on Windows</a></li>
@@ -87,7 +90,7 @@ <h4 id="installing-python">1.1 Installing Python</h4>
8790
<p>When the download is done, run its setup and select “<em>Custom Installation</em>” so that you can “<em>Add Python to environment varaibles</em>”. You can refer to the following image to see the relevant setting.</p>
8891
<p><a target="_blank" href="https://members.hellug.gr/sng/pyradio/python1.jpg">Python Installation</a></p>
8992
<h4 id="verifying-the-installation">1.2 Verifying the installation</h4>
90-
<p>Either if you have just installed <strong>Python</strong> or you already have it installed, you need to verify that its executable is in the <strong>PATH</strong> (i.e. <strong>Python</strong> can be executed from a console by typing“<em>python</em>”).</p>
93+
<p>Either if you have just installed <strong>Python</strong> or you already have it installed, you need to verify that its executable is in the <strong>PATH</strong> (i.e. <strong>Python</strong> can be executed from a console by typing“<em>python</em>”).</p>
9194
<p>So, go ahead and open a console (the command is <strong>cmd</strong>) and type <strong>python</strong>.</p>
9295
<p>If you get something similar to the following snippet, you are good to go.</p>
9396
<pre>Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win
@@ -157,7 +160,7 @@ <h4 id="using-git">4.1 Using Git</h4>
157160
devel\build_install_pyradio</pre>
158161
<h4 id="not-using-git">4.2 Not using Git</h4>
159162
<p>Go to <a target="_blank" href="https://github.com/coderholic/pyradio/releases">PyRadio’s Releases page</a> and download the latest release (either a zip or a tar.gz file).</p>
160-
<p>Extract this file to your “<em>Home</em>” directory (“<strong>C:\Users\[Your User Name]</strong>” or “<strong>%USERPROFILE%</strong>) - you will get a directory whose name is similar to”<strong>pyradio-0.7.9</strong>&quot;.</p>
163+
<p>Extract this file to your “<em>Home</em>” directory (“<strong>C:\Users\[Your User Name]</strong>” or “<strong>%USERPROFILE%</strong>) - you will get a directory whose name is similar to”<strong>pyradio-0.7.9</strong>".</p>
161164
<p>I will use this name for the following examples; you will have to use the actual name of directory you got from the extraction.</p>
162165
<p>Finally, open a console (press the <strong>Win</strong> key, type <strong>cmd</strong> and press <strong>ENTER</strong> or if you are on Windows 10, use <strong>Run it as Administrator</strong> as you can see in the following image).</p>
163166
<p><a target="_blank" href="https://members.hellug.gr/sng/pyradio/run-as-admin.jpg">Run as Administrator</a></p>

0 commit comments

Comments
 (0)