home *** CD-ROM | disk | FTP | other *** search
- on timeline cidx
- global t1_segcnt, t2_segcnt, ltl_mix, ltl_time, ltl_scast, ltl_len, namepause_bs, mixedloop
- set cvidx to value(cidx)
- if 0 then
- if cvidx > 0 then
- if not voidp(getAt(ltl_mix, cvidx)) then
- if (getAt(ltl_mix, cvidx) = "M") or (getAt(ltl_mix, cvidx) = "-") then
- repeat with i = 0 to 11
- if (cvidx - i) < 1 then
- exit repeat
- end if
- if getAt(ltl_mix, cvidx - i) = "M" then
- setAt(ltl_mix, cvidx - i, "-")
- exit repeat
- end if
- end repeat
- end if
- end if
- end if
- end if
- mixneed_off()
- set acs to 1
- repeat with i = 1 to 12
- if (i > t1_segcnt) and (i > t2_segcnt) then
- tl_insert(acs, 0, 0, 0, 0)
- set acs to acs + 1
- next repeat
- end if
- set t1_idx to pos2idx(acs, 0)
- set t2_idx to pos2idx(acs, 12)
- if getAt(ltl_mix, acs) = "M" then
- set acs_mix to getAt(ltl_len, acs)
- set acs to acs + acs_mix
- next repeat
- end if
- set s1 to value(ar1seg(mget, t1_idx))
- set s2 to value(ar1seg(mget, t2_idx))
- set n1 to Ar1sound(mget, t1_idx)
- set n2 to Ar1sound(mget, t2_idx)
- if not (s1 = 0) then
- set tmp_s to s1 - 1
- if not (n1 = namepause_bs) then
- set segtime to Ar1time(mget, t1_idx) / s1
- else
- if not (t2_idx = 0) then
- set segtime to Ar1time(mget, t2_idx) / ar1seg(mget, t2_idx)
- end if
- end if
- tl_insert(acs, s1, segtime, Ar1play(mget, t1_idx), "1")
- mixneed_on()
- set acs to acs + 1
- repeat with i = tmp_s down to 1
- tl_insert(acs, "-", segtime, 0, "-")
- set acs to acs + 1
- end repeat
- next repeat
- end if
- if not (s2 = 0) then
- set tmp_s to s2 - 1
- if not (n2 = namepause_bs) then
- set segtime to Ar1time(mget, t2_idx) / s2
- else
- if not (t1_idx = 0) then
- set segtime to Ar1time(mget, t1_idx) / ar1seg(mget, t1_idx)
- end if
- end if
- tl_insert(acs, s2, segtime, Ar1play(mget, t2_idx), "2")
- mixneed_on()
- set acs to acs + 1
- repeat with i = tmp_s down to 1
- tl_insert(acs, "-", segtime, 0, "-")
- set acs to acs + 1
- end repeat
- end if
- end repeat
- set mixedloop to 0
- end
-
- on pos2idx pos, add
- set retidx to 0
- repeat with i = 1 + add to 12 + add
- if pos = ar1pos(mget, i) then
- set retidx to i
- exit repeat
- end if
- end repeat
- return retidx
- end
-
- on chk_timeline sel_track, sel_idx, segszval
- set retval to 1
- if sel_track = 1 then
- set add_t to 0
- set sub_t to 12
- else
- set add_t to 12
- set sub_t to -12
- end if
- set i to 1
- repeat while 1
- if AR1idx(mget, i + add_t) = sel_idx then
- set sel_pos to ar1pos(mget, i + add_t)
- set sel_time to Ar1time(mget, i + add_t)
- exit repeat
- end if
- set i to i + 1
- end repeat
- set z to 1
- set chk_idx to 0
- repeat while 1
- if AR1idx(mget, z + add_t + sub_t) <= 0 then
- exit repeat
- end if
- if ar1pos(mget, z + add_t + sub_t) = sel_pos then
- set chk_idx to AR1idx(mget, z + add_t + sub_t)
- exit repeat
- end if
- set z to z + 1
- end repeat
- delay(30)
- if chk_idx <> 0 then
- set totime to 0
- set totseg to 1
- repeat while 1
- if AR1idx(mget, chk_idx) = 0 then
- exit repeat
- end if
- if totseg >= segszval then
- exit repeat
- end if
- set totime to totime + Ar1time(mget, chk_idx)
- set chk_idx to chk_idx + 1
- set totseg to totseg + 1
- end repeat
- end if
- return retval
- end
-
- on correct_s s
- if chars(s, 1, 1) < " " then
- set s to chars(s, 2, length(s))
- end if
- if chars(s, length(s), length(s)) < " " then
- set s to chars(s, 1, length(s) - 1)
- end if
- return s
- end
-
- on tl_create
- global ltl_len, ltl_time, ltl_scast, ltl_mix, ltl_upd
- set ltl_len to []
- set ltl_time to []
- set ltl_scast to []
- set ltl_mix to []
- set ltl_upd to []
- setAt(ltl_len, 25, "0")
- setAt(ltl_time, 25, 0)
- setAt(ltl_scast, 25, 0)
- setAt(ltl_mix, 25, 0)
- setAt(ltl_upd, 25, 0)
- end
-
- on tl_insert pos, len, time, scast, mix
- global ltl_len, ltl_time, ltl_scast, ltl_mix, ltl_upd
- setAt(ltl_len, pos, string(len))
- setAt(ltl_mix, pos, string(mix))
- setAt(ltl_time, pos, time)
- setAt(ltl_scast, pos, scast)
- end
-
- on tl_delete pos
- global ltl_len, ltl_time, ltl_scast, ltl_mix
- deleteAt(ltl_len, pos)
- deleteAt(ltl_time, pos)
- deleteAt(ltl_scast, pos)
- deleteAt(ltl_mix, pos)
- deleteAt(ltl_upd, pos)
- end
-
- on tl_timefrom pos
- global ltl_len, ltl_time, ltl_scast, ltl_mix
- set ret_time to 0
- repeat with i = pos to 12
- set ret_time to ret_time + getAt(ltl_time, i)
- end repeat
- return ret_time
- end
-
- on tl_maxpos dummy
- global ltl_len, ltl_time, ltl_scast, ltl_mix
- set iexit to 0
- repeat with i = 1 to 12
- set iexit to iexit + value(getAt(ltl_len, i))
- end repeat
- return iexit
- end
-
- on tl_getmixed
- global ltl_len, ltl_time, ltl_scast, ltl_mix
- set iexit to 0
- repeat with i = 1 to 12
- set tmp_i to string(getAt(ltl_mix, i))
- if tmp_i = "M" then
- set iexit to iexit + 1
- end if
- end repeat
- return iexit
- end
-
- on tl_getupd
- global ltl_len, ltl_time, ltl_scast, ltl_upd
- set iexit to 0
- repeat with i = 1 to 12
- set tmp_i to string(getAt(ltl_upd, i))
- if tmp_i = "U" then
- set iexit to i
- exit repeat
- end if
- end repeat
- return iexit
- end
-
- on set_remix cidx
- global t1_segcnt, t2_segcnt, ltl_mix, ltl_time, ltl_scast, ltl_len, namepause_bs
- set cvidx to value(cidx)
- if cvidx > 0 then
- if not voidp(getAt(ltl_mix, cvidx)) then
- if (getAt(ltl_mix, cvidx) = "M") or (getAt(ltl_mix, cvidx) = "-") then
- repeat with i = 0 to 11
- if (cvidx - i) < 1 then
- exit repeat
- end if
- if getAt(ltl_mix, cvidx - i) = "M" then
- setAt(ltl_mix, cvidx - i, "-")
- mixneed_on()
- exit repeat
- end if
- end repeat
- end if
- end if
- end if
- end
-
- on tltimestop led
- global t1_segcnt, t2_segcnt, ltl_mix, ltl_time, ltl_scast, ltl_len, LED_1, LED_2
- if t1_segcnt >= t2_segcnt then
- set tx to t1_segcnt
- else
- set tx to t2_segcnt
- end if
- if led > (tx + 1) then
- return 0
- end if
- set retvar to 0
- repeat with i = 1 to led
- set tmp to getAt(ltl_time, i)
- if tmp = 0 then
- return retvar
- end if
- set retvar to retvar + tmp
- end repeat
- return retvar
- end
-
- on tltimestart led
- global t1_segcnt, t2_segcnt, ltl_mix, ltl_time, ltl_scast, ltl_len, LED_1, LED_2
- if t1_segcnt >= t2_segcnt then
- set tx to t1_segcnt
- else
- set tx to t2_segcnt
- end if
- if led > tx then
- return 0
- end if
- set retvar to 0
- if led = 1 then
- return 0
- end if
- repeat with i = 1 to led - 1
- set tmp to getAt(ltl_time, i)
- if tmp = 0 then
- return retvar
- end if
- set retvar to retvar + tmp
- end repeat
- return retvar
- end
-