Skip to content

Commit

Permalink
- Version 0.8.8.3
Browse files Browse the repository at this point in the history
- Fixing displaying help for parameters editor
- Updating documentation
  • Loading branch information
s-n-g committed Feb 26, 2021
1 parent c72360f commit 46ff54d
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 46 deletions.
10 changes: 7 additions & 3 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
2021-02-12 s-n-g
2021-02-26 s-n-g
* Basic mouse support implemented
* Config option to enable mouse support added
* Implementing players extra parameters set.
* Player selection Config window redesigned.
* Adding -ep. -ap, -lp command line parameters.
* Fixing a bug which would lead to a crash when "r"
would be pressed in the config window.
* When altering connection type either from the config
or from the dialog ('z'), playback will be restarted
* Playback will be restarted when vital parameters are
changes (encoding, connection type, player parameters).
* When restarting playback, play the correct station
not the selected one.
* Fixing several minor bugs.

2021-01-09 s-n-g
* adding autostart BAT file on Windows to
Expand Down
52 changes: 32 additions & 20 deletions README.html

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ This way, 10 sets of parameters can be inserted and made available for selection

#### Using the command line

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.
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.

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

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

### Changing parameters set

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.

While **PyRadio** is running, the user can change the parameters set used by the player using the "*Player Extra Parameters*" window, by pressing "**Z**".

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

- [ ] Any user request I find interesting :)
- [x] Basic mouse support ([#119](https://github.com/coderholic/pyradio/issues/119))
- [x] New player selection configuration window ([#118](https://github.com/coderholic/pyradio/issues/118))
- [ ] 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))
- [x] Basic mouse support ([#119](https://github.com/coderholic/pyradio/issues/119)) - v. 0.8.8.3
- [x] Players extra parameters ([#118](https://github.com/coderholic/pyradio/issues/118)) - v. 0.8.8.3
- [x] New player selection configuration window ([#118](https://github.com/coderholic/pyradio/issues/118)) - v. 0.8.8.3
- [ ] Notify the user that the package's stations.csv has changed
- [ ] Update / uninstall using command line parameters (-U / -R)
- [ ] 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))

## Acknowledgment

Expand Down
9 changes: 6 additions & 3 deletions build.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
a{ color: SaddleBrown;}
a:visited{color: SaddleBrown;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<header id="title-block-header">
</header>
<h1 style="color: SaddleBrown"id="pyradio-build-instructions">PyRadio Build Instructions</h1>
<p><strong>PyRadio</strong>: Command line internet radio player.</p>
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic" class="uri">https://github.com/coderholic</a></p>
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic">https://github.com/coderholic</a></p>
<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>
<ul>
<li><a href="#building-from-source">Building from source</a>
Expand All @@ -52,7 +55,7 @@ <h2 id="building-from-source">Building from source <span style="padding-left: 10
<li>A pre-built package is not available to you.</li>
<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>
</ul>
<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>
<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>
<p>Finally, you will use the <strong><em>build_install_pyradio</em></strong> script, located int the <strong><em>devel</em></strong> directory.</p>
<p>To see your options, execute:</p>
<pre>devel/build_install_pyradio -h</pre>
Expand Down
10 changes: 5 additions & 5 deletions pyradio.1
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@ Print config directory (\fI[CONFIG DIR]\fR) location and exit.
Open config directory (\fI[CONFIG DIR]\fR) with default file manager.
.IP \fB-ep\ \fIEXTRA_PLAYER_PARAMETERS\fR,\ \fB--extra_player_parameters\ \fIEXTRA_PLAYER_PARAMETERS\fR
Provide extra player parameters as a string. For more information, refer to the \fBEXTRA PLAYER PARAMETERS\fR section.

.IP \fB-ap\fR\ \fIACTIVE_PLAYER_PARAM_ID\fR,\ \fB--active-player-param-id\fR\ \fIACTIVE_PLAYER_PARAM_ID\fR
Specify the extra player parameter set to be used with the default player. \fIACTIVE_PLAYER_PARAM_ID\fR is 1-11.

.IP \fB-lp
List extra players parameters.

.IP \fB--unlock
Remove sessions' lock file.
.IP \fB-d\fR,\fB\ \--debug
Expand Down Expand Up @@ -500,7 +497,7 @@ This way, 10 sets of parameters can be inserted and made available for selection

\fBUSING THE COMMAND LINE\fR

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.
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.

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

Expand Down Expand Up @@ -542,6 +539,7 @@ Example:

\fIpyradio -epp "mpv:profile:second_sound_card"


.P
\fBUSING THE CONFIGURATION WINDOW\fR

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

\fBCHANGING PARAMETERS' SET\fR

.P
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.

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".

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

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


.SH PLAYER CONNECTION PROTOCOL

Most radio stations use plain old http protocol to broadcast, but some of them use https.
Expand Down
14 changes: 11 additions & 3 deletions pyradio/config_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,9 @@ def keypress(self, char):
2: Display line editor help
'''
ret = 1
if char in (curses.KEY_EXIT, 27, ord('q')) and \
if char == ord('?') and self._focus > 0:
return 2
elif char in (curses.KEY_EXIT, 27, ord('q')) and \
self._focus > 0:
self.edit_string = ''
ret = 0
Expand Down Expand Up @@ -805,7 +807,7 @@ def _update_focus(self):

class ExtraParameters(object):
''' display player's extra parameters
in a foreign curses window
in a foreign curses window ('Z')
'''

def __init__(self,
Expand Down Expand Up @@ -835,6 +837,9 @@ def __init__(self,
self.max_lines = max_lines

self.reset(saved=False)
''' set cursor to active item '''
for a_key in self._selections.keys():
self._selections[a_key][0] = self._selections[a_key][2]
self._get_width()

def check_parameters(self):
Expand Down Expand Up @@ -942,7 +947,7 @@ def _dict_to_list(self):
self._selections[a_param_set][2] = int(a_param) - 1
else:
self._items_dict[a_param_set].append(a_param)
# logger.error('DE selections = {}'.format(self._selections))
logger.error('DE selections = {}'.format(self._selections))

def _list_to_dict(self):
''' convert self._items_dict to self._working_params '''
Expand Down Expand Up @@ -1086,6 +1091,7 @@ def keypress(self, char):
3 - error, cannot edit or delete first item
4 - edit parameter
5 - add parameter
6 - line editor help
'''
if char in (
curses.KEY_ENTER, ord('\n'),
Expand Down Expand Up @@ -1382,6 +1388,7 @@ def keypress(self, char):
4 - Editor exited
'''
if self.editing == 0:
''' focus on players '''
if char in (9, ):
if self._players[self.selection][1]:
self._switch_column()
Expand Down Expand Up @@ -1461,6 +1468,7 @@ def keypress(self, char):
self._extra.set_player(self.selected_player_name())

else:
''' focus on parameters '''
ret = self._extra.keypress(char)
if ret == 2:
''' error, number of max lines reached '''
Expand Down
4 changes: 4 additions & 0 deletions pyradio/radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def __init__(self, pyradio_config, play=False, req_player='', theme=''):
self.ws.MOUSE_RESTART_INFO_MODE: self._print_mouse_restart_info,
self.ws.IN_PLAYER_PARAMS_EDITOR: self._redisplay_player_select_win_refresh_and_resize,
self.ws.USER_PARAMETER_ERROR: self._print_user_parameter_error,
self.ws.IN_PLAYER_PARAMS_EDITOR_HELP_MODE: self._show_params_ediror_help,
}

''' list of help functions '''
Expand Down Expand Up @@ -4263,6 +4264,9 @@ def keypress(self, char):
or parameters will be lost!!!
self._player_select_win = None
'''
elif ret == 2:
''' display line editor help '''
self._show_params_ediror_help()
elif ret == 3:
''' Got into paramater editor '''
self.ws.operation_mode = self.ws.IN_PLAYER_PARAMS_EDITOR
Expand Down
11 changes: 7 additions & 4 deletions windows-mplayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
a{ color: SaddleBrown;}
a:visited{color: SaddleBrown;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<header id="title-block-header">
</header>
<h1 style="color: SaddleBrown"id="mplayer-installation-on-windows">MPlayer Installation on Windows</h1>
<p><strong>PyRadio</strong>: Command line internet radio player.</p>
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic" class="uri">https://github.com/coderholic</a></p>
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic">https://github.com/coderholic</a></p>
<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>
<ul>
<li><a href="#mplayer-installation">MPlayer installation</a>
Expand All @@ -47,11 +50,11 @@ <h2 id="mplayer-installation">MPlayer installation <span style="padding-left: 10
<ol type="a">
<li><strong>%USERPROFILE%</strong></p>
<p>This is actually your “<em>Home</em>” directory.</p>
<p>Please make a note that you will add &quot;<strong>%USERPROFILE%\mplayer</strong> to PATH.</p></li>
<p>Please make a note that you will add "<strong>%USERPROFILE%\mplayer</strong> to PATH.</p></li>
<li><strong>%APPDATA%\pyradio</strong></p>
<p>This is (or will be) “<em>PyRadio’s configuration directory</em>”.</p>
<p>In case the <strong>pyradio</strong> directory does not exit, you just go ahead and create it.</p>
<p>(Make a note that you will add &quot;<strong>%APPDATA%\pyradio\mplayer</strong> to PATH)</p></li>
<p>(Make a note that you will add "<strong>%APPDATA%\pyradio\mplayer</strong> to PATH)</p></li>
</ol>
<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>
<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>
Expand Down
11 changes: 7 additions & 4 deletions windows.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
a{ color: SaddleBrown;}
a:visited{color: SaddleBrown;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<header id="title-block-header">
</header>
<h1 style="color: SaddleBrown"id="pyradio-on-windows">PyRadio on Windows</h1>
<p><strong>PyRadio</strong>: Command line internet radio player.</p>
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic" class="uri">https://github.com/coderholic</a></p>
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic">https://github.com/coderholic</a></p>
<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>
<ul>
<li><a href="#running-pyradio-on-windows">Running PyRadio on Windows</a></li>
Expand Down Expand Up @@ -87,7 +90,7 @@ <h4 id="installing-python">1.1 Installing Python</h4>
<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>
<p><a target="_blank" href="https://members.hellug.gr/sng/pyradio/python1.jpg">Python Installation</a></p>
<h4 id="verifying-the-installation">1.2 Verifying the installation</h4>
<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>
<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>
<p>So, go ahead and open a console (the command is <strong>cmd</strong>) and type <strong>python</strong>.</p>
<p>If you get something similar to the following snippet, you are good to go.</p>
<pre>Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win
Expand Down Expand Up @@ -157,7 +160,7 @@ <h4 id="using-git">4.1 Using Git</h4>
devel\build_install_pyradio</pre>
<h4 id="not-using-git">4.2 Not using Git</h4>
<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>
<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>
<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>
<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>
<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>
<p><a target="_blank" href="https://members.hellug.gr/sng/pyradio/run-as-admin.jpg">Run as Administrator</a></p>
Expand Down

0 comments on commit 46ff54d

Please sign in to comment.