home *** CD-ROM | disk | FTP | other *** search
/ Computer Music Interactif 7 / cd.iso / pc / PC / Demos / GroovMak / data1.cab / Program_Executable_Files / Media / MenuSong.dxr / 00119.ls < prev    next >
Encoding:
Text File  |  1999-09-17  |  3.3 KB  |  101 lines

  1. on mouseEnter
  2.   if the visible of window "HelpM" then
  3.     tell window "HelpM"
  4.       go("menuSong4")
  5.     end tell
  6.   end if
  7. end
  8.  
  9. on mouseLeave
  10.   if the visible of window "HelpM" then
  11.     tell window "HelpM"
  12.       go("start")
  13.     end tell
  14.   end if
  15. end
  16.  
  17. on mouseDown
  18.   global gClick, gSong
  19.   if not (the visible of window "HelpM") then
  20.     if (gClick = "cd") and (gSong <> EMPTY) then
  21.       repeat while the mouseDown
  22.         set the memberNum of sprite 18 to the number of member "Htransfer"
  23.         updateStage()
  24.       end repeat
  25.     end if
  26.   end if
  27. end
  28.  
  29. on mouseUp
  30.   global gClick, gSong, gSize, gPath, gCD, gBlue, gVers
  31.   if not (the visible of window "HelpM") then
  32.     if (gClick = "cd") and (gSong <> EMPTY) then
  33.       set the memberNum of sprite 18 to the number of member "transferCd"
  34.       updateStage()
  35.       cursor(4)
  36.       if DirectoryExists(gPath & "Song\" & gSong) = 0 then
  37.         openWin("Message")
  38.         tell window "Message"
  39.           go("3")
  40.         end tell
  41.       else
  42.         if IKGetFreeDiskSpace(chars(gPath, 1, offset("\", gPath))) < (gSize + 10000) then
  43.           openWin("Message")
  44.           tell window "Message"
  45.             go("4")
  46.           end tell
  47.         else
  48.           stop(member "preview")
  49.           set the visible of sprite 48 to 1
  50.           CreateDirectory(gPath & "Song\" & gSong)
  51.           case gVers of
  52.             "1.2":
  53.               set path to gCD & "Library\Song\" & gSong & "\"
  54.             "1.1":
  55.               set path to gCD & "Library\Song\Song44\" & gSong & "\"
  56.           end case
  57.           set fileList to DirectoryToList(path)
  58.           set numFile to count(fileList)
  59.           repeat with i = 1 to count(fileList)
  60.             set nameFile to getAt(fileList, i)
  61.             CopyFile(path & nameFile, gPath & "Song\" & gSong & "\" & nameFile)
  62.             set bar to "bar" & integer(38 * (i - 1) / numFile)
  63.             set the memberNum of sprite 48 to the number of member bar
  64.             updateStage()
  65.           end repeat
  66.           set the visible of sprite 48 to 0
  67.           if gVers = "1.1" then
  68.             DeleteFile(gPath & "Song\" & gSong & "\info.gms")
  69.             set theFile to field gSong
  70.             set newFile to gPath & "Song\" & gSong & "\info.gms"
  71.             set temp to IKCryptCreate(newFile)
  72.             repeat with k = 1 to the number of lines in theFile
  73.               set stringa to line k of theFile
  74.               IKCryptPuts(temp, stringa)
  75.             end repeat
  76.             IKCryptClose(temp)
  77.           end if
  78.           set temp to []
  79.           repeat with i = 1 to the lineCount of member "fieldElencoSongHD"
  80.             append(temp, line i of field "fieldElencoSongHD")
  81.           end repeat
  82.           append(temp, gSong)
  83.           sort(temp)
  84.           put EMPTY into field "fieldElencoSongHD"
  85.           repeat with i = 1 to count(temp)
  86.             put getAt(temp, i) into line i of field "fieldElencoSongHD"
  87.             if getAt(temp, i) = gSong then
  88.               set the foreColor of line i of field "fieldElencoSongHD" to gBlue
  89.               next repeat
  90.             end if
  91.             set the foreColor of line i of field "fieldElencoSongHD" to 0
  92.           end repeat
  93.           set the textFont of field "fieldElencoSongHD" to "IK10"
  94.           set the foreColor of member "fieldElencoSongCD" to 0
  95.         end if
  96.       end if
  97.       cursor(-1)
  98.     end if
  99.   end if
  100. end
  101.