Skip to content

Commit

Permalink
Fixed deleting clips.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Myler committed May 1, 2012
1 parent e166461 commit 04cafd0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 12 deletions.
3 changes: 1 addition & 2 deletions TODO.txt
Expand Up @@ -6,6 +6,5 @@
+ velikost pameti pro zalozku..., hlaseni velikosti zabrane pameti v ramci sandboxu -- nejspis nejde...
+ zmena nastaveni vzorkovaci frekvence hmmm ... taky nejspis nejde menit (zatim?)

+ solo
+ track analyser?
+ !! smazani klipu/vyjmuti, nektere to smaze az na nekolikaty pokus??
+ prehravani od kurzoru pri loopu klipu obcas udela ulet (hraje spatne)
2 changes: 1 addition & 1 deletion css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -8,7 +8,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Audiee</title>
<meta name="description" content="">
<meta name="description" content="Simple experimental web based audio editor.">
<meta name="author" content="Jan Myler">

<!-- Mobile viewport optimized: h5bp.com/viewport -->
Expand Down
8 changes: 6 additions & 2 deletions js/Audiee/Collections.Clips.js
Expand Up @@ -57,6 +57,7 @@ define([

deleteSelection: function(from, to, except) {
var that = this,
deleteRequest = [],
trackPos, end, startTime, endTime, loop, duration, newLoop, newEndTime, newStartTime;

this.each(function(model) {
Expand Down Expand Up @@ -93,8 +94,8 @@ define([
});
that.add(clip);
} else if (trackPos >= from && end <= to) {
// clip begins and ends within the selection (removes the clip)
that.remove(model);
// clip begins and ends within the selection (prepares the clip for a removal)
deleteRequest.push(model);
} else if (trackPos < from && end <= to) {
// clip begins before the selection and ends within the selection (edits the endTime)
newEndTime = (startTime + from - trackPos) % duration;
Expand All @@ -112,6 +113,9 @@ define([
}
}
});

// removes the selected clips
this.remove(deleteRequest);
},

addDuplicate: function(clip) {
Expand Down
9 changes: 5 additions & 4 deletions js/Audiee/Views.TrackControls.js
Expand Up @@ -20,9 +20,9 @@ define([
className: 'track-controls',

template: _.template(
'<button class="btn mute {{ muted }}" data-toggle="button">M</button>' +
'<button class="btn solo {{ solo }}" data-toggle="button">S</button>' +
'<input type="range" class="volume" value="{{ gain }}">'
'<button class="btn mute {{ muted }}" data-toggle="button" title="mute">M</button>' +
'<button class="btn solo {{ solo }}" data-toggle="button" title="solo">S</button>' +
'<input type="range" class="volume" value="{{ gain }}" title="volume">'
),

initialize: function() {
Expand Down Expand Up @@ -54,7 +54,8 @@ define([
cid = $(this.el).parents('.track').data('cid');

this.model.set('gain', volume);
Audiee.Player.volumeChange(volume, cid);

Audiee.Player.volumeChange(volume, cid); // zmenit v souvislosti se solo

if ($('button.mute', this.el).hasClass('active')) {
$('button.mute', this.el).button('toggle');
Expand Down
Empty file removed js/router.js
Empty file.
4 changes: 2 additions & 2 deletions js/templates/Menu.html
@@ -1,4 +1,4 @@
<li class="dropdown">
<!-- <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">File <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#" id="m-new">New</a></li>
Expand All @@ -7,7 +7,7 @@
<li><a href="#" id="m-save">Save</a></li>
<li><a href="#" id="m-saveas">Save As...</a></li>
</ul>
</li>
</li> -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit <b class="caret"></b></a>
<ul class="dropdown-menu">
Expand Down
5 changes: 5 additions & 0 deletions less/style.less
Expand Up @@ -168,6 +168,11 @@ body {
width: 100px;
margin: 5px;
}

.btn {
margin: 10px 0 6px 10px;
padding: 6px 16px;
}
}

.track-display {
Expand Down

0 comments on commit 04cafd0

Please sign in to comment.