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

  1. on mouseEnter
  2.   if the visible of window "Help" then
  3.     tell window "help"
  4.       go("grooveM9")
  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 mouseUp
  18.   global gTraccia, gOn, gGrooveSel, gSync, gFirstClick, gGreen, virTracklIst
  19.   if gOn and not (the visible of window "help") then
  20.     if not gSync or (gSync and gFirstClick) then
  21.       set gFirstClick to 0
  22.       set nomeSprite to the name of member the memberNum of sprite the clickOn
  23.       if (chars(nomeSprite, 1, 2) <> "gr") and (char 1 of nomeSprite <> "h") then
  24.         put EMPTY into field "fieldRandom"
  25.         if gTraccia then
  26.           set the foreColor of word 2 of line getAt(virTracklIst, gTraccia) of field "fieldAudio" to gGreen
  27.         end if
  28.         set gTraccia to 0
  29.         set pos to the clickOn - 29
  30.         set hg to "H" & chars(nomeSprite, 2, length(nomeSprite))
  31.         puppetSprite(12, 1)
  32.         set the memberNum of sprite 12 to the number of member hg
  33.         set the ink of sprite 12 to 36
  34.         set the loc of sprite 12 to the loc of sprite the clickOn
  35.         set gGrooveSel to integer(chars(nomeSprite, 2, length(nomeSprite)))
  36.         groove_mem(pos)
  37.       end if
  38.     end if
  39.   end if
  40.   set the editable of member "fieldBpm" to 0
  41. end
  42.  
  43. on rightMouseDown
  44.   global startPos, startRect, gOn, gGrooveSel, gSync, markerList
  45.   if gOn and not gSync and not (the visible of window "help") then
  46.     if (chars(the name of member the memberNum of sprite the clickOn, 1, 2) <> "gr") and (chars(the name of member the memberNum of sprite the clickOn, 2, length(the name of member the memberNum of sprite the clickOn)) <> string(gGrooveSel)) then
  47.       set startPos to the loc of sprite the clickOn
  48.       set startRect to the rect of sprite the clickOn
  49.       set the memberNum of sprite 58 to the number of member the memberNum of sprite the clickOn
  50.       set the ink of sprite 58 to 36
  51.       set the visible of sprite the clickOn to 0
  52.       repeat while the mouseDown
  53.         set the locH of sprite 58 to the mouseH
  54.         set the locV of sprite 58 to the mouseV
  55.         updateStage()
  56.       end repeat
  57.     end if
  58.   end if
  59. end
  60.  
  61. on rightMouseUp
  62.   global startPos, startRect, gOn, gGrooveSel, glastmarker, gSync, markerList
  63.   if gOn and not gSync and not (the visible of window "help") then
  64.     set trovato to 0
  65.     set newPos to point(the mouseH, the mouseV)
  66.     if inside(newPos, startRect) then
  67.       set the loc of sprite the clickOn to startPos
  68.       set trovato to 1
  69.     end if
  70.     if not trovato then
  71.       set numero to the name of member the memberNum of sprite the clickOn
  72.       set numero to integer(chars(numero, 2, length(numero)))
  73.       repeat with i = numero + 1 to the lineCount of member "grooveMem"
  74.         put line i of field "grooveMem" into line i - 1 of field "grooveMem"
  75.       end repeat
  76.       put EMPTY into line the lineCount of member "grooveMem" of field "grooveMem"
  77.       delete char -30003 of field "grooveMem"
  78.       set the loc of sprite the clickOn to startPos
  79.       case the lineCount of member "grooveMem" of
  80.         0:
  81.           repeat with i = 1 to 8
  82.             set nome to "groove" & i
  83.             set the memberNum of sprite (29 + i) to the number of member nome
  84.           end repeat
  85.         otherwise:
  86.           if (the clickOn = 30) and (the lineCount of member "grooveMem" = (numero - 1)) then
  87.             set nS to "g" & numero - 1
  88.             set the memberNum of sprite 30 to the number of member nS
  89.           else
  90.             set j to numero - 1
  91.             repeat with i = the clickOn - 29 to 8
  92.               set j to j + 1
  93.               if j <= the lineCount of member "grooveMem" then
  94.                 set nS to "g" & j
  95.               else
  96.                 set nS to "groove" & i
  97.               end if
  98.               set the memberNum of sprite (29 + i) to the number of member nS
  99.             end repeat
  100.           end if
  101.       end case
  102.       if gGrooveSel then
  103.         if gGrooveSel > integer(numero) then
  104.           set gGrooveSel to gGrooveSel - 1
  105.         end if
  106.         repeat with i = 37 down to 29
  107.           if chars(the name of member the memberNum of sprite i, 1, 2) <> "gr" then
  108.             set lastNum to integer(chars(the name of member the memberNum of sprite i, 2, length(the name of member the memberNum of sprite i)))
  109.             exit repeat
  110.           end if
  111.         end repeat
  112.         set firstNum to integer(chars(the name of member the memberNum of sprite 30, 2, length(the name of member the memberNum of sprite 30)))
  113.         if (gGrooveSel >= firstNum) and (gGrooveSel <= lastNum) then
  114.           puppetSprite(12, 1)
  115.           set nS to "h" & gGrooveSel
  116.           set the memberNum of sprite 12 to the number of member nS
  117.           set the loc of sprite 12 to the loc of sprite (29 + (gGrooveSel - firstNum + 1))
  118.         end if
  119.       end if
  120.       updateStage()
  121.       if markerList <> [] then
  122.         repeat while getPos(markerList, numero)
  123.           if numero <= glastmarker then
  124.             set glastmarker to glastmarker - 1
  125.           end if
  126.           deleteAt(markerList, getPos(markerList, numero))
  127.         end repeat
  128.         put EMPTY into field "fieldMarkerSeq"
  129.         repeat with i = 1 to count(markerList)
  130.           if getAt(markerList, i) > numero then
  131.             setAt(markerList, i, getAt(markerList, i) - 1)
  132.           end if
  133.           put getAt(markerList, i) & " " after field "fieldMarkerSeq"
  134.         end repeat
  135.         set the textFont of member "fieldMarkerSeq" to "Arial"
  136.         set the textSize of member "fieldMarkerSeq" to 10
  137.         set the foreColor of member "fieldMarkerSeq" to 0
  138.       end if
  139.     end if
  140.     set the memberNum of sprite 58 to 1000
  141.     set the visible of sprite the clickOn to 1
  142.     updateStage()
  143.   end if
  144.   set the editable of member "fieldBpm" to 0
  145. end
  146.