minor cleanup

This commit is contained in:
rlx 2013-08-01 08:42:14 +00:00
parent 3b2c8a40b1
commit ead18f3e0e

View file

@ -207,7 +207,7 @@ Ox.VideoEditor = function(options, self) {
setPoint('in', self.options.position); setPoint('in', self.options.position);
}, },
key_left: function() { key_left: function() {
movePositionBy(-0.04); movePositionBy(-1 / self.options.fps);
}, },
key_minus: function() { key_minus: function() {
self.$player[0].changeVolume(-0.1); self.$player[0].changeVolume(-0.1);
@ -225,7 +225,7 @@ Ox.VideoEditor = function(options, self) {
}, },
key_p: playInToOut, key_p: playInToOut,
key_right: function() { key_right: function() {
movePositionBy(0.04); movePositionBy(1 / self.options.fps);
}, },
key_shift_0: function() { key_shift_0: function() {
movePositionBy(-self.options.position); movePositionBy(-self.options.position);
@ -241,12 +241,12 @@ Ox.VideoEditor = function(options, self) {
getNextAnnotation('result', -1) getNextAnnotation('result', -1)
); );
}, },
key_shift_left: function() {
movePositionBy(-1);
},
key_shift_i: function() { key_shift_i: function() {
goToPoint('in'); goToPoint('in');
}, },
key_shift_left: function() {
movePositionBy(-1);
},
key_shift_minus: function() { key_shift_minus: function() {
self.options.videoSize == 'large' && toggleSize(); self.options.videoSize == 'large' && toggleSize();
}, },
@ -262,9 +262,7 @@ Ox.VideoEditor = function(options, self) {
key_shift_up: function() { key_shift_up: function() {
movePositionBy(-self.options.position); movePositionBy(-self.options.position);
}, },
key_slash: function() { key_slash: selectCut,
selectCut();
},
key_space: togglePaused, key_space: togglePaused,
key_up: function() { key_up: function() {
movePositionBy(-self.sizes.timeline[0].width); movePositionBy(-self.sizes.timeline[0].width);
@ -1183,7 +1181,6 @@ Ox.VideoEditor = function(options, self) {
} }
function setPoint(point, position, keepSelected) { function setPoint(point, position, keepSelected) {
var otherPoint = point == 'in' ? 'out' : 'in';
self.options[point] = position; self.options[point] = position;
if (self.options.selected && !self.editing && !keepSelected) { if (self.options.selected && !self.editing && !keepSelected) {
selectAnnotation({id: ''}); selectAnnotation({id: ''});
@ -1224,17 +1221,11 @@ Ox.VideoEditor = function(options, self) {
var minute = Math.floor(position / 60), var minute = Math.floor(position / 60),
previousMinute = Math.floor(self.options.position / 60); previousMinute = Math.floor(self.options.position / 60);
self.options.position = position; self.options.position = position;
!playing && self.$player[0].options({ !playing && self.$player[0].options({position: self.options.position});
position: self.options.position
});
self.$timeline.forEach(function($timeline) { self.$timeline.forEach(function($timeline) {
$timeline.options({ $timeline.options({position: self.options.position});
position: self.options.position
});
});
self.$annotationPanel.options({
position: self.options.position
}); });
self.$annotationPanel.options({position: self.options.position});
if (!playing || minute != previousMinute) { if (!playing || minute != previousMinute) {
that.triggerEvent(playing ? 'playing' : 'position', { that.triggerEvent(playing ? 'playing' : 'position', {
position: !playing ? self.options.position : minute * 60 position: !playing ? self.options.position : minute * 60