<commit_before>/**
 * Class:    GainFilter<br/>
 * <br/>
 * Created:  12.11.2017<br/>
 * Filename: GainFilter.java<br/>
 * Version:  $Revision$<br/>
 * <br/>
 * last modified on $Date$<br/>
 *               by $Author$<br/>
 * <br/>
 * @author <a href="mailto:<EMAIL>"><NAME>, nacamar GmbH</a>
 * @version $Author$ -- $Revision$ -- $Date$
 * <br/>
 * (c) <NAME>, nacamar GmbH 2017 - All rights reserved.
 */
package net.addradio.codec.mpeg.audio.filter.gain;

import net.addradio.codec.mpeg.audio.filter.BaseMPEGAudioFrameFilter;
import net.addradio.codec.mpeg.audio.model.MPEGAudioFrame;

/**
 * GainFilter.
 */
public abstract class GainFilter extends BaseMPEGAudioFrameFilter {

    /**
     * applyFactorToGlobalGain.
     * @param frame {@link MPEGAudioFrame}
     * @param factor {@code double}
     */
    protected static void applyFactorToGlobalGain(final MPEGAudioFrame frame, final double factor) {
        for (int i = 0; i < frame.getGlobalGain().length; i++) {
            for (int j = 0; j < frame.getGlobalGain()[i].length; j++) {
                frame.getGlobalGain()[i][j] = (int) Math.round(((factor * 0.35) + 0.65) * frame.getGlobalGain()[i][j]);
            }
        }<commit_msg>made method public<commit_after>/**
 * Class:    GainFilter<br/>
 * <br/>
 * Created:  12.11.2017<br/>
 * Filename: GainFilter.java<br/>
 * Version:  $Revision$<br/>
 * <br/>
 * last modified on $Date$<br/>
 *               by $Author$<br/>
 * <br/>
 * @author <a href="mailto:<EMAIL>"><NAME>, nacamar GmbH</a>
 * @version $Author$ -- $Revision$ -- $Date$
 * <br/>
 * (c) <NAME>, nacamar GmbH 2017 - All rights reserved.
 */
package net.addradio.codec.mpeg.audio.filter.gain;

import net.addradio.codec.mpeg.audio.filter.BaseMPEGAudioFrameFilter;
import net.addradio.codec.mpeg.audio.model.MPEGAudioFrame;

/**
 * GainFilter.
 */
public abstract class GainFilter extends BaseMPEGAudioFrameFilter {

    /**
     * applyFactorToGlobalGain.
     * @param frame {@link MPEGAudioFrame}
     * @param factor {@code double}
     */
    public static void applyFactorToGlobalGain(final MPEGAudioFrame frame, final double factor) {
        for (int i = 0; i < frame.getGlobalGain().length; i++) {
            for (int j = 0; j < frame.getGlobalGain()[i].length; j++) {
                frame.getGlobalGain()[i][j] = (int) Math.round(((factor * 0.35) + 0.65) * frame.getGlobalGain()[i][j]);
            }
        }
{'fraction_non_alphanumeric': 0.17206982543640897, 'fraction_numerical': 0.01662510390689942, 'mean_word_length': 2.9654036243822075, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 33, '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': '7322547', 'n_tokens_mistral': 875, 'n_tokens_neox': 837, 'n_words': 176}