Jump to content

Read CD Help


keen
 Share

Recommended Posts

How can i get autoit to read a CD (Music) and be able to play it?

EDIT:

I got it to find the drive but how can i make it not always say that there is no CD.

Script:

#include <GUIConstants.au3>

GUICreate("Amp Music", 954, 762, 166, 120)
GUISetBkColor (0xffffff)
$Pic1 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\BG.gif", 8, 40, 937, 697, BitOR($SS_NOTIFY,$WS_GROUP))
$Pic2 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\Knobs.gif", 184, 70, 81, 81, BitOR($SS_NOTIFY,$WS_GROUP))
$Pic3 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\Volume.gif", 184, 157, 81, 25, BitOR($SS_NOTIFY,$WS_GROUP))
$Pic4 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\input.gif", 26, 82, 59, 59, BitOR($SS_NOTIFY,$WS_GROUP))
$fileread = FileRead ("E:")
If $fileread <> "" Then 
$Pic5 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\No-CD.gif", 16, 144, 80, 68, BitOR($SS_NOTIFY,$WS_GROUP))
Else
$Pic6 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\CD.gif", 16, 144, 80, 68, BitOR($SS_NOTIFY,$WS_GROUP))
EndIf
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        
        Case $Pic3

        
        Case $Pic1

        
        Case $Pic2
    EndSwitch
WEnd
Edited by keen

[center]Kesne's Bar & Grill[/center]

Link to comment
Share on other sites

Fixed up the script. I need it to be able to read the songs off of the CD and put them in the list and i need the CD and no cd thing to actuily work.

Updated Script:

#include <GUIConstants.au3>
#include <Xskin.au3>

$skin_folder = @ScriptDir & "\images\skin"
XskinGUICreate("Amp Music", 1085,800, $skin_folder)

GUISetBkColor (0xffffff)
$Pic1 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\BG.gif", 73, 50, 937, 697, BitOR($SS_NOTIFY,$WS_GROUP))
$Pic2 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\Knobs.gif", 249, 80, 81, 81, BitOR($SS_NOTIFY,$WS_GROUP))
$Pic3 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\Volume.gif", 249, 167, 81, 25, BitOR($SS_NOTIFY,$WS_GROUP))
$Pic4 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\input.gif", 91, 92, 59, 59, BitOR($SS_NOTIFY,$WS_GROUP))
$Pic4 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\songs.gif", 450, 290, 70, 38, BitOR($SS_NOTIFY,$WS_GROUP))
$fileread = FileRead ("E:")
If $fileread <> "" Then 
$Pic5 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\No-CD.gif", 81, 154, 80, 68, BitOR($SS_NOTIFY,$WS_GROUP))
Else
$Pic6 = GUICtrlCreatePic("S:\My Documents\JORDANS STUFF\Amp Music\images\CD.gif", 81, 154, 80, 68, BitOR($SS_NOTIFY,$WS_GROUP))
EndIf
GUICtrlCreateList( $fileread , 550, 220,100,200)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        
        Case $Pic3

        
        Case $Pic1

        
        Case $Pic2
    EndSwitch
WEnd

[center]Kesne's Bar & Grill[/center]

Link to comment
Share on other sites

maybe...

#include <GuiConstants.au3>
#Include <File.au3>

GUICreate("my gui")
$fileread = ""
$list = GUICtrlCreateList( $fileread , 50, 20,250,200)
GUISetState()

$FileList=_FileListToArray(@DesktopDir)
If @Error=1 Then
    MsgBox (0,"","No Files\Folders Found.")
    Exit
EndIf

for $x = 1 to UBound($FileList) - 1
    GUICtrlSetData( $list, $FileList[$x], 1)
Next

Sleep(5000)

8)

NEWHeader1.png

Link to comment
Share on other sites

uhmmm....

no

..... try yourself

8)

aaaaaaaahhh. Why not?

While you're at it , how about finishing PX4 for me. :P

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...