comparison bin/curvecalc @ 964:ced2c5e5fb31

curvecalc can finally change songs without restarting, and it can optionally track the song from ascoltami (beware of losing curve edits in this mode!) Ignore-this: 3a5349b015605c3a8d640d30ea255000
author drewp@bigasterisk.com
date Sat, 15 Jun 2013 08:21:33 +0000
parents fa78048a3240
children 16c771461cde
comparison
equal deleted inserted replaced
963:56218ce0fd37 964:ced2c5e5fb31
76 76
77 def setSong(): 77 def setSong():
78 songChoice(graph.value(session, L9['currentSong'])) 78 songChoice(graph.value(session, L9['currentSong']))
79 graph.addHandler(setSong) 79 graph.addHandler(setSong)
80 # next here, watch songChoice and patch the graph 80 # next here, watch songChoice and patch the graph
81 def songToGraph(newSong):
82 graph.patchObject(context=session, subject=session,
83 predicate=L9['currentSong'], newObject=newSong)
84 songChoice.subscribe(songToGraph)
85 def current_player_song(song):
86 # (this is run on every frame)
87 ps = wtree.get_object("playerSong")
88 if URIRef(ps.get_uri()) != song:
89 print "update playerSong"
90 def setLabel():
91 ps.set_label(graph.label(song))
92 graph.addHandler(setLabel)
93 ps.set_uri(song)
94 if song != songChoice():
95 if wtree.get_object("followPlayerSongChoice").get_active():
96 songChoice(song)
97
98 self.current_player_song = current_player_song
99 dispatcher.connect(current_player_song, "current_player_song")
81 100
82 ec = EditChoice(graph, songChoice, label="Editing song:") 101 ec = EditChoice(graph, songChoice, label="Editing song:")
83 wtree.get_object("currentSongEditChoice").add(ec) 102 wtree.get_object("currentSongEditChoice").add(ec)
84 ec.show() 103 ec.show()
85 104