Skip to content

Commit

Permalink
rly slow for some reason ;~~;
Browse files Browse the repository at this point in the history
  • Loading branch information
pussinboot committed Oct 22, 2015
1 parent 15d794c commit 6cba1da
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 190 deletions.
74 changes: 74 additions & 0 deletions v0.5.0/Twitch.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[IO]
Input Name = Twitch
Input ID = 1

[Keys]
previous set = [151, 18]
scale 2nd layer =
next = [152, 19]
l pad #6 = [151, 101]
l pad #7 = [151, 102]
prev = [152, 18]
change amplitude =
l pad #4 = [151, 99]
cycle waveform =
r pad #6 = [152, 101]
scale waveform =
r pad #1 = [152, 96]
waveform opacity =
r pad #7 = [152, 102]
motion left/right = [184, 53]
stop = [152, 22]
r pad #3 = [152, 98]
l pad #3 = [151, 98]
rotate =
next set = [151, 19]
motion up/down = [183, 53]
l pad #2 = [151, 97]
flip 2nd layer =
r pad #2 = [152, 97]
l pad #5 = [151, 100]
r pad #5 = [152, 100]
r pad #8 = [152, 103]
r pad #4 = [152, 99]
play/pause = [152, 23]
zoom =
l pad #8 = [151, 103]
l pad #1 = [151, 96]
brightness =

[Type]
previous set = p
scale 2nd layer = o
next = p
l pad #6 = p
l pad #7 = p
prev = p
change amplitude = o
l pad #4 = p
cycle waveform = p
r pad #6 = p
scale waveform = o
r pad #1 = p
waveform opacity = o
r pad #7 = p
motion left/right = s
stop = p
r pad #3 = p
l pad #3 = p
rotate = o
next set = p
motion up/down = s
l pad #2 = p
flip 2nd layer = p
r pad #2 = p
l pad #5 = p
r pad #5 = p
r pad #8 = p
r pad #4 = p
play/pause = p
zoom = o
l pad #8 = p
l pad #1 = p
brightness = o

17 changes: 12 additions & 5 deletions v0.5.0/mdvj.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from db import Database
from control_md import ControlMD
from screenshot import Screenshot
import midi_config

class MainGui:
""" the main gui """
Expand Down Expand Up @@ -131,15 +132,21 @@ def __init__(self):
# load config
print('config exists')
else:
Screenshot()
#Screenshot()
#ConfigMidi(tk.Toplevel())
midi_config.main()
main()
# and then configure midi controller : )
# and then finna run the fun


if __name__ == '__main__':
def main():
root = tk.Tk()
root.title("mdvj")
root.resizable(0,0)
#Setup()
gui = MainGui(root)
root.mainloop()
root.mainloop()
if __name__ == '__main__':

Setup()
#
#
46 changes: 29 additions & 17 deletions v0.5.0/midi_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self,master):
self.queue = None
self.start_fun = lambda : None
self.midi_started = False

self.input_storage = None
# tk stuff
self.nb = ttk.Notebook(self.master)
self.nb.pack()
Expand Down Expand Up @@ -50,7 +50,6 @@ def __init__(self,master):
# first popup with selection of inputs
# and outputs as well
#self.start()
self.load()
# then presented with list of
# midi-key | md function

Expand Down Expand Up @@ -154,9 +153,9 @@ def return_vals():
if choices[1] in outputs:
tor[1] = device_dict[1][choices[1]]
device_select.destroy()
self.load(choices[0]+'.ini')
self.master.wm_state('normal')
#return tor # this wont work..
#print(tor)
self.input_storage = [choices[0], str(tor[0])]
self.MC.set_inp(tor[0])
self.midi_started = True
self.start_fun()
Expand Down Expand Up @@ -238,40 +237,53 @@ def load(self,fname='vj_config.ini'):
Config.read(fname)
for o in self.dict:
try:
key = Config.get('Key',o)
key = Config.get('Keys',o)

control_type = Config.get('Type',o)
self.dict[o][0].set(key)
self.dict[o][1].set(control_type)
except:
print(o,'failed to load')
return int(Config.get('IO','Input ID'))

def save(self):
if not self.input_storage[0] or self.input_storage[0] == '-':
return
fname = self.input_storage[0]+'.ini'

def save(self,fname='vj_config.ini'):
Config = configparser.RawConfigParser()
Config.optionxform = str
cfgfile = open(fname,'w')
if not Config.has_section("Key"):
Config.add_section('Key')
if not Config.has_section("Type"):
Config.add_section('Type')
if not Config.has_section('IO'):
Config.add_section('IO')
Config.set('IO','Input Name',self.input_storage[0])
Config.set('IO','Input ID',self.input_storage[1])
keyname = "Keys"
typename = "Type"
if not Config.has_section(keyname):
Config.add_section(keyname)
if not Config.has_section(typename):
Config.add_section(typename)
for k in self.dict:
Config.set('Key',k,self.dict[k][0].get())
Config.set('Type',k,self.dict[k][1].get())
Config.set(keyname,k,self.dict[k][0].get())
Config.set(typename,k,self.dict[k][1].get())
Config.write(cfgfile)
cfgfile.close()

def quit(self):
self.save()
#self.master.destroy()




if __name__ == '__main__':
def main():
root = tk.Tk()
root.wm_state('iconic')
config = ConfigMidi(root)
midi_thread = MidiClient(root,config,250)
midi_thread = MidiClient(root,config,100)
config.set_MC(midi_thread.MC)
config.set_start_op(midi_thread.start)
config.start()
root.mainloop()


if __name__ == '__main__':
main()
70 changes: 0 additions & 70 deletions v0.5.0/vj_config.ini

This file was deleted.

98 changes: 0 additions & 98 deletions v0.5.0/vj_config_backup.ini

This file was deleted.

0 comments on commit 6cba1da

Please sign in to comment.