Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Waves.activity/waves.py
blob: 682e607d66b9dfe362193cf8da744b0de217d4e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import csndsugui
from sugar.activity import activity


class Waves(activity.Activity):

 def __init__(self, handle):
  
   activity.Activity.__init__(self, handle)

   # colours
   red = (0xFFFF,0,0)
   bg  = (0xF000, 0xFF00, 0xFFFF)
   self.win = csndsugui.CsoundGUI(self,bg)
 
   self.win.csd("waves.csd")
   txt = self.win.text("Making Waves")
   sfbox = self.win.box(False)
   bfbox = self.win.box(False)
   sbox = self.win.framebox("frequencies", False, sfbox, red, 40) 
   bbox = self.win.framebox("oscillators", False, bfbox, red, 40)

   self.win.buttonbank(8,bbox)
   self.win.spin(0,0,10,0.5,1,bbox,0, "main_volume")
   self.win.vsliderbank(8,400.0,400.0,500.0,80,400,sbox)
   self.win.play()

 def write_file(self,filepath):
    self.win.logger.debug("write_file\n\n")
    self.win.set_channel_metadata()
    f = open(filepath, 'w')
    f.close() 

 def read_file(self,filepath):
    self.win.logger.debug("read_file \n\n")
    self.win.get_channel_metadata()