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 / 00501.ls < prev    next >
Encoding:
Text File  |  1999-09-17  |  5.8 KB  |  154 lines

  1. on mouseEnter
  2.   if the visible of window "Help" then
  3.     tell window "help"
  4.       go("seq3")
  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 startPos, gPlaySeq, markerList
  19.   if not gPlaySeq and not (the name of member the memberNum of sprite the clickOn = "marker") and not (the visible of window "help") then
  20.     set startPos to the loc of sprite the clickOn
  21.     set the memberNum of sprite 48 to the number of member the memberNum of sprite the clickOn
  22.     set the ink of sprite 48 to 36
  23.     set the visible of sprite the clickOn to 0
  24.     repeat while the mouseDown
  25.       set the locH of sprite 48 to the mouseH
  26.       set the locV of sprite 48 to the mouseV
  27.       updateStage()
  28.     end repeat
  29.   end if
  30. end
  31.  
  32. on mouseUp
  33.   global startPos, gfirstmarker, glastmarker, gPlaySeq, gStartSeq, gBlue, markerList
  34.   if not gPlaySeq and not (the name of member the memberNum of sprite the clickOn = "marker") and not (the visible of window "help") then
  35.     set interseca to 0
  36.     repeat with i = 2 to 9
  37.       if sprite 48 intersects sprite(i) then
  38.         set interseca to 1
  39.         exit repeat
  40.       end if
  41.     end repeat
  42.     set the memberNum of sprite 48 to 1000
  43.     if (the mouseH >= (integer(chars(word 1 of string(startPos), 7, length(word 1 of string(startPos)) - 1)) - 5)) and (the mouseH <= (integer(chars(word 1 of string(startPos), 7, length(word 1 of string(startPos)) - 1)) + 5)) and (the mouseV >= (integer(chars(word 2 of string(startPos), 1, length(word 2 of string(startPos)) - 1)) - 5)) and (the mouseV <= (integer(chars(word 2 of string(startPos), 1, length(word 2 of string(startPos)) - 1)) + 5)) then
  44.       set the loc of sprite the clickOn to startPos
  45.       set the visible of sprite the clickOn to 1
  46.       set interseca to 1
  47.       set i to the clickOn
  48.     end if
  49.     if interseca then
  50.       set num to integer(chars(the name of member the memberNum of sprite the clickOn, 2, length(the name of member the memberNum of sprite the clickOn)))
  51.       if the name of member the memberNum of sprite i = "marker" then
  52.         deleteAt(markerList, gfirstmarker + the clickOn - 2)
  53.         append(markerList, num)
  54.         set the loc of sprite the clickOn to startPos
  55.         set the visible of sprite the clickOn to 1
  56.         repeat with i = 2 to 9
  57.           set the memberNum of sprite i to the number of member "marker"
  58.         end repeat
  59.         set j to 1
  60.         repeat with i = gfirstmarker to 7 + gfirstmarker
  61.           set j to j + 1
  62.           if i > count(markerList) then
  63.             exit repeat
  64.             next repeat
  65.           end if
  66.           set gN to "g" & getAt(markerList, i)
  67.           set the memberNum of sprite j to the number of member gN
  68.           set glastmarker to i
  69.         end repeat
  70.       else
  71.         deleteAt(markerList, gfirstmarker + the clickOn - 2)
  72.         set gN to "g" & num
  73.         addAt(markerList, gfirstmarker + i - 2, num)
  74.         set the loc of sprite the clickOn to startPos
  75.         set the visible of sprite the clickOn to 1
  76.         repeat with i = 2 to 9
  77.           set the memberNum of sprite i to the number of member "marker"
  78.         end repeat
  79.         set j to 1
  80.         repeat with i = gfirstmarker to 7 + gfirstmarker
  81.           set j to j + 1
  82.           if i > count(markerList) then
  83.             exit repeat
  84.           else
  85.             set gN to "g" & getAt(markerList, i)
  86.             set the memberNum of sprite j to the number of member gN
  87.             set glastmarker to i
  88.           end if
  89.           updateStage()
  90.         end repeat
  91.       end if
  92.     else
  93.       deleteAt(markerList, gfirstmarker + the clickOn - 2)
  94.       set the loc of sprite the clickOn to startPos
  95.       set the visible of sprite the clickOn to 1
  96.       repeat with i = 2 to 9
  97.         set the memberNum of sprite i to the number of member "marker"
  98.       end repeat
  99.       set j to 1
  100.       repeat with i = gfirstmarker to 7 + gfirstmarker
  101.         set j to j + 1
  102.         if i > count(markerList) then
  103.           exit repeat
  104.         else
  105.           set gN to "g" & getAt(markerList, i)
  106.           set the memberNum of sprite j to the number of member gN
  107.           set glastmarker to i
  108.         end if
  109.         updateStage()
  110.       end repeat
  111.       if (the name of member the memberNum of sprite 2 = "marker") and (markerList <> []) then
  112.         set nS to "g" & getLast(markerList)
  113.         set the memberNum of sprite 2 to the number of member nS
  114.         set gfirstmarker to getLast(markerList)
  115.         set glastmarker to getLast(markerList)
  116.         updateStage()
  117.       end if
  118.     end if
  119.     put EMPTY into field "fieldMarkerSeq"
  120.     repeat with i = 1 to count(markerList)
  121.       put getAt(markerList, i) & " " after field "fieldMarkerSeq"
  122.     end repeat
  123.     set the textFont of member "fieldMarkerSeq" to "arial"
  124.     set the textSize of member "fieldMarkerSeq" to 10
  125.     set the foreColor of member "fieldMarkerSeq" to 0
  126.     case word 2 of field "fieldDuration" of
  127.       "sec":
  128.         set sec to 1920 * the number of words in field "fieldMarkerSeq" / float(field "fieldBpm")
  129.         set sec to integer(sec)
  130.         set min to sec / 60
  131.         if min = 0 then
  132.           set min to "00"
  133.         end if
  134.         if (min >= 1) and (min <= 9) then
  135.           set min to "0" & min
  136.         end if
  137.         set sec to sec mod 60
  138.         if sec = 0 then
  139.           set sec to "00"
  140.         end if
  141.         if (sec >= 1) and (sec <= 9) then
  142.           set sec to "0" & sec
  143.         end if
  144.         put min & ":" & sec & "  sec" into field "fieldDuration"
  145.       otherwise:
  146.         put 8 * the number of words in field "fieldMarkerSeq" & "  bars" into field "fieldDuration"
  147.     end case
  148.     set the textFont of member "fieldDuration" to "IK10"
  149.     set the foreColor of member "fieldDuration" to gBlue
  150.   end if
  151.   set gStartSeq to 1
  152.   set the editable of member "fieldBpm" to 0
  153. end
  154.