]>
Commit | Line | Data |
---|---|---|
493f1553 RD |
1 | |
2 | from wxPython.wx import * | |
6c5ae2d2 | 3 | from Main import opj |
493f1553 RD |
4 | |
5 | #---------------------------------------------------------------------- | |
6 | ||
7 | class TestPanel(wxPanel): | |
8 | def __init__(self, parent): | |
9 | wxPanel.__init__(self, parent, -1) | |
10 | ||
e5dd90b1 RD |
11 | b = wxButton(self, -1, "Play Sound 1", (25, 25)) |
12 | EVT_BUTTON(self, b.GetId(), self.OnButton1) | |
493f1553 | 13 | |
e5dd90b1 RD |
14 | b = wxButton(self, -1, "Play Sound 2", (25, 65)) |
15 | EVT_BUTTON(self, b.GetId(), self.OnButton2) | |
493f1553 | 16 | |
e5dd90b1 RD |
17 | |
18 | def OnButton1(self, evt): | |
19 | try: | |
20 | wave = wxWave(opj('data/anykey.wav')) | |
21 | wave.Play() | |
22 | except NotImplementedError, v: | |
23 | wxMessageBox(str(v), "Exception Message") | |
24 | ||
25 | ||
26 | def OnButton2(self, evt): | |
493f1553 | 27 | try: |
e5dd90b1 | 28 | wave = wxWave(opj('data/plan.wav')) |
493f1553 RD |
29 | wave.Play() |
30 | except NotImplementedError, v: | |
31 | wxMessageBox(str(v), "Exception Message") | |
32 | ||
33 | ||
34 | #---------------------------------------------------------------------- | |
35 | ||
36 | def runTest(frame, nb, log): | |
37 | win = TestPanel(nb) | |
38 | return win | |
39 | ||
40 | #---------------------------------------------------------------------- | |
41 | ||
42 | ||
43 | overview = """\ | |
44 | """ | |
1fded56b RD |
45 | |
46 | ||
47 | ||
48 | ||
49 | ||
50 | if __name__ == '__main__': | |
51 | import sys,os | |
52 | import run | |
53 | run.main(['', os.path.basename(sys.argv[0])]) |