Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/playfile.activity/playfiles.py
blob: ae8556c65c2a5a592bca4b93467991a1a8b6247b (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
# (c) Victor Lazzarini, 2006
#  Free software, licensed by GNU General Public License
import csndsugui
from sugar.activity import activity


class Playfiles(activity.Activity):

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

   # colour
   bg  = (0x0000, 0x7000, 0xA000)  
   white = (0xFFFF, 0xFFFF, 0xFFFF)
                
   win = csndsugui.CsoundGUI(self, bg)
   win.csd("playfile.csd")
   win.text("Playing Sounds",colour=white)
   #outbox = win.box(True)
   bbox = win.box(False)
   win.button(bbox,"play")
   win.button(bbox,"pause")
   win.filechooser(bbox,"soundfile")
   pbox = []
   for i in range(1, 10):
    pbox.append(win.box(False))
    win.mbutton(pbox[i-1],"i1.%d 0 -1 %d" % (i,i), "add to playlist %d..." % i)
    win.mbutton(pbox[i-1],"i-1.%d 0 1 %d"  % (i,i), "stop")
    win.button(pbox[i-1], "mute%d"% i)
    win.spin(5,0,10,0.5,1,pbox[i-1],0,"main_volume%d" % i )
    win.slider(1.0,0.5,2.0,250,40,pbox[i-1],"pitch%i" % i, False,linear=False)
   lbox = win.box(False)    
   win.mbutton(lbox,"i9 0 -1", "record")
   win.mbutton(lbox,"i-9 0  1", "stop")
   win.filechooser(lbox,"output_file")