Torna indietro   Hardware Upgrade Forum > Componenti Hardware > Schede audio, altoparlanti, software e codec audio

HUAWEI Pura 70 Ultra: il cameraphone è di nuovo tra noi con un ma! Recensione 
HUAWEI Pura 70 Ultra: il cameraphone è di nuovo tra noi con un ma! Recensione 
HUAWEI continua a marciare sul mondo mobile cercando di fare un po’ tutto in casa propria dopo il ban USA e la perdita dei servizi di Google e altro. Il risultato più importante è senza dubbio questo HUAWEI Pura 70 Ultra, un camera phone dalle prestazioni incredibili che rimette in gioco l’azienda grazie anche ai servizi di Google più facilmente installabili.   
Edge 50 Ultra: Motorola convince anche con il suo top di gamma! La recensione
Edge 50 Ultra: Motorola convince anche con il suo top di gamma! La recensione
Motorola sfida i top di gamma con funzionalità AI avanzate, design innovativo e prestazioni da vero flagship. Riuscirà a trovare spazio anche nel segmento premium di mercato? Tutti i dettagli, test e prezzo di questo nuovo smartphone.
FlexiSpot E7B-PRO: una scrivania motorizzata per migliorare la postura
FlexiSpot E7B-PRO: una scrivania motorizzata per migliorare la postura
Abbiamo ricevuto e provato la scrivania FlexiSpot E7B-PRO. Dotata di gambe motorizzate, è una scrivania di nuova generazione regolabile in altezza, perfetta sia per le attività professionali che per l'intrattenimento.
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 28-02-2024, 06:54   #6221
jacobi91
Member
 
L'Avatar di jacobi91
 
Iscritto dal: Oct 2023
Messaggi: 90
"Spin Disc 2 (Art Cover + Spin Disc)" with vinyl_circle.png and Blur effect

Quote:
Originariamente inviato da ApacheReal Guarda i messaggi
Puoi postare lo script del Blur Effect relativo al modulo Spin Disc, Grazie.


Codice:
// ==PREPROCESSOR==
// @name "Spin Disc 2 (Art Cover + Spin Disc)" with vinyl_circle.png and Blur effect
// @author "marc2003"
// Liste des radios ==> Internet Radio
// @optimization "Apache"
// @import "%fb2k_component_path%helpers.txt"
// ==/PREPROCESSOR==

var blur_img = null;
var radius = 120

var colours = {
	accent : RGB(48, 141, 255),
	accent2 : RGB(255, 64, 129),
	accent3 : RGB(255, 234, 0),
	accent4 : RGB(0, 183, 204),
	buttons : RGB(255, 255, 255),
	background : RGB(30, 30, 30),
	title : RGB(255, 255, 255),
	artist : RGB(240, 240, 240),
	date : RGB(200, 200, 200),
	time : RGB(240, 240, 240),
	
	sac : RGB(100, 0, 0),
	red : RGB(55, 255, 255),
	redred : RGB(255, 0, 0),
};

var tfo = {
	artist : fb.TitleFormat('%artist%'),
	lfm_loved : fb.TitleFormat('$if2(%lfm_loved%,0)'),
	title : fb.TitleFormat('%title%'),
	date : fb.TitleFormat(('%date%')),
	playback_time : fb.TitleFormat('[%playback_time%]'),
	length : fb.TitleFormat('$if2(%length%,LIVE)'),
};


var Backgr = utils.LoadImage(fb.ComponentPath + 'samples\\images\\vinyl5.jpg');
var Vinyl_Circle = utils.LoadImage(fb.ComponentPath + 'samples\\images\\vinyl_circle.png');
//if ( plman.ActivePlaylist != "Internet Radio");
//if (plman.ActivePlaylist != list_number);
//if (plman.GetPlaylistSelectedItems != list_number);
if (plman.GetPlaylistSelectedItems(plman.ActivePlaylist)){ 
//var list_number = plman.GetPlaylistSelectedItems;// A vérifier
//       var Vinyl_Arm = utils.LoadImage(fb.ComponentPath + 'samples\\images\\images_v1\\tonearm\\0000' + i + '.png');
}
var i = 0;
var angle = 0;
var angle_circle = 0;
var angle_arm = 0;
var Vinyl_Speed = 2.5;
var normal_font = CreateFontString('Segoe UI', 12);
var small_font = CreateFontString('fontawesome', 6 , true);
var verysmall_font = CreateFontString('fontawesome', 6 , true);

var three_speed_color_R = 255;
var three_speed_color_G = 255;
var three_speed_color_B = 255;
var four_speed_color_R = 255;
var four_speed_color_G = 255;
var four_speed_color_B = 255;
var reverse_speed_color_R = 255;
var reverse_speed_color_G = 255;
var reverse_speed_color_B = 255;

//dimensions
var ratio = 1902/1400;
// var list_number = plman.FindPlaylist("Internet Radio");
var list_number = plman.GetPlaylistSelectedItems;


if( fb.IsPlaying ) {
   fb.GetNowPlaying();
   
   if ( plman.GetPlaylistSelectedItems != list_number){ 
        console.log('obama');
        // TOTAL LENGTH SONG SECONDES
        var Song_Split = tfo.length.Eval().split(':');
        var Song_length_split = tfo.length.Eval().split(':');
        var Song_length_sec = ((((Song_length_split[0] * 1) * 60) + (Song_length_split[1] * 1)) * 10);
   
        // TOTAL PLAYED SONG SECONDES
        var Song_Playtime_Split = tfo.playback_time.Eval().split(':');
        var Song_Playtime_sec = ((((Song_Playtime_Split[0] * 1) * 60) + (Song_Playtime_Split[1] * 1)) * 10);
        Calc_i();
   
window.SetInterval(function () {
       
        if (!fb.IsPlaying || fb.IsPaused) return;
	angle += Vinyl_Speed;
        angle_circle -= 0.6;
        angle_arm += 0.2;
        if( i < 120 && i >=25 ){
            i += 1;
        }    
        window.Repaint();
}, (1 * Song_length_sec) - 30);
}

window.SetInterval(function () {
       
        if (!fb.IsPlaying || fb.IsPaused) return;
	angle += Vinyl_Speed;
        angle_circle -= 0.6;
        angle_arm += 0.2;
        if( i < 25 ){
            i += 1;
        }    
        window.Repaint();
}, 100);
}

var g_img = null;
var g_metadb = null;
var g_tooltip = window.CreateTooltip('Segoe UI', 16);
g_tooltip.SetMaxWidth(600);
g_tooltip.Text = '';
var g_info = '';
var ww = 0, wh = 0;
var temp_gr;
var circular_mask = utils.CreateImage(500, 500); // 500, 500
temp_gr = circular_mask.GetGraphics();
temp_gr.FillEllipse(250, 250, 250, 250, RGB(0, 0, 0));  // 250, 250, 250, 250
circular_mask.ReleaseGraphics();
temp_gr = null;
update_album_art();

function update_album_art() {
	angle = 0;
        angle_circle = 0;
        angle_arm = 0;
        
	if (g_img) g_img.Dispose();
	g_img = null;
	g_info = '';
	g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
	if (g_metadb) {
		var tmp = g_metadb.GetAlbumArt(0) // type 0 = front art.Pour Album Art
		if (!tmp) tmp = g_metadb.GetAlbumArt(4); // use type 4 = artist art
		if (!tmp) tmp = g_metadb.GetAlbumArt(3); // use type 3 = icon art
		if (!tmp) tmp = g_metadb.GetAlbumArt(1); // use type 1 = back art
    	if (!tmp) tmp = g_metadb.GetAlbumArt(2); // use type 2 = disc art
		var tmp2 = g_metadb.GetAlbumArt(2) // type 2 = disc art. Creation tmp2 pour disc art.
		if (!tmp2) tmp2 = g_metadb.GetAlbumArt(3); // use type 3 = icon art
		if (!tmp2) tmp2 = g_metadb.GetAlbumArt(4); // use type 4 = artist art
		if (!tmp2) tmp2 = g_metadb.GetAlbumArt(0); // use type 0 = front art
		if (!tmp2) tmp2 = g_metadb.GetAlbumArt(1); // use type 1 = back art
		if (tmp) {
			var path = tmp.Path;
			var size = Math.min(tmp.Width, tmp.Height);
			g_img = make_square(tmp, size)  // g_img : ==> pochette CD
			//g_img = utils.CreateImage(size, size);
			//temp_gr = g_img.GetGraphics();
			//temp_gr.DrawImageWithMask(make_square(tmp, size), circular_mask, 0, 0, g_img.Width, g_img.Height);
			//g_img.ReleaseGraphics();
			//temp_gr = null;
			//tmp.Dispose();
			//g_info = 'Original dimensions: ' + g_img.Width + 'x' + g_img.Height;
			//if (path.length) g_info += '\nPath: ' + path;
		}
		if (tmp2) {                 // pour disc art
			var path2 = tmp2.Path;
			var size2 = Math.min(tmp2.Width, tmp2.Height);
			
			g2_img = utils.CreateImage(size, size); // pour disc art
			temp2_gr = g2_img.GetGraphics();
			temp2_gr.DrawImageWithMask(make_square(tmp2, size), circular_mask, 0, 0, g2_img.Width, g2_img.Height);
			g2_img.ReleaseGraphics();
			temp2_gr = null;
			tmp2.Dispose();
			g2_info = 'Original dimensions: ' + g2_img.Width + 'x' + g2_img.Height;
			if (path.length) g2_info += '\nPath: ' + path;
		}
	}
	window.Repaint();
}

function make_square(img, size ) {
	if (!img) return null;
	if (img.Width < img.Height) {
		var src_x = 0;
		var src_w = img.Width;
		var src_h = img.Width;
		var src_y = Math.round((img.Height - src_h) / 1);
	} else {
		var src_y = 0;
		var src_w = img.Height;
		var src_h = img.Height;
		var src_x = Math.round((img.Width - src_w) / 1);
	}
	var square = utils.CreateImage(size, size);
	var temp_gr = square.GetGraphics();
	temp_gr.DrawImage(img, 0, 0, size, size, src_x, src_y, src_w, src_h);

	square.ReleaseGraphics();
	return square;
}

function Calc_i() {

        if(Song_Playtime_sec > 30){ 
        var Playtime_Ratio = (Song_Playtime_sec * 100) / Song_length_sec;
        i = 25 +  ((Playtime_Ratio * 100) / 95);
        i = Math.round(i);
        if(i > 120){ i = 120;}; 
        }
        else {
        i = 0;
        }
}

function on_colours_changed() {
	window.Repaint();
}

function on_item_focus_change() {
       	if (!fb.IsPlaying) update_album_art();
        window.Repaint();
}

function on_mouse_lbtn_up(x, y) {
	
							//16.5				   // 24.5

        if( x > (wh / 100) * 7.5 && x < (wh / 100) * 15.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
                if( Vinyl_Speed > 0 ) {
                    Vinyl_Speed = 2.5 ;
                }
                else { 
                    Vinyl_Speed = -2.5;
                }
        }                 // 25                    // 32.5
        if( x > (wh / 100) * 16 && x < (wh / 100) * 23.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
                if( Vinyl_Speed < 4 && Vinyl_Speed > -4){
                Vinyl_Speed = Vinyl_Speed * 2;
                }
        }                 // 16.5                  // 24.5
        if( x > (wh / 100) * 24.5 && x < (wh / 100) * 32.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
              
                Vinyl_Speed = - Vinyl_Speed;
        }   
}

function on_mouse_rbtn_up(x, y) {
           
}

function on_mouse_lbtn_dblclk() {
	if (g_metadb) g_metadb.ShowAlbumArtViewer(0);
}

function on_mouse_move(x, y, gr) {
	if (g_info.length && g_tooltip.Text != g_info) {
	//	g_tooltip.Text = g_info;
	//	g_tooltip.Activate();
	}                                    // 16.5                    // 24.5                                                                 //    16.5                //   32.5
        window.SetCursor( (x > (wh / 100) * 16.5 && x < (wh / 100) * 24.5 && y > (wh / 100) * 87.5 && y < (wh / 100) * 91.5) || (x > (wh / 100) * 16.5 && x < (wh / 100) * 32.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5)  ? IDC_HAND : IDC_ARROW);

        //window.SetCursor( x > (wh / 100) * 16.5 && x < (wh / 100) * 32.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5  ? IDC_HAND : IDC_ARROW);
        // 33 tours speed     16.5                     23.5
        if ( x > (wh / 100) * 9.5 && x < (wh / 100) * 14.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
           three_speed_color_R = 224;
           three_speed_color_G = 189;
           three_speed_color_B = 121;
        } 
        else { 
           three_speed_color_R = 255;
           three_speed_color_G = 255;
           three_speed_color_B = 255;
        }
        // 45 tours speed     25                     32.5
        if ( x > (wh / 100) * 16 && x < (wh / 100) * 23.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
           four_speed_color_R = 224;
           four_speed_color_G = 189;
           four_speed_color_B = 121;
        } 
        else { 
           four_speed_color_R = 255;
           four_speed_color_G = 255;
           four_speed_color_B = 255;
        }                  // 16.5                 //  32.5
        if ( x > (wh / 100) * 17 && x < (wh / 100) * 32.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
           reverse_speed_color_R = 224;
           reverse_speed_color_G = 189;
           reverse_speed_color_B = 121;
        } 
        else { 
           reverse_speed_color_R = 255;
           reverse_speed_color_G = 255;
           reverse_speed_color_B = 255;
        }
}

function on_paint(gr) {
	var bg = window.IsDefaultUI ? window.GetColourDUI(1) : window.GetColourCUI(3);
	gr.FillRectangle(0, 0, ww, wh, RGB(30, 30, 30));
      
	var whh = window.Height;
	var ww = window.Width
	var wh = window.Height;
			var image_ratio = 1902 / 1458;  (www * 100) / 917 , (whh * 48) / 698
    //		var image_ratio = 1888 / 1455; 
	var www = window.Height * image_ratio;
	var circle_ratio = 700 / 670; // 700 / 598. ==> Diametre du cercle. // 670
	var circle2_ratio = 700 / 672; // 700 / 672
	gr.DrawImage(Backgr, 0, 0, wh * ratio, wh , 0, 0, Backgr.Width, Backgr.Height)
	//gr.DrawImage(Backgr, -45, 0, wh * ratio, wh , 0, 0, Backgr.Width, Backgr.Height); // Correction : Décalage  
        
    if ( plman.ActivePlaylist != list_number){     
        // TOTAL LENGTH SONG SECONDES
        var Song_Split = tfo.length.Eval().split(':');
        var Song_length_split = tfo.length.Eval().split(':');
        var Song_length_sec = ((((Song_length_split[0] * 1) * 60) + (Song_length_split[1] * 1)) * 10);
   
        // TOTAL PLAYED SONG SECONDES
        var Song_Playtime_Split = tfo.playback_time.Eval().split(':');
        var Song_Playtime_sec = ((((Song_Playtime_Split[0] * 1) * 60) + (Song_Playtime_Split[1] * 1)) * 10);
       
	//gr.WriteText(tfo.length.Eval(), normal_font, colours.time, 10, 70, 50, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
	//gr.WriteText(tfo.playback_time.Eval(), normal_font, colours.time, 10, 85, 50, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
        
        //gr.WriteText(Song_length_sec, normal_font, colours.time, 10, 160, 400, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
        //gr.WriteText(Song_Playtime_sec, normal_font, colours.time, 10, 175, 400, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);

        //gr.WriteText(i, normal_font, colours.time, 10, 190, 400, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
        }
        if(g_img ) {
		var scale_w = ww / g_img.Width / 1.51; //  / 1.5. ==> Largeur Pochette
		var scale_h = wh / g_img.Height;
		var scale = Math.min(scale_w, scale_h);
		var pos_x = 6, pos_y = 0; // ==> Position en largeur Pochette CD
		if (scale_w < scale_h)
			pos_y = (wh - g_img.height * scale) / 1 - 20; // ==> Position en hauteur Pochette CD
		else if (scale_w > scale_h)
			pos_x = (ww - g_img.Width * scale) / 1;
			// albumart        pos_y - 70
	//gr.DrawImage (Vinyl_Circle, (www * 100) / 7390 , (whh * 48) / 2400, whh / circle2_ratio, whh / circle2_ratio, 0, 0, Vinyl_Circle.Width, Vinyl_Circle.Height, 1, angle_circle );
	//                                / 600 .==>largeur      / 300. ==>hauteur
	// Désactivation. Passage au second plan. Voir plus bas.
	//gr.DrawImage(g2_img, (www * 100) / 740 , (whh * 48) / 2200, whh / circle_ratio, whh / circle_ratio, 0, 0, g2_img.Width , g2_img.Height , 1, angle); // www * 100) / 1830
	// Ajout
	// var blur_img = null;
	// var radius = 250;
	StackBlur(radius);
	function StackBlur(radius) {
	if (blur_img) blur_img.Dispose();
	blur_img = g_img.Clone();
	blur_img.StackBlur(radius);
    }
	// Fin ajout
	// Désactivation de Album Art.
	// gr.DrawImage(g_img, pos_x, pos_y - 60, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height); // pos_y . scale
	gr.DrawImage(blur_img, pos_x - 5, pos_y - 85, g_img.Width * scale + 340, g_img.Height * scale + 105, 0, 0, g_img.Width, g_img.Height, 0.6); // pos_y . scale
	//                                / 600 .==>largeur      / 300. ==>hauteur
	gr.DrawImage(g2_img, (www * 100) / 775 , (whh * 48) / 2200, whh / circle_ratio, whh / circle_ratio, 0, 0, g2_img.Width , g2_img.Height , 1, angle); // www * 100) / 1830	           
								// Position en largeur du cercle. 840. En hauteur 4500. Diamètre : +20 pour circle2_ratio                                       // Opacité. Entre 0 et 1.
	gr.DrawImage (Vinyl_Circle, (www * 100) / 840 , (whh * 48) / 4500, whh / circle2_ratio + 20, whh / circle2_ratio + 20, 0, 0, Vinyl_Circle.Width, Vinyl_Circle.Height, 0.6, angle_circle );

                var arm_ratio = 820 / 1060; 
                var arm_w = (460 * ww) / 827;  // 460
                //var arm_h = 530;          //  460 ---- 827
                                          //  530 ---- 637
                var arm_w_ratio = 827 / 460;
                var arm_h_ratio = 637 / 530;
          if(plman.ActivePlaylist != list_number){     
                // Vinyl_Arm         
		// Vinyl_Arm = utils.LoadImage(fb.ComponentPath + 'samples\\images\\images_v1\\tonearm\\' + i + '.png');
//                gr.DrawImage(Vinyl_Arm, (ww / 100) * 46, (wh / 100) * 6.7, (460 * ww) / 827, arm_w / arm_ratio, 0, 0, Vinyl_Arm.Width, Vinyl_Arm.Height, 1);  
          }     


                //gr.DrawLine(0, (wh / 100) * 87.5, ww, (wh / 100) * 87.5, 1, RGB(255, 255, 255));
                //gr.DrawLine(0, (wh / 100) * 91.5, ww, (wh / 100) * 91.5, 1, RGB(255, 255, 255));

                //gr.DrawLine((wh / 100) * 16.5, 0, (wh / 100) * 16.5, wh, 1, RGB(255, 255, 255));
                //gr.DrawLine((wh / 100) * 24.5, 0, (wh / 100) * 24.5, wh, 1, RGB(255, 255, 255));
                //gr.DrawLine((wh / 100) * 32.5, 0, (wh / 100) * 32.5, wh, 1, RGB(255, 255, 255));

                gr.WriteText('REV', small_font, RGB(reverse_speed_color_R, reverse_speed_color_G, reverse_speed_color_B), (wh / 100) * 26.1 , (wh / 100) * 95.2, 1000, 50, 0, 0); //(wh / 100) * 18.2

                gr.WriteText('SPEED 1', small_font, RGB(three_speed_color_R, three_speed_color_G, three_speed_color_B), (wh / 100) * 10.9 , (wh / 100) * 95.2, 1000, 50, 0, 0); // (wh / 100) * 19.9
                gr.WriteText('SPEED 2', small_font, RGB(four_speed_color_R, four_speed_color_G, four_speed_color_B), (wh / 100) * 18.5 , (wh / 100) * 95.2, 1000, 50, 0, 0); // (wh / 100) * 27.5

                //gr.DrawEllipse(316, 310, 295, 295, 1, colours.red);
		//gr.DrawImage(Backgr2, 0, 0, wh * ratio, wh , 0, 0, Backgr.Width, Backgr.Height);
		//gr.WriteText(' height = ' + wh, normal_font , RGB( 255, 255, 255), 10, 120, 100, 100); 
		//gr.WriteText(' width = ' + ww, normal_font , RGB( 255, 255, 255), 10, 100, 100, 100); 
                //gr.WriteText(arm_w, normal_font , RGB( 255, 255, 255), 10, 140, 100, 100);
		//gr.DrawLine(100, 0, 100 , 600, 1 , RGB( 255, 255, 255));
		//gr.DrawLine(0, 48, 1000 , 48, 1 , RGB( 255, 255, 255));
                window.MinWidth = www;
		window.MaxWidth = www;
	}
	
     
}

function on_size() {
	ww = window.Width;
	wh = window.Height;
}

function on_playback_new_track() {
        i = 0;
        update_album_art();
        window.Reload();
        //window.Repaint();
}

function on_playback_stop(reason) {
        if (reason != 2) {
              update_album_art();
	}
}

function on_playlist_switch() {
	if (!fb.IsPlaying) {
              update_album_art();
        }
        window.Repaint();
}
jacobi91 è offline   Rispondi citando il messaggio o parte di esso
Old 28-02-2024, 09:04   #6222
ApacheReal
Senior Member
 
L'Avatar di ApacheReal
 
Iscritto dal: Feb 2019
Messaggi: 353
@jacobi91

Grazie, mille.

Ho adattato il mio script.

Le linee da aggiungere sono:

var blur_img = null;
var radius = 120




StackBlur(radius);
function StackBlur(radius) {
if (blur_img) blur_img.Dispose();
blur_img = g_img.Clone();
blur_img.StackBlur(radius);
}
gr.DrawImage(blur_img, pos_x-300 * scale, pos_y -420 * scale, g_img.Width, g_img.Height, 210, -210, g_img.Width, g_img.Height, 0.6); // pos_y . scale


la riga in grassetto mi ha fatto combattere e non poco per adattarla alla mia immagine.

@quan33

Ti rispondo qui.

Nello script postato da @jacobi91 hai tutto quello che ti serve.
ApacheReal è offline   Rispondi citando il messaggio o parte di esso
Old 29-02-2024, 00:16   #6223
quan33
Junior Member
 
Iscritto dal: Dec 2023
Messaggi: 8
Quote:
Originariamente inviato da ApacheReal Guarda i messaggi
@jacobi91

Grazie, mille.

Ho adattato il mio script.

Le linee da aggiungere sono:

var blur_img = null;
var radius = 120




StackBlur(radius);
function StackBlur(radius) {
if (blur_img) blur_img.Dispose();
blur_img = g_img.Clone();
blur_img.StackBlur(radius);
}
gr.DrawImage(blur_img, pos_x-300 * scale, pos_y -420 * scale, g_img.Width, g_img.Height, 210, -210, g_img.Width, g_img.Height, 0.6); // pos_y . scale


la riga in grassetto mi ha fatto combattere e non poco per adattarla alla mia immagine.

@quan33

Ti rispondo qui.

Nello script postato da @jacobi91 hai tutto quello che ti serve.
thanks
quan33 è offline   Rispondi citando il messaggio o parte di esso
Old 29-02-2024, 00:56   #6224
quan33
Junior Member
 
Iscritto dal: Dec 2023
Messaggi: 8
Quote:
Originariamente inviato da ApacheReal Guarda i messaggi
@jacobi91

Grazie, mille.

Ho adattato il mio script.

Le linee da aggiungere sono:

var blur_img = null;
var radius = 120




StackBlur(radius);
function StackBlur(radius) {
if (blur_img) blur_img.Dispose();
blur_img = g_img.Clone();
blur_img.StackBlur(radius);
}
gr.DrawImage(blur_img, pos_x-300 * scale, pos_y -420 * scale, g_img.Width, g_img.Height, 210, -210, g_img.Width, g_img.Height, 0.6); // pos_y . scale


la riga in grassetto mi ha fatto combattere e non poco per adattarla alla mia immagine.

@quan33

Ti rispondo qui.

Nello script postato da @jacobi91 hai tutto quello che ti serve.
Quote:
Originariamente inviato da jacobi91 Guarda i messaggi
Codice:
// ==PREPROCESSOR==
// @name "Spin Disc 2 (Art Cover + Spin Disc)" with vinyl_circle.png and Blur effect
// @author "marc2003"
// Liste des radios ==> Internet Radio
// @optimization "Apache"
// @import "%fb2k_component_path%helpers.txt"
// ==/PREPROCESSOR==

var blur_img = null;
var radius = 120

var colours = {
	accent : RGB(48, 141, 255),
	accent2 : RGB(255, 64, 129),
	accent3 : RGB(255, 234, 0),
	accent4 : RGB(0, 183, 204),
	buttons : RGB(255, 255, 255),
	background : RGB(30, 30, 30),
	title : RGB(255, 255, 255),
	artist : RGB(240, 240, 240),
	date : RGB(200, 200, 200),
	time : RGB(240, 240, 240),
	
	sac : RGB(100, 0, 0),
	red : RGB(55, 255, 255),
	redred : RGB(255, 0, 0),
};

var tfo = {
	artist : fb.TitleFormat('%artist%'),
	lfm_loved : fb.TitleFormat('$if2(%lfm_loved%,0)'),
	title : fb.TitleFormat('%title%'),
	date : fb.TitleFormat(('%date%')),
	playback_time : fb.TitleFormat('[%playback_time%]'),
	length : fb.TitleFormat('$if2(%length%,LIVE)'),
};


var Backgr = utils.LoadImage(fb.ComponentPath + 'samples\\images\\vinyl5.jpg');
var Vinyl_Circle = utils.LoadImage(fb.ComponentPath + 'samples\\images\\vinyl_circle.png');
//if ( plman.ActivePlaylist != "Internet Radio");
//if (plman.ActivePlaylist != list_number);
//if (plman.GetPlaylistSelectedItems != list_number);
if (plman.GetPlaylistSelectedItems(plman.ActivePlaylist)){ 
//var list_number = plman.GetPlaylistSelectedItems;// A vérifier
//       var Vinyl_Arm = utils.LoadImage(fb.ComponentPath + 'samples\\images\\images_v1\\tonearm\\0000' + i + '.png');
}
var i = 0;
var angle = 0;
var angle_circle = 0;
var angle_arm = 0;
var Vinyl_Speed = 2.5;
var normal_font = CreateFontString('Segoe UI', 12);
var small_font = CreateFontString('fontawesome', 6 , true);
var verysmall_font = CreateFontString('fontawesome', 6 , true);

var three_speed_color_R = 255;
var three_speed_color_G = 255;
var three_speed_color_B = 255;
var four_speed_color_R = 255;
var four_speed_color_G = 255;
var four_speed_color_B = 255;
var reverse_speed_color_R = 255;
var reverse_speed_color_G = 255;
var reverse_speed_color_B = 255;

//dimensions
var ratio = 1902/1400;
// var list_number = plman.FindPlaylist("Internet Radio");
var list_number = plman.GetPlaylistSelectedItems;


if( fb.IsPlaying ) {
   fb.GetNowPlaying();
   
   if ( plman.GetPlaylistSelectedItems != list_number){ 
        console.log('obama');
        // TOTAL LENGTH SONG SECONDES
        var Song_Split = tfo.length.Eval().split(':');
        var Song_length_split = tfo.length.Eval().split(':');
        var Song_length_sec = ((((Song_length_split[0] * 1) * 60) + (Song_length_split[1] * 1)) * 10);
   
        // TOTAL PLAYED SONG SECONDES
        var Song_Playtime_Split = tfo.playback_time.Eval().split(':');
        var Song_Playtime_sec = ((((Song_Playtime_Split[0] * 1) * 60) + (Song_Playtime_Split[1] * 1)) * 10);
        Calc_i();
   
window.SetInterval(function () {
       
        if (!fb.IsPlaying || fb.IsPaused) return;
	angle += Vinyl_Speed;
        angle_circle -= 0.6;
        angle_arm += 0.2;
        if( i < 120 && i >=25 ){
            i += 1;
        }    
        window.Repaint();
}, (1 * Song_length_sec) - 30);
}

window.SetInterval(function () {
       
        if (!fb.IsPlaying || fb.IsPaused) return;
	angle += Vinyl_Speed;
        angle_circle -= 0.6;
        angle_arm += 0.2;
        if( i < 25 ){
            i += 1;
        }    
        window.Repaint();
}, 100);
}

var g_img = null;
var g_metadb = null;
var g_tooltip = window.CreateTooltip('Segoe UI', 16);
g_tooltip.SetMaxWidth(600);
g_tooltip.Text = '';
var g_info = '';
var ww = 0, wh = 0;
var temp_gr;
var circular_mask = utils.CreateImage(500, 500); // 500, 500
temp_gr = circular_mask.GetGraphics();
temp_gr.FillEllipse(250, 250, 250, 250, RGB(0, 0, 0));  // 250, 250, 250, 250
circular_mask.ReleaseGraphics();
temp_gr = null;
update_album_art();

function update_album_art() {
	angle = 0;
        angle_circle = 0;
        angle_arm = 0;
        
	if (g_img) g_img.Dispose();
	g_img = null;
	g_info = '';
	g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
	if (g_metadb) {
		var tmp = g_metadb.GetAlbumArt(0) // type 0 = front art.Pour Album Art
		if (!tmp) tmp = g_metadb.GetAlbumArt(4); // use type 4 = artist art
		if (!tmp) tmp = g_metadb.GetAlbumArt(3); // use type 3 = icon art
		if (!tmp) tmp = g_metadb.GetAlbumArt(1); // use type 1 = back art
    	if (!tmp) tmp = g_metadb.GetAlbumArt(2); // use type 2 = disc art
		var tmp2 = g_metadb.GetAlbumArt(2) // type 2 = disc art. Creation tmp2 pour disc art.
		if (!tmp2) tmp2 = g_metadb.GetAlbumArt(3); // use type 3 = icon art
		if (!tmp2) tmp2 = g_metadb.GetAlbumArt(4); // use type 4 = artist art
		if (!tmp2) tmp2 = g_metadb.GetAlbumArt(0); // use type 0 = front art
		if (!tmp2) tmp2 = g_metadb.GetAlbumArt(1); // use type 1 = back art
		if (tmp) {
			var path = tmp.Path;
			var size = Math.min(tmp.Width, tmp.Height);
			g_img = make_square(tmp, size)  // g_img : ==> pochette CD
			//g_img = utils.CreateImage(size, size);
			//temp_gr = g_img.GetGraphics();
			//temp_gr.DrawImageWithMask(make_square(tmp, size), circular_mask, 0, 0, g_img.Width, g_img.Height);
			//g_img.ReleaseGraphics();
			//temp_gr = null;
			//tmp.Dispose();
			//g_info = 'Original dimensions: ' + g_img.Width + 'x' + g_img.Height;
			//if (path.length) g_info += '\nPath: ' + path;
		}
		if (tmp2) {                 // pour disc art
			var path2 = tmp2.Path;
			var size2 = Math.min(tmp2.Width, tmp2.Height);
			
			g2_img = utils.CreateImage(size, size); // pour disc art
			temp2_gr = g2_img.GetGraphics();
			temp2_gr.DrawImageWithMask(make_square(tmp2, size), circular_mask, 0, 0, g2_img.Width, g2_img.Height);
			g2_img.ReleaseGraphics();
			temp2_gr = null;
			tmp2.Dispose();
			g2_info = 'Original dimensions: ' + g2_img.Width + 'x' + g2_img.Height;
			if (path.length) g2_info += '\nPath: ' + path;
		}
	}
	window.Repaint();
}

function make_square(img, size ) {
	if (!img) return null;
	if (img.Width < img.Height) {
		var src_x = 0;
		var src_w = img.Width;
		var src_h = img.Width;
		var src_y = Math.round((img.Height - src_h) / 1);
	} else {
		var src_y = 0;
		var src_w = img.Height;
		var src_h = img.Height;
		var src_x = Math.round((img.Width - src_w) / 1);
	}
	var square = utils.CreateImage(size, size);
	var temp_gr = square.GetGraphics();
	temp_gr.DrawImage(img, 0, 0, size, size, src_x, src_y, src_w, src_h);

	square.ReleaseGraphics();
	return square;
}

function Calc_i() {

        if(Song_Playtime_sec > 30){ 
        var Playtime_Ratio = (Song_Playtime_sec * 100) / Song_length_sec;
        i = 25 +  ((Playtime_Ratio * 100) / 95);
        i = Math.round(i);
        if(i > 120){ i = 120;}; 
        }
        else {
        i = 0;
        }
}

function on_colours_changed() {
	window.Repaint();
}

function on_item_focus_change() {
       	if (!fb.IsPlaying) update_album_art();
        window.Repaint();
}

function on_mouse_lbtn_up(x, y) {
	
							//16.5				   // 24.5

        if( x > (wh / 100) * 7.5 && x < (wh / 100) * 15.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
                if( Vinyl_Speed > 0 ) {
                    Vinyl_Speed = 2.5 ;
                }
                else { 
                    Vinyl_Speed = -2.5;
                }
        }                 // 25                    // 32.5
        if( x > (wh / 100) * 16 && x < (wh / 100) * 23.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
                if( Vinyl_Speed < 4 && Vinyl_Speed > -4){
                Vinyl_Speed = Vinyl_Speed * 2;
                }
        }                 // 16.5                  // 24.5
        if( x > (wh / 100) * 24.5 && x < (wh / 100) * 32.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
              
                Vinyl_Speed = - Vinyl_Speed;
        }   
}

function on_mouse_rbtn_up(x, y) {
           
}

function on_mouse_lbtn_dblclk() {
	if (g_metadb) g_metadb.ShowAlbumArtViewer(0);
}

function on_mouse_move(x, y, gr) {
	if (g_info.length && g_tooltip.Text != g_info) {
	//	g_tooltip.Text = g_info;
	//	g_tooltip.Activate();
	}                                    // 16.5                    // 24.5                                                                 //    16.5                //   32.5
        window.SetCursor( (x > (wh / 100) * 16.5 && x < (wh / 100) * 24.5 && y > (wh / 100) * 87.5 && y < (wh / 100) * 91.5) || (x > (wh / 100) * 16.5 && x < (wh / 100) * 32.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5)  ? IDC_HAND : IDC_ARROW);

        //window.SetCursor( x > (wh / 100) * 16.5 && x < (wh / 100) * 32.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5  ? IDC_HAND : IDC_ARROW);
        // 33 tours speed     16.5                     23.5
        if ( x > (wh / 100) * 9.5 && x < (wh / 100) * 14.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
           three_speed_color_R = 224;
           three_speed_color_G = 189;
           three_speed_color_B = 121;
        } 
        else { 
           three_speed_color_R = 255;
           three_speed_color_G = 255;
           three_speed_color_B = 255;
        }
        // 45 tours speed     25                     32.5
        if ( x > (wh / 100) * 16 && x < (wh / 100) * 23.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
           four_speed_color_R = 224;
           four_speed_color_G = 189;
           four_speed_color_B = 121;
        } 
        else { 
           four_speed_color_R = 255;
           four_speed_color_G = 255;
           four_speed_color_B = 255;
        }                  // 16.5                 //  32.5
        if ( x > (wh / 100) * 17 && x < (wh / 100) * 32.5 && y > (wh / 100) * 94 && y < (wh / 100) * 98.5 ) {
           reverse_speed_color_R = 224;
           reverse_speed_color_G = 189;
           reverse_speed_color_B = 121;
        } 
        else { 
           reverse_speed_color_R = 255;
           reverse_speed_color_G = 255;
           reverse_speed_color_B = 255;
        }
}

function on_paint(gr) {
	var bg = window.IsDefaultUI ? window.GetColourDUI(1) : window.GetColourCUI(3);
	gr.FillRectangle(0, 0, ww, wh, RGB(30, 30, 30));
      
	var whh = window.Height;
	var ww = window.Width
	var wh = window.Height;
			var image_ratio = 1902 / 1458;  (www * 100) / 917 , (whh * 48) / 698
    //		var image_ratio = 1888 / 1455; 
	var www = window.Height * image_ratio;
	var circle_ratio = 700 / 670; // 700 / 598. ==> Diametre du cercle. // 670
	var circle2_ratio = 700 / 672; // 700 / 672
	gr.DrawImage(Backgr, 0, 0, wh * ratio, wh , 0, 0, Backgr.Width, Backgr.Height)
	//gr.DrawImage(Backgr, -45, 0, wh * ratio, wh , 0, 0, Backgr.Width, Backgr.Height); // Correction : Décalage  
        
    if ( plman.ActivePlaylist != list_number){     
        // TOTAL LENGTH SONG SECONDES
        var Song_Split = tfo.length.Eval().split(':');
        var Song_length_split = tfo.length.Eval().split(':');
        var Song_length_sec = ((((Song_length_split[0] * 1) * 60) + (Song_length_split[1] * 1)) * 10);
   
        // TOTAL PLAYED SONG SECONDES
        var Song_Playtime_Split = tfo.playback_time.Eval().split(':');
        var Song_Playtime_sec = ((((Song_Playtime_Split[0] * 1) * 60) + (Song_Playtime_Split[1] * 1)) * 10);
       
	//gr.WriteText(tfo.length.Eval(), normal_font, colours.time, 10, 70, 50, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
	//gr.WriteText(tfo.playback_time.Eval(), normal_font, colours.time, 10, 85, 50, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
        
        //gr.WriteText(Song_length_sec, normal_font, colours.time, 10, 160, 400, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
        //gr.WriteText(Song_Playtime_sec, normal_font, colours.time, 10, 175, 400, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);

        //gr.WriteText(i, normal_font, colours.time, 10, 190, 400, 50, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
        }
        if(g_img ) {
		var scale_w = ww / g_img.Width / 1.51; //  / 1.5. ==> Largeur Pochette
		var scale_h = wh / g_img.Height;
		var scale = Math.min(scale_w, scale_h);
		var pos_x = 6, pos_y = 0; // ==> Position en largeur Pochette CD
		if (scale_w < scale_h)
			pos_y = (wh - g_img.height * scale) / 1 - 20; // ==> Position en hauteur Pochette CD
		else if (scale_w > scale_h)
			pos_x = (ww - g_img.Width * scale) / 1;
			// albumart        pos_y - 70
	//gr.DrawImage (Vinyl_Circle, (www * 100) / 7390 , (whh * 48) / 2400, whh / circle2_ratio, whh / circle2_ratio, 0, 0, Vinyl_Circle.Width, Vinyl_Circle.Height, 1, angle_circle );
	//                                / 600 .==>largeur      / 300. ==>hauteur
	// Désactivation. Passage au second plan. Voir plus bas.
	//gr.DrawImage(g2_img, (www * 100) / 740 , (whh * 48) / 2200, whh / circle_ratio, whh / circle_ratio, 0, 0, g2_img.Width , g2_img.Height , 1, angle); // www * 100) / 1830
	// Ajout
	// var blur_img = null;
	// var radius = 250;
	StackBlur(radius);
	function StackBlur(radius) {
	if (blur_img) blur_img.Dispose();
	blur_img = g_img.Clone();
	blur_img.StackBlur(radius);
    }
	// Fin ajout
	// Désactivation de Album Art.
	// gr.DrawImage(g_img, pos_x, pos_y - 60, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height); // pos_y . scale
	gr.DrawImage(blur_img, pos_x - 5, pos_y - 85, g_img.Width * scale + 340, g_img.Height * scale + 105, 0, 0, g_img.Width, g_img.Height, 0.6); // pos_y . scale
	//                                / 600 .==>largeur      / 300. ==>hauteur
	gr.DrawImage(g2_img, (www * 100) / 775 , (whh * 48) / 2200, whh / circle_ratio, whh / circle_ratio, 0, 0, g2_img.Width , g2_img.Height , 1, angle); // www * 100) / 1830	           
								// Position en largeur du cercle. 840. En hauteur 4500. Diamètre : +20 pour circle2_ratio                                       // Opacité. Entre 0 et 1.
	gr.DrawImage (Vinyl_Circle, (www * 100) / 840 , (whh * 48) / 4500, whh / circle2_ratio + 20, whh / circle2_ratio + 20, 0, 0, Vinyl_Circle.Width, Vinyl_Circle.Height, 0.6, angle_circle );

                var arm_ratio = 820 / 1060; 
                var arm_w = (460 * ww) / 827;  // 460
                //var arm_h = 530;          //  460 ---- 827
                                          //  530 ---- 637
                var arm_w_ratio = 827 / 460;
                var arm_h_ratio = 637 / 530;
          if(plman.ActivePlaylist != list_number){     
                // Vinyl_Arm         
		// Vinyl_Arm = utils.LoadImage(fb.ComponentPath + 'samples\\images\\images_v1\\tonearm\\' + i + '.png');
//                gr.DrawImage(Vinyl_Arm, (ww / 100) * 46, (wh / 100) * 6.7, (460 * ww) / 827, arm_w / arm_ratio, 0, 0, Vinyl_Arm.Width, Vinyl_Arm.Height, 1);  
          }     


                //gr.DrawLine(0, (wh / 100) * 87.5, ww, (wh / 100) * 87.5, 1, RGB(255, 255, 255));
                //gr.DrawLine(0, (wh / 100) * 91.5, ww, (wh / 100) * 91.5, 1, RGB(255, 255, 255));

                //gr.DrawLine((wh / 100) * 16.5, 0, (wh / 100) * 16.5, wh, 1, RGB(255, 255, 255));
                //gr.DrawLine((wh / 100) * 24.5, 0, (wh / 100) * 24.5, wh, 1, RGB(255, 255, 255));
                //gr.DrawLine((wh / 100) * 32.5, 0, (wh / 100) * 32.5, wh, 1, RGB(255, 255, 255));

                gr.WriteText('REV', small_font, RGB(reverse_speed_color_R, reverse_speed_color_G, reverse_speed_color_B), (wh / 100) * 26.1 , (wh / 100) * 95.2, 1000, 50, 0, 0); //(wh / 100) * 18.2

                gr.WriteText('SPEED 1', small_font, RGB(three_speed_color_R, three_speed_color_G, three_speed_color_B), (wh / 100) * 10.9 , (wh / 100) * 95.2, 1000, 50, 0, 0); // (wh / 100) * 19.9
                gr.WriteText('SPEED 2', small_font, RGB(four_speed_color_R, four_speed_color_G, four_speed_color_B), (wh / 100) * 18.5 , (wh / 100) * 95.2, 1000, 50, 0, 0); // (wh / 100) * 27.5

                //gr.DrawEllipse(316, 310, 295, 295, 1, colours.red);
		//gr.DrawImage(Backgr2, 0, 0, wh * ratio, wh , 0, 0, Backgr.Width, Backgr.Height);
		//gr.WriteText(' height = ' + wh, normal_font , RGB( 255, 255, 255), 10, 120, 100, 100); 
		//gr.WriteText(' width = ' + ww, normal_font , RGB( 255, 255, 255), 10, 100, 100, 100); 
                //gr.WriteText(arm_w, normal_font , RGB( 255, 255, 255), 10, 140, 100, 100);
		//gr.DrawLine(100, 0, 100 , 600, 1 , RGB( 255, 255, 255));
		//gr.DrawLine(0, 48, 1000 , 48, 1 , RGB( 255, 255, 255));
                window.MinWidth = www;
		window.MaxWidth = www;
	}
	
     
}

function on_size() {
	ww = window.Width;
	wh = window.Height;
}

function on_playback_new_track() {
        i = 0;
        update_album_art();
        window.Reload();
        //window.Repaint();
}

function on_playback_stop(reason) {
        if (reason != 2) {
              update_album_art();
	}
}

function on_playlist_switch() {
	if (!fb.IsPlaying) {
              update_album_art();
        }
        window.Repaint();
}
I installed the script and prompted:

JScript Panel 3.4.9 (Spin Disc 2 (Art Cover + Spin Disc) by marc2003)

JavaScript compile error

An unfinished string constant

File: <main>
Line: 77, Col: 64
console.log('obama // TOTAL LENGTH SONG SECONDES

Also vinyl5.jpg what is a picture can you tell me?
Thank you!
quan33 è offline   Rispondi citando il messaggio o parte di esso
Old 29-02-2024, 06:37   #6225
ApacheReal
Senior Member
 
L'Avatar di ApacheReal
 
Iscritto dal: Feb 2019
Messaggi: 353
Quote:
Originariamente inviato da quan33 Guarda i messaggi
I installed the script and prompted:

JScript Panel 3.4.9 (Spin Disc 2 (Art Cover + Spin Disc) by marc2003)

JavaScript compile error

An unfinished string constant

File: <main>
Line: 77, Col: 64
console.log('obama // TOTAL LENGTH SONG SECONDES

Also vinyl5.jpg what is a picture can you tell me?
Thank you!
In console gli puoi mettere il nome che preferisci ad esempio:

console.log('spin disc');

In \foobar2000\profile\user-components\foo_jscript_panel3\samples\images\
devi avere un file .jpg

Anche qui puoi cambiare il nome come preferisci, ma il nome file deve corrispondere a quello che hai sulla linea ad esempio:

nello script hai:

var Backgr = utils.LoadImage(fb.ComponentPath + 'samples\\images\\vinyl5.jpg');

nella cartella \foobar2000\profile\user-components\foo_jscript_panel3\samples\images\
devi avere un file vinyl5.jpg
ApacheReal è offline   Rispondi citando il messaggio o parte di esso
Old 29-02-2024, 06:51   #6226
jacobi91
Member
 
L'Avatar di jacobi91
 
Iscritto dal: Oct 2023
Messaggi: 90
Quote:
Originariamente inviato da quan33 Guarda i messaggi
I installed the script and prompted:

JScript Panel 3.4.9 (Spin Disc 2 (Art Cover + Spin Disc) by marc2003)

JavaScript compile error

An unfinished string constant

File: <main>
Line: 77, Col: 64
console.log('obama // TOTAL LENGTH SONG SECONDES

Also vinyl5.jpg what is a picture can you tell me?
Thank you!
vinil5.jpg, è solo uno sfondo nero che puoi disattivare commentando le righe 40 e 307 :
40 : var Backgr = utils.LoadImage(fb.ComponentPath + 'samples\\images\\vinyl5.jpg');
307 : gr.DrawImage(Backgr, 0, 0, wh * ratio, wh , 0, 0, Backgr.Width, Backgr.Height)

Sarà sicuramente necessario modificare la trasparenza sulla riga 354 :
gr.DrawImage(blur_img, pos_x - 5, pos_y - 85, g_img.Width * scale + 340, g_img.Height * scale + 105, 0, 0, g_img.Width, g_img.Height, 0.6); // pos_y . scale

Non ricevo questo errore relativo alla riga 77.
jacobi91 è offline   Rispondi citando il messaggio o parte di esso
Old 29-02-2024, 07:53   #6227
quan33
Junior Member
 
Iscritto dal: Dec 2023
Messaggi: 8
Quote:
Originariamente inviato da jacobi91 Guarda i messaggi
vinil5.jpg, è solo uno sfondo nero che puoi disattivare commentando le righe 40 e 307 :
40 : var Backgr = utils.LoadImage(fb.ComponentPath + 'samples\\images\\vinyl5.jpg');
307 : gr.DrawImage(Backgr, 0, 0, wh * ratio, wh , 0, 0, Backgr.Width, Backgr.Height)

Sarà sicuramente necessario modificare la trasparenza sulla riga 354 :
gr.DrawImage(blur_img, pos_x - 5, pos_y - 85, g_img.Width * scale + 340, g_img.Height * scale + 105, 0, 0, g_img.Width, g_img.Height, 0.6); // pos_y . scale

Non ricevo questo errore relativo alla riga 77.
It's been adjusted. Thank you very much!

https://i.postimg.cc/7YG9Gfq8/Snipas...9-15-46-59.png

Thanks again!
quan33 è offline   Rispondi citando il messaggio o parte di esso
Old 29-02-2024, 10:09   #6228
ApacheReal
Senior Member
 
L'Avatar di ApacheReal
 
Iscritto dal: Feb 2019
Messaggi: 353
@jacobi91

Giusto per curiosità vorrei capire meglio questa parte:

if (!tmp) tmp = g_metadb.GetAlbumArt(2); // use type 2 = disc art
var tmp2 = g_metadb.GetAlbumArt(2) // type 2 = disc art. Creation tmp2 pour disc art.
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(3); // use type 3 = icon art
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(4); // use type 4 = artist art
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(0); // use type 0 = front art
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(1); // use type 1 = back art
if (tmp) {
var path = tmp.Path;
var size = Math.min(tmp.Width, tmp.Height);
g_img = make_square(tmp, size) // g_img : ==> pochette CD

}
if (tmp2) { // pour disc art
var path2 = tmp2.Path;
var size2 = Math.min(tmp2.Width, tmp2.Height);

g2_img = utils.CreateImage(size, size); // pour disc art
temp2_gr = g2_img.GetGraphics();
temp2_gr.DrawImageWithMask(make_square(tmp2, size), circular_mask, 0, 0, g2_img.Width, g2_img.Height);
g2_img.ReleaseGraphics();
temp2_gr = null;
tmp2.Dispose();
g2_info = 'Original dimensions: ' + g2_img.Width + 'x' + g2_img.Height;
if (path.length) g2_info += '\nPath: ' + path;
}
}

l'info if (!tmp1) ho fatto delle variazioni io.

if (!tmp2) non ho capito come lavora ne senso che va ha pescare una cover disc art ma da dove?

e poi '\nPath: ' + path che cosa fa?
ApacheReal è offline   Rispondi citando il messaggio o parte di esso
Old 29-02-2024, 12:31   #6229
plata
Senior Member
 
L'Avatar di plata
 
Iscritto dal: May 2005
Città: Trieste
Messaggi: 3360
Ho così impostato la status bar:
[[%codec% | ][$replace($trim($insert($pad_right($div(%samplerate%,100),4),.,3)),.0,) kHz | ][%__bitspersample% bit | ][%bitrate% kbps | ][%channels% | ]]>>[%discnumber%.][%tracknumber%. ]$cut(%title%[ '//' %track artist%][ '['$if($meta(album artist),$meta(album artist) –[ %album%],[– %album%])']'],71)$ifgreater($len(%title%[ '//' %track artist%][ '['$if($meta(album artist),$meta(album artist) –[ %album%],[– %album%])']']),71,...,)<<$tab()[%playback_time%][ / %length%][$ifequal($if(%_time_total_seconds%,$muldiv(%_time_elapsed_seconds%,10,%_time_total_seconds%)),9,>>> '('-%playback_time_remaining%')'<<<, '('-%playback_time_remaining%')')]

Come lasciar comparire i "..." quando la 1^ parte della stringa raggiunge la 2^ e non dopo tot caratteri, lasciando quindi intatti i valori di tempo?
__________________
CASE: Antec Solo II | MOBO: Asus Sabertooth Z87 | CPU: Intel i7 4790K | COOLER: Noctua NH-D15 | RAM: G Skill 16Gb | GPU: nVidia GTX-1070 G1 | ROUTER: AVM7530
PSU: Seasonic P520 | AUDIO: Asus STX II | STORAGE: HDD ST2000DM001 + SSD 850 PRO 512Gb + DVDRAM LG GH24NS50 | LCD: Sony SDM-X72 | TV: Sony 32W4000
AMP: Marantz PM-KI Pearl | SPKR: Vienna Mozart Grand | DAC: Xantech VDA51 | CABLE: WW Platinum Electra - Tasker RG59 - Chord Clearway - VDH Snowline
plata è offline   Rispondi citando il messaggio o parte di esso
Old 29-02-2024, 12:46   #6230
quan33
Junior Member
 
Iscritto dal: Dec 2023
Messaggi: 8
Quote:
Originariamente inviato da jacobi91 Guarda i messaggi
Spinny Album Art Nonsense + Blur effect
@author "marc2003"

Can you share the script for the Spinny album cover crap + blur effect? Thanks!
quan33 è offline   Rispondi citando il messaggio o parte di esso
Old 29-02-2024, 18:09   #6231
jacobi91
Member
 
L'Avatar di jacobi91
 
Iscritto dal: Oct 2023
Messaggi: 90
Quote:
Originariamente inviato da ApacheReal Guarda i messaggi
@jacobi91

Giusto per curiosità vorrei capire meglio questa parte:

if (!tmp) tmp = g_metadb.GetAlbumArt(2); // use type 2 = disc art
var tmp2 = g_metadb.GetAlbumArt(2) // type 2 = disc art. Creation tmp2 pour disc art.
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(3); // use type 3 = icon art
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(4); // use type 4 = artist art
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(0); // use type 0 = front art
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(1); // use type 1 = back art
if (tmp) {
var path = tmp.Path;
var size = Math.min(tmp.Width, tmp.Height);
g_img = make_square(tmp, size) // g_img : ==> pochette CD

}
if (tmp2) { // pour disc art
var path2 = tmp2.Path;
var size2 = Math.min(tmp2.Width, tmp2.Height);

g2_img = utils.CreateImage(size, size); // pour disc art
temp2_gr = g2_img.GetGraphics();
temp2_gr.DrawImageWithMask(make_square(tmp2, size), circular_mask, 0, 0, g2_img.Width, g2_img.Height);
g2_img.ReleaseGraphics();
temp2_gr = null;
tmp2.Dispose();
g2_info = 'Original dimensions: ' + g2_img.Width + 'x' + g2_img.Height;
if (path.length) g2_info += '\nPath: ' + path;
}
}

l'info if (!tmp1) ho fatto delle variazioni io.

if (!tmp2) non ho capito come lavora ne senso che va ha pescare una cover disc art ma da dove?

e poi '\nPath: ' + path che cosa fa?
Un'immagine vale più di mille parole.



jacobi91 è offline   Rispondi citando il messaggio o parte di esso
Old 01-03-2024, 13:45   #6232
quan33
Junior Member
 
Iscritto dal: Dec 2023
Messaggi: 8
Quote:
Originariamente inviato da jacobi91 Guarda i messaggi
Spinny Album Art Nonsense + Blur effect
@author "marc2003"

jacobi91 Hello!
Why can't I adjust the width of the blurred background?
https://i.postimg.cc/jd4MmZ2Q/Snipas...1-21-37-45.png
quan33 è offline   Rispondi citando il messaggio o parte di esso
Old 01-03-2024, 13:46   #6233
quan33
Junior Member
 
Iscritto dal: Dec 2023
Messaggi: 8
Quote:
Originariamente inviato da quan33 Guarda i messaggi
jacobi91 Hello!
Why can't I adjust the width of the blurred background?
https://i.postimg.cc/jd4MmZ2Q/Snipas...1-21-37-45.png
quan33 è offline   Rispondi citando il messaggio o parte di esso
Old 01-03-2024, 15:19   #6234
jacobi91
Member
 
L'Avatar di jacobi91
 
Iscritto dal: Oct 2023
Messaggi: 90
Quote:
Originariamente inviato da quan33 Guarda i messaggi
I can't help you without seeing the Java Script code.
jacobi91 è offline   Rispondi citando il messaggio o parte di esso
Old 01-03-2024, 15:43   #6235
jacobi91
Member
 
L'Avatar di jacobi91
 
Iscritto dal: Oct 2023
Messaggi: 90
Quote:
Originariamente inviato da jacobi91 Guarda i messaggi
I can't help you without seeing the Java Script code.
You can use the "Button_NowPlaying.txt" of Jul2323.
Thank you very much to Jul2323 et marc2003.
https://hydrogenaud.io/index.php/top...tml#msg1031503

Button_NowPlaying.txt is in foobar2000-v2\user-components-x64\foo_jscript_panel3\samples\.
Make a copy of it and edit that copy.

1-- Replace
Quote:
// ==/PREPROCESSOR==
by
Quote:
// ==/PREPROCESSOR==

var blur_img = null;
radius = 120;
2-- Replace
Quote:
if (g_metadb) {
var tmp = g_metadb.GetAlbumArt(2) // type 2 = disc art ////

if (!tmp) tmp = g_metadb.GetAlbumArt(0); // if disc art not found, use front cover
if (tmp) {
var path = tmp.Path;
var size = Math.min(tmp.Width, tmp.Height);

g_img = utils.CreateImage(size, size);
temp_gr = g_img.GetGraphics();
temp_gr.DrawImageWithMask(make_square(tmp, size), circular_mask, 0, 0, g_img.Width, g_img.Height);
g_img.ReleaseGraphics();
temp_gr = null;
tmp.Dispose();
g_info = 'Original dimensions: ' + g_img.Width + 'x' + g_img.Height;
if (path.length) g_info += '\nPath: ' + path;
}
}
by
Quote:
if (g_metadb) {
var tmp = g_metadb.GetAlbumArt(2) // type 2 = disc art
var tmp2 = g_metadb.GetAlbumArt(0) // type 0 = front art. Pour Album Art ==> Blur effect
if (!tmp) tmp = g_metadb.GetAlbumArt(0); // if disc art not found, use front cover
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(1); // use type 1 = back art
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(4); // use type 4 = artist art
if (!tmp2) tmp2 = g_metadb.GetAlbumArt(3); // use type 3 = icon art
if (tmp) {
var path = tmp.Path;
var size = Math.min(tmp.Width, tmp.Height);
g_img = utils.CreateImage(size, size);
temp_gr = g_img.GetGraphics();
temp_gr.DrawImageWithMask(make_square(tmp, size), circular_mask, 0, 0, g_img.Width, g_img.Height);
g_img.ReleaseGraphics();
temp_gr = null;
tmp.Dispose();
g_info = 'Original dimensions: ' + g_img.Width + 'x' + g_img.Height;
if (path.length) g_info += '\nPath: ' + path;
}
if (tmp2) { // Pour Album Art ==> Blur effect
var path2 = tmp2.Path;
var size2 = Math.min(tmp2.Width, tmp2.Height);
g2_img = utils.CreateImage(size, size); // Pour Album Art ==> Blur effect
temp2_gr = g2_img.GetGraphics();
temp2_gr.DrawImageWithMask(make_square(tmp2, size), circular_mask, 0, 0, g2_img.Width, g2_img.Height);
g2_img.ReleaseGraphics();
temp2_gr = null;
tmp2.Dispose();
// g2_info = 'Original dimensions: ' + g2_img.Width + 'x' + g2_img.Height;
// if (path.length) g2_info += '\nPath: ' + path;
}
}
3-- Replace
Quote:
if(g_img ) {
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
var scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;
if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 1;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 1;
// albumart
gr.DrawImage(g_img, (www * 100) / 900 , (whh * 48) / 670, whh / circle_ratio , whh / circle_ratio, 0, 0, g_img.Width , g_img.Height , 1, angle);
by
Quote:
if(g_img && g2_img) {
var scale_w = ww / g_img.Width;
var scale_h = wh / g_img.Height;
var scale = Math.min(scale_w, scale_h);
var pos_x = 0, pos_y = 0;
if (scale_w < scale_h)
pos_y = (wh - g_img.height * scale) / 1;
else if (scale_w > scale_h)
pos_x = (ww - g_img.Width * scale) / 1;
// Ajout
//var blur_img = null;
// var radius = 250;
StackBlur(radius);
function StackBlur(radius) {
if (blur_img) blur_img.Dispose();
blur_img = g2_img.Clone(); // g2_img pour Album Art ==> Blur effect
blur_img.StackBlur(radius);
}
// Fin ajout
// albumart
gr.DrawImage(blur_img, pos_x - 230, pos_y - 85, g2_img.Width * scale + 340, g2_img.Height * scale + 105, 0, 0, g2_img.Width, g2_img.Height, 0.4); // pos_y . scale
gr.DrawImage(g_img, (www * 100) / 900 , (whh * 48) / 670, whh / circle_ratio , whh / circle_ratio, 0, 0, g_img.Width , g_img.Height , 1, angle);
Use the code of that copy in a JSP3 panel of foobar2000
You'll need vinyl_circle.png, vinyl.jpg and the folder images_v1 in foo_jscript_panel3\samples\images
They are in "La Noire V0.70.rar".

Ultima modifica di jacobi91 : 01-03-2024 alle 15:46.
jacobi91 è offline   Rispondi citando il messaggio o parte di esso
Old 01-03-2024, 16:07   #6236
ApacheReal
Senior Member
 
L'Avatar di ApacheReal
 
Iscritto dal: Feb 2019
Messaggi: 353
I moduli relativi agli spin disc non si auto adattano.

Pertanto basta andare a modificare l'area della dimensione del layout, che tutti i valori sballano.

Ho si sa dove mettere le mani, ho è assolutamente inutile postare dei valori che vanno bene per l'immagine personalizzata di chi li posta, ma non vanno per chi usa altro tipo di layout/ dimensioni.

Ultima modifica di ApacheReal : 01-03-2024 alle 16:23.
ApacheReal è offline   Rispondi citando il messaggio o parte di esso
Old 01-03-2024, 19:46   #6237
jacobi91
Member
 
L'Avatar di jacobi91
 
Iscritto dal: Oct 2023
Messaggi: 90
Quote:
Originariamente inviato da ApacheReal Guarda i messaggi
I moduli relativi agli spin disc non si auto adattano.

Pertanto basta andare a modificare l'area della dimensione del layout, che tutti i valori sballano.

Ho si sa dove mettere le mani, ho è assolutamente inutile postare dei valori che vanno bene per l'immagine personalizzata di chi li posta, ma non vanno per chi usa altro tipo di layout/ dimensioni.
Da qui la necessità di installare UI Hacks in modo che la finestra principale di foobar2000 mantenga sempre la stessa dimensione.



jacobi91 è offline   Rispondi citando il messaggio o parte di esso
Old 02-03-2024, 04:11   #6238
ApacheReal
Senior Member
 
L'Avatar di ApacheReal
 
Iscritto dal: Feb 2019
Messaggi: 353
Quote:
Originariamente inviato da jacobi91 Guarda i messaggi
Da qui la necessità di installare UI Hacks in modo che la finestra principale di foobar2000 mantenga sempre la stessa dimensione.



Non ci fai nulla con questo settaggio, perchè ti blocca solo la dimensione del layout principale e non dei singoli pannelli.

Invece se vuoi bloccare i singoli pannelli adiacenti, devi bloccare i bordi:



Ma è sempre relativo alla tua immagine, in particolar modo quando si usa il modulo dello spin disc dove i settaggi sono personalizzati per la tua skin.

Ultima modifica di ApacheReal : 02-03-2024 alle 04:19.
ApacheReal è offline   Rispondi citando il messaggio o parte di esso
Old 02-03-2024, 11:35   #6239
quan33
Junior Member
 
Iscritto dal: Dec 2023
Messaggi: 8
Quote:
Originariamente inviato da ApacheReal Guarda i messaggi
Non ci fai nulla con questo settaggio, perchè ti blocca solo la dimensione del layout principale e non dei singoli pannelli.

Invece se vuoi bloccare i singoli pannelli adiacenti, devi bloccare i bordi:



Ma è sempre relativo alla tua immagine, in particolar modo quando si usa il modulo dello spin disc dove i settaggi sono personalizzati per la tua skin.
Thank you!
quan33 è offline   Rispondi citando il messaggio o parte di esso
Old 02-03-2024, 11:37   #6240
quan33
Junior Member
 
Iscritto dal: Dec 2023
Messaggi: 8
Quote:
Originariamente inviato da jacobi91 Guarda i messaggi
Da qui la necessità di installare UI Hacks in modo che la finestra principale di foobar2000 mantenga sempre la stessa dimensione.



Thank you!
quan33 è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


HUAWEI Pura 70 Ultra: il cameraphone è di nuovo tra noi con un ma! Recensione  HUAWEI Pura 70 Ultra: il cameraphone è di...
Edge 50 Ultra: Motorola convince anche con il suo top di gamma! La recensione Edge 50 Ultra: Motorola convince anche con il su...
FlexiSpot E7B-PRO: una scrivania motorizzata per migliorare la postura FlexiSpot E7B-PRO: una scrivania motorizzata per...
Citroën ë-C3, la prova in anteprima: l'elettrica con caratteristiche e prezzo per tutti Citroën ë-C3, la prova in anteprima: l...
Intel Lunar Lake: le nuove CPU per i notebook del 2024 Intel Lunar Lake: le nuove CPU per i notebook de...
Notebook Snapdragon anche con Linux onbo...
SpaceX ha rilasciato nuove immagini e vi...
ASUS ROG Strix G16: un mostro di potenza...
Alla ricerca di un Hard Disk esterno aff...
roborock Q5 Pro+ a 259€: impossibile spe...
Kit con 2 satelliti Wi-Fi in offerta su ...
Sfida fra offerte: soundbar più subwoofe...
Samsung Galaxy Buds FE e Buds2 Pro in of...
L'impastatrice - robot KitchenAid da 4,3...
Alan Wake 2 arriverà in formato f...
Narwal Freo X Ultra: il nuovo robot per ...
Presentato ad aprile, è scontato ...
2 portatili ASUS Vivobook in offerta! 49...
TV Samsung 4K 55 pollici a prezzo TOP: e...
Samsung Galaxy Watch 4, 5 e 6 in offerta...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 22:46.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Served by www2v