├── MVTouchbar ├── MVTouchbar │ ├── DFRFoundation.framework │ │ ├── Versions │ │ │ ├── Current │ │ │ └── A │ │ │ │ ├── Resources │ │ │ │ ├── touch@2x.png │ │ │ │ ├── framework.sb │ │ │ │ ├── version.plist │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ └── Resources │ ├── MVTouchBar-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── logo.imageset │ │ │ ├── logo.png │ │ │ └── Contents.json │ │ ├── rect.imageset │ │ │ ├── rect.png │ │ │ └── Contents.json │ │ ├── square.imageset │ │ │ ├── square.png │ │ │ └── Contents.json │ │ ├── StatusBarIcon.imageset │ │ │ ├── BW.png │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── logo-1024.png │ │ │ ├── logo-128.png │ │ │ ├── logo-16.png │ │ │ ├── logo-256.png │ │ │ ├── logo-32.png │ │ │ ├── logo-512.png │ │ │ ├── logo-64.png │ │ │ └── Contents.json │ │ └── AccentColor.colorset │ │ │ └── Contents.json │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── spritekitView.swift │ ├── MVTouchbar.entitlements │ ├── AppState.swift │ ├── EventMonitor.swift │ ├── TouchBarPrivateApi.h │ ├── AppDelegate.swift │ ├── Info.plist │ ├── StatusBarController.swift │ ├── StatusBarView.swift │ ├── Resources │ │ └── Credits.rtf │ ├── ViewController.swift │ ├── volume.swift │ ├── barsScene.swift │ └── Main.storyboard └── MVTouchbar.xcodeproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist │ ├── xcuserdata │ └── darsh.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist │ ├── xcshareddata │ └── xcschemes │ │ ├── MVTouchBar.xcscheme │ │ └── MVTouchBar 1.xcscheme │ └── project.pbxproj ├── assets ├── BW.png ├── logo.png ├── logo.icns ├── source │ └── logo.psd ├── screenshots │ ├── s1.png │ ├── s2.png │ ├── s3.png │ ├── s4.png │ ├── s5.png │ ├── s6.png │ ├── s7.png │ ├── s8.png │ └── s9.png └── installer_background.png ├── .all-contributorsrc ├── .gitignore ├── CODE_OF_CONDUCT.md ├── README.md └── LICENSE /MVTouchbar/MVTouchbar/DFRFoundation.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/DFRFoundation.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/MVTouchBar-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "TouchBarPrivateApi.h" 2 | -------------------------------------------------------------------------------- /assets/BW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/BW.png -------------------------------------------------------------------------------- /assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/logo.png -------------------------------------------------------------------------------- /assets/logo.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/logo.icns -------------------------------------------------------------------------------- /assets/source/logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/source/logo.psd -------------------------------------------------------------------------------- /assets/screenshots/s1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/screenshots/s1.png -------------------------------------------------------------------------------- /assets/screenshots/s2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/screenshots/s2.png -------------------------------------------------------------------------------- /assets/screenshots/s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/screenshots/s3.png -------------------------------------------------------------------------------- /assets/screenshots/s4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/screenshots/s4.png -------------------------------------------------------------------------------- /assets/screenshots/s5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/screenshots/s5.png -------------------------------------------------------------------------------- /assets/screenshots/s6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/screenshots/s6.png -------------------------------------------------------------------------------- /assets/screenshots/s7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/screenshots/s7.png -------------------------------------------------------------------------------- /assets/screenshots/s8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/screenshots/s8.png -------------------------------------------------------------------------------- /assets/screenshots/s9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/screenshots/s9.png -------------------------------------------------------------------------------- /assets/installer_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/assets/installer_background.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/logo.imageset/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/logo.imageset/logo.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/rect.imageset/rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/rect.imageset/rect.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/square.imageset/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/square.imageset/square.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/StatusBarIcon.imageset/BW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/StatusBarIcon.imageset/BW.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-1024.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-128.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-16.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-256.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-32.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-512.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/logo-64.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/DFRFoundation.framework/Versions/A/Resources/touch@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darshkpatel/MVTouchbar/HEAD/MVTouchbar/MVTouchbar/DFRFoundation.framework/Versions/A/Resources/touch@2x.png -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/spritekitView.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import SpriteKit 3 | 4 | class spritekitView: SKView { 5 | 6 | let skBarsScene = barsScene(size: CGSize(width: 1005, height: 30)) 7 | 8 | func presentColor() { 9 | self.presentScene(skBarsScene) 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "logo.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/rect.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "rect.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/square.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "square.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/MVTouchbar.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.device.audio-input 8 | 9 | com.apple.security.files.user-selected.read-only 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/StatusBarIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "BW.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "template" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/AppState.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarViewModel.swift 3 | // MVTouchBar 4 | // 5 | // Created by darsh on 28/11/20. 6 | // 7 | 8 | import Foundation 9 | import Cocoa 10 | import Combine 11 | 12 | class AppState: ObservableObject { 13 | static let shared = AppState() 14 | 15 | var inputs = ["System Microphone", "To be Implemented"] 16 | @Published var selectedInput = 0 17 | 18 | var colorInputs = ["Teal", "To be Implemented"] 19 | var colors = [NSColor.systemTeal, NSColor.systemPink, NSColor.systemGreen, NSColor.systemYellow] 20 | 21 | @Published var selectedColor = 0 22 | 23 | } 24 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/DFRFoundation.framework/Versions/A/Resources/framework.sb: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; DFRFoundation - sandbox profile 3 | ;; Copyright (c) 2015 Apple Inc. All Rights reserved. 4 | ;; 5 | ;; WARNING: The sandbox rules in this file currently constitute 6 | ;; Apple System Private Interface and are subject to change at any time and 7 | ;; without notice. The contents of this file are also auto-generated and not 8 | ;; user editable; it may be overwritten at any time. 9 | ;; 10 | 11 | (allow mach-lookup 12 | (global-name "com.apple.touchbarserver") 13 | (global-name "com.apple.touchbarserver.mig") 14 | (global-name "com.apple.controlstrip")) 15 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/DFRFoundation.framework/Versions/A/Resources/version.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildAliasOf 6 | TouchBarServer 7 | BuildVersion 8 | 112 9 | CFBundleShortVersionString 10 | 1.0 11 | CFBundleVersion 12 | 264 13 | ProjectName 14 | DFRFoundation 15 | SourceVersion 16 | 264000000000000 17 | 18 | 19 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar.xcodeproj/xcuserdata/darsh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MVTouchBar 1.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | MVTouchBar.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 3EE8759E256CF81B008682F9 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/EventMonitor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EventMonitor.swift 3 | // MVTouchBar 4 | // 5 | // Created by darsh on 24/11/20. 6 | // 7 | 8 | import Cocoa 9 | 10 | class EventMonitor { 11 | private var monitor: Any? 12 | private let mask: NSEvent.EventTypeMask 13 | private let handler: (NSEvent?) -> Void 14 | 15 | public init(mask: NSEvent.EventTypeMask, handler: @escaping (NSEvent?) -> Void) { 16 | self.mask = mask 17 | self.handler = handler 18 | } 19 | 20 | deinit { 21 | stop() 22 | } 23 | 24 | public func start() { 25 | monitor = NSEvent.addGlobalMonitorForEvents(matching: mask, handler: handler) as! NSObject 26 | } 27 | 28 | public func stop() { 29 | if monitor != nil { 30 | NSEvent.removeMonitor(monitor!) 31 | monitor = nil 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/DFRFoundation.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | files2 8 | 9 | rules 10 | 11 | ^.* 12 | 13 | omit 14 | 15 | weight 16 | 20 17 | 18 | 19 | rules2 20 | 21 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 22 | 23 | nested 24 | 25 | weight 26 | 0.0 27 | 28 | ^.* 29 | 30 | omit 31 | 32 | weight 33 | 20 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "ArpitKotecha", 10 | "name": "Arpit Jain", 11 | "avatar_url": "https://avatars1.githubusercontent.com/u/32438047?v=4", 12 | "profile": "https://www.arpitjain.tech/", 13 | "contributions": [ 14 | "code" 15 | ] 16 | }, 17 | { 18 | "login": "darshkpatel", 19 | "name": "Darsh Patel", 20 | "avatar_url": "https://avatars0.githubusercontent.com/u/11258286?v=4", 21 | "profile": "https://github.com/darshkpatel", 22 | "contributions": [ 23 | "doc", 24 | "code", 25 | "infra" 26 | ] 27 | } 28 | ], 29 | "contributorsPerLine": 7, 30 | "projectName": "MVTouchbar", 31 | "projectOwner": "darshkpatel", 32 | "repoType": "github", 33 | "repoHost": "https://github.com", 34 | "skipCi": true, 35 | "commitConvention": "none" 36 | } 37 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/TouchBarPrivateApi.h: -------------------------------------------------------------------------------- 1 | // 2 | // TouchBarPrivateApi.h 3 | // TouchBarVisualizer 4 | // 5 | // Created by Addison Hanrattie on 4/16/20. 6 | // Copyright © 2020 Addison Hanrattie. All rights reserved. 7 | // 8 | 9 | #ifndef TouchBarPrivateApi_h 10 | #define TouchBarPrivateApi_h 11 | 12 | #import 13 | extern void DFRElementSetControlStripPresenceForIdentifier(NSTouchBarItemIdentifier, BOOL); 14 | extern void DFRSystemModalShowsCloseBoxWhenFrontMost(BOOL); 15 | 16 | @interface NSTouchBarItem (PrivateMethods) 17 | + (void)addSystemTrayItem:(NSTouchBarItem *)item; 18 | + (void)removeSystemTrayItem:(NSTouchBarItem *)item; 19 | @end 20 | 21 | 22 | @interface NSTouchBar (PrivateMethods) 23 | + (void)presentSystemModalTouchBar:(NSTouchBar *)touchBar placement:(long long)placement systemTrayItemIdentifier:(NSTouchBarItemIdentifier)identifier; 24 | + (void)presentSystemModalTouchBar:(NSTouchBar *)touchBar systemTrayItemIdentifier:(NSTouchBarItemIdentifier)identifier; 25 | + (void)dismissSystemModalTouchBar:(NSTouchBar *)touchBar; 26 | + (void)minimizeSystemModalTouchBar:(NSTouchBar *)touchBar; 27 | @end 28 | 29 | #endif /* TouchBarPrivateApi_h */ 30 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import SwiftUI 3 | 4 | @NSApplicationMain 5 | class AppDelegate: NSObject, NSApplicationDelegate { 6 | 7 | let vc : ViewController = ViewController() 8 | 9 | var popover = NSPopover.init() 10 | var statusBar: StatusBarController? 11 | let statusBarView = StatusBarView() 12 | let appState = AppState() 13 | 14 | func applicationDidFinishLaunching(_ aNotification: Notification) { 15 | 16 | // Set the SwiftUI's ContentView to the Popover's ContentViewController 17 | popover.contentSize = NSSize(width: 360, height: 360) 18 | popover.contentViewController = NSHostingController(rootView: statusBarView.environmentObject(appState)) 19 | 20 | // Create the Status Bar Item with the above Popover 21 | statusBar = StatusBarController.init(popover) 22 | 23 | 24 | //Touchbar 25 | if #available(OSX 10.12.2, *) { 26 | NSApplication.shared.isAutomaticCustomizeTouchBarMenuItemEnabled = true 27 | } 28 | 29 | 30 | 31 | 32 | 33 | } 34 | 35 | func applicationWillTerminate(_ aNotification: Notification) { 36 | 37 | vc.stop() 38 | print("closed") 39 | 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | LSUIElement 26 | 27 | NSMainStoryboardFile 28 | Main 29 | NSMicrophoneUsageDescription 30 | To Generate Visualization from Microphone Audio 31 | NSPrincipalClass 32 | NSApplication 33 | NSSupportsSuddenTermination 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "logo-16.png", 5 | "idiom" : "mac", 6 | "scale" : "1x", 7 | "size" : "16x16" 8 | }, 9 | { 10 | "filename" : "logo-32.png", 11 | "idiom" : "mac", 12 | "scale" : "2x", 13 | "size" : "16x16" 14 | }, 15 | { 16 | "filename" : "logo-32.png", 17 | "idiom" : "mac", 18 | "scale" : "1x", 19 | "size" : "32x32" 20 | }, 21 | { 22 | "filename" : "logo-64.png", 23 | "idiom" : "mac", 24 | "scale" : "2x", 25 | "size" : "32x32" 26 | }, 27 | { 28 | "filename" : "logo-128.png", 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "filename" : "logo-256.png", 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "filename" : "logo-256.png", 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "256x256" 44 | }, 45 | { 46 | "filename" : "logo-512.png", 47 | "idiom" : "mac", 48 | "scale" : "2x", 49 | "size" : "256x256" 50 | }, 51 | { 52 | "filename" : "logo-512.png", 53 | "idiom" : "mac", 54 | "scale" : "1x", 55 | "size" : "512x512" 56 | }, 57 | { 58 | "filename" : "logo-1024.png", 59 | "idiom" : "mac", 60 | "scale" : "2x", 61 | "size" : "512x512" 62 | } 63 | ], 64 | "info" : { 65 | "author" : "xcode", 66 | "version" : 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/DFRFoundation.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19A603003 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | DFRFoundation 11 | CFBundleIdentifier 12 | com.apple.framework.DFRFoundation 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | DFRFoundation 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 264 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A8179f 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 11.0.1 37 | DTSDKBuild 38 | 20B21 39 | DTSDKName 40 | macosx11.0internal 41 | DTXcode 42 | 1200 43 | DTXcodeBuild 44 | 12A8179f 45 | LSMinimumSystemVersion 46 | 11.0 47 | NSHumanReadableCopyright 48 | Copyright © 2015–2020 Apple Inc. All rights reserved. 49 | 50 | 51 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/StatusBarController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarController.swift 3 | // MVTouchBar 4 | // 5 | // Created by darsh on 24/11/20. 6 | // 7 | 8 | import AppKit 9 | 10 | class StatusBarController { 11 | private var statusBar: NSStatusBar 12 | private var statusItem: NSStatusItem 13 | private var popover: NSPopover 14 | private var eventMonitor: EventMonitor? 15 | init(_ popover: NSPopover) { 16 | self.popover = popover 17 | statusBar = NSStatusBar.init() 18 | // Creating a status bar item having a fixed length 19 | statusItem = statusBar.statusItem(withLength: 28.0) 20 | 21 | if let statusBarButton = statusItem.button { 22 | statusBarButton.image = #imageLiteral(resourceName: "StatusBarIcon") 23 | statusBarButton.image?.size = NSSize(width: 18.0, height: 18.0) 24 | statusBarButton.image?.isTemplate = true 25 | 26 | statusBarButton.action = #selector(togglePopover(sender:)) 27 | statusBarButton.target = self 28 | } 29 | eventMonitor = EventMonitor(mask: [.leftMouseDown, .rightMouseDown], handler: mouseEventHandler) 30 | 31 | } 32 | 33 | @objc func togglePopover(sender: AnyObject) { 34 | if(popover.isShown) { 35 | hidePopover(sender) 36 | } 37 | else { 38 | showPopover(sender) 39 | } 40 | } 41 | 42 | func showPopover(_ sender: AnyObject) { 43 | if let statusBarButton = statusItem.button { 44 | popover.show(relativeTo: statusBarButton.bounds, of: statusBarButton, preferredEdge: NSRectEdge.maxY) 45 | } 46 | } 47 | 48 | func hidePopover(_ sender: AnyObject) { 49 | popover.performClose(sender) 50 | } 51 | 52 | func mouseEventHandler(_ event: NSEvent?) { 53 | if(popover.isShown) { 54 | hidePopover(event!) 55 | } 56 | } 57 | 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/StatusBarView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarView.swift 3 | // MVTouchBar 4 | // 5 | // Created by darsh on 24/11/20. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct StatusBarView: View { 11 | 12 | @EnvironmentObject private var appState: AppState 13 | 14 | 15 | var body: some View { 16 | VStack(spacing: 10) { 17 | Image("logo") 18 | .resizable() 19 | .scaledToFit() 20 | .frame(width: 100.0, height: 100.0) 21 | 22 | 23 | Text("Audio Input:") 24 | Picker(selection: $appState.selectedInput, label: Text("Audio Input")) { 25 | ForEach(0 ..< appState.inputs.count) { 26 | Text(appState.inputs[$0]) 27 | } 28 | } 29 | .pickerStyle(PopUpButtonPickerStyle()) 30 | .labelsHidden() 31 | .frame(width: 200.0) 32 | 33 | Spacer() 34 | 35 | Text("Pick Color Theme:") 36 | Picker(selection: $appState.selectedColor, label: Text("Pick Color Theme")) { 37 | ForEach(0 ..< appState.colorInputs.count) { 38 | Text(appState.colorInputs[$0]) 39 | } 40 | } 41 | .pickerStyle(PopUpButtonPickerStyle()) 42 | .labelsHidden() 43 | .frame(width: 200.0) 44 | 45 | Spacer() 46 | Button(action: { 47 | NSApplication.shared.terminate(self) 48 | }) 49 | { 50 | Text("Quit App") 51 | .fontWeight(.semibold) 52 | } 53 | .frame(width: 360.0) 54 | } 55 | .padding(10) 56 | .frame(width: 360.0, height: 360.0, alignment: .top) 57 | 58 | } 59 | } 60 | 61 | 62 | struct StatusBarView_Previews: PreviewProvider { 63 | static var previews: some View { 64 | StatusBarView() 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ######################### 2 | # .gitignore file for Xcode4 and Xcode5 Source projects 3 | # 4 | # Apple bugs, waiting for Apple to fix/respond: 5 | # 6 | # 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? 7 | # 8 | # Version 2.6 9 | # For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects 10 | 11 | ##### 12 | # OS X temporary files that should never be committed 13 | # 14 | # c.f. http://www.westwind.com/reference/os-x/invisibles.html 15 | 16 | .DS_Store 17 | 18 | # c.f. http://www.westwind.com/reference/os-x/invisibles.html 19 | 20 | .Trashes 21 | 22 | # c.f. http://www.westwind.com/reference/os-x/invisibles.html 23 | 24 | *.swp 25 | 26 | # 27 | # *.lock - this is used and abused by many editors for many different things. 28 | # For the main ones I use (e.g. Eclipse), it should be excluded 29 | # from source-control, but YMMV. 30 | # (lock files are usually local-only file-synchronization on the local FS that should NOT go in git) 31 | # c.f. the "OPTIONAL" section at bottom though, for tool-specific variations! 32 | # 33 | # In particular, if you're using CocoaPods, you'll want to comment-out this line: 34 | *.lock 35 | 36 | 37 | # 38 | # profile - REMOVED temporarily (on double-checking, I can't find it in OS X docs?) 39 | #profile 40 | 41 | 42 | #### 43 | # Xcode temporary files that should never be committed 44 | # 45 | # NB: NIB/XIB files still exist even on Storyboard projects, so we want this... 46 | 47 | *~.nib 48 | 49 | 50 | #### 51 | # Xcode build files - 52 | # 53 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData" 54 | 55 | DerivedData/ 56 | 57 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build" 58 | 59 | build/ 60 | 61 | 62 | ##### 63 | # Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) 64 | # 65 | # This is complicated: 66 | # 67 | # SOMETIMES you need to put this file in version control. 68 | # Apple designed it poorly - if you use "custom executables", they are 69 | # saved in this file. 70 | # 99% of projects do NOT use those, so they do NOT want to version control this file. 71 | # ..but if you're in the 1%, comment out the line "*.pbxuser" 72 | 73 | # .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html 74 | 75 | *.pbxuser 76 | 77 | # .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html 78 | 79 | *.mode1v3 80 | 81 | # .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html 82 | 83 | *.mode2v3 84 | 85 | # .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file 86 | 87 | *.perspectivev3 88 | 89 | # NB: also, whitelist the default ones, some projects need to use these 90 | !default.pbxuser 91 | !default.mode1v3 92 | !default.mode2v3 93 | !default.perspectivev3 94 | 95 | xcuserdata/ 96 | *.xcuserstate 97 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar.xcodeproj/xcshareddata/xcschemes/MVTouchBar.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar.xcodeproj/xcshareddata/xcschemes/MVTouchBar 1.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at darshkpatel@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![MVTouchbar](https://socialify.git.ci/darshkpatel/MVTouchbar/image?description=1&descriptionEditable=An%20OpenSource%20Audio%20Visualisation%20tool%20for%20the%20Mac%27s%20TouchBar&font=Source%20Code%20Pro&forks=1&issues=1&logo=https%3A%2F%2Fgithub.com%2Fdarshkpatel%2FMVTouchbar%2Fblob%2Fmain%2Fassets%2Flogo.png%3Fraw%3Dtrue&owner=1&pattern=Floating%20Cogs&pulls=1&stargazers=1&theme=Light) 2 | 3 | ### Features 4 | 5 | #### Note: Currently a PoC Application, A lot of features aren't implemented and there's a ton of bugs. Major changes need to be done to this application. ( This is also my first Swift Project so it's in no way testament to best programming practices ) 6 | 7 | - Music Visualizer (Duh!) 8 | - Visualize audio from system microphone 9 | - Low Resource Consumption (9% utilization of a single core, ~60MB Ram ) 10 | 11 | In Progress 12 | - Visualize system audio directly without microphone 13 | - Visualization Customization (Change Colors, Gradient Support) 14 | ### Screenshots 15 | #### Touchbar 16 | ![](./assets/screenshots/s4.png) 17 | ![](./assets/screenshots/s9.png) 18 | ![](./assets/screenshots/s5.png) 19 | ![](./assets/screenshots/s6.png) 20 | ![](./assets/screenshots/s7.png) 21 | 22 | 23 | #### Menu Bar 24 | ![](./assets/screenshots/s2.png) 25 | 26 | 27 | ### Usage 28 | Download the latest application from the [releases page](https://github.com/darshkpatel/MVTouchbar/releases). If Gatekeeper throws an error, right-click and then open the app. 29 | 30 | Press Allow to the Microphone Permission Prompt (Plans to make it optional after system audio source is supported) 31 | 32 | Currently the application starts up as an extra Button in the touchbar, press the button to view the visualizer ( This visualizer is persistent across applications and won't close automatically when you switch applications, thanks to [touch-baer](https://github.com/a2/touch-baer)) 33 | 34 | **Note:** Might be incompatible with tools like Pock or Better Touch Tool, since they use similar methods to override the touchbar switching 35 | 36 | ### Miscellaneous Screenshots 37 | ![](./assets/screenshots/s1.png) 38 | ![](./assets/screenshots/s3.png) 39 | 40 | 41 | ### License 42 | MVTouchBar is available under the GNU General Public License v3.0. See the [LICENSE file](LICENSE). 43 | 44 | Note: This is derived from [Touch-Bar-Visualizer](https://github.com/supersimple33/Touch-Bar-Visualizer/) with additional features and changes. 45 | ## Contributors ✨ 46 | 47 | [![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-) 48 | 49 | 50 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |

Arpit Jain

💻

Darsh Patel

📖 💻 🚇
61 | 62 | 63 | 64 | 65 | 66 | 67 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 68 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Resources/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf2576 2 | \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 AppleColorEmoji;\f2\fswiss\fcharset0 Helvetica-Bold; 3 | \f3\fnil\fcharset0 SFMono-Regular;} 4 | {\colortbl;\red255\green255\blue255;\red27\green31\blue34;\red255\green255\blue255;} 5 | {\*\expandedcolortbl;;\cssrgb\c14118\c16078\c18039;\cssrgb\c100000\c100000\c100000;} 6 | \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 7 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\qc\partightenfactor0 8 | 9 | \f0\fs24 \cf0 Melvin Gundlach\ 10 | {\field{\*\fldinst{HYPERLINK "http://www.melvin-gundlach.de"}}{\fldrslt www.melvin-gundlach.de}}\ 11 | \ 12 | Donate me a cup of coffee 13 | \f1 \uc0\u9749 \u65039 14 | \f0 \ 15 | {\field{\*\fldinst{HYPERLINK "http://paypal.me/melgu"}}{\fldrslt paypal.me/melgu}}\ 16 | \ 17 | 18 | \f2\b Licenses\ 19 | \ 20 | github.com/ddddxxx/TouchDock\ 21 | 22 | \f0\b0 (DFRFoundation.framework, TouchBarPrivateAPIs )\ 23 | Copyright (c) 2017 24 | \f3 \cf2 \cb3 \expnd0\expndtw0\kerning0 25 | \outl0\strokewidth0 \strokec2 Alexsander Akers 26 | \f0 \cf0 \cb1 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 \ 27 | \ 28 | Permission is hereby granted, free of charge, to any person obtaining\ 29 | a copy of this software and associated documentation files (the\ 30 | "Software"), to deal in the Software without restriction, including\ 31 | without limitation the rights to use, copy, modify, merge, publish,\ 32 | distribute, sublicense, and/or sell copies of the Software, and to\ 33 | permit persons to whom the Software is furnished to do so, subject to\ 34 | the following conditions:\ 35 | \ 36 | The above copyright notice and this permission notice shall be\ 37 | included in all copies or substantial portions of the Software.\ 38 | \ 39 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\ 40 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\ 41 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\ 42 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\ 43 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\ 44 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\ 45 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\ 46 | \ 47 | \ 48 | \ 49 | \ 50 | 51 | \f2\b github.com/supersimple33/Touch-Bar-Visualizer\ 52 | 53 | \f0\b0 volume.swift, barsScene.swift, ViewController.swift, WindowController.swift, :\ 54 | Copyright (c) 2019 Addison Hanrattie.\ 55 | \ 56 | All rights reserved.\ 57 | \ 58 | Redistribution and use in source and binary forms, with or without\ 59 | modification, are permitted providing that the following conditions\ 60 | are met:\ 61 | 1. Redistributions of source code must retain the above copyright\ 62 | notice, this list of conditions and the following disclaimer.\ 63 | 2. Redistributions in binary form must reproduce the above copyright\ 64 | notice, this list of conditions and the following disclaimer in the\ 65 | documentation and/or other materials provided with the distribution.\ 66 | \ 67 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\ 68 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\ 69 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\ 70 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\ 71 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\ 72 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\ 73 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\ 74 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\ 75 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\ 76 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\ 77 | POSSIBILITY OF SUCH DAMAGE.\ 78 | \ 79 | You should have received a copy of the GNU General Public License along with this program. If not, see .} -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/ViewController.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import AVFoundation 3 | import Accelerate 4 | import AudioToolbox 5 | import SpriteKit 6 | import CoreAudio 7 | 8 | 9 | 10 | extension NSTouchBarItem.Identifier { 11 | static let mainTouchBarItem = NSTouchBarItem.Identifier("darshkpatel.MVTouchBar.visualizer.color") 12 | } 13 | extension NSTouchBar.CustomizationIdentifier { 14 | static let mainTouchBarCustomization = NSTouchBar.CustomizationIdentifier("darshkpatel.MVTouchBar.visualizer") 15 | } 16 | 17 | 18 | class ViewController: NSViewController { 19 | 20 | let audioEngine = AVAudioEngine() 21 | var vol : volume = volume() 22 | 23 | var appState = AppState() 24 | var colorSKView = spritekitView() 25 | 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | setup() 30 | } 31 | 32 | override func viewDidAppear() { 33 | backGroundShow() 34 | self.view.window?.windowController?.close() 35 | 36 | } 37 | 38 | func updatePresence() { 39 | DFRElementSetControlStripPresenceForIdentifier(.mainTouchBarItem, true) 40 | } 41 | 42 | @objc func showTouchBar() { 43 | presentSystemModal(touchBar, systemTrayItemIdentifier: .mainTouchBarItem) 44 | updatePresence() 45 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { 46 | self.colorSKView.presentColor() 47 | } 48 | } 49 | 50 | func backGroundShow() { 51 | DFRSystemModalShowsCloseBoxWhenFrontMost(false) 52 | let item = NSCustomTouchBarItem(identifier: .mainTouchBarItem) 53 | let nmg = NSImage(named: NSImage.Name("logo"))! 54 | item.view = NSButton(image: nmg, target: self, action: #selector(showTouchBar)) 55 | NSTouchBarItem.addSystemTrayItem(item) 56 | updatePresence() 57 | } 58 | 59 | 60 | func setup(){ 61 | 62 | 63 | let format = audioEngine.inputNode.outputFormat(forBus: 0) 64 | 65 | vol.sampleRate = audioEngine.inputNode.outputFormat(forBus: 0).sampleRate 66 | 67 | audioEngine.inputNode.installTap(onBus: 0, bufferSize: 1024, format: format) { (buffer, time) in 68 | let levels = self.vol.analyze(buffer: buffer) 69 | for i in 0...99 { 70 | self.colorSKView.skBarsScene.levelFor(group: 99 - i, level: levels.0[i]) 71 | } 72 | 73 | 74 | } 75 | 76 | 77 | audioEngine.prepare() 78 | do { 79 | try audioEngine.start() 80 | } catch { 81 | print(error) 82 | } 83 | 84 | 85 | } 86 | 87 | func stop(){ 88 | audioEngine.inputNode.removeTap(onBus: 0) 89 | audioEngine.stop() 90 | print("Stopping Audio Tap") 91 | } 92 | 93 | } 94 | 95 | @available(OSX 10.12.2, *) 96 | extension ViewController: NSTouchBarDelegate { 97 | override func makeTouchBar() -> NSTouchBar? { 98 | let touchBar = NSTouchBar() 99 | touchBar.delegate = self 100 | touchBar.customizationIdentifier = .mainTouchBarCustomization 101 | touchBar.defaultItemIdentifiers = [.mainTouchBarItem] 102 | touchBar.customizationAllowedItemIdentifiers = [.mainTouchBarItem] 103 | return touchBar 104 | } 105 | 106 | func touchBar(_ touchBar: NSTouchBar, makeItemForIdentifier identifier: NSTouchBarItem.Identifier) -> NSTouchBarItem? { 107 | 108 | let item = NSCustomTouchBarItem(identifier: .mainTouchBarItem) 109 | item.view = self.colorSKView 110 | 111 | 112 | 113 | return item 114 | } 115 | 116 | func presentSystemModal(_ touchBar: NSTouchBar!, systemTrayItemIdentifier identifier: NSTouchBarItem.Identifier!) { 117 | NSTouchBar.presentSystemModalTouchBar(touchBar, systemTrayItemIdentifier: identifier) } 118 | 119 | func presentSystemModal(_ touchBar: NSTouchBar!, placement: Int64, systemTrayItemIdentifier identifier: NSTouchBarItem.Identifier!) { 120 | NSTouchBar.presentSystemModalTouchBar(touchBar, placement: placement, systemTrayItemIdentifier: identifier) 121 | } 122 | 123 | func minimizeSystemModal(_ touchBar: NSTouchBar!) { 124 | NSTouchBar.minimizeSystemModalTouchBar(touchBar) 125 | } 126 | } 127 | 128 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/volume.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Addison Hanrattie on 4/24/19. 3 | // Copyright © 2019 Addison Hanrattie. All rights reserved. 4 | // 5 | import Cocoa 6 | import AVFoundation 7 | import Accelerate 8 | 9 | public class volume { 10 | 11 | public var sampleRate = 0.0 12 | var trailingPeak : Float = 0.0000000001 13 | 14 | let col : spritekitView = spritekitView() 15 | 16 | public func analyze(buffer: AVAudioPCMBuffer) -> ([Int], Int) { 17 | // refrenced from stackoverflow.com/questions/3398753/using-the-apple-fft-and-accelerate-framework 18 | 19 | // Set Buffers 20 | let bufferSize = buffer.frameLength 21 | 22 | let sqLog = vDSP_Length(log2(Float(bufferSize))) 23 | var setup : FFTSetup? = vDSP_create_fftsetup(sqLog, FFTRadix(kFFTRadix2))! // Change value for 24 | 25 | let maxBufFloatL = Int(bufferSize / 2) * MemoryLayout.size 26 | 27 | // Set Comnplex 28 | var realp = (malloc(maxBufFloatL)?.assumingMemoryBound(to: Float.self))! 29 | var imagp = (malloc(maxBufFloatL)?.assumingMemoryBound(to: Float.self))! 30 | var complex = DSPSplitComplex(realp: realp, imagp: imagp) 31 | 32 | // Control Memory 33 | defer { 34 | vDSP_destroy_fftsetup(setup) 35 | realp.deallocate() 36 | imagp.deallocate() 37 | } 38 | 39 | // even odds 40 | let cPnt = buffer.audioBufferList.pointee.mBuffers.mData!.assumingMemoryBound(to: DSPComplex.self) 41 | let cPntLen = buffer.audioBufferList.pointee.mBuffers.mDataByteSize 42 | vDSP_ctoz(cPnt, 2, &complex, 1, vDSP_Length(bufferSize / 2)) 43 | memset(cPnt, 0, Int(cPntLen)) 44 | 45 | //fft and clear 46 | vDSP_fft_zrip(setup!, &complex, 1, sqLog, FFTDirection(FFT_FORWARD)) 47 | bzero(complex.imagp, maxBufFloatL) 48 | 49 | var row : vDSP_Length = 0 50 | var vol : Float = 0.0 51 | vDSP_maxvi(complex.realp, 1, &vol, &row, vDSP_Length(bufferSize / 2)) 52 | 53 | var peaks : [Float] = [] 54 | 55 | let kDivCons : Float = 1.035 // kDivCons is a constant which can be tuned to affect of the relative loudness 56 | var topRng = 2205 57 | var btmRng = Int(Float(topRng) / kDivCons) //Constant^ 58 | 59 | topRng = Int(Float(topRng) / kDivCons) //Constant^ 60 | btmRng = Int(Float(topRng) / kDivCons) //Constant^ 61 | 62 | for _ in 1...100 { 63 | var avgPeak : Float = 0.0 64 | vDSP_maxmgv((complex.realp + topRng), 1, &avgPeak, vDSP_Length(topRng - btmRng)) 65 | 66 | 67 | topRng = Int(Float(topRng) / kDivCons) //Constant^ 68 | btmRng = Int(Float(topRng) / kDivCons) //Constant^ 69 | 70 | if avgPeak.isNaN { 71 | avgPeak = 0.0 72 | } else if avgPeak.isInfinite { 73 | avgPeak = 300.0 74 | } 75 | 76 | 77 | peaks.append(avgPeak) 78 | } 79 | 80 | // Getting peak audio value 81 | var peak : Float = 0.0 82 | vDSP_meamgv((complex.realp + topRng), 1, &peak, vDSP_Length(2205 - (Float(btmRng) * kDivCons))) 83 | if peak > trailingPeak { 84 | trailingPeak = peak 85 | } 86 | // if(peak.isNaN) {peak = 0.0} 87 | let method = 2 // TODO: Make configurable by user 88 | var finalPeaks : [Int] = [] 89 | 90 | switch method { //switchs volume scale calculations 91 | case 0: // All volumes based off of max shifted downwards, no manipulation 92 | let shifter = 10.0 / (peaks.max() ?? 1.0) 93 | print(peaks.max() as Any, shifter) 94 | for i in 0...99 { 95 | if shifter.isInfinite || shifter.isNaN { 96 | let peak = Int(peaks[i] * 0.0) + 1 97 | finalPeaks.append(peak) 98 | } else { 99 | let peak = Int(peaks[i] * shifter) + 1 100 | finalPeaks.append(peak) 101 | } 102 | } 103 | case 1: 104 | let sortedPeaks = peaks.sorted() 105 | for i in 0...99 { // Each loudness level has equal number of frequencies 106 | let p = sortedPeaks.firstIndex(of: peaks[i])! 107 | do { 108 | let relLoud = 10.0 * Float(p) / 99.0 109 | var peakiness = Int(relLoud) + 1 110 | if (!(peakiness >= 0 && peakiness <= 10)) { 111 | peakiness = 0 112 | } 113 | finalPeaks.append(peakiness) 114 | } 115 | } 116 | case 2: 117 | let s = powf(peaks.max()!, 0.1) 118 | for i in 0...99 { // Number of frequencies in each loudness level varies logarithmically 119 | if peaks[i] <= 1 { 120 | finalPeaks.append(1) 121 | continue 122 | } 123 | var peak = logA(x: peaks[i], ofBase: s) 124 | if(peak.isNaN){ 125 | peak = 1.0 126 | } 127 | 128 | if peak > 10.0 { 129 | peak = peak/10 130 | } 131 | if peak <= 0.5 { 132 | peak = 1.0 133 | } 134 | 135 | finalPeaks.append(Int(peak)) 136 | } 137 | // print(peaks.max() ?? -1) 138 | default: 139 | fatalError() //should never default 140 | break 141 | } 142 | 143 | //NTS: I have written a couple different ways of scalling the volume 144 | 145 | // Clear Data 146 | for ii in 0.. Float { 154 | return log(x)/log(b) 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/barsScene.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import SpriteKit 3 | 4 | 5 | 6 | 7 | class barsScene: SKScene { 8 | 9 | var ready = false 10 | let height : CGFloat = 30.0 11 | let wid : CGFloat = 10.0 12 | var setupDone = false 13 | var allNodes : [[SKSpriteNode]] = [] 14 | var colorArr = [ 15 | NSColor(red:0x12/255, green:0xc2/255, blue:0xe9/255, alpha:255/255), 16 | NSColor(red:0x13/255, green:0xc1/255, blue:0xe9/255, alpha:255/255), 17 | NSColor(red:0x15/255, green:0xc0/255, blue:0xe9/255, alpha:255/255), 18 | NSColor(red:0x17/255, green:0xbf/255, blue:0xe9/255, alpha:255/255), 19 | NSColor(red:0x19/255, green:0xbe/255, blue:0xe9/255, alpha:255/255), 20 | NSColor(red:0x1a/255, green:0xbd/255, blue:0xe9/255, alpha:255/255), 21 | NSColor(red:0x1c/255, green:0xbd/255, blue:0xe9/255, alpha:255/255), 22 | NSColor(red:0x1e/255, green:0xbc/255, blue:0xe9/255, alpha:255/255), 23 | NSColor(red:0x20/255, green:0xbb/255, blue:0xe9/255, alpha:255/255), 24 | NSColor(red:0x22/255, green:0xba/255, blue:0xe9/255, alpha:255/255), 25 | NSColor(red:0x23/255, green:0xb9/255, blue:0xe9/255, alpha:255/255), 26 | NSColor(red:0x25/255, green:0xb9/255, blue:0xe9/255, alpha:255/255), 27 | NSColor(red:0x27/255, green:0xb8/255, blue:0xe9/255, alpha:255/255), 28 | NSColor(red:0x29/255, green:0xb7/255, blue:0xe9/255, alpha:255/255), 29 | NSColor(red:0x2b/255, green:0xb6/255, blue:0xe9/255, alpha:255/255), 30 | NSColor(red:0x2c/255, green:0xb5/255, blue:0xe9/255, alpha:255/255), 31 | NSColor(red:0x2e/255, green:0xb4/255, blue:0xe9/255, alpha:255/255), 32 | NSColor(red:0x30/255, green:0xb4/255, blue:0xe9/255, alpha:255/255), 33 | NSColor(red:0x32/255, green:0xb3/255, blue:0xe9/255, alpha:255/255), 34 | NSColor(red:0x34/255, green:0xb2/255, blue:0xe9/255, alpha:255/255), 35 | NSColor(red:0x35/255, green:0xb1/255, blue:0xe9/255, alpha:255/255), 36 | NSColor(red:0x37/255, green:0xb0/255, blue:0xe9/255, alpha:255/255), 37 | NSColor(red:0x39/255, green:0xb0/255, blue:0xe9/255, alpha:255/255), 38 | NSColor(red:0x3b/255, green:0xaf/255, blue:0xe9/255, alpha:255/255), 39 | NSColor(red:0x3d/255, green:0xae/255, blue:0xe9/255, alpha:255/255), 40 | NSColor(red:0x3e/255, green:0xad/255, blue:0xea/255, alpha:255/255), 41 | NSColor(red:0x40/255, green:0xac/255, blue:0xea/255, alpha:255/255), 42 | NSColor(red:0x42/255, green:0xab/255, blue:0xea/255, alpha:255/255), 43 | NSColor(red:0x44/255, green:0xab/255, blue:0xea/255, alpha:255/255), 44 | NSColor(red:0x46/255, green:0xaa/255, blue:0xea/255, alpha:255/255), 45 | NSColor(red:0x47/255, green:0xa9/255, blue:0xea/255, alpha:255/255), 46 | NSColor(red:0x49/255, green:0xa8/255, blue:0xea/255, alpha:255/255), 47 | NSColor(red:0x4b/255, green:0xa7/255, blue:0xea/255, alpha:255/255), 48 | NSColor(red:0x4d/255, green:0xa7/255, blue:0xea/255, alpha:255/255), 49 | NSColor(red:0x4f/255, green:0xa6/255, blue:0xea/255, alpha:255/255), 50 | NSColor(red:0x50/255, green:0xa5/255, blue:0xea/255, alpha:255/255), 51 | NSColor(red:0x52/255, green:0xa4/255, blue:0xea/255, alpha:255/255), 52 | NSColor(red:0x54/255, green:0xa3/255, blue:0xea/255, alpha:255/255), 53 | NSColor(red:0x56/255, green:0xa2/255, blue:0xea/255, alpha:255/255), 54 | NSColor(red:0x58/255, green:0xa2/255, blue:0xea/255, alpha:255/255), 55 | NSColor(red:0x59/255, green:0xa1/255, blue:0xea/255, alpha:255/255), 56 | NSColor(red:0x5b/255, green:0xa0/255, blue:0xea/255, alpha:255/255), 57 | NSColor(red:0x5d/255, green:0x9f/255, blue:0xea/255, alpha:255/255), 58 | NSColor(red:0x5f/255, green:0x9e/255, blue:0xea/255, alpha:255/255), 59 | NSColor(red:0x61/255, green:0x9e/255, blue:0xea/255, alpha:255/255), 60 | NSColor(red:0x62/255, green:0x9d/255, blue:0xea/255, alpha:255/255), 61 | NSColor(red:0x64/255, green:0x9c/255, blue:0xea/255, alpha:255/255), 62 | NSColor(red:0x66/255, green:0x9b/255, blue:0xea/255, alpha:255/255), 63 | NSColor(red:0x68/255, green:0x9a/255, blue:0xea/255, alpha:255/255), 64 | NSColor(red:0x6a/255, green:0x99/255, blue:0xea/255, alpha:255/255), 65 | NSColor(red:0x6b/255, green:0x99/255, blue:0xeb/255, alpha:255/255), 66 | NSColor(red:0x6d/255, green:0x98/255, blue:0xeb/255, alpha:255/255), 67 | NSColor(red:0x6f/255, green:0x97/255, blue:0xeb/255, alpha:255/255), 68 | NSColor(red:0x71/255, green:0x96/255, blue:0xeb/255, alpha:255/255), 69 | NSColor(red:0x73/255, green:0x95/255, blue:0xeb/255, alpha:255/255), 70 | NSColor(red:0x74/255, green:0x95/255, blue:0xeb/255, alpha:255/255), 71 | NSColor(red:0x76/255, green:0x94/255, blue:0xeb/255, alpha:255/255), 72 | NSColor(red:0x78/255, green:0x93/255, blue:0xeb/255, alpha:255/255), 73 | NSColor(red:0x7a/255, green:0x92/255, blue:0xeb/255, alpha:255/255), 74 | NSColor(red:0x7c/255, green:0x91/255, blue:0xeb/255, alpha:255/255), 75 | NSColor(red:0x7d/255, green:0x90/255, blue:0xeb/255, alpha:255/255), 76 | NSColor(red:0x7f/255, green:0x90/255, blue:0xeb/255, alpha:255/255), 77 | NSColor(red:0x81/255, green:0x8f/255, blue:0xeb/255, alpha:255/255), 78 | NSColor(red:0x83/255, green:0x8e/255, blue:0xeb/255, alpha:255/255), 79 | NSColor(red:0x85/255, green:0x8d/255, blue:0xeb/255, alpha:255/255), 80 | NSColor(red:0x86/255, green:0x8c/255, blue:0xeb/255, alpha:255/255), 81 | NSColor(red:0x88/255, green:0x8c/255, blue:0xeb/255, alpha:255/255), 82 | NSColor(red:0x8a/255, green:0x8b/255, blue:0xeb/255, alpha:255/255), 83 | NSColor(red:0x8c/255, green:0x8a/255, blue:0xeb/255, alpha:255/255), 84 | NSColor(red:0x8e/255, green:0x89/255, blue:0xeb/255, alpha:255/255), 85 | NSColor(red:0x8f/255, green:0x88/255, blue:0xeb/255, alpha:255/255), 86 | NSColor(red:0x91/255, green:0x87/255, blue:0xeb/255, alpha:255/255), 87 | NSColor(red:0x93/255, green:0x87/255, blue:0xeb/255, alpha:255/255), 88 | NSColor(red:0x95/255, green:0x86/255, blue:0xeb/255, alpha:255/255), 89 | NSColor(red:0x97/255, green:0x85/255, blue:0xeb/255, alpha:255/255), 90 | NSColor(red:0x98/255, green:0x84/255, blue:0xec/255, alpha:255/255), 91 | NSColor(red:0x9a/255, green:0x83/255, blue:0xec/255, alpha:255/255), 92 | NSColor(red:0x9c/255, green:0x83/255, blue:0xec/255, alpha:255/255), 93 | NSColor(red:0x9e/255, green:0x82/255, blue:0xec/255, alpha:255/255), 94 | NSColor(red:0xa0/255, green:0x81/255, blue:0xec/255, alpha:255/255), 95 | NSColor(red:0xa1/255, green:0x80/255, blue:0xec/255, alpha:255/255), 96 | NSColor(red:0xa3/255, green:0x7f/255, blue:0xec/255, alpha:255/255), 97 | NSColor(red:0xa5/255, green:0x7e/255, blue:0xec/255, alpha:255/255), 98 | NSColor(red:0xa7/255, green:0x7e/255, blue:0xec/255, alpha:255/255), 99 | NSColor(red:0xa9/255, green:0x7d/255, blue:0xec/255, alpha:255/255), 100 | NSColor(red:0xaa/255, green:0x7c/255, blue:0xec/255, alpha:255/255), 101 | NSColor(red:0xac/255, green:0x7b/255, blue:0xec/255, alpha:255/255), 102 | NSColor(red:0xae/255, green:0x7a/255, blue:0xec/255, alpha:255/255), 103 | NSColor(red:0xb0/255, green:0x7a/255, blue:0xec/255, alpha:255/255), 104 | NSColor(red:0xb2/255, green:0x79/255, blue:0xec/255, alpha:255/255), 105 | NSColor(red:0xb3/255, green:0x78/255, blue:0xec/255, alpha:255/255), 106 | NSColor(red:0xb5/255, green:0x77/255, blue:0xec/255, alpha:255/255), 107 | NSColor(red:0xb7/255, green:0x76/255, blue:0xec/255, alpha:255/255), 108 | NSColor(red:0xb9/255, green:0x75/255, blue:0xec/255, alpha:255/255), 109 | NSColor(red:0xbb/255, green:0x75/255, blue:0xec/255, alpha:255/255), 110 | NSColor(red:0xbc/255, green:0x74/255, blue:0xec/255, alpha:255/255), 111 | NSColor(red:0xbe/255, green:0x73/255, blue:0xec/255, alpha:255/255), 112 | NSColor(red:0xc0/255, green:0x72/255, blue:0xec/255, alpha:255/255), 113 | NSColor(red:0xc2/255, green:0x71/255, blue:0xec/255, alpha:255/255), 114 | NSColor(red:0xc4/255, green:0x71/255, blue:0xed/255, alpha:255/255) 115 | ] 116 | 117 | 118 | var created = false 119 | 120 | override func didMove(to view: SKView) { // Initialize all sprites for leveling 121 | print(self.size.width) 122 | if(!setupDone){ 123 | self.backgroundColor = .black 124 | for i in 0...99 { 125 | var popul : [SKSpriteNode] = [] 126 | for c in 0...10 { 127 | // if c < 2 { 128 | // color = .systemBlue 129 | // } 130 | 131 | let x : CGFloat = (wid * CGFloat(i + 1)) // 110 aprox escape key distance 132 | var texture: SKTexture 133 | 134 | texture = SKTexture(imageNamed: "square") // TODO: Make this configurable by uset 135 | 136 | let rect = SKSpriteNode(texture: texture, color: colorArr[99-i], size: CGSize(width: wid, height: 3)) 137 | rect.colorBlendFactor = 1.0 138 | self.addChild(rect) 139 | 140 | rect.position = CGPoint(x: x, y: (rect.size.height * CGFloat(c - 1)) + (rect.size.height / 2)) 141 | 142 | popul.append(rect) 143 | } 144 | allNodes.append(popul) 145 | } 146 | 147 | if !ready { 148 | self.backgroundColor = .black 149 | ready = true 150 | } 151 | 152 | if !created { 153 | created = true 154 | moveCent() //Correct call point? 155 | } 156 | setupDone = true 157 | } 158 | } 159 | 160 | func levelFor(group: Int, level: Int) { 161 | guard allNodes.count == 100 else { return } 162 | guard level > 0 else { return } 163 | 164 | for i in 1...level { // Reveal all needed nodes 165 | if i > 10 { 166 | continue 167 | } 168 | allNodes[group][i].isHidden = false 169 | // allNodes[group][i].color = self.color 170 | } 171 | 172 | if level < 10 { 173 | for i in (level + 1)...10 { // Hide all nodes below peak volume 174 | allNodes[group][i].isHidden = true 175 | } 176 | } 177 | } 178 | 179 | 180 | 181 | func moveCent() { 182 | for i in 0...99 { 183 | for j in 0...10 { 184 | let x : CGFloat = (wid * CGFloat(i + 1)) 185 | allNodes[i][j].position = CGPoint(x: x, y: allNodes[i][j].position.y) 186 | } 187 | } 188 | } 189 | 190 | } 191 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3E28E64F25720EB800F5B64B /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E28E64E25720EB800F5B64B /* AppState.swift */; }; 11 | 3E89CECE256E33F600B05752 /* StatusBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E89CECD256E33F600B05752 /* StatusBarView.swift */; }; 12 | 3EE875A3256CF81B008682F9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EE875A2256CF81B008682F9 /* AppDelegate.swift */; }; 13 | 3EE875A7256CF81D008682F9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3EE875A6256CF81D008682F9 /* Assets.xcassets */; }; 14 | 3EE875AA256CF81D008682F9 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3EE875A9256CF81D008682F9 /* Preview Assets.xcassets */; }; 15 | 3EE875B8256CFE84008682F9 /* StatusBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EE875B7256CFE84008682F9 /* StatusBarController.swift */; }; 16 | 3EE875BB256D007B008682F9 /* EventMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EE875BA256D007B008682F9 /* EventMonitor.swift */; }; 17 | 3EFCF1EB256E9C7D001E2220 /* volume.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFCF1EA256E9C7D001E2220 /* volume.swift */; }; 18 | 3EFCF1EF256EA25A001E2220 /* barsScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFCF1EE256EA25A001E2220 /* barsScene.swift */; }; 19 | 3EFCF1FE256EC6A4001E2220 /* DFRFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EFCF1FD256EC6A4001E2220 /* DFRFoundation.framework */; }; 20 | 3EFCF222256ECFB9001E2220 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFCF221256ECFB9001E2220 /* ViewController.swift */; }; 21 | 3EFCF225256ED071001E2220 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3EFCF224256ED071001E2220 /* Main.storyboard */; }; 22 | 3EFCF232256F9FC3001E2220 /* spritekitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EFCF231256F9FC3001E2220 /* spritekitView.swift */; }; 23 | 3EFCF251256FB6C8001E2220 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 3EFCF250256FB6C8001E2220 /* Credits.rtf */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 3E28E64E25720EB800F5B64B /* AppState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppState.swift; sourceTree = ""; }; 28 | 3E89CECD256E33F600B05752 /* StatusBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusBarView.swift; sourceTree = ""; }; 29 | 3EE8759F256CF81B008682F9 /* MVTouchBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MVTouchBar.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 3EE875A2256CF81B008682F9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 31 | 3EE875A6256CF81D008682F9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 32 | 3EE875A9256CF81D008682F9 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 33 | 3EE875AE256CF81D008682F9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | 3EE875AF256CF81D008682F9 /* MVTouchBar.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MVTouchBar.entitlements; sourceTree = ""; }; 35 | 3EE875B7256CFE84008682F9 /* StatusBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusBarController.swift; sourceTree = ""; }; 36 | 3EE875BA256D007B008682F9 /* EventMonitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventMonitor.swift; sourceTree = ""; }; 37 | 3EFCF1EA256E9C7D001E2220 /* volume.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = volume.swift; sourceTree = ""; }; 38 | 3EFCF1EE256EA25A001E2220 /* barsScene.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = barsScene.swift; sourceTree = ""; }; 39 | 3EFCF1FD256EC6A4001E2220 /* DFRFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DFRFoundation.framework; path = ../../../../../System/Library/PrivateFrameworks/DFRFoundation.framework; sourceTree = ""; }; 40 | 3EFCF21B256ECF1A001E2220 /* TouchBarPrivateApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TouchBarPrivateApi.h; sourceTree = ""; }; 41 | 3EFCF21C256ECF1A001E2220 /* MVTouchBar-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MVTouchBar-Bridging-Header.h"; sourceTree = ""; }; 42 | 3EFCF221256ECFB9001E2220 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 43 | 3EFCF224256ED071001E2220 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 44 | 3EFCF231256F9FC3001E2220 /* spritekitView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = spritekitView.swift; sourceTree = ""; }; 45 | 3EFCF250256FB6C8001E2220 /* Credits.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | 3EE8759C256CF81B008682F9 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | 3EFCF1FE256EC6A4001E2220 /* DFRFoundation.framework in Frameworks */, 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | 3E89CED4256E5E0A00B05752 /* Frameworks */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 3EFCF1FD256EC6A4001E2220 /* DFRFoundation.framework */, 64 | ); 65 | name = Frameworks; 66 | sourceTree = ""; 67 | }; 68 | 3EE87596256CF81B008682F9 = { 69 | isa = PBXGroup; 70 | children = ( 71 | 3EE875A1256CF81B008682F9 /* MVTouchBar */, 72 | 3EE875A0256CF81B008682F9 /* Products */, 73 | 3E89CED4256E5E0A00B05752 /* Frameworks */, 74 | ); 75 | sourceTree = ""; 76 | }; 77 | 3EE875A0256CF81B008682F9 /* Products */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 3EE8759F256CF81B008682F9 /* MVTouchBar.app */, 81 | ); 82 | name = Products; 83 | sourceTree = ""; 84 | }; 85 | 3EE875A1256CF81B008682F9 /* MVTouchBar */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 3EFCF246256FB5FB001E2220 /* Resources */, 89 | 3EFCF1EA256E9C7D001E2220 /* volume.swift */, 90 | 3EE875A2256CF81B008682F9 /* AppDelegate.swift */, 91 | 3EFCF1EE256EA25A001E2220 /* barsScene.swift */, 92 | 3EFCF221256ECFB9001E2220 /* ViewController.swift */, 93 | 3EFCF231256F9FC3001E2220 /* spritekitView.swift */, 94 | 3EE875BA256D007B008682F9 /* EventMonitor.swift */, 95 | 3EE875B7256CFE84008682F9 /* StatusBarController.swift */, 96 | 3E89CECD256E33F600B05752 /* StatusBarView.swift */, 97 | 3E28E64E25720EB800F5B64B /* AppState.swift */, 98 | 3EE875A6256CF81D008682F9 /* Assets.xcassets */, 99 | 3EFCF224256ED071001E2220 /* Main.storyboard */, 100 | 3EE875AE256CF81D008682F9 /* Info.plist */, 101 | 3EFCF21B256ECF1A001E2220 /* TouchBarPrivateApi.h */, 102 | 3EFCF21C256ECF1A001E2220 /* MVTouchBar-Bridging-Header.h */, 103 | 3EE875AF256CF81D008682F9 /* MVTouchBar.entitlements */, 104 | 3EE875A8256CF81D008682F9 /* Preview Content */, 105 | ); 106 | path = MVTouchBar; 107 | sourceTree = ""; 108 | }; 109 | 3EE875A8256CF81D008682F9 /* Preview Content */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 3EE875A9256CF81D008682F9 /* Preview Assets.xcassets */, 113 | ); 114 | path = "Preview Content"; 115 | sourceTree = ""; 116 | }; 117 | 3EFCF246256FB5FB001E2220 /* Resources */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 3EFCF250256FB6C8001E2220 /* Credits.rtf */, 121 | ); 122 | path = Resources; 123 | sourceTree = ""; 124 | }; 125 | /* End PBXGroup section */ 126 | 127 | /* Begin PBXNativeTarget section */ 128 | 3EE8759E256CF81B008682F9 /* MVTouchBar */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = 3EE875B2256CF81D008682F9 /* Build configuration list for PBXNativeTarget "MVTouchBar" */; 131 | buildPhases = ( 132 | 3EE8759B256CF81B008682F9 /* Sources */, 133 | 3EE8759C256CF81B008682F9 /* Frameworks */, 134 | 3EE8759D256CF81B008682F9 /* Resources */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | ); 140 | name = MVTouchBar; 141 | packageProductDependencies = ( 142 | ); 143 | productName = MVTouchBar; 144 | productReference = 3EE8759F256CF81B008682F9 /* MVTouchBar.app */; 145 | productType = "com.apple.product-type.application"; 146 | }; 147 | /* End PBXNativeTarget section */ 148 | 149 | /* Begin PBXProject section */ 150 | 3EE87597256CF81B008682F9 /* Project object */ = { 151 | isa = PBXProject; 152 | attributes = { 153 | LastSwiftUpdateCheck = 1220; 154 | LastUpgradeCheck = 1220; 155 | TargetAttributes = { 156 | 3EE8759E256CF81B008682F9 = { 157 | CreatedOnToolsVersion = 12.2; 158 | }; 159 | }; 160 | }; 161 | buildConfigurationList = 3EE8759A256CF81B008682F9 /* Build configuration list for PBXProject "MVTouchBar" */; 162 | compatibilityVersion = "Xcode 9.3"; 163 | developmentRegion = en; 164 | hasScannedForEncodings = 0; 165 | knownRegions = ( 166 | en, 167 | Base, 168 | ); 169 | mainGroup = 3EE87596256CF81B008682F9; 170 | packageReferences = ( 171 | ); 172 | productRefGroup = 3EE875A0256CF81B008682F9 /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 3EE8759E256CF81B008682F9 /* MVTouchBar */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 3EE8759D256CF81B008682F9 /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 3EE875AA256CF81D008682F9 /* Preview Assets.xcassets in Resources */, 187 | 3EE875A7256CF81D008682F9 /* Assets.xcassets in Resources */, 188 | 3EFCF225256ED071001E2220 /* Main.storyboard in Resources */, 189 | 3EFCF251256FB6C8001E2220 /* Credits.rtf in Resources */, 190 | ); 191 | runOnlyForDeploymentPostprocessing = 0; 192 | }; 193 | /* End PBXResourcesBuildPhase section */ 194 | 195 | /* Begin PBXSourcesBuildPhase section */ 196 | 3EE8759B256CF81B008682F9 /* Sources */ = { 197 | isa = PBXSourcesBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | 3EE875B8256CFE84008682F9 /* StatusBarController.swift in Sources */, 201 | 3EFCF222256ECFB9001E2220 /* ViewController.swift in Sources */, 202 | 3E89CECE256E33F600B05752 /* StatusBarView.swift in Sources */, 203 | 3EFCF1EB256E9C7D001E2220 /* volume.swift in Sources */, 204 | 3EFCF1EF256EA25A001E2220 /* barsScene.swift in Sources */, 205 | 3EE875A3256CF81B008682F9 /* AppDelegate.swift in Sources */, 206 | 3EFCF232256F9FC3001E2220 /* spritekitView.swift in Sources */, 207 | 3E28E64F25720EB800F5B64B /* AppState.swift in Sources */, 208 | 3EE875BB256D007B008682F9 /* EventMonitor.swift in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin XCBuildConfiguration section */ 215 | 3EE875B0256CF81D008682F9 /* Debug */ = { 216 | isa = XCBuildConfiguration; 217 | buildSettings = { 218 | ALWAYS_SEARCH_USER_PATHS = NO; 219 | CLANG_ANALYZER_NONNULL = YES; 220 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 221 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 222 | CLANG_CXX_LIBRARY = "libc++"; 223 | CLANG_ENABLE_MODULES = YES; 224 | CLANG_ENABLE_OBJC_ARC = YES; 225 | CLANG_ENABLE_OBJC_WEAK = YES; 226 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 227 | CLANG_WARN_BOOL_CONVERSION = YES; 228 | CLANG_WARN_COMMA = YES; 229 | CLANG_WARN_CONSTANT_CONVERSION = YES; 230 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 231 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 232 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 233 | CLANG_WARN_EMPTY_BODY = YES; 234 | CLANG_WARN_ENUM_CONVERSION = YES; 235 | CLANG_WARN_INFINITE_RECURSION = YES; 236 | CLANG_WARN_INT_CONVERSION = YES; 237 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 238 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 239 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 240 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 241 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 242 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 243 | CLANG_WARN_STRICT_PROTOTYPES = YES; 244 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 245 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 246 | CLANG_WARN_UNREACHABLE_CODE = YES; 247 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 248 | COPY_PHASE_STRIP = NO; 249 | DEBUG_INFORMATION_FORMAT = dwarf; 250 | ENABLE_STRICT_OBJC_MSGSEND = YES; 251 | ENABLE_TESTABILITY = YES; 252 | GCC_C_LANGUAGE_STANDARD = gnu11; 253 | GCC_DYNAMIC_NO_PIC = NO; 254 | GCC_NO_COMMON_BLOCKS = YES; 255 | GCC_OPTIMIZATION_LEVEL = 0; 256 | GCC_PREPROCESSOR_DEFINITIONS = ( 257 | "DEBUG=1", 258 | "$(inherited)", 259 | ); 260 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 261 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 262 | GCC_WARN_UNDECLARED_SELECTOR = YES; 263 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 264 | GCC_WARN_UNUSED_FUNCTION = YES; 265 | GCC_WARN_UNUSED_VARIABLE = YES; 266 | MACOSX_DEPLOYMENT_TARGET = 11.0; 267 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 268 | MTL_FAST_MATH = YES; 269 | ONLY_ACTIVE_ARCH = YES; 270 | SDKROOT = macosx; 271 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 272 | SWIFT_OBJC_BRIDGING_HEADER = ""; 273 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 274 | }; 275 | name = Debug; 276 | }; 277 | 3EE875B1256CF81D008682F9 /* Release */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ALWAYS_SEARCH_USER_PATHS = NO; 281 | CLANG_ANALYZER_NONNULL = YES; 282 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 283 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 284 | CLANG_CXX_LIBRARY = "libc++"; 285 | CLANG_ENABLE_MODULES = YES; 286 | CLANG_ENABLE_OBJC_ARC = YES; 287 | CLANG_ENABLE_OBJC_WEAK = YES; 288 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 289 | CLANG_WARN_BOOL_CONVERSION = YES; 290 | CLANG_WARN_COMMA = YES; 291 | CLANG_WARN_CONSTANT_CONVERSION = YES; 292 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 294 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 295 | CLANG_WARN_EMPTY_BODY = YES; 296 | CLANG_WARN_ENUM_CONVERSION = YES; 297 | CLANG_WARN_INFINITE_RECURSION = YES; 298 | CLANG_WARN_INT_CONVERSION = YES; 299 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 300 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 301 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 304 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 305 | CLANG_WARN_STRICT_PROTOTYPES = YES; 306 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 307 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 308 | CLANG_WARN_UNREACHABLE_CODE = YES; 309 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 310 | COPY_PHASE_STRIP = NO; 311 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 312 | ENABLE_NS_ASSERTIONS = NO; 313 | ENABLE_STRICT_OBJC_MSGSEND = YES; 314 | GCC_C_LANGUAGE_STANDARD = gnu11; 315 | GCC_NO_COMMON_BLOCKS = YES; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | MACOSX_DEPLOYMENT_TARGET = 11.0; 323 | MTL_ENABLE_DEBUG_INFO = NO; 324 | MTL_FAST_MATH = YES; 325 | SDKROOT = macosx; 326 | SWIFT_COMPILATION_MODE = wholemodule; 327 | SWIFT_OBJC_BRIDGING_HEADER = ""; 328 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 329 | }; 330 | name = Release; 331 | }; 332 | 3EE875B3256CF81D008682F9 /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | buildSettings = { 335 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 336 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 337 | CODE_SIGN_ENTITLEMENTS = MVTouchBar/MVTouchBar.entitlements; 338 | CODE_SIGN_IDENTITY = "Apple Development"; 339 | CODE_SIGN_STYLE = Automatic; 340 | COMBINE_HIDPI_IMAGES = YES; 341 | CURRENT_PROJECT_VERSION = 1; 342 | DEVELOPMENT_ASSET_PATHS = "\"MVTouchBar/Preview Content\""; 343 | DEVELOPMENT_TEAM = 3SVMJGTZSF; 344 | ENABLE_PREVIEWS = YES; 345 | FRAMEWORK_SEARCH_PATHS = ( 346 | "$(inherited)", 347 | "$(PROJECT_DIR)", 348 | ); 349 | INFOPLIST_FILE = MVTouchBar/Info.plist; 350 | LD_RUNPATH_SEARCH_PATHS = ( 351 | "$(inherited)", 352 | "@executable_path/../Frameworks", 353 | ); 354 | MACOSX_DEPLOYMENT_TARGET = 10.15; 355 | MARKETING_VERSION = 0.0.4; 356 | PRODUCT_BUNDLE_IDENTIFIER = darshkpatel.MVTouchBar; 357 | PRODUCT_NAME = "$(TARGET_NAME)"; 358 | SWIFT_OBJC_BRIDGING_HEADER = "MVTouchBar/MVTouchBar-Bridging-Header.h"; 359 | SWIFT_PRECOMPILE_BRIDGING_HEADER = YES; 360 | SWIFT_VERSION = 5.0; 361 | SYSTEM_FRAMEWORK_SEARCH_PATHS = ( 362 | "$(inherited)", 363 | "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", 364 | ); 365 | }; 366 | name = Debug; 367 | }; 368 | 3EE875B4256CF81D008682F9 /* Release */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 372 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 373 | CODE_SIGN_ENTITLEMENTS = MVTouchBar/MVTouchBar.entitlements; 374 | CODE_SIGN_IDENTITY = "Apple Development"; 375 | CODE_SIGN_STYLE = Automatic; 376 | COMBINE_HIDPI_IMAGES = YES; 377 | CURRENT_PROJECT_VERSION = 1; 378 | DEVELOPMENT_ASSET_PATHS = "\"MVTouchBar/Preview Content\""; 379 | DEVELOPMENT_TEAM = 3SVMJGTZSF; 380 | ENABLE_PREVIEWS = YES; 381 | FRAMEWORK_SEARCH_PATHS = ( 382 | "$(inherited)", 383 | "$(PROJECT_DIR)", 384 | ); 385 | INFOPLIST_FILE = MVTouchBar/Info.plist; 386 | LD_RUNPATH_SEARCH_PATHS = ( 387 | "$(inherited)", 388 | "@executable_path/../Frameworks", 389 | ); 390 | MACOSX_DEPLOYMENT_TARGET = 10.15; 391 | MARKETING_VERSION = 0.0.4; 392 | PRODUCT_BUNDLE_IDENTIFIER = darshkpatel.MVTouchBar; 393 | PRODUCT_NAME = "$(TARGET_NAME)"; 394 | SWIFT_OBJC_BRIDGING_HEADER = "MVTouchBar/MVTouchBar-Bridging-Header.h"; 395 | SWIFT_PRECOMPILE_BRIDGING_HEADER = YES; 396 | SWIFT_VERSION = 5.0; 397 | SYSTEM_FRAMEWORK_SEARCH_PATHS = ( 398 | "$(inherited)", 399 | "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", 400 | ); 401 | }; 402 | name = Release; 403 | }; 404 | /* End XCBuildConfiguration section */ 405 | 406 | /* Begin XCConfigurationList section */ 407 | 3EE8759A256CF81B008682F9 /* Build configuration list for PBXProject "MVTouchBar" */ = { 408 | isa = XCConfigurationList; 409 | buildConfigurations = ( 410 | 3EE875B0256CF81D008682F9 /* Debug */, 411 | 3EE875B1256CF81D008682F9 /* Release */, 412 | ); 413 | defaultConfigurationIsVisible = 0; 414 | defaultConfigurationName = Release; 415 | }; 416 | 3EE875B2256CF81D008682F9 /* Build configuration list for PBXNativeTarget "MVTouchBar" */ = { 417 | isa = XCConfigurationList; 418 | buildConfigurations = ( 419 | 3EE875B3256CF81D008682F9 /* Debug */, 420 | 3EE875B4256CF81D008682F9 /* Release */, 421 | ); 422 | defaultConfigurationIsVisible = 0; 423 | defaultConfigurationName = Release; 424 | }; 425 | /* End XCConfigurationList section */ 426 | }; 427 | rootObject = 3EE87597256CF81B008682F9 /* Project object */; 428 | } 429 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /MVTouchbar/MVTouchbar/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | Default 531 | 532 | 533 | 534 | 535 | 536 | 537 | Left to Right 538 | 539 | 540 | 541 | 542 | 543 | 544 | Right to Left 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | Default 556 | 557 | 558 | 559 | 560 | 561 | 562 | Left to Right 563 | 564 | 565 | 566 | 567 | 568 | 569 | Right to Left 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | --------------------------------------------------------------------------------