<commit_before>//
//  GainAudioUnit2.swift
//  AudioKit
//
//  Created by <NAME> on 9/23/17.
//  Copyright © 2017 AudioKit. All rights reserved.
//

import AVFoundation

public class GainAudioUnit2: AK4AudioUnitBase {
    
    var gain : Float = 1.0 {
        didSet {
            setParameterWithAddress(AUParameterAddress(0), value: gain)
        }
    }
    
    var rampTime : Float = 0.0;
    
    public override func initDsp(withSampleRate sampleRate: Double,
                          channelCount count: AVAudioChannelCount) -> UnsafeMutableRawPointer! {
        return createGainEffectDsp(Int32(count), sampleRate);       
    }

    override init(componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) throws {
        try super.init(componentDescription: componentDescription, options: options)
        
        let flags : AudioUnitParameterOptions = [.flag_IsReadable, .flag_IsWritable, .flag_CanRamp]
        let gain = AUParameterTree.createParameter(withIdentifier: "gain",
                                                   name: "Gain",
                                                   address: AUParameterAddress(0),
                                                   min: 0.0, max: 1.0,
                                                   unit: .linearGain, unitName: nil,
                                                   flags: flags,
                                                   valueStrings: nil, dependentParameters: nil)
        setParameterTree(AUParameterTree.createTree(withChildren: [gain]))
        gain.value = 1.0;
        
    }
    
    public override var canProcessInPlace: Bool { get { return true; }}
    
}<commit_msg>cleanup based on Houndi comments<commit_after>//
//  GainAudioUnit2.swift
//  AudioKit
//
//  Created by <NAME> on 9/23/17.
//  Copyright © 2017 AudioKit. All rights reserved.
//

import AVFoundation

public class GainAudioUnit2: AK4AudioUnitBase {
    
    var gain: Float = 1.0 {
        didSet {
            setParameterWithAddress(AUParameterAddress(0), value: gain)
        }
    }
    
    var rampTime: Float = 0.0
    
    public override func initDsp(withSampleRate sampleRate: Double,
                                 channelCount count: AVAudioChannelCount) -> UnsafeMutableRawPointer! {
        return createGainEffectDsp(Int32(count), sampleRate)
    }

    override init(componentDescription: AudioComponentDescription,
                  options: AudioComponentInstantiationOptions = []) throws {
        try super.init(componentDescription: componentDescription, options: options)

        let flags : AudioUnitParameterOptions = [.flag_IsReadable, .flag_IsWritable, .flag_CanRamp]
        let gain = AUParameterTree.createParameter(withIdentifier: "gain",
                                                   name: "Gain",
                                                   address: AUParameterAddress(0),
                                                   min: 0.0, max: 1.0,
                                                   unit: .linearGain, unitName: nil,
                                                   flags: flags,
                                                   valueStrings: nil, dependentParameters: nil)
        setParameterTree(AUParameterTree.createTree(withChildren: [gain]))
        gain.value = 1.0
    }

    public override var canProcessInPlace: Bool { get { return true; }}

}
{'fraction_non_alphanumeric': 0.07903178769320501, 'fraction_numerical': 0.01516477107028288, 'mean_word_length': 1.618320610687023, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 25, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '977981', 'n_tokens_mistral': 844, 'n_tokens_neox': 803, 'n_words': 198}