Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attract mode (Cycle through user collection) #37

Closed
checkist84 opened this issue Apr 21, 2014 · 4 comments
Closed

Attract mode (Cycle through user collection) #37

checkist84 opened this issue Apr 21, 2014 · 4 comments

Comments

@checkist84
Copy link

Appreciate your great work!

I suggest that adding 'attract mode' feature to the program, that is,

  1. Randomly pick a game
  2. Play the corresponding video, if any. Then return to 1, if the playback is finished
  3. If there are no corresponding video, wait for N seconds (this may be adjusted through option), then return to 1.

So basically, it is the 'attract mode' for the 'attract-mode' frontend :)

Possible options would be :
(1) Start / End random-cycling : In the control key setup
(2) Display time for non-videos(sec) :
(3) Jump to next game if video ends : Yes/No
If No, then use (2) (jump to next game, regardless of video status)
(4) Jump to another list : Yes/No
(5) Jump to another filter : Yes/No

Again, thanks for your effort! This is one of the best software I have used so far.

@nblondiau
Copy link

Are you aware that Attract-Mode already has a screensaver feature? :-)

From Layouts and Plug-ins Reference:

The Attract-Mode screen saver is really just a special case layout that is loaded after a user-configured period of inactivity. The screen saver script is located in the "screensaver.nut" file stored in the "layouts" subdirectory.

The default screensaver.nut supports movies.

@checkist84
Copy link
Author

Great! I didn't know about configurable screensavers. Thanks for the information.

The screensaver function seems to serve almost everything I needed.
Yet, still it would be nice to have functionalities that:
(1) A key that manually starts screensaver mode (which can be adjusted in control key setup)
(2) A method to know whether the movie has finished playback. (or the method of getting the length of movie file in .nut script)

Anyway, a fully configurable screensaver! This program never cease to impress me. Guess I'll enjoy several weekends of tweaking it :-)

@checkist84
Copy link
Author

Well, it turned out that screensaver mechanism itself was slightly different than what I expected....
However, the default screensaver.nut gave useful insights, which solved most of the needed functionalities...


fe.add_ticks_callback( "saver_tick" );

local user_interval = 60;
// similar to screensaver timer, resets to this value if user selects something

local saver_interval = 30;
// displays this amount of time, then switch to next game

preview_counter.msg = count;
// preview_counter is just a text, used for on-screen timer

local previous_select = fe.list.index;
local count = 0;
local last_time = 0;
function saver_tick( stime )
{
// 'User' selected something, reset the counter to screensaver value.
if ( previous_select != fe.list.index) {
last_time = stime;
count = user_interval;
previous_select = fe.list.index;
return;
}
// Update on-screen timer every 1 seconds
if ( stime - last_time > 1000) {
count--;
preview_counter.msg = count;
last_time = stime;
}
// If timer expired, change to next random game
if ( count <= 0 ) {
fe.list.index = rand();
previous_select = fe.list.index;
count = saver_interval;
preview_counter.msg = count;
}
}


Having a pair of .nut files with/without this screensaver-like function, and switching between them by using 'Toggle Layout' key, it removed the need for separate screen saver controlling key.

It would be still nice to have :
(1) Movie length information
: -1, if there are no movies for this game?
(2) Set current filter/file (currently, only 'get' is supported)
: allows to use something like 'fe.list.filter = rand()' ?

mickelson added a commit that referenced this issue Apr 25, 2014
- Issue #4 - added surface objects for layouts.  Surfaces are
offscreen textures that other images, artworks, texts and surfaces
can be drawn on.  The surface itself is treated like any other image
and can have skew, pinch and shader effects applied.

- Issue #35 - removed the concept of a special "movie artwork".  Any
artwork or static image can now contain images or videos.  Videos are
given preference over images.

- Issue #37 - Added "video_flags" and "video_playing" properties to the
Image class for layout scripts.  Layouts can now test if a video is
playing, start or stop a video, and can set whether a video automatically
starts, loops, or plays its audio track.

- Multiple paths can now be specified for each artwork.  The paths are
checked in order for each rule (i.e. path#1 for romname, path#2 for
romname, path#1 for cloneof, path#2...)

- If an artwork path contains a subdirectory that matches a rule, then a
random video or image from that subdirectory is loaded (i.e. if path#1
contains a "pacman" subdirectory (but no pacman image or video), then a
random video or image from the subdirectory will be chosen if available.
Videos get preference.

- Fixed a bug that prevented image flipping from working when image/video
is scaled

- Added set_pos( x, y) and set_pos( x, y, w, h ) functions to the Image,
Text and ListBox classes used in layouts.
@mickelson
Copy link
Owner

Hi, good timing on this request as I was just in the process of reworking how video works. I have added a 'video_playing' property to allow layouts to check if a video is playing and to start or stop it if it is. I'll also add a mappable command to launch the screen saver... thanks for the suggestions

mickelson added a commit that referenced this issue May 12, 2014
- Added "Add/Remove Tags" command for adding custom tag(s) to a game
- Lists can be filtered based using the custom tags
- Issue #37 - Added "Screen Saver" command to launch the screen saver
- Added border to all "Overlay" graphics (Filter Menu, List Menu, etc)
- Added title to Filter Menu, List Menu
mickelson added a commit that referenced this issue May 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants