import random
import math
import util

import sys

print sys.path
sys.path.append("d:\\demos\\demo")



from demoscript import *
import layers

feg = FileEventGenerator("fart")

d = 0.3
for i in xrange(50):
	feg.addEvent(d+6.315 + 0.4350*i,"bass")

feg.addEvent(d + 21.362, "1")
feg.addEvent(d + 21.594, "2")
feg.addEvent(d + 21.966, "3")
feg.addEvent(d + 22.198, "4")

feg.addEvent(d + 26.377, "1")
feg.addEvent(d + 26.563, "2")
feg.addEvent(d + 26.981, "3")
feg.addEvent(d + 27.213, "4")


sched = SchedulerSingleton_instance() # setup scheduler

playSong("d:\\demos\\demo\\okkie_is_lief.wma")


# ---

ps = PSRenderer()
pslayers = []
layer = PSLayer("d:\\demos\\demo\\h_static.tris")
pslayers.append(layer)
ps.addLayer(layer)
layer.x = -0.2
layer.y = 0.4
layer.rotation = 0

layer = layers.Logo("d:\\demos\\demo\\h_logo.tris")
pslayers.append(layer)
ps.addLayer(layer)
layer.x = -0.2
layer.y = 0.4
layer.rotation = 0

for i in xrange(1,5):
  layer = layers.Number("d:\\demos\\demo\\h_" + `i` + ".tris", i)
  pslayers.append(layer)
  ps.addLayer(layer)
  layer.x = -0.2
  layer.y = 0.4
  layer.rotation = 0

harry = util.SimpleScene("d:\\demos\\demo\\harry.lzma")

harry.speed = FixedSlider(4500, 4500)
#backdrop.connectOutput(harry, "in")


harry.connectOutput(ps, "in")


sched.schedule(0,
               33.6,
               ps,
               SI_A,
               0)

