No announcement yet.

Ive created a random album selector!

  • Filter
  • Time
  • Show
Clear All
new posts

  • Ive created a random album selector!

    For as long as Ive had a car computer Ive wanted some sort of a random album selector so I didnt have to clumbsily attempt to select a new album and artist while driving if my music ran out

    It never ocurred to me before but I finally figured out I could use an automation program called AutoIt. AutoIt makes it happen but with a few complications (see end of post)

    This script when run with Centrafuse open in 800x600 will select and load a random album from your media library


    ; AutoIt Version: 3.0
    ; Language:       English
    ; Platform:       Win9x/NT
    ; Author:         aoLhaTer
    ; Script Function:
    ;   Automatically select and load an album in Centrafuse - 800x600
    ; Click on the media button
    MouseClick( "left", 53, 133, 1, 0 )
    ; Click on the media list button
    MouseClick( "left", 750, 238, 1, 0 )
    ; Click on the Library button to make sure we're at the root
    MouseClick( "left", 104, 108, 1, 0 )
    ; Hit enter to proceed to artists
    Send( "{ENTER}" )
    ; Create a random integer, 122(+1) is the max artists
    $X = Random ( 0, 122, 1 )
    ; Go down the list X times
    For $I = 0 To $X
    	Send( "{DOWN}" )
    ; Hit enter to proceed to random artist
    Send( "{ENTER}" )
    ; Create a new random integer, 2(+1) is the max albums
    $X = Random ( 0, 2, 1 )
    ; Go through the albums X times
    For $I = 0 To $X
    	Send( "{DOWN}" )
    ; Click load to play album
    MouseClick( "left", 410, 490, 1, 0 )
    ; Finished!
    If you want to recompile this is the program, AutoIt

    Ive tested this on my desktop computer and it seems to run great. Have yet to test it in the car

    Now, there are some complications I ran into. The script is completely unaware of how many artists there are in your database and its also unaware of how many albums each artist has. Therefore when the script does its random number generator you have to set the maximum numbers yourself. In the compiled EXE you see above Ive used a maximum of 123 artists and a maximum of 3 albums. The artist randomization will work fine....except when you add new artists. The album randomization will work but it will skip any albums if an artist has more than 3 and it will also give more weight to the 2nd album if the artist only has 2.
    If anyone can figure out a solution to this please share. Only solution in my estimation is to get the library data from Centrafuse's dat file and know exact numbers from there.
    2004 G35 Coupe project

  • #2
    Clever, but how the hell are you managing to RUN this script from within CentraFuse interface?!

    I've asked David to allow for buttons to be associated with programs WITHOUT EMBEDDING, but this is not currently possible. Can you please explain how you envision running this script from within CF?
    2002 Honda CR-V
    Carputer progress: 90% [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -]
    Spent so far: $1105.90

    Download the NEXUS Skin for Centrafuse
    ...or even Listen to my music


    • #3
      That is yet another problem
      David has said that in future versions (which Im assuming to be 1.5) we will be able to launch applications without specifying a window

      Im going to be using AltTabber right now to launch the application and then hopefully when 1.6 comes I can launch it as a button in CF
      2004 G35 Coupe project