Compare commits

..

No commits in common. "8033e98f2025e169cc63645a492efa5dd273a32c" and "1dd8ac7c16ea2df32269cf259114e5d5b4dba376" have entirely different histories.

3 changed files with 7 additions and 61 deletions

View File

@ -1,45 +0,0 @@
#!/usr/bin/python3
import json
import sys
def format_duration(seconds):
seconds = float(seconds)
d = int(seconds / 86400)
h = int(seconds % 86400 / 3600)
m = int(seconds % 3600 / 60)
s = float(seconds % 60)
durations = []
if h:
durations.append('%sh' % h)
if m:
durations.append('%sm' % m)
if s:
durations.append('%ss' % int(s))
r = ' '.join(durations)
return r + ((10-len(r)) * ' ')
presets = json.load(open(sys.argv[1]))
sequence = json.load(open(sys.argv[2]))
padding = max([len(p['name']) for p in presets]) + 5
position = 0
for i, clip in enumerate(sequence):
preset = [p for p in presets if p['id'] == clip['preset']][0]
if clip.get('duration'):
position += clip.get('duration', 0)
d = format_duration(clip['duration'])
else:
d = '... '
print('\t'.join([
'%02d' % preset['id'] + ': ' + preset['name'] + ((padding-len(preset['name'])) * ' '),
format_duration(position),
'Speed: ' + str(clip.get('speed', 0)),
'Sleep: ' + str(clip.get('sleep', 0)),
d,
]))

View File

@ -96,7 +96,7 @@
<h2>Edit:</h2>
<li><button class="delete">delete row</button></li>
<li><button class="insert">insert row</button></li>
<li><button class="all_presets">add unused presets</button></li>
<li><button class="all_presets">load all presets</button></li>
<li>Global Speed: <input type="text" style="width:30px" value="20" class="default_speed"><button class="set_speed">set</button></li>
<h2>Export:</h2>
<li><a><button class="export_sequence">export sequence</button></a></li>

View File

@ -481,21 +481,12 @@ $('button.export_presets').on({click: function() {
});
}})
$('button.all_presets').on({click: function() {
api('getPresets', {}, function(response) {
presets = response.result.presets
var seq = [].concat(data, presets.filter(function(preset) {
return data.filter(function(row) {
return row.preset == preset.id
}).length == 0
}).map(function(preset) {
loadData(presets.map(function(preset) {
return {
preset: preset.id,
speed: parseInt($('input.default_speed').val(), 10)
}
}))
loadData(seq)
})
}})
$('input.import_sequence').on({change: function() {