Jump to content
LaunchBox Community Forums

Recommended Posts

Posted

The only downside is Jason would have to come up with a way to change the startup delay to match what is required for the randomly selected video to try and prevent looping, that will be a fun chore.

Posted

I could very well be simplifying this a ton but the app needs to look for a file saved in a specific location.  I would envision something like this...

1) have a folder for start up videos

2) have an option in the app to specify the number of videos in that folder

3) have the videos labeled 1-x

4) use a math random type function to pick a number from 1-x

5) use that number to select the file

I don't see how that would cause any performance issues 

 

Posted
30 minutes ago, andy_d said:

4) use a math random type function to pick a number from 1-x

rand() % noOfVids;

But yeah that feature would sound awesome :D

Posted

Yeah getting it to work would probably be that easy but how to deal with different length videos and how to logically control that aspect wouldn't be as easy.

Posted (edited)
5 minutes ago, DOS76 said:

Yeah getting it to work would probably be that easy but how to deal with different length videos and how to logically control that aspect wouldn't be as easy.

Well windows knows the length of the video so it must be stored somewhere in the file.

Edited by Zaazu
  • Like 1
Posted (edited)

I guess I don't understand what you mean by length?  Why does that matter?  If it's a video shared on here, shouldnt that work well?

I mean if all the videos are the right length, then I'd imagine it's ok

Edited by andy_d
Posted
7 hours ago, Zaazu said:

As in, the length of the video in seconds is stored in the file somewhere.

Oh that i understand - i mean what does length have to do with picking random videos?  I could be missing something : ) but I was thinking more of just the videos that are shared here which should be good.

Posted
6 minutes ago, neil9000 said:

Because if a video is too long it will get cut short, or if it is short it will repeat while big box is loading.

Ah ok but I'd imagine that those that are willing to make things for us will consider what the requirements are.

Posted

Sure if there was a understanding that all start up videos had to be the same length than that would work. Currently though they are all different, so as I said some would repeat, others would get cut short. I as well as others I'm sure have the delay set just right for the video we are using, a different length video would mess with that.

Posted (edited)

Here is the code, make a blank text file.

Set the first folder to where your startup videos are located

Set the second folder to the location of your working startup video

Replace the final line with the exe of your big box install.

Rename text file to .bat and use that to start Big Box.

 

**edit** Just got home so I could actually write this against my install. Made some tweaks. This works like a charm.

@echo off
REM Location of your startup vid collection
set folder=C:\Users\Lancer\LaunchBox\Videos\Startup_Vids
REM Location of your current working startup vid
set destfolder=C:\Users\Lancer\LaunchBox\Videos

REM Get count of the number of .mp4 files in folder above then get random number then divide
REM it by the count and take remainder.  No. is 0 to count -1
for /f "delims=" %%C in ('dir /b /a-d "%folder%\*.mp4" ^| find /c /v ""') do set /A num=%random% %% %%C

for /f "delims=" %%F in ('dir /b /a-d "%folder%\*.mp4" ^| more +%num%') do set name=%%F & goto next

:next

REM echo startup is now %name%
copy "%folder%\%name%" "%destfolder%\startup.mp4"


REM Replace this with your Big Box exe
start "" "C:\Users\Lancer\LaunchBox\BigBox.exe"

 

If you want to get really fancy and don't want to lose the pretty BigBox icon, you can create a shortcut to the bigbox exe, then re-point the shortcut to the batch file. 

Edited by Lancer-am
  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...