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 / 00124.ls < prev    next >
Encoding:
Text File  |  1999-09-17  |  6.1 KB  |  146 lines

  1. on exitFrame
  2.   go(the frame)
  3. end
  4.  
  5. on enterFrame
  6.   global gYes, gSong, gPath, gYesQuit, gNet, gClickNet, gNetDati, gClickDati, gLine, checkStream, gSource, netLibraryList, gNetLibrary
  7.   if the visible of window "HelpM" then
  8.     moveHelp()
  9.   else
  10.     set the volume of member "preview" to 255 * integer(field "fieldMasterVol") / 128
  11.     if gYes then
  12.       set gYes to 0
  13.       stop(member "preview")
  14.       set tList to DirectoryToList(gPath & "Song\" & gSong & "\")
  15.       repeat with i = 1 to count(tList)
  16.         set file to getAt(tList, i)
  17.         IKChangeAttrib(gPath & "Song\" & gSong & "\" & file)
  18.         DeleteFile(gPath & "Song\" & gSong & "\" & file)
  19.       end repeat
  20.       DeleteDirectory(gPath & "Song\" & gSong)
  21.       repeat with i = 1 to the lineCount of member "fieldElencoSongHD"
  22.         if line i of field "fieldElencoSongHD" = gSong then
  23.           delete line i of field "fieldElencoSongHD"
  24.           exit repeat
  25.         end if
  26.       end repeat
  27.       put EMPTY into field "fieldDescription"
  28.       put EMPTY into field "fieldBpm"
  29.       sound stop 1
  30.     end if
  31.     if gYesQuit then
  32.       IKSynthStop()
  33.       IKStop()
  34.       closeXLib("Xtras\IKTrack.X32")
  35.       closeXLib("Xtras\Fileio.X32")
  36.       closeXLib("Xtras\FileUtil.X32")
  37.       put EMPTY into field "fieldMasterVol"
  38.       put EMPTY into field "fieldBpm"
  39.       put EMPTY into field "fieldDescription"
  40.       go("exit")
  41.     end if
  42.     if gClickNet then
  43.       set the visible of sprite 53 to 1
  44.       if netTextResult(gNet) <> EMPTY then
  45.         set the visible of sprite 53 to 0
  46.         set gClickNet to 0
  47.         put EMPTY into field "fieldElencoSongNET"
  48.         set netLibraryList to []
  49.         repeat with i = 1 to the number of lines in netTextResult(gNet)
  50.           set temp to line i of netTextResult(gNet)
  51.           append(netLibraryList, word 1 of temp)
  52.           delete word 1 of temp
  53.           put temp & RETURN after field "fieldElencoSongNET"
  54.         end repeat
  55.         delete char -30003 of field "fieldElencoSongNET"
  56.         set the textFont of member "fieldElencoSongNET" to "IK10"
  57.         set the foreColor of member "fieldElencoSongNET" to 0
  58.         set the textSize of member "fieldElencoSongNET" to 13
  59.         set the scrollTop of member "fieldElencoSongNET" to 0
  60.       end if
  61.     end if
  62.     if gClickDati then
  63.       set the visible of sprite 53 to 1
  64.       if netTextResult(gNetDati) <> EMPTY then
  65.         set gClickDati to 0
  66.         set dati to netTextResult(gNetDati)
  67.         netAbort()
  68.         repeat with i = 1 to the number of lines in dati
  69.           set linea to line i of dati
  70.           case word 1 of linea of
  71.             "SONGLIBRARY:":
  72.               delete word 1 of linea
  73.               put linea into field "fieldLibrary"
  74.               set the textFont of member "fieldLibrary" to "Arial"
  75.               set the textSize of member "fieldLibrary" to 10
  76.               set the foreColor of member "fieldLibrary" to 0
  77.             "SONGTITLE:":
  78.               delete word 1 of linea
  79.               put linea into field "fieldTitle"
  80.               set the textFont of member "fieldTitle" to "Arial"
  81.               set the textSize of member "fieldTitle" to 10
  82.               set the foreColor of member "fieldTitle" to 0
  83.             "SONGDESCRIPTION:":
  84.               delete word 1 of linea
  85.               put linea into field "fieldDescription"
  86.               set the textFont of member "fieldDescription" to "Arial"
  87.               set the textSize of member "fieldDescription" to 10
  88.               set the foreColor of member "fieldDescription" to 0
  89.             "SONGBPM:":
  90.               delete word 1 of linea
  91.               put linea into field "fieldBpm"
  92.               set the textFont of member "fieldBpm" to "Arial"
  93.               set the textSize of member "fieldBpm" to 10
  94.               set the foreColor of member "fieldBpm" to 0
  95.             "COPYRIGHT:":
  96.               delete word 1 of linea
  97.               put linea into field "fieldCopy"
  98.               set the textFont of member "fieldCopy" to "Arial"
  99.               set the textSize of member "fieldCopy" to 10
  100.               set the foreColor of member "fieldCopy" to 0
  101.             "LICENSE:":
  102.               delete word 1 of linea
  103.               put linea into field "fieldLic"
  104.               set the textFont of member "fieldLic" to "Arial"
  105.               set the textSize of member "fieldLic" to 10
  106.               set the foreColor of member "fieldLic" to 0
  107.           end case
  108.         end repeat
  109.         set pos to gLine
  110.         set the fileName of member "library" to the moviePath & "library.gif"
  111.         set source to "http://www.groovemaker.com/songpreview/" & getAt(netLibraryList, pos) & ".gif"
  112.         if FileExists(gPath & "Media\" & getAt(netLibraryList, pos) & ".gif") <> 0 then
  113.           downloadNetThing(source, gPath & "Media\" & getAt(netLibraryList, pos) & ".gif")
  114.           set gSource to gPath & "Media\" & getAt(netLibraryList, pos)
  115.           set checkStream to 1
  116.         else
  117.           set the fileName of member "library" to gPath & "Media\" & getAt(netLibraryList, pos) & ".gif"
  118.           set the memberNum of sprite 51 to the number of member "library"
  119.           set the visible of sprite 50 to 1
  120.           set the visible of sprite 51 to 1
  121.           updateStage()
  122.           if FileExists(gPath & "Media\" & getAt(netLibraryList, pos) & ".swa") = 0 then
  123.             set the visible of sprite 53 to 0
  124.           end if
  125.         end if
  126.         set source to "http://www.groovemaker.com/songpreview/" & getAt(netLibraryList, pos) & ".swa"
  127.         if FileExists(gPath & "Media\" & getAt(netLibraryList, pos) & ".swa") <> 0 then
  128.           downloadNetThing(source, gPath & "Media\" & getAt(netLibraryList, pos) & ".swa")
  129.           set gSource to gPath & "Media\" & getAt(netLibraryList, pos)
  130.           set checkStream to 1
  131.         else
  132.           set the url of member "preview" to gPath & "Media\" & getAt(netLibraryList, pos) & ".swa"
  133.           play frame member "preview"
  134.           if FileExists(gPath & "Media\" & getAt(netLibraryList, pos) & ".gif") = 0 then
  135.             set the visible of sprite 53 to 0
  136.           end if
  137.           play frame member "preview"
  138.         end if
  139.       end if
  140.     end if
  141.   end if
  142.   if checkStream then
  143.     checkSwa()
  144.   end if
  145. end
  146.