home *** CD-ROM | disk | FTP | other *** search
/ Sound, Music & MIDI Collection 2 / SMMVOL2.bin / DEMO / PRG / CIRCLES.ZIP / CI_MAIN.DIX / 00004_M-SL-KB.ls < prev    next >
Encoding:
Text File  |  1995-05-01  |  17.1 KB  |  566 lines

  1. on mMouseDown
  2.   global mcast, fcommand, scommand, acwin, demo, framecnt, xy_copy, xy_past, xy_load, xy_save, xy_inse, xy_dele, xy_info, xy_ende, xy_paus, xy_halt, xy_mix, xy_rand, xy_setu, xy_l01, xy_l02, xy_l03, xy_l04, xy_l05, xy_l06, xy_l07, xy_l08, xy_l09, xy_l10, xy_l11, xy_l12, xy_m01, xy_m02, xy_s12, xy_s09, xy_s08, xy_s06, xy_s05, xy_s04, xy_s03, xy_s02, xy_s01, hp_r, hp_l, hp_x, hp_page, player, hp_itm01, hp_itm02, hp_itm03, hp_itm04, hp_itm05, hp_itm06, hp_itm07, hp_itm08, hp_itm09, hp_itm10, hp_itm11, hp_itm12, hp_itm13, ltl_mix
  3.   if the mouseDown and (acwin = "MAIN") then
  4.     set x to the mouseH
  5.     set y to the mouseV
  6.     set m_point to point(x, y)
  7.     set mcast to the mouseCast
  8.     if not (fcommand = EMPTY) then
  9.       if mcast = the number of cast "lop_do" then
  10.         circleloopstop()
  11.       end if
  12.       return 
  13.     else
  14.       snd_stop()
  15.       if inside(m_point, xy_copy) then
  16.         set fcommand to "COPY"
  17.       end if
  18.       if inside(m_point, xy_past) then
  19.         set fcommand to "PAST"
  20.       end if
  21.       if inside(m_point, xy_load) then
  22.         set fcommand to "LOAD"
  23.       end if
  24.       if inside(m_point, xy_save) then
  25.         set fcommand to "SAVE"
  26.       end if
  27.       if inside(m_point, xy_inse) then
  28.         set fcommand to "INSE"
  29.       end if
  30.       if inside(m_point, xy_dele) then
  31.         set fcommand to "PAUS"
  32.       end if
  33.       if inside(m_point, xy_info) then
  34.         set fcommand to "INFO"
  35.       end if
  36.       if inside(m_point, xy_ende) then
  37.         set fcommand to "ENDE"
  38.       end if
  39.       if inside(m_point, xy_mix) then
  40.         set fcommand to "REMX"
  41.       end if
  42.       if inside(m_point, xy_rand) then
  43.         set fcommand to "EFFE"
  44.       end if
  45.       if inside(m_point, xy_setu) then
  46.         set fcommand to "SEUP"
  47.       end if
  48.       if inside(m_point, xy_l01) then
  49.         set fcommand to "LD01"
  50.       end if
  51.       if inside(m_point, xy_l02) then
  52.         set fcommand to "LD02"
  53.       end if
  54.       if inside(m_point, xy_l03) then
  55.         set fcommand to "LD03"
  56.       end if
  57.       if inside(m_point, xy_l04) then
  58.         set fcommand to "LD04"
  59.       end if
  60.       if inside(m_point, xy_l05) then
  61.         set fcommand to "LD05"
  62.       end if
  63.       if inside(m_point, xy_l06) then
  64.         set fcommand to "LD06"
  65.       end if
  66.       if inside(m_point, xy_l07) then
  67.         set fcommand to "LD07"
  68.       end if
  69.       if inside(m_point, xy_l08) then
  70.         set fcommand to "LD08"
  71.       end if
  72.       if inside(m_point, xy_l09) then
  73.         set fcommand to "LD09"
  74.       end if
  75.       if inside(m_point, xy_l10) then
  76.         set fcommand to "LD10"
  77.       end if
  78.       if inside(m_point, xy_l11) then
  79.         set fcommand to "LD11"
  80.       end if
  81.       if inside(m_point, xy_l12) then
  82.         set fcommand to "LD12"
  83.       end if
  84.       if inside(m_point, xy_s12) then
  85.         set fcommand to "SG12"
  86.       end if
  87.       if inside(m_point, xy_s09) then
  88.         set fcommand to "SG09"
  89.       end if
  90.       if inside(m_point, xy_s08) then
  91.         set fcommand to "SG08"
  92.       end if
  93.       if inside(m_point, xy_s06) then
  94.         set fcommand to "SG06"
  95.       end if
  96.       if inside(m_point, xy_s05) then
  97.         set fcommand to "SG05"
  98.       end if
  99.       if inside(m_point, xy_s04) then
  100.         set fcommand to "SG04"
  101.       end if
  102.       if inside(m_point, xy_s03) then
  103.         set fcommand to "SG03"
  104.       end if
  105.       if inside(m_point, xy_s02) then
  106.         set fcommand to "SG02"
  107.       end if
  108.       if inside(m_point, xy_s01) then
  109.         set fcommand to "SG01"
  110.       end if
  111.       if not player then
  112.         if inside(m_point, xy_halt) then
  113.           set fcommand to "HALT"
  114.         end if
  115.       end if
  116.       if hp_page = 0 then
  117.         if inside(m_point, hp_itm01) then
  118.           help_open(1)
  119.         end if
  120.         if inside(m_point, hp_itm02) then
  121.           help_open(2)
  122.         end if
  123.         if inside(m_point, hp_itm03) then
  124.           help_open(3)
  125.         end if
  126.         if inside(m_point, hp_itm04) then
  127.           help_open(4)
  128.         end if
  129.         if inside(m_point, hp_itm05) then
  130.           help_open(5)
  131.         end if
  132.         if inside(m_point, hp_itm06) then
  133.           help_open(6)
  134.         end if
  135.         if inside(m_point, hp_itm07) then
  136.           help_open(7)
  137.         end if
  138.         if inside(m_point, hp_itm08) then
  139.           help_open(8)
  140.         end if
  141.         if inside(m_point, hp_itm09) then
  142.           help_open(9)
  143.         end if
  144.         if inside(m_point, hp_itm10) then
  145.           help_open(10)
  146.         end if
  147.         if inside(m_point, hp_itm11) then
  148.           help_open(11)
  149.         end if
  150.         if inside(m_point, hp_itm12) then
  151.           help_open(12)
  152.         end if
  153.       end if
  154.       if inside(m_point, hp_r) then
  155.         help_R()
  156.       end if
  157.       if inside(m_point, hp_l) then
  158.         help_L()
  159.       end if
  160.       if inside(m_point, hp_x) then
  161.         help_X()
  162.       end if
  163.     end if
  164.     if mcast = the number of cast "volume" then
  165.       set fcommand to "SLID"
  166.     end if
  167.     if mcast = the number of cast "title" then
  168.       set fcommand to "TITL"
  169.     end if
  170.     if mcast = the number of cast "sndwin" then
  171.       set fcommand to "MSTR"
  172.     end if
  173.     if mcast = the number of cast "DEL" then
  174.       set fcommand to "DELE"
  175.     end if
  176.     if mcast = the number of cast "MIX" then
  177.       set fcommand to "CMIX"
  178.     end if
  179.     if mcast = the number of cast "lop" then
  180.       set fcommand to "LPCK"
  181.     end if
  182.     if mcast = the number of cast "fire" then
  183.       set fcommand to "FIRE"
  184.     end if
  185.     if mcast >= the number of cast "10101" then
  186.       set fcommand to "SEGS"
  187.     end if
  188.     if mcast = the number of cast "TRACK2" then
  189.       set fcommand to "MU01"
  190.     end if
  191.     if mcast = the number of cast "TRACK1" then
  192.       set fcommand to "MU02"
  193.     end if
  194.     if mcast = the number of cast "TRACKI" then
  195.       set fcommand to "MU00"
  196.     end if
  197.     if mcast = the number of cast "BF_CP1" then
  198.       set fcommand to "BFC1"
  199.     end if
  200.     if mcast = the number of cast "BF_CP2" then
  201.       set fcommand to "BFC2"
  202.     end if
  203.     if fcommand = "SLID" then
  204.       circleslider()
  205.     else
  206.       if fcommand = "MSTR" then
  207.         circlemaster()
  208.       else
  209.         if fcommand = "TITL" then
  210.           circlemaster()
  211.         else
  212.           if fcommand = "PLAY" then
  213.             circleplay()
  214.           else
  215.             if fcommand = "STOP" then
  216.               circlestop()
  217.             else
  218.               if fcommand = "LPCK" then
  219.                 circleloopinit()
  220.               else
  221.                 if fcommand = "FIRE" then
  222.                   circlefire()
  223.                 else
  224.                   if fcommand = "SEGS" then
  225.                     segmentselect()
  226.                   else
  227.                     if fcommand = "LOOP" then
  228.                       circleloopplay()
  229.                     else
  230.                       if fcommand = "ENDE" then
  231.                         but_flash("QUIT", 591 + 18, 5 + 9)
  232.                         if demo then
  233.                           demowin(1)
  234.                         end if
  235.                         set fcommand to "ENDE"
  236.                         set framecnt to 2
  237.                         exit
  238.                       else
  239.                         if fcommand = "LOAD" then
  240.                           but_flash("LOAD", 539 + 18, 394 + 19)
  241.                           circleload()
  242.                         else
  243.                           if fcommand = "SAVE" then
  244.                             but_flash("SAVE", 591 + 18, 394 + 19)
  245.                             circlesave()
  246.                           else
  247.                             if fcommand = "INFO" then
  248.                               but_flash("HELP", 538 + 18, 5 + 9)
  249.                               help_open(0)
  250.                             else
  251.                               if fcommand = "INSE" then
  252.                                 but_flash("ELEM", 514 + 31, 118 + 19)
  253.                                 circleinsert()
  254.                               else
  255.                                 if fcommand = "DELE" then
  256.                                   sounddelete()
  257.                                 else
  258.                                   if fcommand = "COPY" then
  259.                                     but_flash("COPY_R", 591 + 18, 60 + 19)
  260.                                     d_copy(2)
  261.                                   else
  262.                                     if fcommand = "PAST" then
  263.                                       but_flash("COPY_L", 538 + 18, 60 + 19)
  264.                                       d_copy(1)
  265.                                     else
  266.                                       if fcommand = "PAUS" then
  267.                                         but_flash("EMPTY", 591 + 18, 118 + 19)
  268.                                         circlepause()
  269.                                       else
  270.                                         if fcommand = "CMIX" then
  271.                                           circleshrink()
  272.                                         else
  273.                                           if fcommand = "REMX" then
  274.                                             but_flash("REMIX", 539 + 18, 336 + 19)
  275.                                             mkrandom()
  276.                                           else
  277.                                             if fcommand = "EFFE" then
  278.                                               but_flash("EFX", 591 + 18, 336 + 19)
  279.                                               soundeffect()
  280.                                             else
  281.                                               if fcommand = "HALT" then
  282.                                                 haltcircle()
  283.                                               else
  284.                                                 if fcommand = "CWIN" then
  285.                                                   ci_sup_ok()
  286.                                                 else
  287.                                                   if fcommand = "SEUP" then
  288.                                                     but_flash("SETUP", 440 + 40, 5 + 9)
  289.                                                     ci_sup_open()
  290.                                                   else
  291.                                                     if fcommand = "BFC1" then
  292.                                                       d_paste(1)
  293.                                                     else
  294.                                                       if fcommand = "BFC2" then
  295.                                                         d_paste(2)
  296.                                                       end if
  297.                                                     end if
  298.                                                   end if
  299.                                                 end if
  300.                                               end if
  301.                                             end if
  302.                                           end if
  303.                                         end if
  304.                                       end if
  305.                                     end if
  306.                                   end if
  307.                                 end if
  308.                               end if
  309.                             end if
  310.                           end if
  311.                         end if
  312.                       end if
  313.                     end if
  314.                   end if
  315.                 end if
  316.               end if
  317.             end if
  318.           end if
  319.         end if
  320.       end if
  321.     end if
  322.     if chars(fcommand, 1, 2) = "LD" then
  323.       ledklick(fcommand)
  324.     end if
  325.     if chars(fcommand, 1, 2) = "MU" then
  326.       muteklick(fcommand)
  327.     end if
  328.     if chars(fcommand, 1, 2) = "SG" then
  329.       segszklick(fcommand)
  330.     end if
  331.   end if
  332. end
  333.  
  334. on circleslider
  335.   global fcommand, backcast, sel_idx
  336.   set fcommand to EMPTY
  337.   if backcast <> 0 then
  338.     slider(the name of cast backcast)
  339.     set_remix(sel_idx)
  340.     setwindow(the name of cast backcast)
  341.   else
  342.     slider("MASTER")
  343.     setmastervol()
  344.   end if
  345. end
  346.  
  347. on slider cname
  348.   global steps, stepsize, maxsegs, up_mvol
  349.   set tmpsprite to getspritenum("VOLUME")
  350.   repeat while the mouseDown
  351.     set b to the mouseH
  352.     set mxsteps to 15
  353.     set slmax to 609
  354.     set slmin to 458
  355.     set sllen to slmax - slmin
  356.     set stepsize to sllen / mxsteps
  357.     if b >= slmax then
  358.       set the locH of sprite tmpsprite to slmax
  359.       set b to slmax
  360.     else
  361.       if b <= slmin then
  362.         set the locH of sprite tmpsprite to slmin
  363.         set b to slmin
  364.       else
  365.         set the locH of sprite tmpsprite to b
  366.       end if
  367.     end if
  368.     updateStage()
  369.   end repeat
  370.   set steps to (b - slmin) / stepsize
  371.   if cname <> "MASTER" then
  372.     set t_idx to ar_get("CAST", cname)
  373.     Ar1Vol(mput, t_idx, steps)
  374.   else
  375.     set up_mvol to steps
  376.   end if
  377. end
  378.  
  379. on setslider steps
  380.   set mxsteps to 15
  381.   set slmax to 609
  382.   set slmin to 458
  383.   set sllen to slmax - slmin
  384.   set tmpsprite to getspritenum("VOLUME")
  385.   set tmp to slmin + ((slmax - slmin) / mxsteps * steps)
  386.   if steps = 16 then
  387.     set the locH of sprite tmpsprite to slmax
  388.   else
  389.     set the locH of sprite tmpsprite to tmp
  390.   end if
  391. end
  392.  
  393. on initxy
  394.   global xy_copy, xy_past, xy_load, xy_save, xy_inse, xy_dele, xy_info, xy_ende, xy_paus, xy_halt, xy_mix, xy_rand, xy_setu, xy_l01, xy_l02, xy_l03, xy_l04, xy_l05, xy_l06, xy_l07, xy_l08, xy_l09, xy_l10, xy_l11, xy_l12, xy_m01, xy_m02, xy_s12, xy_s09, xy_s08, xy_s06, xy_s05, xy_s04, xy_s03, xy_s02, xy_s01
  395.   set xy_copy to rect(590, 61, 630, 101)
  396.   set xy_past to rect(538, 61, 578, 101)
  397.   set xy_load to rect(538, 394, 578, 435)
  398.   set xy_save to rect(590, 394, 630, 435)
  399.   set xy_inse to rect(512, 118, 578, 160)
  400.   set xy_dele to rect(590, 118, 630, 160)
  401.   set xy_info to rect(538, 5, 578, 26)
  402.   set xy_ende to rect(590, 5, 630, 26)
  403.   set xy_paus to rect(503, 115, 526, 153)
  404.   set xy_halt to rect(1, 1, 90, 20)
  405.   set xy_mix to rect(538, 335, 578, 377)
  406.   set xy_rand to rect(590, 335, 630, 377)
  407.   set xy_setu to rect(440, 5, 525, 26)
  408.   set xy_l01 to rect(218, 1, 252, 38)
  409.   set xy_l02 to rect(332, 48, 366, 65)
  410.   set xy_l03 to rect(415, 107, 449, 143)
  411.   set xy_l04 to rect(438, 224, 472, 261)
  412.   set xy_l05 to rect(410, 341, 444, 379)
  413.   set xy_l06 to rect(332, 415, 366, 452)
  414.   set xy_l07 to rect(218, 441, 252, 478)
  415.   set xy_l08 to rect(107, 415, 141, 452)
  416.   set xy_l09 to rect(20, 341, 54, 379)
  417.   set xy_l10 to rect(0, 224, 34, 261)
  418.   set xy_l11 to rect(21, 107, 55, 143)
  419.   set xy_l12 to rect(96, 48, 130, 65)
  420.   set xy_m01 to rect(480, 64, 493, 77)
  421.   set xy_m02 to rect(504, 64, 517, 77)
  422.   set xy_s12 to rect(520, 320 - (1 * 16), 555, 320 - (0 * 16))
  423.   set xy_s09 to rect(520, 320 - (2 * 16), 555, 320 - (1 * 16))
  424.   set xy_s08 to rect(520, 320 - (3 * 16), 555, 320 - (2 * 16))
  425.   set xy_s06 to rect(520, 320 - (4 * 16), 555, 320 - (3 * 16))
  426.   set xy_s05 to rect(520, 320 - (5 * 16), 555, 320 - (4 * 16))
  427.   set xy_s04 to rect(520, 320 - (6 * 16), 555, 320 - (5 * 16))
  428.   set xy_s03 to rect(520, 320 - (7 * 16), 555, 320 - (6 * 16))
  429.   set xy_s02 to rect(520, 320 - (8 * 16), 555, 320 - (7 * 16))
  430.   set xy_s01 to rect(520, 320 - (9 * 16), 555, 320 - (8 * 16))
  431. end
  432.  
  433. on snd_mdown
  434.   set junk to the number of cast "MDOWN"
  435. end
  436.  
  437. on waitforup
  438.   repeat while 1
  439.     if not (the mouseDown) then
  440.       exit repeat
  441.     end if
  442.   end repeat
  443. end
  444.  
  445. on mykeyup
  446.   global fcommand, ecommand, acwin, fl_msg, scrollstep, fn_sel
  447.   set myrkey to the key
  448.   set myvkey to charToNum(myrkey)
  449.   if myvkey >= 97 then
  450.     set myvkey to myvkey - 32
  451.   end if
  452.   set mykey to numToChar(myvkey)
  453.   if acwin = "MAIN" then
  454.     if myrkey = "Q" then
  455.       circleend()
  456.     end if
  457.     if mykey = " " then
  458.       if fcommand = "LOOP" then
  459.         circleloopstop()
  460.       else
  461.         circleloopinit()
  462.       end if
  463.     end if
  464.     if mykey = "I" then
  465.       circleinsert()
  466.     end if
  467.     if mykey = "D" then
  468.       sounddelete()
  469.     end if
  470.     if mykey = "L" then
  471.       circleload()
  472.     end if
  473.     if mykey = "S" then
  474.       circlesave()
  475.     end if
  476.     if mykey = "P" then
  477.       circleplay()
  478.     end if
  479.     if myvkey = 13 then
  480.       circlestop()
  481.     end if
  482.     if mykey = "F" then
  483.       circlefire()
  484.     end if
  485.     if mykey = "H" then
  486.       help_open(0)
  487.     end if
  488.     if mykey = "C" then
  489.       soundcopy()
  490.     end if
  491.     if mykey = "R" then
  492.       mkrandom()
  493.     end if
  494.     if mykey = "U" then
  495.       ci_sup_open()
  496.     end if
  497.     if mykey = "E" then
  498.       circlepause()
  499.     end if
  500.     if mykey = "M" then
  501.       circlemix()
  502.     end if
  503.   else
  504.     if acwin = "FSEL" then
  505.       if myrkey = 8 then
  506.         fsel_back()
  507.       end if
  508.       if myvkey = 11 then
  509.         fl_slup()
  510.       end if
  511.       if myvkey = 12 then
  512.         fl_sldw()
  513.       end if
  514.       if myvkey = 13 then
  515.         fl_load()
  516.       end if
  517.       if mykey = " " then
  518.         fl_play()
  519.       end if
  520.       if myvkey = 31 then
  521.         if fn_sel < scrollstep then
  522.           set v to string(fn_sel + 1)
  523.           if length(v) < 2 then
  524.             set v to "0" & v
  525.           end if
  526.           set fl_msg to "fn" & v
  527.           fl_fn()
  528.         end if
  529.       end if
  530.       if myvkey = 30 then
  531.         if fn_sel > 1 then
  532.           set v to string(fn_sel - 1)
  533.           if length(v) < 2 then
  534.             set v to "0" & v
  535.           end if
  536.           set fl_msg to "fn" & v
  537.           fl_fn()
  538.         end if
  539.       end if
  540.     end if
  541.   end if
  542. end
  543.  
  544. on but_flash fcast, x, y
  545.   global framecnt, butisflash
  546.   if not butisflash then
  547.     sprite_save(46)
  548.     set sp to 46
  549.     set the castNum of sprite sp to the number of cast fcast
  550.     set the ink of sprite sp to 36
  551.     sprite_show(sp, x, y)
  552.     set butisflash to 1
  553.     updateStage()
  554.   end if
  555. end
  556.  
  557. on but_reflash
  558.   global framecnt, butisflash
  559.   if butisflash then
  560.     set sp to 46
  561.     sprite_blank(sp)
  562.     sprite_rest()
  563.     set butisflash to 0
  564.   end if
  565. end
  566.