Skip to content

Commit

Permalink
- version 0.9.2.12
Browse files Browse the repository at this point in the history
- updating docs
  • Loading branch information
s-n-g committed Jul 1, 2023
1 parent dd273ac commit 72905f5
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 24 deletions.
8 changes: 8 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2023-07-01 s-n-g
* version 0.9.2.12
* Implementing VLC recorder (not for Windows)
* MPlayer recorder will display volume level
* MPlayer on Windows 7 will not use profiles
* Trying different recorded file limit to start monitor
* updating docs

2023-06-20 s-n-g
* version 0.9.2.11
* implementing station recording for MPlayer media player
Expand Down
9 changes: 9 additions & 0 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
<h2 id="changelog">Changelog <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
<pre style="height: 200px;">

2023-07-01 s-n-g
* version 0.9.2.12
* Implementing VLC recorder (not for Windows)
* MPlayer recorder will display volume level
* MPlayer on Windows 7 will not use profiles
* Trying different recorded file limit to start monitor
* updating docs

2023-06-20 s-n-g
* version 0.9.2.11
* implementing station recording for MPlayer media player
Expand Down Expand Up @@ -1461,6 +1469,7 @@ <h2 id="player-detection-selection">Player detection / selection <span style="pa
<h3 id="changing-player-mid-session">Changing player mid-session</h3>
<p>If the user faces a playback problem with a given station, chances are that a different player will successfully play it.</p>
<p>Pressing “<strong>\m</strong>” will bring up the “<em>Switch Media Player</em>” window, where a different player can be activated.</p>
<p>If <strong>recording is on</strong> while using the previously activated player, it will remain on with the newly activated one. This actually means that the recording will stop when the old player is stopped and resumed when the new player is activated (creating a new recorder file). There is just one exception to that; selecting <strong>VLC</strong> is not possible on <strong>Windows</strong>, since <strong>VLC</strong> does not support recording on this platform.</p>
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> The activated player will not be saved; <strong>PyRadio</strong> will still use the player defined at its config next time it is executed.</p>
<h3 id="extra-player-parameters">Extra Player Parameters</h3>
<p>All three supported players can accept a significant number of “<em>command line options</em>”, which are well documented and accessible through man pages (on linux and macOs) or the documentation (on Windows).</p>
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ If the user faces a playback problem with a given station, chances are that a di

Pressing "**\\m**" will bring up the "*Switch Media Player*" window, where a different player can be activated.

If **recording is on** while using the previously activated player, it will remain on with the newly activated one. This actually means that the recording will stop when the old player is stopped and resumed when the new player is activated (creating a new recorder file). There is just one exception to that; selecting **VLC** is not possible on **Windows**, since **VLC** does not support recording on this platform.

**Note:** The activated player will not be saved; **PyRadio** will still use the player defined at its config next time it is executed.

### Extra Player Parameters
Expand Down
13 changes: 7 additions & 6 deletions devel/build_install_pyradio.bat
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ IF %ERRORLEVEL% == 1 (
SET ERRPKG=pip
GOTO piperror
)
ECHO Installing / Updating windows-curses
%PROGRAM% -m pip install --upgrade windows-curses 1>NUL 2>NUL
IF %ERRORLEVEL% == 1 (
SET ERRPKG=windows-curses
GOTO piperror
)
REM ECHO Installing / Updating windows-curses
REM %PROGRAM% -m pip install --upgrade windows-curses 1>NUL 2>NUL
REM IF %ERRORLEVEL% == 1 (
REM SET ERRPKG=windows-curses
REM GOTO piperror
REM )
ECHO Installing / Updating rich
%PROGRAM% -m pip install --upgrade rich 1>NUL 2>NUL
IF %ERRORLEVEL% == 1 (
Expand All @@ -47,6 +47,7 @@ IF %ERRORLEVEL% == 1 (
)

echo pywin32 > requirements.txt
echo windows-curses >> requirements.txt
echo requests >> requirements.txt
echo rich >> requirements.txt
echo dnspython >> requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pyradio"
version = "0.9.2.11"
version = "0.9.2.12"
authors = [
{ name="Ben Dowling", email="ben.m.dowling@gmail.com" },
{ name="Spiros Georgaras", email="sng@hellug.gr" },
Expand Down
2 changes: 1 addition & 1 deletion pyradio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
" pyradio -- Console radio player. "

version_info = (0, 9, 2, 11)
version_info = (0, 9, 2, 12)

# Set it to True if new stations have been
# added to the package's stations.csv
Expand Down
2 changes: 1 addition & 1 deletion pyradio/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
''' This is PyRadio version this
install.py was released for
'''
PyRadioInstallPyReleaseVersion = '0.9.2.11'
PyRadioInstallPyReleaseVersion = '0.9.2.12'

import locale
locale.setlocale(locale.LC_ALL, "")
Expand Down
22 changes: 11 additions & 11 deletions pyradio/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def create_monitor_player(self, stop, limit, notify_function):
if stop():
logger.error('Asked to stop. Exiting....')
return
logger.error('while 2')
# logger.error('while 2')
while os.path.getsize(self.recording_filename) < limit:
sleep(.1)
if stop():
Expand All @@ -422,17 +422,17 @@ def create_monitor_player(self, stop, limit, notify_function):
if stop():
logger.error('\n\nAsked to stop. Exiting....\n\n')
return
logger.error('----------------------starting!')
# logger.error('----------------------starting!')
self.monitor_process = subprocess.Popen(
self.monitor_opts, shell=False,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.STDOUT
)
logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
logger.error('------------------ to notify function')
# logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
# logger.error('------------------ to notify function')
notify_function()
logger.error('------------------ after notify function')
# logger.error('------------------ after notify function')
if logger.isEnabledFor(logging.INFO):
logger.info('Executing command: {}'.format(' '.join(self.monitor_opts)))
logger.info('----==== {} monitor started ====----'.format(self.PLAYER_NAME))
Expand Down Expand Up @@ -1631,7 +1631,7 @@ def play(self,
):
''' use a multimedia player to play a stream '''
self.monitor = self.monitor_process = self.monitor_opts = None
logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
# logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
self.recording_filename = ''
self.volume = -1
self.close()
Expand Down Expand Up @@ -1741,7 +1741,7 @@ def play(self,
logger.info('----==== {} player started ====----'.format(self.PLAYER_NAME))
if self.recording == self.RECORD_AND_LISTEN \
and self.PLAYER_NAME != 'mpv':
logger.error('=======================\n\n')
# logger.error('=======================\n\n')
limit = 120000
if self.PLAYER_NAME == 'mplayer':
if not platform.startswith('win'):
Expand All @@ -1756,22 +1756,22 @@ def play(self,
target=self.create_monitor_player,
args=(lambda: self.stop_mpv_status_update_thread, limit, self._start_monitor_update_thread)
).start()
logger.error('=======================\n\n')
# logger.error('=======================\n\n')

def _sendCommand(self, command):
''' send keystroke command to player '''
if [x for x in ('q', 'shutdown') if command.startswith(x)]:
self._command_to_player(self.process, command)
logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
# logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
if self.monitor_process is not None:
self._command_to_player(self.monitor_process, command)
return
logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
# logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
if self.monitor_process is not None and \
[x for x in
('/', '*', 'p', 'm', 'vol', 'pause' ) if command.startswith(x)
]:
logger.error('\n\nsending command: "{}"\n\n'.format(command))
# logger.error('\n\nsending command: "{}"\n\n'.format(command))
self._command_to_player(self.monitor_process, command)
else:
self._command_to_player(self.process, command)
Expand Down
3 changes: 2 additions & 1 deletion pyradio/radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ def keypress(self, char):
ord('s'), ord(' '),
ord('l'), curses.KEY_RIGHT
):
if not self._no_vlc:
if not (self._no_vlc and \
self._available_players[self._selected] == 'vlc'):
return self._available_players[self._selected]
elif char in (ord('h'), curses.KEY_LEFT,
ord('q'), curses.KEY_EXIT, 27):
Expand Down
8 changes: 7 additions & 1 deletion recording.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
<li><a href="#mpv">MPV</a></li>
<li><a href="#mplayer">MPlayer</a></li>
<li><a href="#vlc">VLC</a></li>
<li><a href="#vlc-recording-on-windows">VLC recording on Windows</a></li>
</ul></li>
<li><a href="#recording-implementation">Recording implementation</a>
<ul>
Expand All @@ -65,6 +66,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
</ul></li>
</ul>
<!-- vim-markdown-toc -->
<p><a href="README.html">[Return to main doc]</a></p>
<h2 id="intro">Intro <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
<p><strong>PyRadio v. 0.9.2.8</strong> introduces the ability to record stations, a feature used mainly to facilitate another feature: the ability to <em>pause and resume playback</em>.</p>
<p>All supported media players (<strong>MPV</strong>, <strong>MPlayer</strong> and <strong>VLC</strong>) support stream recording, each implementing it in a different way, which pose a challenge for the front end implementation.</p>
Expand Down Expand Up @@ -99,7 +101,6 @@ <h3 id="mplayer">MPlayer</h3>
<li>pausing and resuming the <strong>monitor</strong> for long will lead to song titles being out of sync, since the <strong>recorder</strong> will keep receiving data (and song titles) even when the playback if off.</li>
</ul>
<h3 id="vlc">VLC</h3>
<p><strong>Note</strong>: <strong>VLC</strong> recording has not been implemented yet!</p>
<p><strong>VLC</strong> stream recording has the following characteristics:</p>
<ul>
<li>it does not have the ability to record and play a stream at the same time.<br />
Expand All @@ -108,6 +109,11 @@ <h3 id="vlc">VLC</h3>
<li>the <strong>monitor</strong> will be started after the output file gets to a certain size, set to 120000 bytes by trial and error.</li>
<li>pausing and resuming the <strong>monitor</strong> for long will lead to song titles being out of sync, since the <strong>recorder</strong> will keep receiving data (and song titles) even when the playback if off.</li>
</ul>
<h3 id="vlc-recording-on-windows">VLC recording on Windows</h3>
<p><strong>VLC</strong> recording in <strong>not</strong> supported on <strong>Windows</strong>.</p>
<p>The <strong>VLC</strong> implementation on <strong>Window</strong> is a bit clumsy as it is as a radio player, and duplicating all this clumsiness in order to support recording as well, is just too much.</p>
<p>Trying to enable recording while <strong>VLC</strong> is the active player will lead to displaying a message informing the user of the situation and ways to proceed.</p>
<p>Consequently, this restriction has been applied to the “<em>Switch Media Player</em>” window (opened with “<strong>\m</strong>”); when recording a station and trying to change the player in use on <strong>Windows</strong>, selecting <strong>VLC</strong> is not supported.</p>
<h2 id="recording-implementation">Recording implementation <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
<p>The following keys are used for this feature:</p>
<table>
Expand Down
15 changes: 13 additions & 2 deletions recording.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ ___
* [MPV](#mpv)
* [MPlayer](#mplayer)
* [VLC](#vlc)
* [VLC recording on Windows](#vlc-recording-on-windows)
* [Recording implementation](#recording-implementation)
* [File location](#file-location)
* [File type](#file-type)
* [Pausing playback](#pausing-playback)

<!-- vim-markdown-toc -->

[[Return to main doc]](README.md)

## Intro

**PyRadio v. 0.9.2.8** introduces the ability to record stations, a feature used mainly to facilitate another feature: the ability to *pause and resume playback*.
Expand Down Expand Up @@ -76,8 +79,6 @@ This means that the front end (**PyRadio**) will have to use two *mplayer* insta

### VLC

**Note**: **VLC** recording has not been implemented yet!

**VLC** stream recording has the following characteristics:

- it does not have the ability to record and play a stream at the same time. \
Expand All @@ -86,6 +87,16 @@ This means that the front end (**PyRadio**) will have to use two *vlc* instances
- the **monitor** will be started after the output file gets to a certain size, set to 120000 bytes by trial and error.
- pausing and resuming the **monitor** for long will lead to song titles being out of sync, since the **recorder** will keep receiving data (and song titles) even when the playback if off.

### VLC recording on Windows

**VLC** recording in **not** supported on **Windows**.

The **VLC** implementation on **Window** is a bit clumsy as it is as a radio player, and duplicating all this clumsiness in order to support recording as well, is just too much.

Trying to enable recording while **VLC** is the active player will lead to displaying a message informing the user of the situation and ways to proceed.

Consequently, this restriction has been applied to the "*Switch Media Player*" window (opened with "**\\m**"); when recording a station and trying to change the player in use on **Windows**, selecting **VLC** is not supported.

## Recording implementation

The following keys are used for this feature:
Expand Down

0 comments on commit 72905f5

Please sign in to comment.