C5YAMU7DCHM55Y6XRTZHZBHBAN3FRPHSNP75PTWQNXLMFGGWHXZQC
WR3N7TWWPZLA2JPBG3DBAYK6YNQRMA4X4GNZRVIHZARN65BNIRKAC
QY3TGOEHGWZKJX3YE3XCNMQTCL3RGFJJAX5R4NUGH2HPE2JV6GNAC
EZHO4TSWIYYUE73S6XQWIEF3HA3H7MKCNJOT27NTWTVSPVS2SL5QC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
OYKTFGBR3B5I6QZRGP5XWQ5OU5JXBC5HXPTJPJZOA5AN3P35IRQQC
TRKFVOL7TVS6SLVW3DZMNDMLQEIGRWFIABGXA4YVYCOSPVTH2IRQC
LFLBKJFWWNPL6RVB6PHOE5FNHSMRUMGBOSCP5LKH5RJDVVUI2UBAC
PCIXQTNS34K6V672C7RFI6FM5KLPZKGDDI56TR35WCZMVUMPI2MQC
IBLDYAK2M5FN5XZNOWIQDN3BTUQGCPPP7R72D2YGKJITX64PJQKQC
2ELOFNFZIM4RVILKIXDKKWPE6CVSWGI36HJPCV4JU5Z5TV2AYPCAC
7T3YYRL4PXCPI2L24IM2I4VV3YQMQP5J72M7RQMX7NLXHFK7STMQC
WIKPYMSPVUBU4F6NAUAM7WD7RMXCYZGWZ2Y2ZRVVQLYPYO65SQ3AC
G5BUJAF22ZJHHAO3E624PU6ZN3C5YSYHZXFDFWYXCCO6JTGYK2NQC
54UFWEVZ7PP2P3EQBPONJJ4Q3MKITLA2GOJY652TGQR34DNEF65QC
62ZSRAF5GN3UMOY3B2XD22BK3POFOKBJ2WUEYRKOVME75VU24UQQC
7PMEO4GFIWAEZYONKVRWYLF3UPOW6JWVX6LFRAJUGRENLN2JUEFQC
ZAOOBVQ37BL2LABIRZ6PPX5QFZNAFWS4WU3Z6OX7J4E725FIPLSAC
5UCLBIFY4LTDA2EGR2SNK4Z7YPJ5IC3CSBYZ6ZYQQ7KYCRLSIZ4QC
6YXYTHFCHJVY6EAFVYME6UMQWB7GLGICNRDAJZ3EC2MH77JA2YEAC
LRDM35CEK3OHXOTB7TEFJRL7P6PQWO5ZG3F2BVA7DIDFHBPJQ7KAC
MD3W5IRAC6UQALQE4LJC52VQNDO3I3HXF3XE2XHDABXBYJBUVAXQC
FS2ITYYHBLFT66YUC3ENPFYI2HOYHOVEPQIN7NQR6KF5MEK4NKZAC
on.load_settings = function(settings)
Font_height = settings.font_height
Line_height = settings.line_height
for _,w in ipairs(settings.words) do
new_word()
Cursor_word.contents = w
Cursor_word.lines[1].data = w
Text.redraw_all(Cursor_word)
end
Cursor_word = nil
end
on.keychord_press = function(chord, key)
if chord == '#' then
if Mode == 'teach' then Mode = 'learn'
else Mode = 'teach' end
return
end
if Mode == 'teach' then
teach_keychord_press(chord, key)
else
learn_keychord_press(chord, key)
end
end
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
learn_keychord_press = function(chord, key)
if chord == 'return' then
if trim(Workbook.lines[1].data) == trim(Words[Answer_idx].contents) then
print('correct!')
Workbook.lines[1].data = ''
Workbook.cursor1 = {line=1, pos=1}
Text.redraw_all(Workbook)
Answer_idx = love.math.random(#Words)
play(Answer_idx)
else
print(':(')
end
else
edit.keychord_press(Workbook, chord, key)
end
end
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif exists(Words[word_idx].contents..'.wav') then
Words[word_idx].recording = love.sound.newSoundData(Words[word_idx].contents..'.wav')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif file_exists(Words[word_idx].contents..'.wav') then
Words[word_idx].recording = love.sound.newSoundData(Words[word_idx].contents..'.wav')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif love.filesystem.exists(Words[word_idx].contents..'.sounddata') then
Words[word_idx].recording = love.sound.newSoundData(Words[word_idx].contents..'.sounddata')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
print(Words[word_idx].recording:getSampleCount(), Words[word_idx].recording:getSampleRate())
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start(10*8000, 8000)
Recording_word = Words[word_idx]
Playing_source = nil
end
{"teach_text_input":49,"learn_mouse_press":57,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"learn_key_release":61,"on.text_input":54,"learn_text_input":60,"draw_learn_screen":4,"learn_keychord_press":59,"on.draw":5,"learn_mouse_release":58,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":60,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":124,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":118,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":122,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":125,"Words":12,"draw_new_word_button":117,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"draw_teach_word":68,"on_play":96,"on_record":95,"teach_mouse_release":46,"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"play":135,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"Recording_device":132,"on.text_input":54,"teach_mouse_press":88,"Playing_source":126,"teach_key_release":56,"on_new_word_button":118,"to_word_idx":94,"new_word":64,"Cursor_word":24,"on":1,"on_word":80,"draw_playing_button":130,"learn_mouse_release":58,"fw_parent":135,"draw_play_button":75,"fw_app":"spell-cards","record":134}
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":140,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":139,"on_record":95,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"Recording_word":138,"teach_mouse_release":46,"teach_key_release":56}
{"draw_play_button":141,"on.keychord_press":53,"play":177,"on.text_input":54,"Playing_source":126,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"on.load_settings":193,"to_word_idx":94,"Recording_word":138,"record":189,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"exists":175,"on.key_release":55,"teach_mouse_release":46,"draw_teach_screen":110,"teach_keychord_press":47,"on.mouse_release":52,"teach_key_release":56,"save_wav":171,"draw_learn_screen":4,"on":1,"on.draw":5,"on.mouse_press":51,"file_exists":176,"teach_text_input":49,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"on_record":95,"learn_keychord_press":59,"Words":12,"learn_text_input":60,"learn_mouse_release":58,"learn_key_release":61,"Mode":2,"draw_playing_button":130,"Cursor_word":24,"on.save_settings":192,"fw_parent":192,"draw_record_button":140,"fw_app":"spell-cards"}
{"to_word_idx":94,"Recording_word":138,"record":156,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"draw_learn_screen":4,"on.draw":5,"fw_parent":155,"Words":12,"fw_app":"spell-cards","on.initialize":7,"on":1,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"draw_playing_button":130,"learn_text_input":60,"learn_key_release":61,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"draw_teach_screen":110,"on.key_release":55,"teach_text_input":49,"on.text_input":54,"Recording_device":132,"Playing_source":126,"draw_recording_button":133,"on_record":95,"on_new_word_button":118,"Cursor_word":24,"new_word":64,"draw_new_word_button":117,"play":155,"on_word":80,"Mode":2,"learn_keychord_press":59}
{"teach_text_input":49,"learn_mouse_press":57,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"on.text_input":54,"learn_text_input":60,"draw_learn_screen":4,"learn_keychord_press":59,"on.draw":5,"learn_mouse_release":58,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":59,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
{"on.save_settings":200,"draw_record_button":140,"draw_play_button":141,"on.load_settings":232,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"play":235,"draw_teach_screen":110,"on_new_word_button":118,"teach_key_release":56,"teach_text_input":49,"on_word":80,"on.initialize":202,"to_word_idx":94,"Font_height":8,"Line_height":9,"record":189,"fw_parent":238,"learn_keychord_press":237,"on_play":96,"learn_text_input":222,"learn_mouse_release":220,"learn_mouse_press":219,"on_record":95,"file_exists":176,"on.mouse_press":51,"Answer_idx":206,"on.mouse_release":52,"save_wav":171,"on.keychord_press":239,"draw_playing_button":130,"on.key_release":55,"on.draw":5,"on.text_input":54,"learn_initialize":236,"Cursor_word":24,"Words":12,"on":1,"draw_new_word_button":117,"Workbook":198,"new_word":225,"draw_learn_screen":210,"draw_recording_button":133,"Mode":199,"fw_app":"spell-cards","exists":175,"draw_teach_word":68,"Recording_device":132,"learn_key_release":223,"Playing_source":126,"Recording_word":138}
{"learn_text_input":222,"learn_key_release":223,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":238,"on.key_release":55,"save_wav":171,"Cursor_word":24,"on_new_word_button":118,"new_word":225,"Recording_device":132,"on_word":80,"Recording_word":138,"on":1,"to_word_idx":94,"Playing_source":126,"on.text_input":54,"on_record":95,"record":189,"fw_app":"spell-cards","teach_text_input":49,"fw_parent":237,"draw_teach_word":68,"exists":175,"teach_key_release":56,"learn_keychord_press":237,"on.save_settings":200,"teach_mouse_press":88,"teach_keychord_press":47,"teach_mouse_release":46,"on.load_settings":232,"Mode":199,"on_play":96,"draw_teach_screen":110,"learn_initialize":236,"draw_learn_screen":210,"Workbook":198,"on.draw":5,"play":235,"Words":12,"draw_recording_button":133,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"Answer_idx":206,"file_exists":176,"draw_playing_button":130,"learn_mouse_release":220}
{"teach_text_input":49,"Recording_word":138,"on.draw":5,"Words":12,"on.initialize":7,"on_play":96,"Font_height":8,"learn_mouse_press":57,"fw_parent":164,"learn_mouse_release":58,"fw_app":"spell-cards","learn_keychord_press":59,"on":1,"learn_key_release":61,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"play":165,"on_new_word_button":118,"new_word":64,"on_word":80,"to_word_idx":94,"record":162,"draw_learn_screen":4,"draw_teach_screen":110,"draw_recording_button":133,"draw_teach_word":68,"learn_text_input":60,"on_record":95,"draw_playing_button":130,"Line_height":9,"teach_mouse_press":88,"Playing_source":126,"teach_mouse_release":46,"Recording_device":132,"Mode":2,"on.keychord_press":53,"teach_key_release":56,"teach_keychord_press":47}
{"learn_key_release":61,"new_word":64,"draw_record_button":140,"draw_play_button":141,"file_exists":176,"Playing_source":126,"on_new_word_button":118,"exists":175,"Recording_device":132,"on_word":80,"Mode":2,"on":1,"draw_teach_screen":110,"Recording_word":138,"record":172,"on.draw":5,"on.initialize":7,"Words":12,"draw_teach_word":68,"on_play":96,"draw_learn_screen":4,"Font_height":8,"fw_app":"spell-cards","on_record":95,"learn_keychord_press":59,"play":177,"teach_mouse_release":46,"teach_keychord_press":47,"teach_mouse_press":88,"teach_key_release":56,"Line_height":9,"teach_text_input":49,"to_word_idx":94,"learn_mouse_release":58,"draw_recording_button":133,"on.mouse_press":51,"fw_parent":176,"on.mouse_release":52,"draw_new_word_button":117,"on.keychord_press":53,"learn_mouse_press":57,"on.key_release":55,"save_wav":171,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"learn_text_input":60}
{"fw_parent":196,"learn_mouse_release":58,"fw_app":"spell-cards","learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_new_word_button":117,"on.mouse_press":51,"draw_record_button":140,"save_wav":171,"draw_play_button":141,"on.keychord_press":194,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"on_word":80,"exists":175,"draw_playing_button":130,"play":197,"record":189,"Line_height":9,"learn_mouse_press":57,"on.save_settings":192,"to_word_idx":94,"draw_teach_word":68,"Recording_device":132,"on.load_settings":193,"draw_recording_button":133,"teach_mouse_release":46,"teach_mouse_press":88,"teach_key_release":56,"file_exists":176,"Recording_word":138,"Mode":2,"on.mouse_release":52,"draw_teach_screen":110,"draw_learn_screen":4,"teach_text_input":49,"on_play":96,"on.draw":5,"teach_keychord_press":47,"Words":12,"on_record":95,"on.initialize":7,"Playing_source":126,"Font_height":8,"on":1}
{"on.save_settings":200,"Words":12,"on.initialize":202,"on_word":80,"Font_height":8,"to_word_idx":94,"Recording_word":138,"record":189,"draw_teach_word":68,"learn_initialize":224,"on.mouse_press":51,"on_record":95,"on.mouse_release":52,"teach_mouse_release":46,"fw_parent":230,"teach_keychord_press":47,"fw_app":"spell-cards","teach_key_release":56,"teach_text_input":49,"play":197,"Workbook":198,"teach_mouse_press":88,"exists":175,"draw_new_word_button":117,"file_exists":176,"learn_mouse_press":219,"on_new_word_button":118,"draw_recording_button":133,"on.load_settings":201,"draw_playing_button":130,"Recording_device":132,"learn_text_input":222,"save_wav":171,"learn_key_release":223,"Answer_idx":206,"learn_keychord_press":231,"new_word":225,"on":1,"Line_height":9,"draw_record_button":140,"Cursor_word":24,"draw_play_button":141,"on.keychord_press":194,"on_play":96,"on.key_release":55,"Mode":199,"on.text_input":54,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"learn_mouse_release":220,"on.draw":5}
{"draw_new_word_button":117,"learn_mouse_press":219,"draw_recording_button":133,"draw_playing_button":130,"learn_text_input":222,"learn_key_release":223,"on.mouse_release":52,"play":235,"on.keychord_press":194,"file_exists":176,"draw_record_button":140,"draw_play_button":141,"Cursor_word":24,"Playing_source":126,"on.text_input":54,"learn_keychord_press":237,"on_new_word_button":118,"on.save_settings":200,"new_word":225,"on.key_release":55,"Recording_device":132,"on_word":80,"on":1,"on.mouse_press":51,"to_word_idx":94,"learn_mouse_release":220,"Words":12,"Workbook":198,"record":189,"Answer_idx":206,"on.initialize":202,"save_wav":171,"draw_teach_word":68,"learn_initialize":236,"exists":175,"on_play":96,"Mode":199,"teach_mouse_press":88,"draw_teach_screen":110,"teach_mouse_release":46,"draw_learn_screen":210,"teach_keychord_press":47,"on.draw":5,"teach_key_release":56,"fw_parent":236,"teach_text_input":49,"fw_app":"spell-cards","on_record":95,"Font_height":8,"on.load_settings":232,"Line_height":9,"Recording_word":138}
{"draw_teach_word":68,"Playing_source":126,"teach_mouse_press":88,"teach_mouse_release":46,"Recording_device":132,"on_word":80,"draw_teach_screen":110,"fw_parent":187,"draw_learn_screen":4,"fw_app":"spell-cards","on.draw":5,"Recording_word":138,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"exists":175,"record":188,"Cursor_word":24,"on_record":95,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"play":177,"save_wav":171,"on.mouse_release":52,"draw_playing_button":130,"on_new_word_button":118,"draw_recording_button":133,"new_word":64,"Mode":2,"on_play":96,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_key_release":61,"teach_keychord_press":47}
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
learn_initialize = function()
Workbook = edit.initialize_state(
50, -- top
20 + 50, App.screen.width-50,
Font_height, Line_height)
Text.redraw_all(Workbook)
Answer_idx = love.math.random(#Words)
if Answer_idx then
play(Answer_idx)
end
end
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":123,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":118,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":122,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":124,"Words":12,"draw_new_word_button":117,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
learn_keychord_press = function(chord, key)
if chord == 'return' then
if trim(Workbook.lines[1].data) == trim(Words[Answer_idx].contents) then
print('correct!')
Workbook.lines[1].data = ''
Text.redraw_all(Workbook)
Answer_idx = love.math.random(#Words)
play(Answer_idx)
else
print(':(')
end
else
edit.keychord_press(Workbook, chord, key)
end
end
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif love.filesystem.exists(Words[word_idx].contents..'.sounddata') then
Words[word_idx].recording = love.audio.newSoundData(Words[word_idx].contents..'.sounddata')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"draw_teach_word":68,"on_play":96,"on_record":95,"teach_mouse_release":46,"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"play":135,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"Recording_device":132,"on.text_input":54,"teach_mouse_press":88,"Playing_source":126,"teach_key_release":56,"on_new_word_button":118,"to_word_idx":94,"new_word":64,"Cursor_word":24,"on":1,"on_word":80,"draw_playing_button":130,"learn_mouse_release":58,"fw_parent":134,"draw_play_button":75,"fw_app":"spell-cards","Recording":103,"record":134}
{"teach_text_input":49,"learn_mouse_press":57,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"on.text_input":54,"draw_learn_screen":4,"learn_keychord_press":59,"on.draw":5,"learn_mouse_release":58,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":58,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
play = function(word_idx)
print('play', word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif file_exists(Words[word_idx].contents..'.wav') then
Words[word_idx].recording = love.sound.newSoundData(Words[word_idx].contents..'.wav')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":139,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":75,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":139,"on_record":95,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"Recording_word":138,"teach_mouse_release":46,"teach_key_release":56}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
print(Words[word_idx].recording:getSampleCount(), Words[word_idx].recording:getSampleRate())
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start(80000, 8000) -- 10 seconds
Recording_word = Words[word_idx]
Playing_source = nil
end
{"learn_key_release":61,"new_word":64,"draw_record_button":140,"draw_play_button":141,"file_exists":176,"Playing_source":126,"on_new_word_button":118,"exists":175,"Recording_device":132,"on_word":80,"Mode":2,"on":1,"draw_teach_screen":110,"Recording_word":138,"record":172,"on.draw":5,"on.initialize":7,"Words":12,"draw_teach_word":68,"on_play":96,"draw_learn_screen":4,"Font_height":8,"fw_app":"spell-cards","on_record":95,"learn_keychord_press":59,"play":174,"teach_mouse_release":46,"teach_keychord_press":47,"teach_mouse_press":88,"teach_key_release":56,"Line_height":9,"teach_text_input":49,"to_word_idx":94,"learn_mouse_release":58,"draw_recording_button":133,"on.mouse_press":51,"fw_parent":175,"on.mouse_release":52,"draw_new_word_button":117,"on.keychord_press":53,"learn_mouse_press":57,"on.key_release":55,"save_wav":171,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"learn_text_input":60}
{"to_word_idx":94,"Recording_word":138,"record":153,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"draw_learn_screen":4,"on.draw":5,"fw_parent":153,"Words":12,"fw_app":"spell-cards","on.initialize":7,"on":1,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"draw_playing_button":130,"learn_text_input":60,"learn_key_release":61,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"draw_teach_screen":110,"on.key_release":55,"teach_text_input":49,"on.text_input":54,"Recording_device":132,"Playing_source":126,"draw_recording_button":133,"on_record":95,"on_new_word_button":118,"Cursor_word":24,"new_word":64,"draw_new_word_button":117,"play":155,"on_word":80,"Mode":2,"learn_keychord_press":59}
{"on.text_input":54,"Cursor_word":24,"on":1,"on_new_word_button":118,"new_word":64,"on_word":80,"Playing_source":126,"record":189,"Recording_device":132,"draw_teach_word":68,"fw_parent":191,"fw_app":"spell-cards","on_record":95,"Recording_word":138,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"save_wav":171,"draw_learn_screen":4,"on.save_settings":192,"on.draw":5,"file_exists":176,"exists":175,"teach_keychord_press":47,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"draw_playing_button":130,"learn_keychord_press":59,"learn_mouse_release":58,"learn_text_input":60,"Words":12,"learn_key_release":61,"teach_text_input":49,"to_word_idx":94,"play":177,"on_play":96,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"draw_teach_screen":110,"on.key_release":55,"teach_mouse_press":88}
{"teach_text_input":49,"learn_mouse_press":57,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"on.text_input":54,"draw_learn_screen":4,"on.draw":5,"learn_mouse_release":58,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":57,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
record = function(word_idx)
if Recording_device then
Recording_device:stop()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
play = function(word_idx)
cording)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Playing_source":126,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":162,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":163,"teach_keychord_press":47,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_keychord_press":59,"on.draw":5,"Mode":2,"Words":12,"play":164,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Cursor_word":24,"draw_playing_button":130,"on_record":95,"learn_text_input":60,"draw_recording_button":133,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_screen":110,"draw_learn_screen":4}
{"Font_height":8,"Line_height":9,"on_new_word_button":118,"file_exists":176,"new_word":225,"save_wav":171,"on_word":80,"to_word_idx":94,"record":189,"fw_app":"spell-cards","draw_teach_word":68,"on_play":96,"on_record":95,"Cursor_word":24,"teach_mouse_release":46,"on.draw":5,"teach_keychord_press":47,"Words":12,"teach_key_release":56,"on.save_settings":200,"teach_text_input":49,"teach_mouse_press":88,"Recording_device":132,"on.load_settings":232,"learn_initialize":236,"fw_parent":235,"Recording_word":138,"draw_new_word_button":117,"draw_teach_screen":110,"Workbook":198,"draw_learn_screen":210,"draw_recording_button":133,"on":1,"draw_playing_button":130,"exists":175,"learn_text_input":222,"play":235,"learn_key_release":223,"on.initialize":202,"Answer_idx":206,"Mode":199,"learn_mouse_release":220,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"learn_mouse_press":219,"on.key_release":55,"learn_keychord_press":231,"on.text_input":54,"Playing_source":126}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":122,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":118,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":122,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":123,"Words":12,"draw_new_word_button":117,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on.save_settings":200,"Words":12,"on.initialize":202,"on_word":80,"Font_height":8,"to_word_idx":94,"Recording_word":138,"record":189,"draw_teach_word":68,"learn_initialize":224,"on.mouse_press":51,"on_record":95,"on.mouse_release":52,"teach_mouse_release":46,"fw_parent":229,"teach_keychord_press":47,"fw_app":"spell-cards","teach_key_release":56,"teach_text_input":49,"play":197,"Workbook":198,"teach_mouse_press":88,"exists":175,"draw_new_word_button":117,"file_exists":176,"learn_mouse_press":219,"on_new_word_button":118,"draw_recording_button":133,"on.load_settings":201,"draw_playing_button":130,"Recording_device":132,"learn_text_input":222,"save_wav":171,"learn_key_release":223,"Answer_idx":206,"learn_keychord_press":230,"new_word":225,"on":1,"Line_height":9,"draw_record_button":140,"Cursor_word":24,"draw_play_button":141,"on.keychord_press":194,"on_play":96,"on.key_release":55,"Mode":199,"on.text_input":54,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"learn_mouse_release":220,"on.draw":5}
{"learn_text_input":60,"learn_key_release":61,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"on.key_release":55,"file_exists":176,"on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"fw_parent":195,"Recording_word":138,"record":189,"fw_app":"spell-cards","draw_teach_screen":110,"on.save_settings":192,"draw_teach_word":68,"on_play":96,"play":196,"save_wav":171,"Playing_source":126,"teach_mouse_press":88,"teach_text_input":49,"teach_mouse_release":46,"on":1,"Mode":2,"teach_keychord_press":47,"teach_key_release":56,"exists":175,"draw_learn_screen":4,"on_record":95,"on.draw":5,"learn_keychord_press":59,"Words":12,"draw_recording_button":133,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on.load_settings":193,"draw_playing_button":130}
{"draw_teach_word":68,"on_play":96,"on_record":95,"teach_mouse_release":46,"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"play":129,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"Recording_device":132,"on.text_input":54,"teach_mouse_press":88,"Playing_source":126,"teach_key_release":56,"on_new_word_button":118,"to_word_idx":94,"new_word":64,"Cursor_word":24,"on":1,"on_word":80,"draw_playing_button":130,"learn_mouse_release":58,"fw_parent":133,"draw_play_button":75,"fw_app":"spell-cards","Recording":103,"record":134}
{"draw_teach_word":68,"Playing_source":126,"teach_mouse_press":88,"teach_mouse_release":46,"Recording_device":132,"on_word":80,"draw_teach_screen":110,"fw_parent":186,"draw_learn_screen":4,"fw_app":"spell-cards","on.draw":5,"Recording_word":138,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"exists":175,"record":187,"Cursor_word":24,"on_record":95,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"play":177,"save_wav":171,"on.mouse_release":52,"draw_playing_button":130,"on_new_word_button":118,"draw_recording_button":133,"new_word":64,"Mode":2,"on_play":96,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_key_release":61,"teach_keychord_press":47}
{"teach_text_input":49,"learn_mouse_press":57,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"on.text_input":54,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":56,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif love.filesystem.exists(Words[word_idx].contents..'.sounddata') then
Playing_source = love.audio.newSoundData(Words[word_idx].contents..'.sounddata')
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
learn_keychord_press = function(chord, key)
if chord == 'return' then
if trim(Workbook.lines[1].data) == trim(Words[Answer_idx].contents) then
print('correct!')
else
print(':(')
end
else
edit.keychord_press(Workbook, chord, key)
end
end
{"learn_key_release":61,"new_word":64,"draw_record_button":140,"draw_play_button":141,"Playing_source":126,"on_new_word_button":118,"exists":175,"Recording_device":132,"on_word":80,"Mode":2,"on":1,"draw_teach_screen":110,"Recording_word":138,"record":172,"on.draw":5,"on.initialize":7,"Words":12,"draw_teach_word":68,"on_play":96,"draw_learn_screen":4,"Font_height":8,"fw_app":"spell-cards","on_record":95,"learn_keychord_press":59,"play":174,"teach_mouse_release":46,"teach_keychord_press":47,"teach_mouse_press":88,"teach_key_release":56,"Line_height":9,"teach_text_input":49,"to_word_idx":94,"learn_mouse_release":58,"draw_recording_button":133,"on.mouse_press":51,"fw_parent":174,"on.mouse_release":52,"draw_new_word_button":117,"on.keychord_press":53,"learn_mouse_press":57,"on.key_release":55,"save_wav":171,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"learn_text_input":60}
play = function(word_idx)
print('play', word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif exists(Words[word_idx].contents..'.wav') then
Words[word_idx].recording = love.sound.newSoundData(Words[word_idx].contents..'.wav')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":138,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"draw_play_button":75,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":139,"on_record":95,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"Recording_word":138,"teach_mouse_release":46,"teach_key_release":56}
{"to_word_idx":94,"Recording_word":138,"record":153,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"draw_learn_screen":4,"on.draw":5,"fw_parent":153,"Words":12,"fw_app":"spell-cards","on.initialize":7,"on":1,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"draw_playing_button":130,"learn_text_input":60,"learn_key_release":61,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"draw_teach_screen":110,"on.key_release":55,"teach_text_input":49,"on.text_input":54,"Recording_device":132,"Playing_source":126,"draw_recording_button":133,"on_record":95,"on_new_word_button":118,"Cursor_word":24,"new_word":64,"draw_new_word_button":117,"play":154,"on_word":80,"Mode":2,"learn_keychord_press":59}
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":189,"teach_text_input":49,"play":177,"draw_teach_word":68,"on_play":96,"fw_parent":189,"draw_teach_screen":110,"fw_app":"spell-cards","on_record":95,"exists":175,"teach_mouse_release":46,"teach_mouse_press":88,"Mode":2,"on":1,"teach_key_release":56,"Playing_source":126,"draw_learn_screen":4,"learn_keychord_press":59,"on.draw":5,"save_wav":171,"Words":12,"file_exists":176,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"learn_mouse_release":58,"draw_playing_button":130,"teach_keychord_press":47,"learn_text_input":60,"on.save_settings":191,"learn_key_release":61}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
print(Words[word_idx].recording:getSampleCount(), Words[word_idx].recording:getSampleRate())
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"teach_text_input":49,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"on.text_input":54,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":55,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":121,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":118,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":122,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":117,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"draw_teach_word":68,"on_play":96,"on_record":95,"teach_mouse_release":46,"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"play":129,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"Recording_device":132,"on.text_input":54,"teach_mouse_press":88,"Playing_source":126,"teach_key_release":56,"on_new_word_button":118,"to_word_idx":94,"new_word":64,"Cursor_word":24,"on":1,"on_word":80,"draw_playing_button":130,"learn_mouse_release":58,"fw_parent":132,"draw_play_button":75,"fw_app":"spell-cards","Recording":103,"record":128}
record = function(word_idx)
if Recording_device then
print('save recording')
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Playing_source":126,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":162,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":162,"teach_keychord_press":47,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_keychord_press":59,"on.draw":5,"Mode":2,"Words":12,"play":163,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Cursor_word":24,"draw_playing_button":130,"on_record":95,"learn_text_input":60,"draw_recording_button":133,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_screen":110,"draw_learn_screen":4}
{"on.save_settings":200,"Words":12,"on.initialize":202,"on_word":80,"Font_height":8,"to_word_idx":94,"Recording_word":138,"record":189,"draw_teach_word":68,"learn_initialize":224,"on.mouse_press":51,"on_record":95,"on.mouse_release":52,"teach_mouse_release":46,"fw_parent":228,"teach_keychord_press":47,"fw_app":"spell-cards","teach_key_release":56,"teach_text_input":49,"play":197,"Workbook":198,"teach_mouse_press":88,"exists":175,"draw_new_word_button":117,"file_exists":176,"learn_mouse_press":219,"on_new_word_button":118,"draw_recording_button":133,"on.load_settings":201,"draw_playing_button":130,"Recording_device":132,"learn_text_input":222,"save_wav":171,"learn_key_release":223,"Answer_idx":206,"learn_keychord_press":229,"new_word":225,"on":1,"Line_height":9,"draw_record_button":140,"Cursor_word":24,"draw_play_button":141,"on.keychord_press":194,"on_play":96,"on.key_release":55,"Mode":199,"on.text_input":54,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"learn_mouse_release":220,"on.draw":5}
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":137,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"draw_play_button":75,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":137,"on_record":95,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"Recording_word":138,"teach_mouse_release":46,"teach_key_release":56}
{"learn_text_input":60,"learn_key_release":61,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"on.key_release":55,"file_exists":176,"on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"fw_parent":194,"Recording_word":138,"record":189,"fw_app":"spell-cards","draw_teach_screen":110,"on.save_settings":192,"draw_teach_word":68,"on_play":96,"play":195,"save_wav":171,"Playing_source":126,"teach_mouse_press":88,"teach_text_input":49,"teach_mouse_release":46,"on":1,"Mode":2,"teach_keychord_press":47,"teach_key_release":56,"exists":175,"draw_learn_screen":4,"on_record":95,"on.draw":5,"learn_keychord_press":59,"Words":12,"draw_recording_button":133,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on.load_settings":193,"draw_playing_button":130}
{"teach_key_release":56,"play":235,"on.draw":5,"Words":12,"on.initialize":202,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":220,"on.save_settings":200,"draw_new_word_button":117,"learn_text_input":222,"on.load_settings":232,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"on.key_release":55,"on.text_input":54,"teach_keychord_press":47,"Cursor_word":24,"learn_keychord_press":231,"on_play":96,"on_new_word_button":118,"on_record":95,"new_word":225,"Playing_source":126,"Workbook":198,"on_word":80,"exists":175,"save_wav":171,"to_word_idx":94,"on":1,"Recording_device":132,"draw_learn_screen":210,"record":189,"draw_teach_screen":110,"teach_text_input":49,"file_exists":176,"draw_teach_word":68,"Recording_word":138,"fw_parent":234,"learn_initialize":234,"fw_app":"spell-cards","teach_mouse_press":88,"learn_key_release":223,"teach_mouse_release":46,"Answer_idx":206,"Mode":199}
{"teach_text_input":49,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":48,"on.key_release":55,"on.text_input":54,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":54,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
learn_keychord_press = function(chord, key)
if chord == 'return' then
if trim(Workbook.lines[1].data) == trim(Words[answer_idx].contents) then
print('correct!')
else
print(':(')
end
else
edit.keychord_press(Workbook, chord, key)
end
end
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
love.filesystem.write(Words[word_idx].contents..'.sounddata', Words[word_idx].recording:getString())
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"draw_teach_word":68,"Playing_source":126,"teach_mouse_press":88,"teach_mouse_release":46,"Recording_device":132,"on_word":80,"draw_teach_screen":110,"fw_parent":185,"draw_learn_screen":4,"fw_app":"spell-cards","on.draw":5,"Recording_word":138,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"exists":175,"record":186,"Cursor_word":24,"on_record":95,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"play":177,"save_wav":171,"on.mouse_release":52,"draw_playing_button":130,"on_new_word_button":118,"draw_recording_button":133,"new_word":64,"Mode":2,"on_play":96,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_key_release":61,"teach_keychord_press":47}
on.keychord_press = function(chord, key)
if chord == 'tab' then
if Mode == 'teach' then Mode = 'learn'
else Mode = 'teach' end
return
end
if Mode == 'teach' then
teach_keychord_press(chord, key)
else
learn_keychord_press(chord, key)
end
end
learn_initialize = function()
Workbook = edit.initialize_state(
50, -- top
20 + 50, App.screen.width-50,
Font_height, Line_height)
Text.redraw_all(Workbook)
Answer_idx = love.math.random(#Words)
print(Answer_idx)
if Answer_idx then
play(Answer_idx)
end
end
record = function(word_idx)
if Recording_device then
Recording_device:stop()
Recording_device = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Playing_source = nil
end
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":189,"exists":175,"play":177,"draw_teach_word":68,"on_play":96,"fw_parent":189,"teach_keychord_press":47,"fw_app":"spell-cards","teach_mouse_press":88,"on_record":95,"teach_mouse_release":46,"teach_text_input":49,"Mode":2,"on":1,"draw_teach_screen":110,"teach_key_release":56,"draw_learn_screen":4,"draw_recording_button":133,"on.draw":5,"draw_playing_button":130,"Words":12,"file_exists":176,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"save_wav":171,"learn_keychord_press":59,"Playing_source":126,"learn_text_input":60,"on.save_settings":190,"learn_key_release":61}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":120,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":118,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":121,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":117,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"to_word_idx":94,"record":153,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":148,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":152,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
{"draw_teach_word":68,"on_play":96,"on_record":95,"teach_mouse_release":46,"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":125,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"play":129,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"Recording_device":132,"on.text_input":54,"teach_mouse_press":88,"Playing_source":126,"teach_key_release":56,"on_new_word_button":118,"to_word_idx":94,"new_word":64,"Cursor_word":24,"on":1,"on_word":80,"draw_playing_button":130,"learn_mouse_release":58,"fw_parent":131,"draw_play_button":75,"fw_app":"spell-cards","Recording":103,"record":128}
{"teach_text_input":49,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":48,"on.key_release":22,"on.text_input":54,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":53,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
print(Words[word_idx].recording:getSampleCount())
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Playing_source":126,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":162,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":161,"teach_keychord_press":47,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_keychord_press":59,"on.draw":5,"Mode":2,"Words":12,"play":159,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Cursor_word":24,"draw_playing_button":130,"on_record":95,"learn_text_input":60,"draw_recording_button":133,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_screen":110,"draw_learn_screen":4}
{"on.save_settings":200,"Words":12,"on.initialize":202,"on_word":80,"Font_height":8,"to_word_idx":94,"Recording_word":138,"record":189,"draw_teach_word":68,"learn_initialize":224,"on.mouse_press":51,"on_record":95,"on.mouse_release":52,"teach_mouse_release":46,"fw_parent":227,"teach_keychord_press":47,"fw_app":"spell-cards","teach_key_release":56,"teach_text_input":49,"play":197,"Workbook":198,"teach_mouse_press":88,"exists":175,"draw_new_word_button":117,"file_exists":176,"learn_mouse_press":219,"on_new_word_button":118,"draw_recording_button":133,"on.load_settings":201,"draw_playing_button":130,"Recording_device":132,"learn_text_input":222,"save_wav":171,"learn_key_release":223,"Answer_idx":206,"learn_keychord_press":228,"new_word":225,"on":1,"Line_height":9,"draw_record_button":140,"Cursor_word":24,"draw_play_button":141,"on.keychord_press":194,"on_play":96,"on.key_release":55,"Mode":199,"on.text_input":54,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"learn_mouse_release":220,"on.draw":5}
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":136,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"draw_play_button":75,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":137,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"on_record":95,"teach_mouse_release":46,"teach_key_release":56}
{"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"learn_keychord_press":59,"learn_text_input":60,"on.save_settings":192,"learn_key_release":61,"Recording_device":132,"on.load_settings":193,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Recording_word":138,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"fw_parent":193,"on_word":80,"fw_app":"spell-cards","to_word_idx":94,"record":189,"file_exists":176,"draw_playing_button":130,"Mode":2,"draw_teach_word":68,"on_play":96,"learn_mouse_release":58,"draw_learn_screen":4,"save_wav":171,"teach_mouse_press":88,"on_record":95,"teach_mouse_release":46,"exists":175,"teach_keychord_press":47,"on.keychord_press":194,"teach_key_release":56,"on":1,"teach_text_input":49,"Playing_source":126,"on.draw":5,"play":177,"Words":12,"draw_teach_screen":110,"on.initialize":7,"draw_new_word_button":117}
{"teach_text_input":49,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":48,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":52,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
{"teach_key_release":56,"teach_text_input":49,"play":197,"on.save_settings":200,"fw_parent":233,"draw_new_word_button":117,"on.load_settings":232,"learn_mouse_press":219,"draw_recording_button":133,"draw_playing_button":130,"Workbook":198,"learn_text_input":222,"learn_key_release":223,"learn_initialize":234,"on.mouse_press":51,"draw_record_button":140,"Answer_idx":206,"draw_play_button":141,"on.keychord_press":194,"on.key_release":55,"teach_mouse_release":46,"on.text_input":54,"learn_mouse_release":220,"Playing_source":126,"on":1,"Cursor_word":24,"on_new_word_button":118,"on.mouse_release":52,"new_word":225,"Recording_word":138,"Recording_device":132,"on_word":80,"fw_app":"spell-cards","Font_height":8,"save_wav":171,"Mode":199,"file_exists":176,"draw_teach_screen":110,"record":189,"draw_learn_screen":210,"to_word_idx":94,"on.draw":5,"draw_teach_word":68,"Words":12,"exists":175,"on.initialize":202,"teach_mouse_press":88,"on_record":95,"on_play":96,"Line_height":9,"learn_keychord_press":231,"teach_keychord_press":47}
learn_keychord_press = function(chord, key)
if chord == 'return' then
if trim(Workbook.lines[1]) == trim(Words[answer_idx].contents) then
print('correct!')
else
print(':(')
end
else
edit.keychord_press(Workbook, chord, key)
end
end
{"draw_teach_word":68,"on_play":96,"on_record":95,"teach_mouse_release":46,"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":125,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"play":129,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"draw_learn_screen":4,"on.text_input":54,"teach_mouse_press":88,"Playing_source":126,"teach_key_release":56,"on_new_word_button":118,"to_word_idx":94,"new_word":64,"Cursor_word":24,"on":1,"on_word":80,"draw_playing_button":130,"learn_mouse_release":58,"fw_parent":130,"draw_play_button":75,"fw_app":"spell-cards","Recording":103,"record":128}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":119,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":118,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":120,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":117,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
print('saving')
love.filesystem.write(Words[word_idx].contents..'.sounddata', Words[word_idx].recording:getString())
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"draw_teach_word":68,"Playing_source":126,"teach_mouse_press":88,"teach_mouse_release":46,"Recording_device":132,"on_word":80,"draw_teach_screen":110,"fw_parent":184,"draw_learn_screen":4,"fw_app":"spell-cards","on.draw":5,"Recording_word":138,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"exists":175,"record":185,"Cursor_word":24,"on_record":95,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"play":177,"save_wav":171,"on.mouse_release":52,"draw_playing_button":130,"on_new_word_button":118,"draw_recording_button":133,"new_word":64,"Mode":2,"on_play":96,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_key_release":61,"teach_keychord_press":47}
{"to_word_idx":94,"record":152,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":148,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":151,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":189,"play":177,"draw_teach_word":68,"on_play":96,"fw_parent":188,"teach_keychord_press":47,"fw_app":"spell-cards","teach_mouse_press":88,"on_record":95,"teach_mouse_release":46,"teach_text_input":49,"Mode":2,"on":1,"draw_teach_screen":110,"teach_key_release":56,"draw_learn_screen":4,"draw_recording_button":133,"on.draw":5,"draw_playing_button":130,"Words":12,"file_exists":176,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"save_wav":171,"learn_keychord_press":59,"Playing_source":126,"learn_text_input":60,"exists":175,"learn_key_release":61}
{"teach_text_input":49,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":38,"teach_key_release":48,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":51,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
record = function(word_idx)
if Recording_device then
Recording_device:stop()
Words[word_idx].recording = Recording_device:getData()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
print(love.audio.getVolume())
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
print(Recording_device:getData():getSampleCount())
Recording_word = Words[word_idx]
Playing_source = nil
end
{"on.save_settings":200,"Words":12,"on.initialize":202,"on_word":80,"Font_height":8,"to_word_idx":94,"Recording_word":138,"record":189,"draw_teach_word":68,"learn_initialize":224,"on.mouse_press":51,"on_record":95,"on.mouse_release":52,"teach_mouse_release":46,"fw_parent":226,"teach_keychord_press":47,"fw_app":"spell-cards","teach_key_release":56,"teach_text_input":49,"play":197,"Workbook":198,"teach_mouse_press":88,"exists":175,"draw_new_word_button":117,"file_exists":176,"learn_mouse_press":219,"on_new_word_button":118,"draw_recording_button":133,"on.load_settings":201,"draw_playing_button":130,"Recording_device":132,"learn_text_input":222,"save_wav":171,"learn_key_release":223,"Answer_idx":206,"learn_keychord_press":227,"new_word":225,"on":1,"Line_height":9,"draw_record_button":140,"Cursor_word":24,"draw_play_button":141,"on.keychord_press":194,"on_play":96,"on.key_release":55,"Mode":199,"on.text_input":54,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"learn_mouse_release":220,"on.draw":5}
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Playing_source":126,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":161,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":160,"teach_keychord_press":47,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_keychord_press":59,"on.draw":5,"Mode":2,"Words":12,"play":159,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Cursor_word":24,"draw_playing_button":130,"on_record":95,"learn_text_input":60,"draw_recording_button":133,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_screen":110,"draw_learn_screen":4}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":118,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":118,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":119,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":117,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"new_word":225,"play":197,"on_word":80,"to_word_idx":94,"record":189,"file_exists":176,"draw_teach_word":68,"on_play":96,"save_wav":171,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":232,"Mode":199,"learn_keychord_press":231,"draw_teach_screen":110,"teach_keychord_press":47,"exists":175,"draw_recording_button":133,"on.draw":5,"teach_text_input":49,"Words":12,"Workbook":198,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"Playing_source":126,"Answer_idx":206,"draw_playing_button":130,"on_record":95,"learn_text_input":222,"teach_key_release":56,"learn_key_release":223,"Recording_device":132,"on.load_settings":232,"fw_app":"spell-cards","Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"on.save_settings":200,"on.key_release":55,"draw_learn_screen":210,"on.text_input":54,"learn_initialize":233,"Cursor_word":24,"on":1,"learn_mouse_release":220,"on_new_word_button":118}
{"teach_text_input":49,"on.mouse_press":51,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"teach_key_release":48,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":49,"Mode":2,"draw_teach_screen":43,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
learn_keychord_press = function(chord, key)
if chord == 'return' then
if trim(Workbook.lines[1]) == trim(Words[answer_idx].contents) then
print('correct!')
else
print(':(')
end
end
edit.keychord_press(Workbook, chord, key)
end
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
love.filesystem.write(Words[word_idx].contents..'.sounddata', Words[word_idx].recording:getString())
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"to_word_idx":94,"record":151,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":148,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":150,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
{"draw_teach_word":68,"Playing_source":126,"teach_mouse_press":88,"teach_mouse_release":46,"Recording_device":132,"on_word":80,"draw_teach_screen":110,"fw_parent":183,"draw_learn_screen":4,"fw_app":"spell-cards","on.draw":5,"Recording_word":138,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"exists":175,"record":184,"Cursor_word":24,"on_record":95,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"play":177,"save_wav":171,"on.mouse_release":52,"draw_playing_button":130,"on_new_word_button":118,"draw_recording_button":133,"new_word":64,"Mode":2,"on_play":96,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_key_release":61,"teach_keychord_press":47}
{"teach_text_input":49,"on.mouse_press":50,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"teach_key_release":48,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"teach_keychord_press":47,"Words":12,"new_word":37,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"fw_app":"spell-cards","Line_height":9,"teach_mouse_press":45,"draw_teach_screen":43,"Mode":2,"fw_parent":49,"on":1,"Cursor_word":24}
record = function(word_idx)
if Recording_device then
print('saving to word', word_idx, Recording_device:getData())
Recording_device:stop()
print('saving to word 2', word_idx, Recording_device:getData())
Words[word_idx].recording = Recording_device:getData()
print(Words[word_idx].recording)
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"on.save_settings":200,"Words":12,"on.initialize":202,"on_word":80,"Font_height":8,"to_word_idx":94,"Recording_word":138,"record":189,"draw_teach_word":68,"learn_initialize":224,"on.mouse_press":51,"on_record":95,"on.mouse_release":52,"teach_mouse_release":46,"fw_parent":225,"teach_keychord_press":47,"fw_app":"spell-cards","teach_key_release":56,"teach_text_input":49,"play":197,"Workbook":198,"teach_mouse_press":88,"exists":175,"draw_new_word_button":117,"file_exists":176,"learn_mouse_press":219,"on_new_word_button":118,"draw_recording_button":133,"on.load_settings":201,"draw_playing_button":130,"Recording_device":132,"learn_text_input":222,"save_wav":171,"learn_key_release":223,"Answer_idx":206,"learn_keychord_press":226,"new_word":225,"on":1,"Line_height":9,"draw_record_button":140,"Cursor_word":24,"draw_play_button":141,"on.keychord_press":194,"on_play":96,"on.key_release":55,"Mode":199,"on.text_input":54,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"learn_mouse_release":220,"on.draw":5}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":117,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":118,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":111,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":117,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
print(love.audio.getVolume())
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
print(Recording_device:getData():getSampleCount())
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Playing_source":126,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":160,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":159,"teach_keychord_press":47,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_keychord_press":59,"on.draw":5,"Mode":2,"Words":12,"play":159,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Cursor_word":24,"draw_playing_button":130,"on_record":95,"learn_text_input":60,"draw_recording_button":133,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_screen":110,"draw_learn_screen":4}
{"teach_text_input":49,"on.mouse_press":39,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"teach_key_release":48,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"teach_keychord_press":47,"Words":12,"new_word":37,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"fw_app":"spell-cards","Line_height":9,"teach_mouse_press":45,"draw_teach_screen":43,"Mode":2,"fw_parent":48,"on":1,"Cursor_word":24}
{"draw_teach_word":68,"draw_new_word_button":117,"teach_mouse_press":88,"teach_mouse_release":46,"draw_playing_button":130,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":202,"draw_learn_screen":210,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":220,"Playing_source":126,"learn_keychord_press":231,"exists":175,"learn_text_input":222,"draw_teach_screen":110,"learn_key_release":223,"on_new_word_button":118,"on.save_settings":200,"file_exists":176,"on.text_input":54,"Recording_device":132,"on_word":80,"on.mouse_release":52,"draw_play_button":141,"to_word_idx":94,"Mode":199,"on.key_release":55,"Recording_word":138,"record":189,"on_play":96,"Cursor_word":24,"fw_parent":231,"on.keychord_press":194,"fw_app":"spell-cards","draw_record_button":140,"new_word":225,"on":1,"on_record":95,"Answer_idx":206,"save_wav":171,"play":197,"Workbook":198,"learn_initialize":224,"draw_recording_button":133,"teach_keychord_press":47,"on.load_settings":232,"on.mouse_press":51}
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif love.filesystem.exists(Words[word_idx].contents..'.sounddata') then
print('trying to load')
Playing_source = love.audio.newSoundData(Words[word_idx].contents..'.sounddata')
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"on.mouse_press":39,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"teach_key_release":48,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"teach_keychord_press":47,"Words":12,"new_word":37,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"fw_app":"spell-cards","Line_height":9,"teach_mouse_press":45,"draw_teach_screen":43,"Mode":2,"fw_parent":47,"on":1,"Cursor_word":24}
{"to_word_idx":94,"record":150,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":148,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":149,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":116,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":114,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":111,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":117,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"draw_teach_word":68,"Playing_source":126,"teach_mouse_press":88,"teach_mouse_release":46,"Recording_device":132,"on_word":80,"draw_teach_screen":110,"fw_parent":182,"draw_learn_screen":4,"fw_app":"spell-cards","on.draw":5,"Recording_word":138,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"exists":175,"record":183,"Cursor_word":24,"on_record":95,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"play":177,"save_wav":171,"on.mouse_release":52,"draw_playing_button":130,"on_new_word_button":118,"draw_recording_button":133,"new_word":64,"Mode":2,"on_play":96,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_key_release":61,"teach_keychord_press":47}
record = function(word_idx)
if Recording_device then
Recording_device:stop()
print('saving to word', word_idx)
Words[word_idx].recording = Recording_device:getData()
print(Words[word_idx].recording)
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"on.text_input":54,"Cursor_word":24,"learn_initialize":224,"on_new_word_button":118,"on_record":95,"fw_parent":224,"on_word":80,"fw_app":"spell-cards","exists":175,"on_play":96,"draw_teach_word":68,"draw_new_word_button":117,"Recording_word":138,"draw_playing_button":130,"teach_text_input":49,"teach_mouse_press":88,"learn_mouse_release":220,"teach_mouse_release":46,"on.key_release":55,"Mode":199,"teach_keychord_press":47,"teach_key_release":56,"record":189,"draw_learn_screen":210,"Playing_source":126,"on.draw":5,"to_word_idx":94,"Words":12,"draw_recording_button":133,"on.initialize":202,"draw_teach_screen":110,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"on":1,"new_word":225,"learn_keychord_press":221,"Answer_idx":206,"learn_text_input":222,"on.mouse_release":52,"on.save_settings":200,"learn_key_release":223,"save_wav":171,"Recording_device":132,"on.load_settings":201,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":194,"Workbook":198,"play":197}
{"on.mouse_press":39,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"teach_keychord_press":47,"Words":12,"new_word":37,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"fw_app":"spell-cards","Line_height":9,"teach_mouse_press":45,"draw_teach_screen":43,"Mode":2,"fw_parent":46,"on":1,"Cursor_word":24}
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Playing_source":126,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":157,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":158,"teach_keychord_press":47,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_keychord_press":59,"on.draw":5,"Mode":2,"Words":12,"play":159,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Cursor_word":24,"draw_playing_button":130,"on_record":95,"learn_text_input":60,"draw_recording_button":133,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_screen":110,"draw_learn_screen":4}
learn_initialize = function()
Workbook = edit.initialize_state(
50, -- top
20 + 50, App.screen.width-50,
Font_height, Line_height)
Text.redraw_all(Workbook)
Answer_idx = love.math.random(#Words)
play(Answer_idx)
end
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
print(love.audio.getVolume())
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif love.filesystem.exists(Words[word_idx].contents+'.sounddata') then
print('trying to load')
Playing_source = love.audio.newSoundData(Words[word_idx].contents+'.sounddata')
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":115,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":114,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":111,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":116,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on.mouse_press":39,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"fw_app":"spell-cards","Line_height":9,"teach_mouse_press":45,"draw_teach_screen":43,"Mode":2,"fw_parent":45,"on":1,"Cursor_word":24}
{"to_word_idx":94,"record":149,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":148,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":148,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
draw_new_word_button = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 40, 5, cmd_width+10, Line_height+10)
App.color(Text_color)
App.screen.print(cmd, 40+5, 5+5)
end
teach_mouse_press = function(x,y, mouse_button)
if x >= 20 and x < 20+App.width(to_text('new word (ctrl+n)')) + 10 and
y >= 5 and y < 5 + Line_height + 10 then
new_word()
return
end
if x >= 20 and x < 100 then
local idx = math.floor((y-50)/Line_height/2)
if idx >= 1 and idx <= #Words then
Cursor_word = Words[idx]
edit.mouse_press(Cursor_word, x,y, mouse_button)
end
end
end
play = function(word_idx)
print('playing word', word_idx, Words[word_idx].recording)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"draw_teach_word":68,"Playing_source":126,"teach_mouse_press":88,"teach_mouse_release":46,"Recording_device":132,"on_word":80,"draw_teach_screen":110,"fw_parent":181,"draw_learn_screen":4,"fw_app":"spell-cards","on.draw":5,"Recording_word":138,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"exists":175,"record":182,"Cursor_word":24,"on_record":95,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"play":177,"save_wav":171,"on.mouse_release":52,"draw_playing_button":130,"on_new_word_button":118,"draw_recording_button":133,"new_word":64,"Mode":2,"on_play":96,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_key_release":61,"teach_keychord_press":47}
{"Workbook":198,"learn_key_release":223,"learn_initialize":224,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":223,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":221,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":220,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":222}
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Playing_source":126,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":157,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":157,"teach_keychord_press":47,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_keychord_press":59,"on.draw":5,"Mode":2,"Words":12,"play":158,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Cursor_word":24,"draw_playing_button":130,"on_record":95,"learn_text_input":60,"draw_recording_button":133,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_screen":110,"draw_learn_screen":4}
{"on.mouse_press":39,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Font_height":8,"fw_app":"spell-cards","Line_height":9,"teach_mouse_press":45,"draw_teach_screen":43,"Mode":2,"fw_parent":44,"on":1,"Cursor_word":24}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
print(Recording_device:getVolume())
Recording_word = Words[word_idx]
Playing_source = nil
end
{"on.mouse_press":39,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Font_height":8,"Line_height":9,"fw_app":"spell-cards","draw_teach_screen":43,"Mode":2,"fw_parent":43,"on":1,"Cursor_word":24}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":114,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":114,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":111,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":115,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
love.filesystem.write(Words[word_idx].contents+'.sounddata', Words[word_idx].recording:getString())
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"to_word_idx":94,"record":147,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":148,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":147,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
draw_new_word_button = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 40, 5, cmd_width+10, Line_height+10)
App.color(Text_color)
App.screen.print(cmd, 20+5, 5+5)
end
{"on.mouse_press":39,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Font_height":8,"Line_height":9,"fw_app":"spell-cards","draw_word":32,"draw_teach_screen":43,"Mode":2,"fw_parent":42,"on":1,"Cursor_word":24}
{"Workbook":198,"learn_key_release":223,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":222,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":221,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":220,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":222}
record = function(word_idx)
if Recording_device then
Recording_device:stop()
print('saving to word', word_idx)
Words[word_idx].recording = Recording_device:getData()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"draw_teach_word":68,"Playing_source":126,"teach_mouse_press":88,"teach_mouse_release":46,"Recording_device":132,"on_word":80,"draw_teach_screen":110,"fw_parent":180,"draw_learn_screen":4,"fw_app":"spell-cards","on.draw":5,"Recording_word":138,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"exists":175,"record":181,"Cursor_word":24,"on_record":95,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"play":177,"save_wav":171,"on.mouse_release":52,"draw_playing_button":130,"on_new_word_button":118,"draw_recording_button":133,"new_word":64,"Mode":2,"on_play":96,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_key_release":61,"teach_keychord_press":47}
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+10, Line_height+10)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 20+5, 5+5)
local y = 50
for _,word in ipairs(Words) do
draw_teach_word(word)
y = y+Line_height
end
end
{"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Playing_source":126,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"Recording_word":138,"record":157,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"fw_parent":156,"teach_keychord_press":47,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_keychord_press":59,"on.draw":5,"Mode":2,"Words":12,"play":155,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Cursor_word":24,"draw_playing_button":130,"on_record":95,"learn_text_input":60,"draw_recording_button":133,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_screen":110,"draw_learn_screen":4}
{"on.mouse_press":39,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Font_height":8,"Line_height":9,"fw_app":"spell-cards","draw_word":32,"draw_teach_screen":42,"Mode":2,"fw_parent":41,"on":1,"Cursor_word":24}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":113,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":114,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":111,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":109,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"to_word_idx":94,"record":147,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":146,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":146,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+10, Line_height+10)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 20+5, 5+5)
local y = 50
for _,word in ipairs(Words) do
draw_teach_word(word)
y = y+Line_height
end
end
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":221,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":221,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":220,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":222}
play = function(word_idx)
print('playing word', word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"on.mouse_press":39,"on.mouse_release":40,"draw_teach_word":41,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Font_height":8,"Line_height":9,"fw_app":"spell-cards","draw_word":32,"draw_teach_screen":30,"Mode":2,"fw_parent":40,"on":1,"Cursor_word":24}
{"draw_teach_word":68,"Playing_source":126,"teach_mouse_press":88,"teach_mouse_release":46,"Recording_device":132,"on_word":80,"draw_teach_screen":110,"fw_parent":179,"draw_learn_screen":4,"fw_app":"spell-cards","on.draw":5,"Recording_word":138,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"exists":175,"record":180,"Cursor_word":24,"on_record":95,"on.mouse_press":51,"draw_record_button":140,"file_exists":176,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"draw_new_word_button":117,"on.key_release":55,"on.text_input":54,"play":177,"save_wav":171,"on.mouse_release":52,"draw_playing_button":130,"on_new_word_button":118,"draw_recording_button":133,"new_word":64,"Mode":2,"on_play":96,"on":1,"teach_key_release":56,"teach_text_input":49,"learn_key_release":61,"teach_keychord_press":47}
{"draw_record_button":72,"Cursor_word":24,"play":113,"new_word":64,"to_word_idx":94,"fw_parent":112,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":111,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":109,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"to_word_idx":94,"record":145,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":146,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":145,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
{"on.mouse_press":39,"on.mouse_release":40,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Font_height":8,"Line_height":9,"fw_app":"spell-cards","draw_word":32,"draw_teach_screen":30,"Mode":2,"fw_parent":39,"on":1,"Cursor_word":24}
record = function(word_idx)
if Recording_device then
love.timer.sleep(2)
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":220,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":221,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":220,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":60}
record = function(word_idx)
if Recording_device then
Recording_device:stop()
print('saving to word', word_idx)
Words[word_idx].recording = Recording_device:getData()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
on.mouse_press = function(x,y, mouse_button)
if x >= 20 and x < 20+App.width(to_text('new word (ctrl+n)')) + 10 and
y >= 5 and y < 5 + Line_height + 10 then
new_word()
return
end
if x >= 20 and x < 100 then
local idx = math.floor((y-50)/Line_height/2)
if idx >= 1 and idx <= #Words then
Cursor_word = Words[idx]
edit.mouse_press(Cursor_word, x,y, mouse_button)
end
end
end
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":111,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":111,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":109,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":112,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on.mouse_press":39,"on.mouse_release":20,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Font_height":8,"Line_height":9,"fw_app":"spell-cards","draw_word":32,"draw_teach_screen":30,"Mode":2,"fw_parent":38,"on":1,"Cursor_word":24}
{"on_new_word_button":118,"new_word":64,"Mode":2,"on_word":80,"draw_teach_screen":110,"draw_learn_screen":4,"on.draw":5,"exists":175,"on.initialize":7,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"Line_height":9,"draw_recording_button":133,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"file_exists":176,"on":1,"learn_text_input":60,"learn_mouse_press":57,"learn_key_release":61,"Playing_source":126,"draw_playing_button":130,"learn_keychord_press":59,"Font_height":8,"fw_parent":178,"save_wav":171,"fw_app":"spell-cards","Recording_device":132,"Recording_word":138,"learn_mouse_release":58,"on.mouse_release":52,"on.mouse_press":51,"draw_record_button":140,"play":177,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"on.key_release":55,"Words":12,"on.text_input":54,"on_record":95,"Cursor_word":24,"record":179}
on.keychord_press = function(chord, key)
if chord == 'C-n' then
new_word()
elseif Cursor_word then
if chord == 'return' then
Cursor_word.contents = Cursor_word.lines[1].data
Cursor_word = nil
else
edit.keychord_press(Cursor_word, chord, key)
end
end
end
{"to_word_idx":94,"record":145,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":143,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":144,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":219,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":59,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":220,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":60}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":110,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":111,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":109,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on.mouse_press":36,"on.mouse_release":20,"on.keychord_press":38,"on.key_release":22,"on.text_input":33,"draw_learn_screen":4,"on.draw":5,"Words":12,"new_word":37,"on.initialize":7,"Font_height":8,"Line_height":9,"fw_app":"spell-cards","draw_word":32,"draw_teach_screen":30,"Mode":2,"fw_parent":37,"on":1,"Cursor_word":24}
record = function(word_idx)
if Recording_device then
love.timer.sleep(0.2)
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
record = function(word_idx)
if Recording_device then
Recording_device:stop()
Words[word_idx].recording = Recording_device:getData()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
new_word = function()
Cursor_word = edit.initialize_state(50 + (#Words+1)*Line_height*2, 20, 100, Font_height, Line_height)
Text.redraw_all(Cursor_word)
Cursor_word.contents = ''
table.insert(Words, Cursor_word)
end
{"on":1,"Line_height":9,"draw_word":32,"on.mouse_press":36,"on.mouse_release":20,"on.keychord_press":34,"draw_teach_screen":30,"fw_parent":36,"Mode":2,"fw_app":"spell-cards","on.text_input":33,"Cursor_word":24,"draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Words":12,"new_word":37,"on.initialize":7,"Font_height":8}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":109,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":108,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":109,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":110,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
on.mouse_press = function(x,y, mouse_button)
if x >= 20 and x < 20+App.width(to_text('new word (ctrl+n)')) + 10 and
y >= 5 and y < 5 + Line_height + 10 then
new_word()
return
end
if x >= 20 and x < 100 then
local idx = math.floor((y-50)/Line_height/2)
if idx >= 1 and idx <= #Words then
Cursor_word = Words[idx]
end
end
end
{"on_new_word_button":118,"new_word":64,"Mode":2,"on_word":80,"draw_teach_screen":110,"draw_learn_screen":4,"on.draw":5,"exists":175,"on.initialize":7,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"Line_height":9,"draw_recording_button":133,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"file_exists":176,"on":1,"learn_text_input":60,"learn_mouse_press":57,"learn_key_release":61,"Playing_source":126,"draw_playing_button":130,"learn_keychord_press":59,"Font_height":8,"fw_parent":177,"save_wav":171,"fw_app":"spell-cards","Recording_device":132,"Recording_word":138,"learn_mouse_release":58,"on.mouse_release":52,"on.mouse_press":51,"draw_record_button":140,"play":177,"draw_play_button":141,"on.keychord_press":53,"to_word_idx":94,"on.key_release":55,"Words":12,"on.text_input":54,"on_record":95,"Cursor_word":24,"record":178}
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":218,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":59,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":219,"Line_height":9,"learn_mouse_release":58,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":60}
{"to_word_idx":94,"record":144,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":143,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":143,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
{"on":1,"Line_height":9,"draw_word":32,"on.mouse_press":36,"on.mouse_release":20,"on.keychord_press":34,"draw_teach_screen":30,"fw_parent":35,"Mode":2,"fw_app":"spell-cards","on.text_input":33,"Cursor_word":24,"draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Words":12,"new_word":35,"on.initialize":7,"Font_height":8}
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
new_word = function()
Cursor_word = edit.initialize_state(50 + #Words*Line_height*2, 20, 100, Font_height, Line_height)
Text.redraw_all(Cursor_word)
Cursor_word.contents = ''
table.insert(Words, Cursor_word)
end
{"on":1,"Line_height":9,"draw_word":32,"on.mouse_press":27,"on.mouse_release":20,"on.keychord_press":34,"draw_teach_screen":30,"fw_parent":34,"Mode":2,"fw_app":"spell-cards","on.text_input":33,"Cursor_word":24,"draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Words":12,"new_word":35,"on.initialize":7,"Font_height":8}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":108,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":108,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":109,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":106,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"to_word_idx":94,"record":142,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":143,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":142,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":217,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":59,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":218,"Line_height":9,"learn_mouse_release":58,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":60}
draw_new_word_button = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+10, Line_height+10)
App.color(Text_color)
App.screen.print(cmd, 20+5, 5+5)
end
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":33,"on.text_input":33,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on.key_release":22,"on.initialize":7,"Cursor_word":24,"Font_height":8,"on.mouse_press":27,"Line_height":9,"draw_teach_screen":30,"draw_word":32,"on.keychord_press":34}
record = function(word_idx)
if Recording_device then
Recording_device:stop()
Words[word_idx].recording = Recording_device:data()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":32,"on.text_input":33,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on.key_release":22,"on.initialize":7,"Cursor_word":24,"Font_height":8,"on.mouse_press":27,"Line_height":9,"draw_teach_screen":30,"draw_word":32,"on.keychord_press":25}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":107,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"draw_playing_button":108,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":104,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":106,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":30,"on.text_input":23,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on.key_release":22,"on.initialize":7,"Cursor_word":24,"Font_height":8,"on.mouse_press":27,"Line_height":9,"draw_teach_screen":30,"draw_word":32,"on.keychord_press":25}
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif love.filesystem.exists(Words[word_idx].contents..'.wav') then
Words[word_idx].recording = love.sound.newSoundData(Words[word_idx].contents..'.wav')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"to_word_idx":94,"record":142,"draw_new_word_button":117,"draw_teach_word":68,"on_play":96,"draw_recording_button":133,"draw_playing_button":130,"teach_mouse_press":88,"teach_mouse_release":46,"teach_keychord_press":47,"teach_key_release":56,"teach_text_input":49,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Playing_source":126,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Mode":2,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"play":135,"on.draw":5,"draw_learn_screen":4,"on.key_release":55,"on":1,"on.text_input":54,"Line_height":9,"Cursor_word":24,"on_record":95,"fw_parent":141,"on_new_word_button":118,"fw_app":"spell-cards","new_word":64,"on.keychord_press":53,"Recording_device":132,"on_word":80,"draw_play_button":141,"draw_teach_screen":110}
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":216,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":59,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":217,"Line_height":9,"learn_mouse_release":58,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":60}
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":30,"draw_teach_screen":30,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":31,"on.keychord_press":25}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":106,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_recording_button":107,"Words":12,"draw_new_word_button":104,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":106,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Recording_device":132,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Recording_word":138,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"fw_parent":173,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"play":174,"on_new_word_button":118,"new_word":64,"on_word":80,"to_word_idx":94,"record":172,"draw_recording_button":133,"draw_playing_button":130,"draw_teach_word":68,"on":1,"save_wav":171,"on.keychord_press":53,"on_record":95,"draw_teach_screen":110,"teach_mouse_release":46,"Mode":2,"teach_keychord_press":47,"teach_mouse_press":88,"teach_key_release":56,"on_play":96,"teach_text_input":49,"fw_app":"spell-cards","on.draw":5,"draw_learn_screen":4,"Words":12,"Playing_source":126,"on.initialize":7}
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":29,"draw_teach_screen":30,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":29,"on.keychord_press":25}
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif love.filesystem.exists(Words[word_idx].contents..'.wav') then
Words[word_idx].recording = love.sound.newSoundData(Words[word_idx].contents..'.sounddata')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('sample.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":215,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":59,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":216,"Line_height":9,"learn_mouse_release":58,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":60}
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+10, Line_height+10)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 20+5, 5+5)
local y = 50
for _,word in ipairs(Words) do
draw_word(word)
y = y+Line_height*2
end
end
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":105,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"draw_new_word_button":104,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":106,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":28,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":29,"on.keychord_press":25}
{"draw_record_button":140,"draw_play_button":141,"on.mouse_press":51,"on.mouse_release":52,"fw_parent":172,"Playing_source":126,"fw_app":"spell-cards","on.key_release":55,"on_new_word_button":118,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_word":80,"new_word":64,"Recording_word":138,"record":172,"on":1,"on_play":96,"on_record":95,"draw_teach_word":68,"draw_learn_screen":4,"to_word_idx":94,"teach_mouse_press":88,"play":173,"teach_mouse_release":46,"draw_recording_button":133,"teach_keychord_press":47,"save_wav":171,"teach_key_release":56,"learn_keychord_press":59,"teach_text_input":49,"draw_new_word_button":117,"on.draw":5,"learn_mouse_press":57,"Words":12,"learn_mouse_release":58,"on.initialize":7,"draw_playing_button":130,"Font_height":8,"learn_text_input":60,"Line_height":9,"learn_key_release":61,"Mode":2,"draw_teach_screen":110,"on.keychord_press":53}
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":27,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":13,"on.keychord_press":25}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":104,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"draw_new_word_button":104,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":105,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":214,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":59,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":215,"Line_height":9,"learn_mouse_release":58,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":60}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.wav', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":26,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":13,"on.keychord_press":25}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":103,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"draw_new_word_button":104,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":25,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":26,"draw_word":13,"on.keychord_press":25}
{"draw_record_button":140,"draw_play_button":141,"on.mouse_press":51,"on.mouse_release":52,"fw_parent":171,"Playing_source":126,"fw_app":"spell-cards","on.key_release":55,"on_new_word_button":118,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_word":80,"new_word":64,"Recording_word":138,"record":172,"on":1,"on_play":96,"on_record":95,"draw_teach_word":68,"draw_learn_screen":4,"to_word_idx":94,"teach_mouse_press":88,"play":169,"teach_mouse_release":46,"draw_recording_button":133,"teach_keychord_press":47,"save_wav":171,"teach_key_release":56,"learn_keychord_press":59,"teach_text_input":49,"draw_new_word_button":117,"on.draw":5,"learn_mouse_press":57,"Words":12,"learn_mouse_release":58,"on.initialize":7,"draw_playing_button":130,"Font_height":8,"learn_text_input":60,"Line_height":9,"learn_key_release":61,"Mode":2,"draw_teach_screen":110,"on.keychord_press":53}
draw_new_word_button = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+10, Line_height+10)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 20+5, 5+5)
end
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":213,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":59,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":214,"Line_height":9,"learn_mouse_release":58,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":60}
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":24,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":19,"draw_word":13,"on.keychord_press":25}
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":23,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":19,"draw_word":13,"on.keychord_press":21}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":102,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":103,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":22,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":19,"draw_word":13,"on.keychord_press":21}
{"draw_record_button":140,"draw_play_button":141,"on.mouse_press":51,"on.mouse_release":52,"fw_parent":170,"Playing_source":126,"fw_app":"spell-cards","on.key_release":55,"on_new_word_button":118,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_word":80,"new_word":64,"Recording_word":138,"record":167,"on":1,"on_play":96,"on_record":95,"draw_teach_word":68,"draw_learn_screen":4,"to_word_idx":94,"teach_mouse_press":88,"play":169,"teach_mouse_release":46,"draw_recording_button":133,"teach_keychord_press":47,"save_wav":171,"teach_key_release":56,"learn_keychord_press":59,"teach_text_input":49,"draw_new_word_button":117,"on.draw":5,"learn_mouse_press":57,"Words":12,"learn_mouse_release":58,"on.initialize":7,"draw_playing_button":130,"Font_height":8,"learn_text_input":60,"Line_height":9,"learn_key_release":61,"Mode":2,"draw_teach_screen":110,"on.keychord_press":53}
{"Workbook":198,"learn_key_release":61,"learn_initialize":207,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"Answer_idx":206,"fw_parent":212,"on.key_release":55,"fw_app":"spell-cards","on.text_input":54,"Cursor_word":24,"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"save_wav":171,"on.save_settings":200,"Mode":199,"record":189,"on":1,"file_exists":176,"learn_keychord_press":59,"draw_teach_word":68,"on_play":96,"play":197,"teach_key_release":56,"on.load_settings":201,"teach_mouse_press":88,"on.keychord_press":194,"teach_mouse_release":46,"on_record":95,"teach_keychord_press":47,"on.mouse_press":51,"draw_teach_screen":110,"Playing_source":126,"draw_learn_screen":210,"draw_recording_button":133,"on.draw":5,"exists":175,"Words":12,"to_word_idx":94,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":213,"Line_height":9,"learn_mouse_release":58,"teach_text_input":49,"draw_playing_button":130,"Recording_word":138,"learn_text_input":60}
{"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.key_release":22,"on.draw":5,"on.keychord_press":21,"Words":12,"on":1,"on.initialize":7,"on.mouse_release":20,"Font_height":8,"on.mouse_press":19,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":21}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":101,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"record":100,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"Playing":102,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":101,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.keychord_press":21,"Words":12,"on":1,"on.initialize":7,"on.mouse_release":20,"Font_height":8,"on.mouse_press":19,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":20}
save_wav = function(filename, sounddata)
-- credit to Intas and zorg on the LÖVE forum <3
-- https://love2d.org/forums/viewtopic.php?t=86173
local samples = {}
for i = 0, sounddata:getSampleCount() - 1 do
local sample = sounddata:getSample(i)
local n
local to16bit = sample * 32767
if (to16bit > 0) then
n = math.floor(math.min(to16bit, 32767))
else
n = math.floor(math.max(to16bit, -32768))
end
table.insert(samples, n)
end
local w = wav.create_context("test.wav", "w")
w.init(sounddata:getChannelCount(), sounddata:getSampleRate(), sounddata:getBitDepth())
w.write_samples_interlaced(samples)
w.finish()
end
{"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"on.mouse_release":20,"Font_height":8,"on.mouse_press":19,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":19}
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":100,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"on.mouse_release":52,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"record":100,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"Recording":101,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"Font_height":8,"on.mouse_press":19,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":18}
{"exists":175,"on_play":96,"on_record":95,"Workbook":198,"on":1,"draw_teach_word":68,"learn_initialize":207,"teach_text_input":49,"Answer_idx":206,"teach_mouse_release":46,"teach_keychord_press":47,"record":189,"learn_mouse_press":212,"learn_mouse_release":58,"draw_learn_screen":210,"Recording_device":132,"fw_parent":211,"Cursor_word":24,"learn_text_input":60,"to_word_idx":94,"on.initialize":202,"on.load_settings":201,"Font_height":8,"draw_teach_screen":110,"Line_height":9,"Words":12,"draw_record_button":140,"Mode":199,"draw_play_button":141,"learn_key_release":61,"teach_mouse_press":88,"save_wav":171,"on_new_word_button":118,"teach_key_release":56,"draw_recording_button":133,"Playing_source":126,"on.mouse_press":51,"draw_playing_button":130,"on.mouse_release":52,"fw_app":"spell-cards","on.keychord_press":194,"draw_new_word_button":117,"on.key_release":55,"on_word":80,"on.text_input":54,"on.draw":5,"play":197,"learn_keychord_press":59,"file_exists":176,"Recording_word":138,"on.save_settings":200,"new_word":64}
{"draw_record_button":140,"draw_play_button":141,"on.mouse_press":51,"on.mouse_release":52,"fw_parent":169,"Playing_source":126,"fw_app":"spell-cards","on.key_release":55,"on_new_word_button":118,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_word":80,"new_word":64,"Recording_word":138,"record":167,"on":1,"on_play":96,"on_record":95,"draw_teach_word":68,"draw_learn_screen":4,"to_word_idx":94,"teach_mouse_press":88,"play":169,"teach_mouse_release":46,"draw_recording_button":133,"teach_keychord_press":47,"save_wav":170,"teach_key_release":56,"learn_keychord_press":59,"teach_text_input":49,"draw_new_word_button":117,"on.draw":5,"learn_mouse_press":57,"Words":12,"learn_mouse_release":58,"on.initialize":7,"draw_playing_button":130,"Font_height":8,"learn_text_input":60,"Line_height":9,"learn_key_release":61,"Mode":2,"draw_teach_screen":110,"on.keychord_press":53}
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+10, Line_height+10)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 20+5, 5+5)
local y = 50
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":99,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"record":100,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
play = function(word_idx)
if Words[word_idx].recording then
Playing_source = love.audio.newSource(Words[word_idx].recording)
elseif love.filesystem.exists(Words[word_idx].contents..'.sounddata') then
Words[word_idx].recording = love.sound.newSoundData(Words[word_idx].contents..'.sounddata')
Playing_source = love.audio.newSource(Words[word_idx].recording)
else
Playing_source = love.audio.newSource('test.wav', 'static')
end
Playing_source:play()
Recording_device = nil
end
{"exists":175,"on_play":96,"on_record":95,"Workbook":198,"on":1,"draw_teach_word":68,"learn_initialize":207,"teach_text_input":49,"Answer_idx":206,"teach_mouse_release":46,"teach_keychord_press":47,"record":189,"learn_mouse_press":211,"learn_mouse_release":58,"draw_learn_screen":210,"Recording_device":132,"fw_parent":210,"Cursor_word":24,"learn_text_input":60,"to_word_idx":94,"on.initialize":202,"on.load_settings":201,"Font_height":8,"draw_teach_screen":110,"Line_height":9,"Words":12,"draw_record_button":140,"Mode":199,"draw_play_button":141,"learn_key_release":61,"teach_mouse_press":88,"save_wav":171,"on_new_word_button":118,"teach_key_release":56,"draw_recording_button":133,"Playing_source":126,"on.mouse_press":51,"draw_playing_button":130,"on.mouse_release":52,"fw_app":"spell-cards","on.keychord_press":194,"draw_new_word_button":117,"on.key_release":55,"on_word":80,"on.text_input":54,"on.draw":5,"play":197,"learn_keychord_press":59,"file_exists":176,"Recording_word":138,"on.save_settings":200,"new_word":64}
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+4, 25)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 22, 7)
local y = 50
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":98,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"record":99,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"record":167,"new_word":64,"on":1,"save_wav":168,"on_record":95,"draw_teach_word":68,"teach_mouse_press":88,"teach_mouse_release":46,"draw_new_word_button":117,"draw_teach_screen":110,"teach_keychord_press":47,"draw_recording_button":133,"fw_parent":168,"on.draw":5,"fw_app":"spell-cards","Words":12,"teach_key_release":56,"on.initialize":7,"on.keychord_press":53,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Mode":2,"learn_keychord_press":59,"Recording_device":132,"learn_text_input":60,"Playing_source":126,"learn_key_release":61,"Recording_word":138,"draw_playing_button":130,"teach_text_input":49,"on_play":96,"on.mouse_press":51,"draw_record_button":140,"on_new_word_button":118,"draw_play_button":141,"play":169,"on.mouse_release":52,"on.key_release":55,"on_word":80,"on.text_input":54,"Cursor_word":24,"to_word_idx":94,"draw_learn_screen":4}
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
love.graphics.rectangle('fill', 20, 5, 50, 25)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print('new word (ctrl+n)', 22, 7)
local y = 50
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end
{"draw_teach_word":68,"on_play":96,"learn_initialize":207,"on_record":95,"teach_mouse_release":46,"teach_keychord_press":47,"fw_app":"spell-cards","teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"learn_keychord_press":59,"learn_text_input":60,"teach_mouse_press":88,"learn_key_release":61,"fw_parent":209,"Playing_source":126,"exists":175,"Answer_idx":206,"file_exists":176,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"draw_learn_screen":210,"on.key_release":55,"play":197,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"Recording_word":138,"teach_key_release":56,"on_new_word_button":118,"save_wav":171,"new_word":64,"on.save_settings":200,"Mode":199,"on_word":80,"draw_teach_screen":110,"on.load_settings":201,"to_word_idx":94,"on.mouse_press":51,"Recording_device":132,"learn_mouse_release":58,"record":189,"Workbook":198,"on":1}
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
love.graphics.rectangle('fill', 20, 5, 50, 25)
local y = 50
App.color{r=0.2, g=0.2, b=0.2, a=1}
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end
{"draw_record_button":72,"Cursor_word":24,"play":98,"new_word":64,"to_word_idx":94,"fw_parent":97,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
save_wav = function(filename, sounddata)
local channelCount = sounddata:getChannelCount()
local sampleRate = sounddata:getSampleRate()
local bitDepth = sounddata:getBitDepth()
local samples = {}
for i = 0, sounddata:getSampleCount() - 1 do
local sample = sounddata:getSample(i)
local n
local to16bit = sample * 32767
if (to16bit > 0) then
n = math.floor(math.min(to16bit, 32767))
else
n = math.floor(math.max(to16bit, -32768))
end
table.insert(samples, n)
end
local w = wav.create_context("test.wav", "w")
w.init(channelCount, sampleRate, bitDepth)
w.write_samples_interlaced(samples)
w.finish()
end
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
love.graphics.rectangle(20, 5, 50, 25)
local y = 50
App.color{r=0.2, g=0.2, b=0.2, a=1}
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end
{"draw_teach_word":68,"on_play":96,"on.mouse_press":51,"on_record":95,"teach_mouse_release":46,"fw_app":"spell-cards","on.text_input":54,"on":1,"Recording":103,"Playing":102,"new_word":64,"draw_new_word_button":117,"learn_mouse_press":57,"learn_mouse_release":58,"draw_playing_button":130,"learn_text_input":60,"learn_key_release":61,"play":129,"draw_record_button":72,"draw_play_button":75,"learn_keychord_press":59,"on.mouse_release":52,"Mode":2,"on.key_release":55,"draw_teach_screen":110,"draw_recording_button":125,"Playing_source":126,"teach_mouse_press":88,"on.draw":5,"on_new_word_button":118,"Words":12,"fw_parent":129,"on.initialize":7,"on.keychord_press":53,"Font_height":8,"Cursor_word":24,"Line_height":9,"to_word_idx":94,"on_word":80,"teach_key_release":56,"teach_text_input":49,"record":128,"draw_learn_screen":4,"teach_keychord_press":47}
{"draw_record_button":72,"Cursor_word":24,"play":97,"new_word":64,"to_word_idx":94,"fw_parent":96,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"record":167,"new_word":64,"on":1,"save_wav":168,"on_record":95,"draw_teach_word":68,"teach_mouse_press":88,"teach_mouse_release":46,"draw_new_word_button":117,"draw_teach_screen":110,"teach_keychord_press":47,"draw_recording_button":133,"fw_parent":167,"on.draw":5,"fw_app":"spell-cards","Words":12,"teach_key_release":56,"on.initialize":7,"on.keychord_press":53,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Mode":2,"learn_keychord_press":59,"Recording_device":132,"learn_text_input":60,"Playing_source":126,"learn_key_release":61,"Recording_word":138,"draw_playing_button":130,"teach_text_input":49,"on_play":96,"on.mouse_press":51,"draw_record_button":140,"on_new_word_button":118,"draw_play_button":141,"play":165,"on.mouse_release":52,"on.key_release":55,"on_word":80,"on.text_input":54,"Cursor_word":24,"to_word_idx":94,"draw_learn_screen":4}
{"draw_teach_word":68,"on_play":96,"learn_initialize":207,"on_record":95,"teach_mouse_release":46,"teach_keychord_press":47,"fw_app":"spell-cards","teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"learn_keychord_press":59,"learn_text_input":60,"teach_mouse_press":88,"learn_key_release":61,"fw_parent":208,"Playing_source":126,"exists":175,"Answer_idx":206,"file_exists":176,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"draw_learn_screen":209,"on.key_release":55,"play":197,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"Recording_word":138,"teach_key_release":56,"on_new_word_button":118,"save_wav":171,"new_word":64,"on.save_settings":200,"Mode":199,"on_word":80,"draw_teach_screen":110,"on.load_settings":201,"to_word_idx":94,"on.mouse_press":51,"Recording_device":132,"learn_mouse_release":58,"record":189,"Workbook":198,"on":1}
record = function(word_idx)
if Recording_device then
Words[word_idx].recording = Recording_device:getData()
Recording_device:stop()
if Words[word_idx].recording then
save_wav(Words[word_idx].contents..'.sounddata', Words[word_idx].recording)
end
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":94,"fw_parent":95,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":96,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"Cursor_word":24,"on_new_word_button":118,"new_word":64,"on_word":80,"to_word_idx":94,"record":128,"draw_teach_word":68,"on_play":96,"Mode":2,"draw_teach_screen":110,"on_record":95,"draw_learn_screen":4,"teach_mouse_release":46,"on.draw":5,"teach_keychord_press":47,"Words":12,"teach_key_release":56,"fw_app":"spell-cards","teach_text_input":49,"Font_height":8,"Recording":103,"Line_height":9,"Playing":102,"draw_new_word_button":117,"learn_mouse_press":57,"learn_mouse_release":58,"draw_playing_button":127,"Playing_source":126,"learn_text_input":60,"on":1,"learn_key_release":61,"on.text_input":54,"on.keychord_press":53,"draw_play_button":75,"on.key_release":55,"on.mouse_press":51,"draw_record_button":72,"fw_parent":128,"play":129,"teach_mouse_press":88,"draw_recording_button":125,"on.initialize":7,"on.mouse_release":52,"learn_keychord_press":59}
{"record":167,"new_word":64,"on":1,"save_wav":166,"on_record":95,"draw_teach_word":68,"teach_mouse_press":88,"teach_mouse_release":46,"draw_new_word_button":117,"draw_teach_screen":110,"teach_keychord_press":47,"draw_recording_button":133,"fw_parent":166,"on.draw":5,"fw_app":"spell-cards","Words":12,"teach_key_release":56,"on.initialize":7,"on.keychord_press":53,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Mode":2,"learn_keychord_press":59,"Recording_device":132,"learn_text_input":60,"Playing_source":126,"learn_key_release":61,"Recording_word":138,"draw_playing_button":130,"teach_text_input":49,"on_play":96,"on.mouse_press":51,"draw_record_button":140,"on_new_word_button":118,"draw_play_button":141,"play":165,"on.mouse_release":52,"on.key_release":55,"on_word":80,"on.text_input":54,"Cursor_word":24,"to_word_idx":94,"draw_learn_screen":4}
{"draw_teach_word":68,"on_play":96,"learn_initialize":207,"on_record":95,"teach_mouse_release":46,"teach_keychord_press":47,"fw_app":"spell-cards","teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"draw_recording_button":133,"learn_keychord_press":59,"learn_text_input":60,"teach_mouse_press":88,"learn_key_release":61,"fw_parent":207,"Playing_source":126,"exists":175,"Answer_idx":206,"file_exists":176,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"draw_learn_screen":208,"on.key_release":55,"play":197,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"Recording_word":138,"teach_key_release":56,"on_new_word_button":118,"save_wav":171,"new_word":64,"on.save_settings":200,"Mode":199,"on_word":80,"draw_teach_screen":110,"on.load_settings":201,"to_word_idx":94,"on.mouse_press":51,"Recording_device":132,"learn_mouse_release":58,"record":189,"Workbook":198,"on":1}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":94,"fw_parent":94,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"on_record":95,"learn_key_release":61,"on_play":93,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"Cursor_word":24,"on_new_word_button":118,"new_word":64,"on_word":80,"to_word_idx":94,"record":128,"draw_teach_word":68,"on_play":96,"Mode":2,"draw_teach_screen":110,"on_record":95,"draw_learn_screen":4,"teach_mouse_release":46,"on.draw":5,"teach_keychord_press":47,"Words":12,"teach_key_release":56,"fw_app":"spell-cards","teach_text_input":49,"Font_height":8,"Recording":103,"Line_height":9,"Playing":102,"draw_new_word_button":117,"learn_mouse_press":57,"learn_mouse_release":58,"draw_playing_button":127,"Playing_source":126,"learn_text_input":60,"on":1,"learn_key_release":61,"on.text_input":54,"on.keychord_press":53,"draw_play_button":75,"on.key_release":55,"on.mouse_press":51,"draw_record_button":72,"fw_parent":127,"play":113,"teach_mouse_press":88,"draw_recording_button":125,"on.initialize":7,"on.mouse_release":52,"learn_keychord_press":59}
{"record":162,"new_word":64,"on":1,"save_wav":166,"on_record":95,"draw_teach_word":68,"teach_mouse_press":88,"teach_mouse_release":46,"draw_new_word_button":117,"draw_teach_screen":110,"teach_keychord_press":47,"draw_recording_button":133,"fw_parent":165,"on.draw":5,"fw_app":"spell-cards","Words":12,"teach_key_release":56,"on.initialize":7,"on.keychord_press":53,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"Mode":2,"learn_keychord_press":59,"Recording_device":132,"learn_text_input":60,"Playing_source":126,"learn_key_release":61,"Recording_word":138,"draw_playing_button":130,"teach_text_input":49,"on_play":96,"on.mouse_press":51,"draw_record_button":140,"on_new_word_button":118,"draw_play_button":141,"play":165,"on.mouse_release":52,"on.key_release":55,"on_word":80,"on.text_input":54,"Cursor_word":24,"to_word_idx":94,"draw_learn_screen":4}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":94,"fw_parent":93,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"on_record":92,"learn_key_release":61,"on_play":93,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"Cursor_word":24,"on_new_word_button":118,"new_word":64,"on_word":80,"to_word_idx":94,"record":112,"draw_teach_word":68,"on_play":96,"Mode":2,"draw_teach_screen":110,"on_record":95,"draw_learn_screen":4,"teach_mouse_release":46,"on.draw":5,"teach_keychord_press":47,"Words":12,"teach_key_release":56,"fw_app":"spell-cards","teach_text_input":49,"Font_height":8,"Recording":103,"Line_height":9,"Playing":102,"draw_new_word_button":117,"learn_mouse_press":57,"learn_mouse_release":58,"draw_playing_button":127,"Playing_source":126,"learn_text_input":60,"on":1,"learn_key_release":61,"on.text_input":54,"on.keychord_press":53,"draw_play_button":75,"on.key_release":55,"on.mouse_press":51,"draw_record_button":72,"fw_parent":126,"play":113,"teach_mouse_press":88,"draw_recording_button":125,"on.initialize":7,"on.mouse_release":52,"learn_keychord_press":59}
{"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Playing_source":126,"on.save_settings":200,"draw_record_button":140,"on.mouse_release":52,"Recording_device":132,"on.load_settings":201,"fw_app":"spell-cards","on.key_release":55,"on.text_input":54,"on":1,"on_new_word_button":118,"new_word":64,"learn_initialize":207,"on_word":80,"teach_keychord_press":47,"draw_recording_button":133,"to_word_idx":94,"play":197,"Cursor_word":24,"file_exists":176,"record":189,"Workbook":198,"Recording_word":138,"on.keychord_press":194,"draw_teach_word":68,"on_play":96,"draw_play_button":141,"on.mouse_press":51,"draw_teach_screen":110,"on_record":95,"draw_new_word_button":117,"teach_mouse_release":46,"teach_text_input":49,"Mode":199,"save_wav":171,"teach_key_release":56,"draw_playing_button":130,"draw_learn_screen":205,"Answer_idx":206,"on.draw":5,"exists":175,"Words":12,"fw_parent":206,"on.initialize":202,"teach_mouse_press":88,"Font_height":8}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":87,"fw_parent":92,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"on_record":92,"learn_key_release":61,"on_play":93,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"Cursor_word":24,"on_new_word_button":118,"new_word":64,"on_word":80,"to_word_idx":94,"record":112,"draw_teach_word":68,"on_play":96,"Mode":2,"draw_teach_screen":110,"on_record":95,"draw_learn_screen":4,"teach_mouse_release":46,"on.draw":5,"teach_keychord_press":47,"Words":12,"teach_key_release":56,"fw_app":"spell-cards","teach_text_input":49,"Font_height":8,"Recording":103,"Line_height":9,"Playing":102,"draw_new_word_button":117,"learn_mouse_press":57,"learn_mouse_release":58,"draw_playing_button":122,"Playing_source":126,"learn_text_input":60,"on":1,"learn_key_release":61,"on.text_input":54,"on.keychord_press":53,"draw_play_button":75,"on.key_release":55,"on.mouse_press":51,"draw_record_button":72,"fw_parent":125,"play":113,"teach_mouse_press":88,"draw_recording_button":125,"on.initialize":7,"on.mouse_release":52,"learn_keychord_press":59}
{"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"Playing_source":126,"on.save_settings":200,"draw_record_button":140,"on.mouse_release":52,"Recording_device":132,"on.load_settings":201,"fw_app":"spell-cards","on.key_release":55,"on.text_input":54,"on":1,"on_new_word_button":118,"new_word":64,"learn_initialize":204,"on_word":80,"teach_keychord_press":47,"draw_recording_button":133,"to_word_idx":94,"play":197,"Cursor_word":24,"file_exists":176,"record":189,"Workbook":198,"Recording_word":138,"on.keychord_press":194,"draw_teach_word":68,"on_play":96,"draw_play_button":141,"on.mouse_press":51,"draw_teach_screen":110,"on_record":95,"draw_new_word_button":117,"teach_mouse_release":46,"teach_text_input":49,"Mode":199,"save_wav":171,"teach_key_release":56,"draw_playing_button":130,"draw_learn_screen":205,"Answer_idx":206,"on.draw":5,"exists":175,"Words":12,"fw_parent":205,"on.initialize":202,"teach_mouse_press":88,"Font_height":8}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":87,"fw_parent":91,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"on_record":92,"learn_key_release":61,"on_play":91,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"on.save_settings":200,"file_exists":176,"record":189,"on.load_settings":201,"draw_teach_word":68,"on_play":96,"learn_initialize":204,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":199,"teach_key_release":56,"draw_learn_screen":205,"exists":175,"fw_parent":204,"Words":12,"fw_app":"spell-cards","Playing_source":126,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on_record":95,"learn_keychord_press":59,"on":1,"learn_text_input":60,"teach_keychord_press":47,"learn_key_release":61,"on.draw":5,"teach_text_input":49,"save_wav":171,"draw_teach_screen":110,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"Recording_word":138,"on.key_release":55,"Workbook":198,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"play":197,"draw_recording_button":133}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":87,"fw_parent":90,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"on_play":91,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":87,"fw_parent":89,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"on_play":90,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"on.save_settings":200,"file_exists":176,"record":189,"on.load_settings":201,"draw_teach_word":68,"on_play":96,"learn_initialize":204,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":199,"teach_key_release":56,"draw_learn_screen":4,"exists":175,"fw_parent":203,"Words":12,"fw_app":"spell-cards","Playing_source":126,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on_record":95,"learn_keychord_press":59,"on":1,"learn_text_input":60,"teach_keychord_press":47,"learn_key_release":61,"on.draw":5,"teach_text_input":49,"save_wav":171,"draw_teach_screen":110,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"Recording_word":138,"on.key_release":55,"Workbook":198,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"play":197,"draw_recording_button":133}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":87,"fw_parent":88,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"on_play":89,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"on.save_settings":200,"file_exists":176,"record":189,"on.load_settings":201,"draw_teach_word":68,"on_play":96,"learn_initialize":203,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":199,"teach_key_release":56,"draw_learn_screen":4,"exists":175,"fw_parent":202,"Words":12,"fw_app":"spell-cards","Playing_source":126,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on_record":95,"learn_keychord_press":59,"on":1,"learn_text_input":60,"teach_keychord_press":47,"learn_key_release":61,"on.draw":5,"teach_text_input":49,"save_wav":171,"draw_teach_screen":110,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"Recording_word":138,"on.key_release":55,"Workbook":198,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"play":197,"draw_recording_button":133}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":87,"fw_parent":87,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"on.save_settings":200,"file_exists":176,"record":189,"on.load_settings":201,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":199,"teach_key_release":56,"draw_learn_screen":4,"exists":175,"fw_parent":201,"Words":12,"fw_app":"spell-cards","Playing_source":126,"on.initialize":202,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on_record":95,"learn_keychord_press":59,"on":1,"learn_text_input":60,"teach_keychord_press":47,"learn_key_release":61,"on.draw":5,"teach_text_input":49,"save_wav":171,"draw_teach_screen":110,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"Recording_word":138,"on.key_release":55,"Workbook":198,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"play":197,"draw_recording_button":133}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":87,"fw_parent":86,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":86,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
on.load_settings = function(settings)
Font_height = settings.font_height
Line_height = settings.line_height
for _,w in ipairs(settings.words) do
new_word()
Cursor_word.contents = w
Cursor_word.lines[1].data = w
Text.redraw_all(Cursor_word)
end
Cursor_word = nil
end
teach_mouse_press = function(x,y, mouse_button)
if on_new_word_button(x,y) then
new_word()
return
end
if on_word(x) then
local idx = to_word_idx(y)
if idx >= 1 and idx <= #Words then
Cursor_word = Words[idx]
edit.mouse_press(Cursor_word, x,y, mouse_button)
end
elseif on_play(x) then
play(to_word_idx(y))
elseif on_record(x) then
record(to_word_idx(y))
end
end
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":82,"fw_parent":85,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":86,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"on.save_settings":200,"file_exists":176,"record":189,"on.load_settings":201,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":199,"teach_key_release":56,"draw_learn_screen":4,"exists":175,"fw_parent":200,"Words":12,"fw_app":"spell-cards","Playing_source":126,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on_record":95,"learn_keychord_press":59,"on":1,"learn_text_input":60,"teach_keychord_press":47,"learn_key_release":61,"on.draw":5,"teach_text_input":49,"save_wav":171,"draw_teach_screen":110,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"Recording_word":138,"on.key_release":55,"Workbook":198,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"play":197,"draw_recording_button":133}
on.save_settings = function()
settings = {words={}}
for _,word in ipairs(Words) do
if word.contents and #word.contents > 0 then
table.insert(settings.words, word.contents)
end
end
settings.font_height = Font_height
settings.line_height = Line_height
return settings
end
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":82,"fw_parent":84,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":84,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"record":85,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
teach_mouse_press = function(x,y, mouse_button)
if on_new_word_button(x,y) then
new_word()
return
end
if on_word(x) then
local idx = to_word_idx(y)
if idx >= 1 and idx <= #Words then
Cursor_word = Words[idx]
edit.mouse_press(Cursor_word, x,y, mouse_button)
end
elseif on_play(x) then
record(to_word_idx(y))
elseif on_record(x) then
record(to_word_idx(y))
end
end
{"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"on.save_settings":200,"file_exists":176,"record":189,"on.load_settings":193,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":199,"teach_key_release":56,"draw_learn_screen":4,"exists":175,"fw_parent":199,"Words":12,"fw_app":"spell-cards","Playing_source":126,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on_record":95,"learn_keychord_press":59,"on":1,"learn_text_input":60,"teach_keychord_press":47,"learn_key_release":61,"on.draw":5,"teach_text_input":49,"save_wav":171,"draw_teach_screen":110,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"Recording_word":138,"on.key_release":55,"Workbook":198,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"play":197,"draw_recording_button":133}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":82,"fw_parent":83,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":84,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
teach_mouse_press = function(x,y, mouse_button)
if on_new_word_button(x,y) then
new_word()
return
end
if on_word(x) then
local idx = to_word_idx(y)
if idx >= 1 and idx <= #Words then
Cursor_word = Words[idx]
edit.mouse_press(Cursor_word, x,y, mouse_button)
end
end
end
{"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"on.save_settings":192,"file_exists":176,"record":189,"on.load_settings":193,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":199,"teach_key_release":56,"draw_learn_screen":4,"exists":175,"fw_parent":198,"Words":12,"fw_app":"spell-cards","Playing_source":126,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on_record":95,"learn_keychord_press":59,"on":1,"learn_text_input":60,"teach_keychord_press":47,"learn_key_release":61,"on.draw":5,"teach_text_input":49,"save_wav":171,"draw_teach_screen":110,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"Recording_word":138,"on.key_release":55,"Workbook":198,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"play":197,"draw_recording_button":133}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":82,"fw_parent":82,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":83,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"on_new_word_button":118,"new_word":64,"Recording_device":132,"on_word":80,"to_word_idx":94,"on.save_settings":192,"file_exists":176,"record":189,"on.load_settings":193,"draw_teach_word":68,"on_play":96,"teach_mouse_press":88,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"draw_learn_screen":4,"exists":175,"fw_parent":197,"Words":12,"fw_app":"spell-cards","Playing_source":126,"on.initialize":7,"draw_new_word_button":117,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on_record":95,"learn_keychord_press":59,"on":1,"learn_text_input":60,"teach_keychord_press":47,"learn_key_release":61,"on.draw":5,"teach_text_input":49,"save_wav":171,"draw_teach_screen":110,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":194,"Recording_word":138,"on.key_release":55,"Workbook":198,"on.text_input":54,"draw_playing_button":130,"Cursor_word":24,"play":197,"draw_recording_button":133}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"to_word_idx":82,"fw_parent":81,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":81,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
teach_mouse_press = function(x,y, mouse_button)
if on_new_word_button(x,y) then
new_word()
return
end
if on_word(x) then
local idx = math.floor((y-50)/Line_height/2)
if idx >= 1 and idx <= #Words then
Cursor_word = Words[idx]
edit.mouse_press(Cursor_word, x,y, mouse_button)
end
end
end
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"fw_parent":80,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":81,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"draw_record_button":72,"Cursor_word":24,"new_word":64,"fw_parent":79,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":78,"teach_mouse_release":46,"Mode":2,"teach_key_release":56,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"on_word":80,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"learn_text_input":60,"learn_key_release":61,"draw_learn_screen":4,"draw_teach_screen":62,"on.mouse_press":51,"on.text_input":54,"draw_play_button":75,"on.mouse_release":52,"on.keychord_press":53,"teach_keychord_press":47,"on.key_release":55,"on":1}
{"teach_key_release":56,"Mode":2,"teach_text_input":49,"draw_play_button":75,"on.draw":5,"draw_record_button":72,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":78,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":79,"teach_mouse_press":78,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
teach_mouse_press = function(x,y, mouse_button)
if on_new_word_button(x,y) then
new_word()
return
end
if x >= 20 + 50 and x < 150 then
local idx = math.floor((y-50)/Line_height/2)
if idx >= 1 and idx <= #Words then
Cursor_word = Words[idx]
edit.mouse_press(Cursor_word, x,y, mouse_button)
end
end
end
{"teach_key_release":56,"Mode":2,"teach_text_input":49,"draw_play_button":75,"on.draw":5,"draw_record_button":72,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":77,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":77,"teach_mouse_press":78,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"Mode":2,"teach_text_input":49,"draw_play_button":75,"on.draw":5,"draw_record_button":72,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":76,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":77,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"Mode":2,"teach_text_input":49,"draw_play_button":75,"on.draw":5,"draw_record_button":72,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":75,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"on_new_word_button":76,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"draw_play_button":75,"on.draw":5,"draw_record_button":72,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":74,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"draw_play_button":74,"on.draw":5,"draw_record_button":72,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":73,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"draw_play_button":73,"on.draw":5,"draw_record_button":72,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":72,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"draw_play_button":67,"on.draw":5,"draw_record_button":72,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":71,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"draw_play_button":67,"on.draw":5,"draw_record_button":71,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":70,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"draw_play_button":67,"on.draw":5,"draw_record_button":70,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":69,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"draw_play_button":67,"on.draw":5,"draw_record_button":69,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":68,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"draw_play_button":67,"on.draw":5,"draw_record_button":66,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":67,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":68,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"draw_play_button":67,"on.draw":5,"draw_record_button":66,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":66,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":41,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
{"teach_key_release":56,"teach_text_input":49,"on.draw":5,"draw_record_button":66,"Words":12,"new_word":64,"on.initialize":7,"teach_mouse_release":46,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"on":1,"learn_keychord_press":59,"draw_teach_screen":62,"learn_text_input":60,"fw_parent":65,"learn_key_release":61,"fw_app":"spell-cards","draw_teach_word":41,"Mode":2,"teach_mouse_press":65,"on.mouse_press":51,"teach_keychord_press":47,"on.mouse_release":52,"Cursor_word":24,"on.keychord_press":53,"on.text_input":54,"on.key_release":55,"draw_learn_screen":4}
teach_mouse_press = function(x,y, mouse_button)
if x >= 20 and x < 20+App.width(to_text('new word (ctrl+n)')) + 10 and
y >= 5 and y < 5 + Line_height + 10 then
new_word()
return
end
if x >= 20 + 50 and x < 150 then
local idx = math.floor((y-50)/Line_height/2)
if idx >= 1 and idx <= #Words then
Cursor_word = Words[idx]
edit.mouse_press(Cursor_word, x,y, mouse_button)
end
end
end
{"teach_text_input":49,"learn_mouse_press":57,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"learn_key_release":61,"on.text_input":54,"learn_text_input":60,"draw_learn_screen":4,"learn_keychord_press":59,"on.draw":5,"learn_mouse_release":58,"Words":12,"new_word":64,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":65,"fw_parent":64,"Mode":2,"draw_teach_screen":62,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
new_word = function()
Cursor_word = edit.initialize_state(
50 + (#Words+1)*Line_height*2, -- top
20 + 50, 150,
Font_height, Line_height)
Text.redraw_all(Cursor_word)
Cursor_word.contents = ''
table.insert(Words, Cursor_word)
end
{"teach_text_input":49,"learn_mouse_press":57,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"learn_key_release":61,"on.text_input":54,"learn_text_input":60,"draw_learn_screen":4,"learn_keychord_press":59,"on.draw":5,"learn_mouse_release":58,"Words":12,"new_word":64,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":63,"Mode":2,"draw_teach_screen":62,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
new_word = function()
Cursor_word = edit.initialize_state(
50 + (#Words+1)*Line_height*2, -- top
20, 100,
Font_height, Line_height)
Text.redraw_all(Cursor_word)
Cursor_word.contents = ''
table.insert(Words, Cursor_word)
end
{"teach_text_input":49,"learn_mouse_press":57,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"learn_key_release":61,"on.text_input":54,"learn_text_input":60,"draw_learn_screen":4,"learn_keychord_press":59,"on.draw":5,"learn_mouse_release":58,"Words":12,"new_word":63,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":62,"Mode":2,"draw_teach_screen":62,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
{"teach_text_input":49,"learn_mouse_press":57,"on.mouse_press":51,"on.mouse_release":52,"draw_teach_word":41,"on.keychord_press":53,"teach_key_release":56,"on.key_release":55,"learn_key_release":61,"on.text_input":54,"learn_text_input":60,"draw_learn_screen":4,"learn_keychord_press":59,"on.draw":5,"learn_mouse_release":58,"Words":12,"new_word":37,"on.initialize":7,"Cursor_word":24,"Font_height":8,"teach_keychord_press":47,"Line_height":9,"teach_mouse_press":45,"fw_parent":61,"Mode":2,"draw_teach_screen":62,"fw_app":"spell-cards","on":1,"teach_mouse_release":46}
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+10, Line_height+10)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 20+5, 5+5)
for _,word in ipairs(Words) do
draw_teach_word(word)
end
end
This file contains no definition, but is used as a marker in the save dir to
indicate all definitions have been copied from the repo to the save dir.
This file contains no definition, but is used as a marker in the save dir to indicate all definitions have been copied from the repo to the save dir.