Skip to content

Commit 72905f5

Browse files
committed
- version 0.9.2.12
- updating docs
1 parent dd273ac commit 72905f5

11 files changed

+62
-24
lines changed

Changelog

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2023-07-01 s-n-g
2+
* version 0.9.2.12
3+
* Implementing VLC recorder (not for Windows)
4+
* MPlayer recorder will display volume level
5+
* MPlayer on Windows 7 will not use profiles
6+
* Trying different recorded file limit to start monitor
7+
* updating docs
8+
19
2023-06-20 s-n-g
210
* version 0.9.2.11
311
* implementing station recording for MPlayer media player

README.html

+9
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
207207
<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>
208208
<pre style="height: 200px;">
209209

210+
2023-07-01 s-n-g
211+
* version 0.9.2.12
212+
* Implementing VLC recorder (not for Windows)
213+
* MPlayer recorder will display volume level
214+
* MPlayer on Windows 7 will not use profiles
215+
* Trying different recorded file limit to start monitor
216+
* updating docs
217+
210218
2023-06-20 s-n-g
211219
* version 0.9.2.11
212220
* implementing station recording for MPlayer media player
@@ -1461,6 +1469,7 @@ <h2 id="player-detection-selection">Player detection / selection <span style="pa
14611469
<h3 id="changing-player-mid-session">Changing player mid-session</h3>
14621470
<p>If the user faces a playback problem with a given station, chances are that a different player will successfully play it.</p>
14631471
<p>Pressing “<strong>\m</strong>” will bring up the “<em>Switch Media Player</em>” window, where a different player can be activated.</p>
1472+
<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>
14641473
<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>
14651474
<h3 id="extra-player-parameters">Extra Player Parameters</h3>
14661475
<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>

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,8 @@ If the user faces a playback problem with a given station, chances are that a di
671671

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

674+
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.
675+
674676
**Note:** The activated player will not be saved; **PyRadio** will still use the player defined at its config next time it is executed.
675677

676678
### Extra Player Parameters

devel/build_install_pyradio.bat

+7-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ IF %ERRORLEVEL% == 1 (
2727
SET ERRPKG=pip
2828
GOTO piperror
2929
)
30-
ECHO Installing / Updating windows-curses
31-
%PROGRAM% -m pip install --upgrade windows-curses 1>NUL 2>NUL
32-
IF %ERRORLEVEL% == 1 (
33-
SET ERRPKG=windows-curses
34-
GOTO piperror
35-
)
30+
REM ECHO Installing / Updating windows-curses
31+
REM %PROGRAM% -m pip install --upgrade windows-curses 1>NUL 2>NUL
32+
REM IF %ERRORLEVEL% == 1 (
33+
REM SET ERRPKG=windows-curses
34+
REM GOTO piperror
35+
REM )
3636
ECHO Installing / Updating rich
3737
%PROGRAM% -m pip install --upgrade rich 1>NUL 2>NUL
3838
IF %ERRORLEVEL% == 1 (
@@ -47,6 +47,7 @@ IF %ERRORLEVEL% == 1 (
4747
)
4848

4949
echo pywin32 > requirements.txt
50+
echo windows-curses >> requirements.txt
5051
echo requests >> requirements.txt
5152
echo rich >> requirements.txt
5253
echo dnspython >> requirements.txt

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pyradio"
3-
version = "0.9.2.11"
3+
version = "0.9.2.12"
44
authors = [
55
{ name="Ben Dowling", email="[email protected]" },
66
{ name="Spiros Georgaras", email="[email protected]" },

pyradio/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" pyradio -- Console radio player. "
22

3-
version_info = (0, 9, 2, 11)
3+
version_info = (0, 9, 2, 12)
44

55
# Set it to True if new stations have been
66
# added to the package's stations.csv

pyradio/install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
''' This is PyRadio version this
1616
install.py was released for
1717
'''
18-
PyRadioInstallPyReleaseVersion = '0.9.2.11'
18+
PyRadioInstallPyReleaseVersion = '0.9.2.12'
1919

2020
import locale
2121
locale.setlocale(locale.LC_ALL, "")

pyradio/player.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def create_monitor_player(self, stop, limit, notify_function):
412412
if stop():
413413
logger.error('Asked to stop. Exiting....')
414414
return
415-
logger.error('while 2')
415+
# logger.error('while 2')
416416
while os.path.getsize(self.recording_filename) < limit:
417417
sleep(.1)
418418
if stop():
@@ -422,17 +422,17 @@ def create_monitor_player(self, stop, limit, notify_function):
422422
if stop():
423423
logger.error('\n\nAsked to stop. Exiting....\n\n')
424424
return
425-
logger.error('----------------------starting!')
425+
# logger.error('----------------------starting!')
426426
self.monitor_process = subprocess.Popen(
427427
self.monitor_opts, shell=False,
428428
stdout=subprocess.PIPE,
429429
stdin=subprocess.PIPE,
430430
stderr=subprocess.STDOUT
431431
)
432-
logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
433-
logger.error('------------------ to notify function')
432+
# logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
433+
# logger.error('------------------ to notify function')
434434
notify_function()
435-
logger.error('------------------ after notify function')
435+
# logger.error('------------------ after notify function')
436436
if logger.isEnabledFor(logging.INFO):
437437
logger.info('Executing command: {}'.format(' '.join(self.monitor_opts)))
438438
logger.info('----==== {} monitor started ====----'.format(self.PLAYER_NAME))
@@ -1631,7 +1631,7 @@ def play(self,
16311631
):
16321632
''' use a multimedia player to play a stream '''
16331633
self.monitor = self.monitor_process = self.monitor_opts = None
1634-
logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
1634+
# logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
16351635
self.recording_filename = ''
16361636
self.volume = -1
16371637
self.close()
@@ -1741,7 +1741,7 @@ def play(self,
17411741
logger.info('----==== {} player started ====----'.format(self.PLAYER_NAME))
17421742
if self.recording == self.RECORD_AND_LISTEN \
17431743
and self.PLAYER_NAME != 'mpv':
1744-
logger.error('=======================\n\n')
1744+
# logger.error('=======================\n\n')
17451745
limit = 120000
17461746
if self.PLAYER_NAME == 'mplayer':
17471747
if not platform.startswith('win'):
@@ -1756,22 +1756,22 @@ def play(self,
17561756
target=self.create_monitor_player,
17571757
args=(lambda: self.stop_mpv_status_update_thread, limit, self._start_monitor_update_thread)
17581758
).start()
1759-
logger.error('=======================\n\n')
1759+
# logger.error('=======================\n\n')
17601760

17611761
def _sendCommand(self, command):
17621762
''' send keystroke command to player '''
17631763
if [x for x in ('q', 'shutdown') if command.startswith(x)]:
17641764
self._command_to_player(self.process, command)
1765-
logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
1765+
# logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
17661766
if self.monitor_process is not None:
17671767
self._command_to_player(self.monitor_process, command)
17681768
return
1769-
logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
1769+
# logger.error('self.monitor_process.pid = {}'.format(self.monitor_process))
17701770
if self.monitor_process is not None and \
17711771
[x for x in
17721772
('/', '*', 'p', 'm', 'vol', 'pause' ) if command.startswith(x)
17731773
]:
1774-
logger.error('\n\nsending command: "{}"\n\n'.format(command))
1774+
# logger.error('\n\nsending command: "{}"\n\n'.format(command))
17751775
self._command_to_player(self.monitor_process, command)
17761776
else:
17771777
self._command_to_player(self.process, command)

pyradio/radio.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def keypress(self, char):
240240
ord('s'), ord(' '),
241241
ord('l'), curses.KEY_RIGHT
242242
):
243-
if not self._no_vlc:
243+
if not (self._no_vlc and \
244+
self._available_players[self._selected] == 'vlc'):
244245
return self._available_players[self._selected]
245246
elif char in (ord('h'), curses.KEY_LEFT,
246247
ord('q'), curses.KEY_EXIT, 27):

recording.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
5656
<li><a href="#mpv">MPV</a></li>
5757
<li><a href="#mplayer">MPlayer</a></li>
5858
<li><a href="#vlc">VLC</a></li>
59+
<li><a href="#vlc-recording-on-windows">VLC recording on Windows</a></li>
5960
</ul></li>
6061
<li><a href="#recording-implementation">Recording implementation</a>
6162
<ul>
@@ -65,6 +66,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
6566
</ul></li>
6667
</ul>
6768
<!-- vim-markdown-toc -->
69+
<p><a href="README.html">[Return to main doc]</a></p>
6870
<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>
6971
<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>
7072
<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>
@@ -99,7 +101,6 @@ <h3 id="mplayer">MPlayer</h3>
99101
<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>
100102
</ul>
101103
<h3 id="vlc">VLC</h3>
102-
<p><strong>Note</strong>: <strong>VLC</strong> recording has not been implemented yet!</p>
103104
<p><strong>VLC</strong> stream recording has the following characteristics:</p>
104105
<ul>
105106
<li>it does not have the ability to record and play a stream at the same time.<br />
@@ -108,6 +109,11 @@ <h3 id="vlc">VLC</h3>
108109
<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>
109110
<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>
110111
</ul>
112+
<h3 id="vlc-recording-on-windows">VLC recording on Windows</h3>
113+
<p><strong>VLC</strong> recording in <strong>not</strong> supported on <strong>Windows</strong>.</p>
114+
<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>
115+
<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>
116+
<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>
111117
<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>
112118
<p>The following keys are used for this feature:</p>
113119
<table>

recording.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ ___
2626
* [MPV](#mpv)
2727
* [MPlayer](#mplayer)
2828
* [VLC](#vlc)
29+
* [VLC recording on Windows](#vlc-recording-on-windows)
2930
* [Recording implementation](#recording-implementation)
3031
* [File location](#file-location)
3132
* [File type](#file-type)
3233
* [Pausing playback](#pausing-playback)
3334

3435
<!-- vim-markdown-toc -->
3536

37+
[[Return to main doc]](README.md)
38+
3639
## Intro
3740

3841
**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*.
@@ -76,8 +79,6 @@ This means that the front end (**PyRadio**) will have to use two *mplayer* insta
7679

7780
### VLC
7881

79-
**Note**: **VLC** recording has not been implemented yet!
80-
8182
**VLC** stream recording has the following characteristics:
8283

8384
- it does not have the ability to record and play a stream at the same time. \
@@ -86,6 +87,16 @@ This means that the front end (**PyRadio**) will have to use two *vlc* instances
8687
- the **monitor** will be started after the output file gets to a certain size, set to 120000 bytes by trial and error.
8788
- 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.
8889

90+
### VLC recording on Windows
91+
92+
**VLC** recording in **not** supported on **Windows**.
93+
94+
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.
95+
96+
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.
97+
98+
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.
99+
89100
## Recording implementation
90101

91102
The following keys are used for this feature:

0 commit comments

Comments
 (0)