Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/test_composant.py
blob: b0f755826e48ae401c7f19158af6d771dbe7bd04 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/usr/bin/env python
# -*- coding: utf-8 -*-

#------------------------------------------------------------------------------

# Copyright 2008-2009 : François Sénéquier
# Email : francois.senequier@netcourrier.com

# This file is part of 'Theorie'.
#
# 'Theorie' is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# 'Theorie' is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with 'Theorie'.  If not, see <http://www.gnu.org/licenses/>.

#------------------------------------------------------------------------------

import initialisations

import pygtk
import gtk

from modele import *
from modele_data import *
from commun import *
from composant_flute import *
from composant_guitare import *
from composant_harmonica import *
from composant_piano import *
from composant_clarinette import *
from composant_comparaison import *
from composant_degres import *
from composant_notes import *
from composant_selection import *
from composant_affichage import *
from composant_qcm import *

#------------------------------------------------------------------------------

def testComposantClarinette(notes):
	win = gtk.Window()
	obj = ComposantClarinette(notes)
	win.add(obj.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()
		
def testComposantFlute(notes):
	win = gtk.Window()
	obj = ComposantFlute(notes)
	win.add(obj.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()

def testComposantGuitare(notes):
	win = gtk.Window()
	obj = ComposantGuitare(notes)
	win.add(obj.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()

def testComposantHarmonica(notes):
	win = gtk.Window()
	obj = ComposantHarmonica(notes)
	win.add(obj.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()
		
def testComposantPiano(notes):
	win = gtk.Window()
	obj = ComposantPiano(notes)
	win.add(obj.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()

def testComposantDegres():
	obj = ComposantAccords()
	win = gtk.Window()
	win.add(obj.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()

def testComposantNotes():
	obj = ComposantNotes()
	win = gtk.Window()
	win.add(obj.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()

def testComposantComparaison(notes):
	win = gtk.Window()
	obj = ComposantComparaison(notes)
	win.add(obj.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()

def testComposantSelection():
	compGAM = ComposantGammes()
	compACC = ComposantAccords()
	compNOT = ComposantNotes()
	composant = ComposantSelection("", [compGAM, compACC, compNOT], gtk.POS_TOP)
	win = gtk.Window()
	win.add(composant.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()

def testComposantAffichage(notes):
	compINS = ComposantAffichage(TXT_ONG_INS, notes, [ComposantGuitare(notes), ComposantHarmonica(notes), ComposantPiano(notes),ComposantFlute(notes),ComposantClarinette(notes)], gtk.POS_TOP)
	compTHE = ComposantComparaison(notes)
	compAFF = ComposantAffichage("", notes, [compINS, compTHE], gtk.POS_TOP)
	composant = definirHBOX([compAFF.getContainer()])
	win = gtk.Window()
	win.add(composant)
	win.connect("destroy", gtk.main_quit)
	win.fullscreen()
	win.show_all()
	gtk.main()

def testComposantQCM(ton, nom):
	lis = ListeGammes()
	deg = lis.getDegres(nom)
	ens = deg.getNotes(ton, 0, False)
	com = ComposantQCM(ens)
	win = gtk.Window()
	win.add(com.getContainer())
	win.connect("destroy", gtk.main_quit)
	win.set_size_request(700, 300)
	win.show_all()
	gtk.main()

#------------------------------------------------------------------------------

if __name__ == "__main__":
	SET_AFF(MOD_NOT)
	SET_CMP(MOD_OCT)
	#testComposantFlute("Do0 Ré0 Mi0 Fa0 Sol0 La0 Si0")
	#testComposantGuitare("Do0 Ré0 Mi0 Fa0 Sol0 La0 Si0")
	#testComposantHarmonica("Do0 Ré0 Mi0 Fa0 Sol0 La0 Si0")
	#testComposantPiano("Do0 Ré0 Mi0 Fa0 Sol0 La0 Si0")
	#testComposantClarinette("Mi0 Fa0 Sol0 La0 Si0")
	#testComposantDegres()
	#testComposantNotes()
	#testComposantComparaison("Mi0 Sol0 Si0 Ré1 Fa1")
	#testComposantSelection()
	#testComposantAffichage("Mi0 Sol0 Si0 Ré1 Fa1")
	testComposantQCM("Sol", "Bartok")