Permalink
Browse files

finetune

  • Loading branch information...
1 parent 9eee657 commit df4fae6a63bebdee3383ed28790259c60e6ded86 @rockdog rockdog committed Mar 25, 2012
Showing with 16 additions and 3 deletions.
  1. +12 −1 app/assets/javascripts/models/mod.coffee
  2. +4 −2 app/assets/javascripts/tracker.coffee
View
13 app/assets/javascripts/models/mod.coffee
@@ -47,6 +47,17 @@ class window.CT2.models.Mod
volume_down: (sample) ->
@set_volume(sample, @samples[sample].volume - 1)
+ set_finetune: (sample, finetune) ->
+ if finetune >= -8 && finetune <= 7
+ @samples[sample].finetune = finetune
+ console.log(@samples[sample].finetune)
+
+ finetune_up: (sample) ->
+ @set_finetune(sample, @samples[sample].finetune + 1)
+
+ finetune_down: (sample) ->
+ @set_finetune(sample, @samples[sample].finetune - 1)
+
set_note: (pattern, row, channel, note, sample) ->
@patterns[pattern][row][channel].note = note
@patterns[pattern][row][channel].note_text = @note_from_text(note)
@@ -90,7 +101,7 @@ class window.CT2.models.Mod
sample.data = @base64ToInt8(data.sample_data[i])
else
sample.data = []
-
+
fix_patterns: ->
View
6 app/assets/javascripts/tracker.coffee
@@ -358,11 +358,13 @@ class window.CT2.views.AppView extends Backbone.View
finetune_up: (event) ->
event.preventDefault()
- console.log('NOOP')
+ window.CT2.PlayerInstance.module.finetune_up(@current_sample)
+ @update_sample_fields()
finetune_down: (event) ->
event.preventDefault()
- console.log('NOOP')
+ window.CT2.PlayerInstance.module.finetune_down(@current_sample)
+ @update_sample_fields()
prev_pattern: ->
@current_pattern--

0 comments on commit df4fae6

Please sign in to comment.