mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-22 05:39:48 +00:00
osd title changed
This commit is contained in:
parent
abf0b7f4c0
commit
610fc8f1f3
@ -60,19 +60,19 @@ if track_activity_history:
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
||||||
@player.property_observer('filtered-metadata')
|
def osd_observer(value):
|
||||||
@logger.catch
|
|
||||||
def osd_observer(_name, value):
|
|
||||||
'''Sumulate osd playing message in console'''
|
'''Sumulate osd playing message in console'''
|
||||||
if value:
|
if value:
|
||||||
osd_message = []
|
osd_message = []
|
||||||
for i in value.items():
|
for i in value.items():
|
||||||
if i[0] in ('Artist', 'Album', 'Title'):
|
if i[0] in ('Artist', 'Album', 'Title'):
|
||||||
osd_message.append(i[1])
|
osd_message.append(i[1])
|
||||||
print_there(0, 0, '\r ')
|
osd_string = ' - '.join(osd_message)
|
||||||
osd_string = ' — '.join(osd_message)
|
|
||||||
term_len = get_terminal_size().columns
|
term_len = get_terminal_size().columns
|
||||||
|
print_there(0, 0, '\r'+' '*term_len)
|
||||||
print_there(0, 0, '\r'+osd_string[:term_len])
|
print_there(0, 0, '\r'+osd_string[:term_len])
|
||||||
|
else:
|
||||||
|
print_there(0, 0, '\rNo metadata...')
|
||||||
|
|
||||||
|
|
||||||
@player.event_callback('start-file')
|
@player.event_callback('start-file')
|
||||||
@ -109,6 +109,7 @@ def universal_observer(_name, value):
|
|||||||
player_pos = f'{player.playlist_pos_1}/{player.playlist_count}'
|
player_pos = f'{player.playlist_pos_1}/{player.playlist_count}'
|
||||||
else:
|
else:
|
||||||
player_pos = '-/-'
|
player_pos = '-/-'
|
||||||
|
osd_observer(player.filtered_metadata)
|
||||||
print_there(2, 2, f'\r'+' '*get_terminal_size().columns)
|
print_there(2, 2, f'\r'+' '*get_terminal_size().columns)
|
||||||
print_there(2, 2, f'\r{player_pos} | {kbps} kbps | {percent}% | {track_size}MB {cache_speed}')
|
print_there(2, 2, f'\r{player_pos} | {kbps} kbps | {percent}% | {track_size}MB {cache_speed}')
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user