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

  1. on mouseEnter
  2.   if the visible of window "Help" then
  3.     tell window "help"
  4.       go("seq10")
  5.     end tell
  6.   end if
  7. end
  8.  
  9. on mouseLeave
  10.   if the visible of window "Help" then
  11.     tell window "help"
  12.       go("start")
  13.     end tell
  14.   end if
  15. end
  16.  
  17. on mouseDown
  18.   global markerList
  19.   if (markerList <> []) and not (the visible of window "help") then
  20.     repeat while the mouseDown
  21.       set the memberNum of sprite 34 to the number of member "HsaveSeq"
  22.       updateStage()
  23.     end repeat
  24.   end if
  25. end
  26.  
  27. on mouseUp
  28.   global markerList, gSong, gPath
  29.   if (markerList <> []) and not (the visible of window "help") then
  30.     set the memberNum of sprite 34 to the number of member "saveSeq"
  31.     updateStage()
  32.     cursor(4)
  33.     set myFile to new(xtra("fileio"))
  34.     setFilterMask(myFile, ".txt")
  35.     set nameFile to displaySave(myFile, "Save sequence window", EMPTY)
  36.     createFile(myFile, nameFile)
  37.     openFile(myFile, nameFile, 2)
  38.     writeString(myFile, gSong && "seq" & numToChar(13) & numToChar(10) & line getAt(markerList, 1) of field "grooveMem" & numToChar(13) & numToChar(10))
  39.     set temp to [1]
  40.     repeat with i = 2 to count(markerList)
  41.       set trovato to 0
  42.       repeat with j = 1 to i - 1
  43.         if getAt(markerList, i) = getAt(markerList, j) then
  44.           set trovato to 1
  45.           append(temp, getAt(temp, j))
  46.           exit repeat
  47.         end if
  48.       end repeat
  49.       if not trovato then
  50.         writeString(myFile, line getAt(markerList, i) of field "grooveMem" & numToChar(13) & numToChar(10))
  51.         append(temp, max(temp) + 1)
  52.       end if
  53.     end repeat
  54.     set lastLine to EMPTY
  55.     repeat with i = 1 to count(temp)
  56.       set lastLine to lastLine & getAt(temp, i) & " "
  57.     end repeat
  58.     writeString(myFile, lastLine)
  59.     closeFile(myFile)
  60.     set myFile to 0
  61.     cursor(-1)
  62.   end if
  63.   set the editable of member "fieldBpm" to 0
  64. end
  65.