<commit_before>/**
 *
 *
 *
 *
 */

"use strict"
 
define(['backbone'], function(Backbone) {
   
    var View = Backbone.View.extend({
        
        el: '#view-controls',
        
        events: {
            'input input[name=loopers-volume]': 'changedVolume',
            'input input[name=loopers-pitch]': 'changedPitch'
        },
                
        changedVolume: function(ev) {
            this.app.dispatcher.trigger('change-volume', this.getVolume());
        },
        
        changedPitch: function(ev) {
            this.app.dispatcher.trigger('change-pitch', this.getPitch());
        },
        
        getVolume: function() {
            return (this.$el.find('input[name=loopers-volume]').val() / 100);
        },
        
        getPitch: function() {
            return (this.$el.find('input[name=loopers-pitch]').val() / 100);
        },
        
        initialize: function() {
            this.app.dispatcher.on('loop-added', this.render, this);
        },
        
        render: function() {
            var view = this;
            if (view.$el.find('input[name=loopers-volume]').length == 0 &&
                view.$el.find('input[name=loopers-pitch]').length == 0
            ) {
                view.getTemplate('/looper/views/controls.html', {}, function(res) {
                    view.show(res);
                });
            }
        }
        
    });
   
    return View;
    
});
 <commit_msg>Changed the Controls view to use the loops-added event.<commit_after>/**
 *
 *
 *
 *
 */

"use strict"
 
define(['backbone'], function(Backbone) {
   
    var View = Backbone.View.extend({
        
        el: '#view-controls',
        
        events: {
            'input input[name=loopers-volume]': 'changedVolume',
            'input input[name=loopers-pitch]': 'changedPitch'
        },
                
        changedVolume: function(ev) {
            this.app.dispatcher.trigger('change-volume', this.getVolume());
        },
        
        changedPitch: function(ev) {
            this.app.dispatcher.trigger('change-pitch', this.getPitch());
        },
        
        getVolume: function() {
            return (this.$el.find('input[name=loopers-volume]').val() / 100);
        },
        
        getPitch: function() {
            return (this.$el.find('input[name=loopers-pitch]').val() / 100);
        },
        
        initialize: function() {
            this.app.dispatcher.on('loops-added', this.render, this);
        },
        
        render: function() {
            var view = this;
            if (view.$el.find('input[name=loopers-volume]').length == 0 &&
                view.$el.find('input[name=loopers-pitch]').length == 0
            ) {
                view.getTemplate('/looper/views/controls.html', {}, function(res) {
                    view.show(res);
                });
            }
        }
        
    });
   
    return View;
    
});
 
{'fraction_non_alphanumeric': 0.158199795431299, 'fraction_numerical': 0.005455165359699966, 'mean_word_length': 1.5098374679213002, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1161772', 'n_tokens_mistral': 874, 'n_tokens_neox': 837, 'n_words': 118}