<commit_before>//
//  AKAudioPlayerWindow.swift
//  AudioKit
//
//  Created by <NAME> on 11/9/15.
//  Copyright © 2015 AudioKit. All rights reserved.
//

#if os(OSX)
import Foundation
import Cocoa

/// A Window to control AKAudioPlayer in Playgrounds
public class AKAudioPlayerWindow: NSWindow {
    
    private let windowWidth = 200
    private let padding = 30
    private let sliderHeight = 20
    private let numberOfComponents = 3
    
    private let playButton: NSButton
    private let pauseButton: NSButton
    private let stopButton: NSButton

    private var player: AKAudioPlayer
    
    /// Initialize the AKAudioplayer window
    public init(_ control: AKAudioPlayer) {
        player = control
        let sliderWidth = windowWidth - 2 * padding
        playButton      = NSButton(frame: NSRect(x: padding, y: 0, width: sliderWidth, height: sliderHeight))
        pauseButton      = NSButton(frame: NSRect(x: padding, y: 0, width: sliderWidth, height: sliderHeight))
        stopButton      = NSButton(frame: NSRect(x: padding, y: 0, width: sliderWidth, height: sliderHeight))
        
        let titleHeightApproximation = 50
        let windowHeight = padding * 2 + titleHeightApproximation + numberOfComponents * 3 * sliderHeight
        
        super.init(contentRect: NSRect(x: 2 * padding + 400, y: padding, width: windowWidth, height: windowHeight),
            styleMask: NSTitledWindowMask,
            backing: .Buffered,
            `defer`: false)
        self.hasShadow = true
        self.styleMask = NSBorderlessWindowMask | NSResizableWindowMask
        self.movableByWindowBackground = true
        self.level = 7
        self.title = "AKAudioPlayer"
        
        let viewRect = NSRect(x: 0, y: 0, width: windowWidth, height: windowHeight)
        let view = NSView(frame: viewRect)
        
        let topTitle = NSTextField()
        topTitle.stringValue = "AKAudioPlayer"
        topTitle.editable = false
        topTitle.drawsBackground = false
        topTitle.bezeled = false
        topTitle.alignment = NSCenterTextAlignment
        topTitle.font = NSFont(name: "Lucida Grande", size: 24)
        topTitle.sizeToFit()
        topTitle.frame.origin.x = CGFloat(windowWidth / 2) - topTitle.frame.width / 2
        topTitle.frame.origin.y = CGFloat(windowHeight - padding) - topTitle.frame.height
        view.addSubview(topTitle)
        
        playButton.target = self
        playButton.action = "play"
        playButton.title = "Play"
        playButton.frame.origin.y = topTitle.frame.origin.y - 2 * CGFloat(sliderHeight)
        view.addSubview(playButton)
        
        pauseButton.target = self
        pauseButton.action = "pause"
        pauseButton.title = "Pause"
        pauseButton.frame.origin.y = playButton.frame.origin.y - 2 * CGFloat(sliderHeight)
        view.addSubview(pauseButton)

        stopButton.target = self
        stopButton.action = "stop"
        stopButton.title = "Stop"
        stopButton.frame.origin.y = pauseButton.frame.origin.y - 2 * CGFloat(sliderHeight)
        view.addSubview(stopButton)

        
        self.contentView!.addSubview(view)
        self.makeKeyAndOrderFront(nil)
    }
    
    private func play() {
        player.play()
    }
    
    private func pause() {
        player.pause()
    }
    
    private func stop() {
        player.stop()
    }
    
    /// Required Initializer
    required public init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

#endif
<commit_msg>Private was the wrong declaration for things needing storyboard access<commit_after>//
//  AKAudioPlayerWindow.swift
//  AudioKit
//
//  Created by <NAME> on 11/9/15.
//  Copyright © 2015 AudioKit. All rights reserved.
//

#if os(OSX)
import Foundation
import Cocoa

/// A Window to control AKAudioPlayer in Playgrounds
public class AKAudioPlayerWindow: NSWindow {
    
    private let windowWidth = 200
    private let padding = 30
    private let sliderHeight = 20
    private let numberOfComponents = 3
    
    private let playButton: NSButton
    private let pauseButton: NSButton
    private let stopButton: NSButton

    private var player: AKAudioPlayer
    
    /// Initialize the AKAudioplayer window
    public init(_ control: AKAudioPlayer) {
        player = control
        let sliderWidth = windowWidth - 2 * padding
        playButton      = NSButton(frame: NSRect(x: padding, y: 0, width: sliderWidth, height: sliderHeight))
        pauseButton      = NSButton(frame: NSRect(x: padding, y: 0, width: sliderWidth, height: sliderHeight))
        stopButton      = NSButton(frame: NSRect(x: padding, y: 0, width: sliderWidth, height: sliderHeight))
        
        let titleHeightApproximation = 50
        let windowHeight = padding * 2 + titleHeightApproximation + numberOfComponents * 3 * sliderHeight
        
        super.init(contentRect: NSRect(x: 2 * padding + 400, y: padding, width: windowWidth, height: windowHeight),
            styleMask: NSTitledWindowMask,
            backing: .Buffered,
            `defer`: false)
        self.hasShadow = true
        self.styleMask = NSBorderlessWindowMask | NSResizableWindowMask
        self.movableByWindowBackground = true
        self.level = 7
        self.title = "AKAudioPlayer"
        
        let viewRect = NSRect(x: 0, y: 0, width: windowWidth, height: windowHeight)
        let view = NSView(frame: viewRect)
        
        let topTitle = NSTextField()
        topTitle.stringValue = "AKAudioPlayer"
        topTitle.editable = false
        topTitle.drawsBackground = false
        topTitle.bezeled = false
        topTitle.alignment = NSCenterTextAlignment
        topTitle.font = NSFont(name: "Lucida Grande", size: 24)
        topTitle.sizeToFit()
        topTitle.frame.origin.x = CGFloat(windowWidth / 2) - topTitle.frame.width / 2
        topTitle.frame.origin.y = CGFloat(windowHeight - padding) - topTitle.frame.height
        view.addSubview(topTitle)
        
        playButton.target = self
        playButton.action = "play"
        playButton.title = "Play"
        playButton.frame.origin.y = topTitle.frame.origin.y - 2 * CGFloat(sliderHeight)
        view.addSubview(playButton)
        
        pauseButton.target = self
        pauseButton.action = "pause"
        pauseButton.title = "Pause"
        pauseButton.frame.origin.y = playButton.frame.origin.y - 2 * CGFloat(sliderHeight)
        view.addSubview(pauseButton)

        stopButton.target = self
        stopButton.action = "stop"
        stopButton.title = "Stop"
        stopButton.frame.origin.y = pauseButton.frame.origin.y - 2 * CGFloat(sliderHeight)
        view.addSubview(stopButton)

        
        self.contentView!.addSubview(view)
        self.makeKeyAndOrderFront(nil)
    }
    
    internal func play() {
        player.play()
    }
    
    internal func pause() {
        player.pause()
    }
    
    internal func stop() {
        player.stop()
    }
    
    /// Required Initializer
    required public init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

#endif

{'fraction_non_alphanumeric': 0.09016853932584269, 'fraction_numerical': 0.010955056179775281, 'mean_word_length': 2.3877259752616555, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4939044', 'n_tokens_mistral': 2145, 'n_tokens_neox': 2022, 'n_words': 511}