Results 1 to 3 of 3

Thread: Ive created a random album selector!

  1. #1
    FLAC aoLhaTer's Avatar
    Join Date
    Mar 2003
    Location
    Rohnert Park, CA
    Posts
    1,122

    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

    Script: http://www.dwoloz.com/centrafuse-autoalbum.exe

    Source:
    Code:
    ;
    ; 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}" )
    Next
    
    ; 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}" )
    Next
    
    ; Click load to play album
    MouseClick( "left", 410, 490, 1, 0 )
    
    
    
    ; Finished!
    If you want to recompile this is the program, AutoIt http://www.autoitscript.com/autoit3/


    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.

  2. #2
    Raw Wave justintime's Avatar
    Join Date
    Apr 2005
    Posts
    2,695
    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. #3
    FLAC aoLhaTer's Avatar
    Join Date
    Mar 2003
    Location
    Rohnert Park, CA
    Posts
    1,122
    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

Similar Threads

  1. Album art downloader
    By hijinks21 in forum Software & Software Development
    Replies: 105
    Last Post: 07-20-2006, 09:56 AM
  2. Browsing by Album, Artist, Genres
    By F350 in forum Road Runner
    Replies: 19
    Last Post: 12-09-2005, 08:45 AM
  3. FRODO doesn't remeber Album Art
    By heiniheini in forum FrodoPlayer
    Replies: 7
    Last Post: 05-25-2005, 02:28 AM
  4. Random...Little too Random
    By Prindle19 in forum Centrafuse
    Replies: 1
    Last Post: 01-17-2005, 05:30 PM
  5. Replies: 0
    Last Post: 11-06-2004, 11:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •