Skip to content

Commit

Permalink
Merge pull request #1769 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored Sep 14, 2024
2 parents 5517b16 + e4138c7 commit 99388f1
Show file tree
Hide file tree
Showing 46 changed files with 386 additions and 7,480 deletions.
24 changes: 13 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ alias=r1

. /srv/http/bash/settings/addons.sh

# 20240913
file=$dirsystem/volumeboot
if [[ -e $file ]]; then
echo "\
startup=$( cut -d= -f2 $file.conf )
max=100
" > $dirsystem/volumelimit.conf
rm -f $file*
touch $dirsystem/volumelimit
fi

# 20240906
revision=$( grep ^Revision /proc/cpuinfo )
BB=${revision: -3:2}
Expand Down Expand Up @@ -31,15 +42,6 @@ if [[ -e /boot/kernel.img ]]; then
fi
fi

# 20240719
rm -f $dirshm/system

file=$dirsystem/lcdcharconf.py
if [[ -e $file ]]; then
sed -i -E 's/False|"//g' $file
mv $file $dirsystem/lcdchar.conf
fi

#-------------------------------------------------------------------------------
installstart "$1"

Expand All @@ -54,5 +56,5 @@ $dirbash/cmd.sh cachebust

installfinish

# 20240818
systemctl restart mpd
# 20240913
$dirsettings/player-conf.sh
9 changes: 3 additions & 6 deletions srv/http/assets/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@font-face {
font-family : rern;
src : url( '/assets/fonts/rern.woff2?v=1725496279' );
src : url( '/assets/fonts/rern.woff2?v=1725496281' );
}
@font-face {
font-family : Lato;
Expand Down Expand Up @@ -221,7 +221,7 @@ i {
.i-usbdrive::before { content: '\F553' }
.i-volume::before { content: '\F516' }
.i-volume.mute::before { content: '\F517' }
.i-volumeboot::before { content: '\F51E' }
.i-volumelimit::before { content: '\F51E' }
.i-vuled::before { content: '\F57C' }
.i-warning::before { content: '\F562' }
.i-webradio::before { content: '\F55D' }
Expand Down Expand Up @@ -563,9 +563,6 @@ input[ type=checkbox ] {
color: var( --cg60 ) !important;
pointer-events: none;
}
.noclick {
pointer-events: none;
}
.infobtn.disabled {
background-color: var( --cgd ) !important;
box-shadow: none;
Expand Down Expand Up @@ -774,7 +771,7 @@ hr {
font-size: 20px;
margin-right: 5px;
}
#infoList i:not( .cmd ) {
#infoList i:not( .submenu ) {
width: 24px;
line-height: 24px;
font-size: 20px;
Expand Down
11 changes: 11 additions & 0 deletions srv/http/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,17 @@ i.map.disabled, .map.disabled i {
clear: both;
margin: 0;
}
.infomessage .thumbnail {
display: inline-block;
margin-bottom: 10px;
}
.infomessage .thumbnail:nth-child( 2 ) {
margin-left: 10px;
}
.infomessage .thumbnail img {
margin-bottom: -5px;
}

/* ---------------------- breadcrumb and index ---------------------- */
.content-top {
position: fixed;
Expand Down
5 changes: 5 additions & 0 deletions srv/http/assets/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ input.disabled + .switchlabel:after {
.gpio svg {
max-width: 100%;
}
.gpiopins {
margin-top: 0;
text-align: left;
line-height: 20px;
}
#infoList .gpio tr td:nth-child( odd ) {
width: 35px !important;
padding-right: 2px !important;
Expand Down
Binary file modified srv/http/assets/fonts/rern.woff2
Binary file not shown.
Binary file added srv/http/assets/img/powerbutton.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,544 changes: 0 additions & 3,544 deletions srv/http/assets/img/powerbutton.svg

This file was deleted.

Binary file modified srv/http/assets/img/relays.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added srv/http/assets/img/vuled.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,630 changes: 0 additions & 3,630 deletions srv/http/assets/img/vuled.svg

This file was deleted.

9 changes: 7 additions & 2 deletions srv/http/assets/js/camilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -1737,14 +1737,14 @@ var common = {
, tabTitle : () => V.tab[ 0 ].toUpperCase() + V.tab.slice( 1 )
, volumeAnimate : ( target, volume ) => {
var bandW = $( '#volume-band' ).width() - 40;
$( '#divvolume' ).addClass( 'noclick' );
$( '#divvolume' ).css( 'pointer-events', 'none' );
$( '#volume .thumb' ).animate(
{ 'margin-left': bandW / 100 * target }
, {
duration : Math.abs( target - volume ) * 40
, easing : 'linear'
, complete : () => {
$( '#divvolume' ).removeClass( 'noclick' );
$( '#divvolume' ).css( 'pointer-events', '' );
render.volume();
}
}
Expand Down Expand Up @@ -1937,6 +1937,7 @@ $( '#volume-band' ).on( 'touchstart mousedown', function( e ) {
if ( x < V.volume.min + 20 || x > V.volume.max + 20 ) return

S.volume = Math.round( ( x - 20 - V.volume.min ) / V.volume.width * 100 );
volumeMaxSet();
render.volume();
volumeSet();
} ).on( 'touchend mouseup', function( e ) {
Expand All @@ -1954,6 +1955,7 @@ $( '#volume-band' ).on( 'touchstart mousedown', function( e ) {
} else {
S.volume = Math.round( ( x - V.volume.min - 20 ) / V.volume.width * 100 );
}
volumeMaxSet();
$( '#divvolume .level' ).text( S.volume );
common.volumeAnimate( S.volume, current );
volumeSet();
Expand All @@ -1965,6 +1967,7 @@ $( '#volume-band' ).on( 'touchstart mousedown', function( e ) {
$( '#volume-0, #volume-100' ).on( 'click', function() {
var current = S.volume;
S.volume = this.id === 'volume-0' ? 0 : 100;
volumeMaxSet();
$( '#divvolume .level' ).text( S.volume );
common.volumeAnimate( S.volume, current );
volumeSet();
Expand All @@ -1974,6 +1977,7 @@ $( '#divvolume' ).on( 'click', '.i-minus, .i-plus', function() {
if ( ( ! up && S.volume === 0 ) || ( up && S.volume === 100 ) ) return

up ? S.volume++ : S.volume--;
volumeMaxSet();
render.volume();
volumeSet();
} ).on( 'touchend mouseup mouseleave', function() {
Expand All @@ -1985,6 +1989,7 @@ $( '#divvolume' ).on( 'click', '.i-minus, .i-plus', function() {
var up = $( e.target ).hasClass( 'i-plus' );
V.intervalvolume = setInterval( () => {
up ? S.volume++ : S.volume--;
volumeMaxSet();
volumeSet();
$( '#volume .thumb' ).css( 'margin-left', V.volume.x );
$( '#divvolume .level' ).text( S.volume );
Expand Down
14 changes: 9 additions & 5 deletions srv/http/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,6 @@ function info( json ) {
function infoButtonCommand( fn, cancel ) {
if ( typeof fn === 'function' ) fn();
if ( cancel ) delete I.oknoreset;
if ( I.prompt ) $( '#infoOverlay' ).addClass( 'hide' );
if ( V.local || V.press || I.oknoreset ) return // consecutive info / no reset

infoReset();
Expand Down Expand Up @@ -771,9 +770,9 @@ function infoFileImageRender( src, original, resize ) {
+'<img class="infoimgnew" src="'+ src +'">'
+'<div class="infoimgwh">'
+ ( resize ? resize : '' )
+ ( original ? '<br>original: '+ original : '' )
+ ( original ? 'original: '+ original : '' )
+ ( src.slice( 0, 4 ) === 'blob' ? '' : '<br>'+ ico( 'redo rotate' ) +'Tap to rotate' )
+'</div>'
+ ( src.slice( 0, 4 ) === 'blob' ? '' : '<br>'+ ico( 'redo rotate' ) +'&ensp;Tap to rotate' )
+'</span>'
);
}
Expand Down Expand Up @@ -867,7 +866,7 @@ function infoToggle( reset ) {
$( '#infoOverlay' ).trigger( 'focus' );
}
if ( ! page ) {
$( '.page, .list' ).css( { height: height, overflow: overflow } );
$( '.page, .list' ).css( { 'max-height': height, overflow: overflow } );
$( '.list' ).css( 'padding-bottom', padding );
}
$( window ).scrollTop( scrolltop );
Expand Down Expand Up @@ -1238,6 +1237,12 @@ window.onfocus = pageActive;
window.onpagehide = pageInactive;
window.onpageshow = pageActive;

function volumeMaxSet() {
if ( S.volumemax && S.volume > S.volumemax ) {
S.volume = S.volumemax;
banner( 'volumelimit', 'Volume Limit', 'Max: '+ S.volumemax );
}
}
function volumeMuteToggle() {
if ( S.volumemute ) {
S.volume = S.volumemute;
Expand All @@ -1258,7 +1263,6 @@ function volumeSet( type ) { // type: mute / unmute
V.volumeactive = true;
setTimeout( () => V.volumeactive = false, 300 );
if ( V.drag || V.press ) type = 'dragpress';
if ( S.volumelimit && S.volume > S.volumelimit ) S.volume = S.volumelimit;
bash( [ 'volume', V.volumecurrent, S.volume, S.control, S.card, type, 'CMD CURRENT TARGET CONTROL CARD TYPE' ] );
V.volumecurrent = S.volume;
}
Expand Down
46 changes: 31 additions & 15 deletions srv/http/assets/js/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,24 @@ function tagModeSwitch() {
}
function thumbnailUpdate() {
var $img = V.list.li.find( 'img' );
var icon = $img.length ? '<span class="button-coverart"><img src="'+ $img.attr( 'src' ) +'"></span>' : 'coverart';
var src = $img.attr( 'src' );
if ( $img.length ) {
var icon = '<span class="button-coverart"><img src="'+ src +'"></span>';
var message = '<div class="thumbnail"><img src="'+ src +'" style="opacity: 0.5">'
+'<br>thumb.jpg</div>';
} else {
var icon = 'coverart';
var message = '';
}
bash( [ 'coverfileget', V.list.path, 'CMD DIR' ], data => {
var message = data.src ? '<img src="'+ data.src + versionHash() +'">' : 'With coverarts in each folder:';
if ( data.src ) {
message += '<div class="thumbnail"><img src="'+ data.src + versionHash() +'">'
+'<br>'+ data.src.replace( /.*\//, '' ) +'</div>';
} else {
message += '<br>With coverarts in each subfolder:';
}
message += '<br>'+ ico( 'folder gr' ) +' <wh>'+ V.list.path +'</wh>';
infoThumbnail( icon, message, V.list.path, data.nosubdir );
infoThumbnail( icon, message, V.list.path, data.subdir );
}, 'json' );
}
function updateDirectory() {
Expand Down Expand Up @@ -572,25 +585,29 @@ var listwebradio = {
}
}
function webRadioEdit() {
var url = V.list.path;
var rprf = url.includes( 'stream.radioparadise.com' ) || url.includes( 'icecast.radiofrance.fr' );
info( {
icon : 'webradio'
, title : 'Edit Web Radio'
, message : '<img src="'+ ( V.list.li.find( 'img' ).attr( 'src' ) || V.coverdefault ) +'">'
, list : rprf ? listwebradio.list.slice( 0, 2 ) : listwebradio.list
, values : [ V.list.name, url, V.list.li.data( 'charset' ) || 'UTF-8' ]
, list : listwebradio.list
, values : [ V.list.name, V.list.path, V.list.li.data( 'charset' ) || 'UTF-8' ]
, checkchanged : true
, checkblank : [ 0, 1 ]
, boxwidth : 'max'
, beforeshow : rprf ? '' : listwebradio.button
, beforeshow : () => {
if ( /stream.radioparadise.com|icecast.radiofrance.fr/.test( V.list.path ) ) {
$( '#infoList tr' ).eq( 2 ).addClass( 'hide' );
} else {
listwebradio.button();
}
}
, oklabel : ico( 'save' ) +'Save'
, ok : () => {
var values = infoVal();
var name = values[ 0 ];
var newurl = values[ 1 ];
var charset = values[ 2 ].replace( /UTF-8|iso *-*/, '' );
bash( [ 'webradioedit', V.list.dir, name, newurl, charset, url, 'CMD DIR NAME NEWURL CHARSET URL' ], error => {
var charset = values[ 2 ].replace( /UTF-*8|iso *-* */, '' );
bash( [ 'webradioedit', V.list.dir, name, newurl, charset, V.list.path, 'CMD DIR NAME NEWURL CHARSET URL' ], error => {
if ( error ) webRadioExists( error, '', newurl );
} );
}
Expand Down Expand Up @@ -622,12 +639,11 @@ function webRadioNew( name, url, charset ) {
var values = infoVal();
var name = values[ 0 ];
var url = values[ 1 ];
var charset = values[ 2 ].replace( /UTF-8|iso *-*/, '' );
var dir = $( '#lib-path .lipath' ).text();
if ( [ 'm3u', 'pls' ].includes( url.slice( -3 ) ) ) banner( 'webradio blink', 'Web Radio', 'Add ...', -1 );
bash( [ 'webradioadd', dir, name, url, charset, 'CMD DIR NAME URL CHARSET' ], error => {
if ( error ) webRadioExists( error, name, url, charset );
var charset = values[ 2 ].replace( /UTF-*8|iso *-* */, '' );
if ( [ 'm3u', 'pls' ].includes( url.slice( -3 ) ) ) banner( 'webradio blink', 'Web Radio', 'Get URL ...', -1 );
bash( [ 'webradioadd', $( '#lib-path .lipath' ).text(), name, url, charset, 'CMD DIR NAME URL CHARSET' ], error => {
bannerHide();
if ( error ) webRadioExists( error, name, url, charset );
} );
}
} );
Expand Down
31 changes: 31 additions & 0 deletions srv/http/assets/js/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,37 @@ $( '#setting-stoptimer' ).on( 'click', function() {
, fileconf : true
} );
} );
$( '#setting-volumelimit' ).on( 'click', function() {
info( {
icon : SW.icon
, title : SW.title
, list : [
[ 'Startup default', 'number', { updn: { step: 1, min: 0, max: S.volumelimitconf.MAX } } ]
, [ 'Maximum limit', 'number', { updn: { step: 1, min: 0, max: 100 } } ]
]
, boxwidth : 70
, values : S.volumelimitconf
, checkchanged : S.volumelimit
, beforeshow : () => {
var $input = $( '#infoList input' );
var $startup = $input.eq( 0 );
var $max = $input.eq( 1 );
var $up = $( '#infoList .up' ).eq( 0 );
$( '#infoList .up' ).eq( 1 ).on( 'click', function() {
var max = +$max.val();
if ( +$startup.val() > max ) {
$startup.val( max );
$up.addClass( 'disabled' );
} else {
$up.removeClass( 'disabled' );
}
} );
}
, cancel : switchCancel
, ok : switchEnable
, fileconf : true
} );
} );

} );

Expand Down
Loading

0 comments on commit 99388f1

Please sign in to comment.