Moode Forum
[IDEA] Coverview improvements - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8)
+--- Thread: [IDEA] Coverview improvements (/showthread.php?tid=7452)

Pages: 1 2 3 4 5 6


RE: Coverview improvements - Tim Curtis - 03-02-2025

I can make that change.


RE: Coverview improvements - romain - 03-02-2025

(03-02-2025, 07:30 PM)Tim Curtis Wrote: I can make that change.

Well, if this info looks pertinent, yes

Also I thought that if you could display bit depth, sample rate and channels, on "Audio information -> Playback" page, you could also have these displayed on cover view instead of "Unknown"

[attachment=4436]


RE: Coverview improvements - romain - 03-03-2025

Hello,

just for testing I've replaced the 

PHP Code:
$encodedAt = 'Unknown'

 at line 703 in music-library.php by the following block of code 

PHP Code:
$sock getMpdSock();
$mpdStatus getMpdStatus($sock);
$rate = empty($mpdStatus['audio_sample_rate']) ? '?' $mpdStatus['audio_sample_rate'];
$encodedAt 'UPnP stream ' $mpdStatus['audio_sample_depth'] . '/' $rate ' kHz, ' $mpdStatus['audio_channels']; 

the result below:

[attachment=4437]


RE: Coverview improvements - Tim Curtis - 03-03-2025

(03-03-2025, 12:27 PM)romain Wrote: Hello,

just for testing I've replaced the 

PHP Code:
$encodedAt = 'Unknown'

 at line 703 in music-library.php by the following block of code 

PHP Code:
$sock getMpdSock();
$mpdStatus getMpdStatus($sock);
$rate = empty($mpdStatus['audio_sample_rate']) ? '?' $mpdStatus['audio_sample_rate'];
$encodedAt 'UPnP stream ' $mpdStatus['audio_sample_depth'] . '/' $rate ' kHz, ' $mpdStatus['audio_channels']; 

the result below:

Thats the decodedTo format not the encodedAt format
https://mpd.readthedocs.io/en/latest/protocol.html#querying-mpd-s-status

To see if the encodedAt format is available for an http file reference try mediainfo <URL>


RE: Coverview improvements - romain - 03-03-2025

(03-03-2025, 12:46 PM)Tim Curtis Wrote:
(03-03-2025, 12:27 PM)romain Wrote: Hello,

just for testing I've replaced the 

PHP Code:
$encodedAt = 'Unknown'

 at line 703 in music-library.php by the following block of code 

PHP Code:
$sock getMpdSock();
$mpdStatus getMpdStatus($sock);
$rate = empty($mpdStatus['audio_sample_rate']) ? '?' $mpdStatus['audio_sample_rate'];
$encodedAt 'UPnP stream ' $mpdStatus['audio_sample_depth'] . '/' $rate ' kHz, ' $mpdStatus['audio_channels']; 

the result below:

Thats the decodedTo format not the encodedAt format
https://mpd.readthedocs.io/en/latest/protocol.html#querying-mpd-s-status

To see if the encodedAt format is available for an http file reference try mediainfo <URL>

OK, so used this block of code instead


PHP Code:
$result sysCmd('mediainfo --Inform="Audio;file:///var/www/util/mediainfo.tpl" ' '"' $songData['file'] . '"');
$bitDepth $result[0];
$sampleRate $result[1];
$channels $result[2];
$format $result[3];
$encodedAt $bitDepth == '?' ?
'UPnP ' $format ' stream ' formatRate($sampleRate) . 'kHz' :
'UPnP ' $format ' stream ' $bitDepth '/' formatRate($sampleRate) . ' kHz, ' $channels 'ch'

 and the resut now Smile (only tested with Tidal and still missing the HD badge)

[attachment=4439]


RE: Coverview improvements - Tim Curtis - 03-03-2025

That could work.


RE: Coverview improvements - romain - 03-03-2025

(03-03-2025, 05:49 PM)Tim Curtis Wrote: That could work.

On the other hand I have no idea how the HD badge is displayed


RE: Coverview improvements - romain - 03-03-2025

This could look like this until someone finds how to add the HD badge before the song title when necessary.

PHP Code:
$result sysCmd('mediainfo --Inform="Audio;file:///var/www/util/mediainfo.tpl" ' '"' $songData['file'] . '"');
 
$bitDepth $result[0];
$sampleRate $result[1];
$channels $result[2];
$format $result[3];
$encodedAt 'UPnP ' $format ' ' . ($bitDepth == '?' ?
formatRate($sampleRate) . 'kHz' :
$bitDepth '/' formatRate($sampleRate) . ' kHz, ' $channels 'ch'); 

[attachment=4441]


RE: Coverview improvements - Tim Curtis - 03-03-2025

(03-03-2025, 05:59 PM)romain Wrote:
(03-03-2025, 05:49 PM)Tim Curtis Wrote: That could work.

On the other hand I have no idea how the HD badge is displayed

Have a look at the } else { block around line 685


RE: Coverview improvements - romain - 03-03-2025

(03-03-2025, 10:14 PM)Tim Curtis Wrote:
(03-03-2025, 05:59 PM)romain Wrote:
(03-03-2025, 05:49 PM)Tim Curtis Wrote: That could work.

On the other hand I have no idea how the HD badge is displayed

Have a look at the } else { block around line 685

I can determine if the stream is HD by comparing bit depth and sample rate and tried this 


PHP Code:
$result sysCmd('mediainfo --Inform="Audio;file:///var/www/util/mediainfo.tpl" ' '"' $songData['file'] . '"');
$bitDepth $result[0];
$sampleRate $result[1];
$channels $result[2];
$format $result[3];
$hiDef = ($bitDepth ALBUM_BIT_DEPTH_THRESHOLD ||
$sampleRate ALBUM_SAMPLE_RATE_THRESHOLD) ? 'h' 's';
$encodedAt 'UPnP ' $format ' ' $bitDepth '/' formatRate($sampleRate) . ' kHz'',' $hiDef ',' $channels 'ch';

/* $encodedAt = 'UPnP ' . $format . ' ' . ($bitDepth == '?' ?
formatRate($sampleRate) . 'kHz' :
$bitDepth . '/' . formatRate($sampleRate) . ' kHz, ' . $channels . 'ch'); */ 

of course I miss something to get the HD badge displayed because as a result I get this

[attachment=4442]