Author Topic: About of jukebox pointer coding request  (Read 4352 times)

kent79

  • Hero Member
  • *****
  • Posts: 856
    • View Profile
About of jukebox pointer coding request
« on: April 12, 2021, 05:14:13 AM »
Hello,

I have some idea of theme, in normal, when pressing up / down, the pointer will be moved to presoius / next music. Then snap video will change accroding pointer.

My idea is,

1. the video is playing randomly
2. When I pressing up / down to select music, the video don't follow the changing in this moment
3. When I confirm the selection, press select button to confirm, the video will change now

Please teach me if you know the coding. Thanks.
« Last Edit: April 12, 2021, 05:45:23 AM by kent79 »

kent79

  • Hero Member
  • *****
  • Posts: 856
    • View Profile
Re: About of jukebox pointer coding request
« Reply #1 on: April 13, 2021, 12:31:48 AM »
I try to make a sample with Shuffle module by keilmillerjr.

I want to wheel image (B) change following by pointer change only, snap video (A) remain playing orginial before press select button to confirm. Please help me if you know how to modify the code. Thanks.

Code: [Select]
class UserConfig {

}


fe.load_module("animate");
fe.load_module("shuffle");

local flw = fe.layout.width;
local flh = fe.layout.height;

fe.layout.width = 1920;
fe.layout.height = 1080;


local snap = fe.add_artwork( "snap", -240, 0, 1920, 1080 );
snap.preserve_aspect_ratio = true;

local wheel = fe.add_artwork( "wheel", 1500, 600, 400, 400 );
wheel.preserve_aspect_ratio = true;

local config = {};
config.list <- {
x = flw*1.1,
w = flw*0.305,
h = flh*0.120,
};


local list = [];
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.080, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.145, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.210, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.275, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.340, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.405, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.470, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.535, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.600, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.665, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.730, config.list.w, config.list.h));
list.push(fe.add_text("[ListEntry]. [Title]", config.list.x, flh*0.795, config.list.w, config.list.h));

class ShuffleList extends Shuffle {
function _refreshSelected(slot) {
slot.font="BebasNeue Regular.ttf";
slot.align = Align.Left;
slot.charsize = 36;
slot.set_rgb ( 254, 232, 53 );
}

function _refreshDeselected(slot) {
slot.font="BebasNeue Regular.ttf";
slot.align = Align.Left;
slot.charsize = 36;
slot.set_rgb (119, 183, 34);
}
}
local list = ShuffleList({slots=list, reset=false});


function on_signal( sig )
{
switch ( sig )
{
case "up":
fe.signal( "prev_game" );
return true;

case "down":
fe.signal( "next_game" );
return true;

case "select":

break;

default:
break;
}

return false;
}

fe.add_signal_handler( this, "on_signal" );
« Last Edit: April 13, 2021, 01:15:21 AM by kent79 »

kent79

  • Hero Member
  • *****
  • Posts: 856
    • View Profile
Re: About of jukebox pointer coding request
« Reply #2 on: April 13, 2021, 07:52:58 AM »
I having some some idea to fix it. But don't know the actual code.

I need to create a new array to store the video artwork and then make this oBject to random loop playing.

Then, it should be ignore the input singal. Please teach me if anyone how to write a code. thanks.