Announcement

Collapse
No announcement yet.

Auto CD / DVD Insert with definable actions

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Auto CD / DVD Insert with definable actions

    Note: his has turned into a beta, as the script evolves to add more functionality and features from this thread. If you use this, pop in now and then to get the latest version.

    Basically this is a stand alone exe file, that you can start when Road Runner is launched. It will monitor your CD/DVD Drive in the background. If you put in an Audio CD, one action is taken, and another if a DVD is inserted.

    The actions taken are set up in the .ini file. You can use any Road Runner command. If you put a CD in, you can have it go to the CDRip screen if you wish.

    With the default ini settings, when a Audio CD is inserted, it will load the songs from the CD to a playlist, and then go to the audio screen, and automatically begin playing. The same goes for the DVD.

    When the disk is removed, it will continue to watch for another disk to be inserted.

    If a CD/DVD is in the drive when Road Runner is loaded, it will just ignore it. If you leave an disk in the drive, I personally do not want it to start playing every single time Road Runner is started

    YOU MUST change your CD/DVD drive letter in the ini initially to match the drive letter on your system.

    Just place the AutoLaunch.exe and the AutoLaunch.ini in any directory that you want, and have it either start with the computer, or when RR starts. It is very CPU friendly! It will use less than 1% of your CPU cycles while it is running in the system tray.

    CAUTION: If you start this with ONSKINSTART in the exectbl, the skin will load a second instance of the script with a RELOADSKIN command, so do try to avoid using this if you use an RELOADSKIN command in your skin to change background colors and the likes.

    09/13/07
    - I added code to save the playlist when a CD is inserted, and it will reload that playlist when the CD is ejected.

    09/14/07
    - It will now turn on and off 2 different indicators if a CD or DVD is in the drive. the indicator names are:
    "CUSTOM_DVDIN"
    "CUSTOM_CDIN"

    08/18/07
    - When a CD is now ejected, it will return the the song that was playing, and the position the song was at.
    - Delay timer set in the INI files to tweak it to slower, average, and faster CarPC's

    Download: AutoLaunch.zip
    Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

    My Fiero Build Thread

  • #2
    Thanks John,i was at my wits end with the other complicated methods,kudos to you both for the effort.
    P4 2.8 HT, 512Mb Ram, 60Gb 2.5 HD, M4-ATX, SB Audigy2, BU353, Lilliput TS,Soundgraph Imon VFD,SONY Optiarc dvd Burner,RideRunner, iGo8, Custom Freedom 2.1

    Comment


    • #3
      Sweet John! RR keeps getting better and better! I trust this will be made a part of your skin?
      cashtexts - Earn money for receiving text messaged offers
      cashtexts review not a scam
      Space Navigator - 6 Axis input device: Take it apart - Driver App
      RRCam - Video/webcam capture, text overlay, and recording: 2.0 Stable

      Comment


      • #4
        not that it would make much of a difference but i could create an official rr plugin that does this if interested. Good job john!
        mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
        Follow Me on Twitter or Facebook
        Live mp3Car Facebook Chat

        Comment


        • #5
          so would it be pos.

          to have this fired up from a button code, like in your player skin(john) the player button which has no real use at the moment, can i use that to .exe the program and it loads.

          also would it be pos. to use a button switch code to start the program and to unload the cd from the playlist and reinstate the origanal playlist with out ejecting the cd/dvd.
          Riderunner / Genesis
          Plugin Breaker in test BassRR Plugin Player, Wifiman_NET
          New Home for Genesis & BassRR :adding to site ,, Hellfyre night
          Bassrr Beta Release :Version 1.3.7
          Movie_info Release :Version 3.1.0
          Wifiman_NET:Version 1.0.0

          Every Future, Needs A Beginning

          Comment


          • #6
            Originally posted by carputer1 View Post
            to have this fired up from a button code, like in your player skin(john) the player button which has no real use at the moment, can i use that to .exe the program and it loads.

            also would it be pos. to use a button switch code to start the program and to unload the cd from the playlist and reinstate the origanal playlist with out ejecting the cd/dvd.
            Just having the program running on startup, or such would work, so it is always running seems better to me.

            As for the playlist thing, sure that's actually easy. I can just save the playlist to a temp location when the CD is inserted, and just reinstate it when the CD is removed.

            Funny thing is, the inh messaged me today, and he suggested the very same thing
            Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

            My Fiero Build Thread

            Comment


            • #7
              Plugin [Script] Updated

              Ok, I added the code to save the playlist when a CD is inserted, and it will reload that playlist when the CD is ejected.

              The .zip file in the first post contains the new script.

              Here is the source code, if someone would like to make improvements or enhancements to make it better.

              Sonic, using the below code, you can probably pretty easily create a "True RR plugin" with it. The logic was the hard part to know when and when not to start, load the playlist, not keep triggering the CD ejected routine every 1 second ect! I agree this would be a much cleaner way to have the script load, and unload with RR.

              I added some comments in the script, to easily see what section is doing what.

              Code:
              ; Written by JohnWPB of the MP3 Car Forums 9/12/07
              ; This script will monitor your CD/DVD drive
              ; Looking for a CD or DVD to be inserted and
              ; will then auto play it inside Road Runner.
              ; When a CD is inserted, it will save your current
              ; playlist to a temporary file. When the CD is then
              ; ejected, it will then reload that playlist.
              
              Dim $DiskInserted
              Dim $DiskType
              Dim $DriveStatus
              Dim $TypeDisk
              
              ;Open communications with RR
              $rr = ObjCreate("RoadRunner.SDK")
              
              ; Read the lines from the AutoLaunch.ini
              $MyDrive = IniRead("AutoLaunch.ini", "Auto Drive Settings", "CDDrive", "NotFound")
              $DVDCOMMAND = IniRead("AutoLaunch.ini", "Auto Drive Settings", "DVDCOMMAND", "NotFound")
              $CDCOMMAND = IniRead("AutoLaunch.ini", "Auto Drive Settings", "CDCOMMAND", "NotFound")
              $CDCOMMAND = "LoadList;" & $MyDrive & "||" & $CDCOMMAND
              
              While 1
                  $DiskType = DriveGetFileSystem($MyDrive)
              
                  If $DiskType = "UDF" And $DiskInserted = "no" Then
              ;MsgBox(4096, "Drive Status:", "A DVD Was inserted")
                      $rr.Execute($DVDCOMMAND)
                      $DiskInserted = "yes"
                  EndIf
              
                  If $DiskType = "CDFS" And $DiskInserted = "no" Then
              ;MsgBox(4096, "Drive Status:", "An Audio CD Was inserted")
                      $TypeDisk="CD"
                      $SavePLCommand = "SAVELIST;$SKINPATH$TempPL.M3u"
                      $rr.Execute($SavePLCommand)
              ; Pause for 2 seconds, give RR time to catch up and save the playlist to disk
                      sleep(2000)
                      $rr.Execute($CDCOMMAND)
                      
                      $DiskInserted = "yes"
                  EndIf
              
                  $DriveStatus = DriveStatus($MyDrive)
                  If $DriveStatus = "NOTREADY" Then        
                      If $TypeDisk="CD" then
              ;MsgBox(4096, "Drive Status:", "an Audio CD Was Ejected")
                          $LoadPLCommand = "LOADLIST;$SKINPATH$TempPL.M3u"
                          $rr.Execute($LoadPLCommand)
                          $TypeDisk = "None"
                      EndIf
                      $DiskInserted = "no"
                  EndIf
              Sleep(2000)
              WEnd
              Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

              My Fiero Build Thread

              Comment


              • #8
                i have not downloaded this yet, so im not sure if this is a feature request or just a quesiton:

                can i have it execute some RR command on inserting a blank cd/dvd?

                Comment


                • #9
                  john you really scare me, here is my script and is so similar, that i cut say something else, the only difference is that i use the cdplayer bat file from the cfx skin to save the playlist, and reload it back when the cd is ejected also mine is not running all the time(i dont use cd/dvd media that much).agree that sonic needs to make an official plug in.
                  Code:
                  Opt("WinTitleMatchMode", 3)
                  $cdrom = "Cdrom"
                  If WinExists($cdrom) Then Exit
                  AutoItWinSetTitle($cdrom)
                  $rr=ObjCreate("RoadRunner.sdk")
                  $rrpath=$rr.getinfo("RRPATH")
                  $rrdrive=$rr.getinfo("=$cddrive$")
                  $drive=IniRead($rrpath&'\cdrom.ini', 'SETTINGS', 'drive', $rrdrive)
                  if (DriveStatus($drive) == "READY") then
                  $type=DriveGetFileSystem($drive)
                  $cdin=IniRead($rrpath&'\cdrom.ini', 'SETTINGS', 'cdin','')
                  $dvdin=IniRead($rrpath&'\cdrom.ini', 'SETTINGS', 'dvdin','')
                  if $type="CDFS" then $rr.Execute($cdin)
                  if $type="UDF" then $rr.Execute($dvdin)
                  	CDTray($drive, 'open')
                  	Sleep(2000)
                  EndIf
                  While Not (DriveStatus($drive) == "READY")
                  Sleep(2000)
                  if (DriveStatus($drive) =="UNKNOWN") then
                  	$blankcd=IniRead($rrpath&'\cdrom.ini', 'SETTINGS', 'blankcd','"MENU;popup_success.skin||SETLABEL;!SUCCESS;!!COMMAND IS EMPTY!!||WAIT;3||CLOSE"')
                  	$rr.Execute($blankcd)
                  	ExitLoop
                  	EndIf
                  WEnd
                  $status=DriveStatus ($drive)
                  Sleep(1000)
                  if $status="READY" then
                  	    FileChangeDir ( $drive&"\" )
                  	    $search = FileFindFirstFile("*.*")
                  		If $search = -1 Then
                  			 $cdempty=IniRead($rrpath&'\cdrom.ini', 'SETTINGS', 'cdempty','"MENU;popup_success.skin||SETLABEL;!SUCCESS;!!COMMAND IS EMPTY!!||WAIT;3||CLOSE"')
                  		 $rr.Execute($cdempty)
                  	        Exit
                          EndIf
                           $file = FileFindNextFile($search)
                  		Sleep(1000)
                           $cd=FileExists($drive&"\*.cda")
                  	     $dvd=FileExists($drive&"\VIDEO_TS")
                      if $cd = 1 then
                  		 $cd=IniRead($rrpath&'\cdrom.ini', 'SETTINGS', 'cd','"MENU;popup_success.skin||SETLABEL;!SUCCESS;!!COMMAND IS EMPTY!!||WAIT;3||CLOSE"')
                  		 $rr.Execute($cd)
                  	ElseIf $dvd = 1 Then
                  		 $dvd=IniRead($rrpath&'\cdrom.ini', 'SETTINGS', 'dvd','""MENU;popup_success.skin||SETLABEL;!SUCCESS;!!DVD IN 0 COMMANDS!!||WAIT;3||CLOSE"')
                   		 $rr.Execute($dvd)
                  	Else
                  		 $other=IniRead($rrpath&'\cdrom.ini', 'SETTINGS', 'other','"MENU;popup_success.skin||SETLABEL;!SUCCESS;!!DATA DISK 0 COMMANDS!!||WAIT;3||CLOSE"')
                  		 $rr.Execute($other)
                      EndIf
                  FileClose($search)
                  		 Else
                  		 $cdempty=IniRead($rrpath&'\cdrom.ini', 'SETTINGS', 'cdempty','')
                  		 $rr.Execute($cdempty)
                  EndIf
                  BASSRR ==> [Audio Player/MusicDB/Cd Player/Ripper/Rate/Internet Radio/Audio Capture/Youtube Video]
                  RRTube ==> [View/Download Youtube Videos]
                  WifiMan ==> [Wifi Manager]
                  RRec ==> [Audio Capture]

                  If You Want To Be Given Everything, Give Everything Up ...
                  Bird York -- In The Deep --

                  Comment


                  • #10
                    Originally posted by tundra2000 View Post
                    i have not downloaded this yet, so im not sure if this is a feature request or just a quesiton:

                    can i have it execute some RR command on inserting a blank cd/dvd?
                    Hmmm right now if a blank CD/DVD is inserted it won't do anything... I will need to find a way to detect that to make it work.

                    Originally posted by EL CAMINO View Post
                    john you really scare me, here is my script and is so similar, that i cut say something else, the only difference is that i use the cdplayer bat file from the cfx skin to save the playlist, and reload it back when the cd is ejected also mine is not running all the time(i dont use cd/dvd media that much).agree that sonic needs to make an official plug in.
                    Wow! that is close! hahaahhh! Wish I would have know that before I spent the time to write it heheeh.
                    Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

                    My Fiero Build Thread

                    Comment


                    • #11
                      mine has the blank media option. feel free to use the code. and improve it.
                      BASSRR ==> [Audio Player/MusicDB/Cd Player/Ripper/Rate/Internet Radio/Audio Capture/Youtube Video]
                      RRTube ==> [View/Download Youtube Videos]
                      WifiMan ==> [Wifi Manager]
                      RRec ==> [Audio Capture]

                      If You Want To Be Given Everything, Give Everything Up ...
                      Bird York -- In The Deep --

                      Comment


                      • #12
                        Originally posted by JohnWPB View Post
                        Hmmm right now if a blank CD/DVD is inserted it won't do anything... I will need to find a way to detect that to make it work.



                        Wow! that is close! hahaahhh! Wish I would have know that before I spent the time to write it heheeh.
                        Sonic's K.I.S.S method (keep it simple stupid!) would be to check the free space in the main directory.. if its 750 its a blank cd.. if its 4.7 its a blank dvd.
                        mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
                        Follow Me on Twitter or Facebook
                        Live mp3Car Facebook Chat

                        Comment


                        • #13
                          set off indicators?

                          Hi,

                          I haven't used the program yet, but I was wondering if you make it so that when you insert a cd, dvd or blank disk, it will set off an indicator in RR telling me that a disk is in the drive. If you can do that or at least point me in the right direction it will be much appreciated.

                          Comment


                          • #14
                            Popped in a blank CD and it shows 702MB free.... I'm sure you like more suggestions How about if it detects .mp4 or .mpg and opens the video player, or if it detects .mp3 or other music file and plays them--regardless of CD/DVD. This goes past CDFS and UDF detection though.
                            CarPC in my 82 Camaro. Dual core atom, M4-ATX, 7 lilliput, bu353 GPS, Reborn skin, punch 40/100ix
                            MediaLaunch for RR
                            Online Check for RR
                            Locker for RR

                            Comment


                            • #15
                              Originally posted by 2poor4mods View Post
                              Hi,

                              I haven't used the program yet, but I was wondering if you make it so that when you insert a cd, dvd or blank disk, it will set off an indicator in RR telling me that a disk is in the drive. If you can do that or at least point me in the right direction it will be much appreciated.
                              if you want to use john's script do this,
                              in the ini add this code

                              Code:
                              CDCOMMAND=AUDIO||SETIND;CUSTOM_CDIN;ON
                              DVDCOMMAND=DVD||SETIND;CUSTOM_DVDIN;ON
                              and in the button that you use for eject, add this.

                              Code:
                              "SETIND;CUSTOM_CDIN;OFF||SETIND;CUSTOM_DVDIN;OFF"
                              the indicators in you skin shut be

                              Code:
                              "CUSTOM_CDIN"
                              and
                              Code:
                              "CUSTOM_DVDIN"
                              this will work if you use RoadRunner to eject. if not the indicators will not change states, unless the code is rewritten for that which is not to hard.

                              NOTE: YOU CAN USE A SINGLE LABEL FOR THIS. IF YOU WANT I LET YOU KNOW HOW.
                              BASSRR ==> [Audio Player/MusicDB/Cd Player/Ripper/Rate/Internet Radio/Audio Capture/Youtube Video]
                              RRTube ==> [View/Download Youtube Videos]
                              WifiMan ==> [Wifi Manager]
                              RRec ==> [Audio Capture]

                              If You Want To Be Given Everything, Give Everything Up ...
                              Bird York -- In The Deep --

                              Comment

                              Working...
                              X