Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-11-25 05:12:45 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-11-25 05:12:45 (GMT)
commite377a85e2155b2d0b7903fd4711a3c24dc90f34f (patch)
tree6f8316a00d3f047cb6be18d08552004de6d3125b
parent023903668e454940b7591be2c71ea53d30f4a91d (diff)
Add the labels to show the notes in german notation
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--activity.py15
-rw-r--r--icons/c_key.svg59
2 files changed, 74 insertions, 0 deletions
diff --git a/activity.py b/activity.py
index dc5b90f..9f300f0 100644
--- a/activity.py
+++ b/activity.py
@@ -70,6 +70,12 @@ class SimplePianoActivity(activity.Activity):
notes_labels.connect('clicked', self.set_notes_labels_cb)
toolbar_box.toolbar.insert(notes_labels, -1)
+ german_labels = RadioToolButton()
+ german_labels.props.icon_name = 'c_key'
+ german_labels.props.group = keybord_labels
+ german_labels.connect('clicked', self.set_german_labels_cb)
+ toolbar_box.toolbar.insert(german_labels, -1)
+
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
@@ -88,6 +94,11 @@ class SimplePianoActivity(activity.Activity):
'SOL#', 'LA', 'LA#', 'SI']
self.notes_labels = [notes, notes, ['DO']]
+ german_notes = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G',
+ 'G#', 'A', 'A#', 'B']
+
+ self.german_labels = [german_notes, german_notes, ['C']]
+
self.piano = PianoKeyboard(octaves=2, add_c=True,
labels=self.keyboard_letters)
@@ -147,6 +158,10 @@ class SimplePianoActivity(activity.Activity):
self.piano.font_size = 20
self.piano.set_labels(self.keyboard_letters)
+ def set_german_labels_cb(self, widget):
+ self.piano.font_size = 20
+ self.piano.set_labels(self.german_labels)
+
def enableKeyboard(self):
self.keyboardStandAlone = KeyboardStandAlone(self.sequencer.recording,
self.sequencer.adjustDuration, self.csnd.loopGetTick,
diff --git a/icons/c_key.svg b/icons/c_key.svg
new file mode 100644
index 0000000..fa9a0d4
--- /dev/null
+++ b/icons/c_key.svg
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ width="55"
+ height="55"
+ viewBox="0 0 55 55"
+ id="svg3062"
+ xml:space="preserve"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="c_key.svg"><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1366"
+ inkscape:window-height="709"
+ id="namedview3050"
+ showgrid="false"
+ inkscape:zoom="9.2909091"
+ inkscape:cx="13.61546"
+ inkscape:cy="27.5"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg3062" /><metadata
+ id="metadata3079"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs3077" />
+
+
+
+<text
+ x="22.244463"
+ y="32.999866"
+ transform="scale(0.82460938,1.2126954)"
+ id="text3857"
+ xml:space="preserve"
+ style="font-size:30.8579998px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Sans"
+ sodipodi:linespacing="125%"><tspan
+ x="22.244463"
+ y="32.999866"
+ id="tspan3859"
+ style="font-weight:bold;-inkscape-font-specification:Sans Bold">C</tspan></text>
+
+</svg> \ No newline at end of file