Last active
August 29, 2015 14:02
-
-
Save henry0312/c36f70f2d8bcddb8546a to your computer and use it in GitHub Desktop.
Revisions
-
henry0312 revised this gist
Jun 21, 2014 . 2 changed files with 0 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,3 @@ import Cocoa class AppDelegate: NSObject, NSApplicationDelegate { This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,3 @@ import Cocoa class Track: NSObject { -
henry0312 created this gist
Jun 21, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ // // AppDelegate.swift // TrackMix // // Created by Tsukasa OMOTO on 2014/06/18. // Copyright (c) 2014年 Tsukasa OMOTO. All rights reserved. // import Cocoa class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet var window: NSWindow var track: Track! @IBOutlet var textField : NSTextField @IBOutlet var slider : NSSlider @IBAction func mute(sender : AnyObject) { //NSLog("received a mute: message") track.volume = 0.0 updateUserInterface() } @IBAction func takeFloatValueForVolumeFrom(sender : AnyObject) { /* var senderName: String if sender is NSTextField { senderName = "textField" } else { senderName = "slider" } NSLog("%@ sent takeFloatValueForVolumeFrom: with value %1.2f", senderName, sender.floatValue) */ let newValue = sender.doubleValue track.volume = newValue updateUserInterface() } func updateUserInterface() { let volume = track.volume self.textField.doubleValue = volume self.slider.doubleValue = volume } func applicationDidFinishLaunching(aNotification: NSNotification?) { // Insert code here to initialize your application track = Track() updateUserInterface() } func applicationWillTerminate(aNotification: NSNotification?) { // Insert code here to tear down your application } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ // // Track.swift // TrackMix // // Created by Tsukasa OMOTO on 2014/06/18. // Copyright (c) 2014年 Tsukasa OMOTO. All rights reserved. // import Cocoa class Track: NSObject { var volume: Double init() { volume = 0.0 } }