i think this is all good i hope
This commit is contained in:
parent
3ae2c586da
commit
ffe4b62677
16 changed files with 197 additions and 24 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
|
@ -7,6 +7,7 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
BD555AF02518A159006E0058 /* FourthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD555AEF2518A159006E0058 /* FourthViewController.swift */; };
|
||||
BD7A5E342510173A003E992C /* day.gif in Resources */ = {isa = PBXBuildFile; fileRef = BD7A5E332510173A003E992C /* day.gif */; };
|
||||
BD7A5E39251034D7003E992C /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD7A5E38251034D7003E992C /* StoreKit.framework */; };
|
||||
BD7D35D72510042D00A61B6B /* night.gif in Resources */ = {isa = PBXBuildFile; fileRef = BD7D35D52510042D00A61B6B /* night.gif */; };
|
||||
|
@ -69,6 +70,7 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
BD555AEF2518A159006E0058 /* FourthViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FourthViewController.swift; sourceTree = "<group>"; };
|
||||
BD58E8C325145778008D1E8E /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
|
||||
BD7A5E332510173A003E992C /* day.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = day.gif; sourceTree = "<group>"; };
|
||||
BD7A5E38251034D7003E992C /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
|
||||
|
@ -187,6 +189,7 @@
|
|||
BDA060FD2447F3E6009C72CE /* FirstViewController.swift */,
|
||||
BDA060FF2447F3E6009C72CE /* SecondViewController.swift */,
|
||||
BDE8138E2507422100371570 /* ThirdViewController.swift */,
|
||||
BD555AEF2518A159006E0058 /* FourthViewController.swift */,
|
||||
BDA061012447F3E6009C72CE /* Main.storyboard */,
|
||||
BDA061042447F3F2009C72CE /* Assets.xcassets */,
|
||||
BD7D35D42510042D00A61B6B /* gifs */,
|
||||
|
@ -405,6 +408,7 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BD555AF02518A159006E0058 /* FourthViewController.swift in Sources */,
|
||||
BDA061002447F3E6009C72CE /* SecondViewController.swift in Sources */,
|
||||
BDA060FE2447F3E6009C72CE /* FirstViewController.swift in Sources */,
|
||||
BDE8138F2507422100371570 /* ThirdViewController.swift in Sources */,
|
||||
|
@ -601,7 +605,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = grandfatherrock/grandfatherrock.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 7;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_TEAM = PRBH2T6668;
|
||||
INFOPLIST_FILE = grandfatherrock/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
|
@ -609,7 +613,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
MARKETING_VERSION = 1.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock;
|
||||
PRODUCT_NAME = "Nook Music";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
|
@ -627,7 +631,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = grandfatherrock/grandfatherrock.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 7;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_TEAM = PRBH2T6668;
|
||||
INFOPLIST_FILE = grandfatherrock/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
|
@ -635,7 +639,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
MARKETING_VERSION = 1.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock;
|
||||
PRODUCT_NAME = "Nook Music";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
|
@ -737,6 +741,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_TEAM = PRBH2T6668;
|
||||
INFOPLIST_FILE = hsscene/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
|
@ -745,6 +750,7 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -763,6 +769,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_TEAM = PRBH2T6668;
|
||||
INFOPLIST_FILE = hsscene/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
|
@ -771,6 +778,7 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
"repositoryURL": "https://github.com/kirualex/SwiftyGif.git",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "420d12cba8338b03993f73a72c1f6b70d5273cf2",
|
||||
"version": "5.3.0"
|
||||
"revision": "0cd770feed5807d9fd4fa8df5ad74b56b814b0c8",
|
||||
"version": "5.4.0"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array/>
|
||||
</plist>
|
Binary file not shown.
|
@ -7,12 +7,12 @@
|
|||
<key>grandfatherrock.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>hssceneExtension.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>hswidgetExtension.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="49e-Tb-3d3">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="49e-Tb-3d3">
|
||||
<device id="retina4_0" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
|
@ -34,6 +34,7 @@
|
|||
</imageView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nou-CB-qnJ">
|
||||
<rect key="frame" x="95" y="195" width="130" height="129"/>
|
||||
<accessibility key="accessibilityConfiguration" hint="Press to pause/play the music" label="Media Control Button"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="130" id="1c8-JO-es0"/>
|
||||
<constraint firstAttribute="width" secondItem="Nou-CB-qnJ" secondAttribute="height" multiplier="1:1" id="3mw-Za-8Hw"/>
|
||||
|
@ -133,6 +134,7 @@
|
|||
</label>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TnY-SL-DcE">
|
||||
<rect key="frame" x="16" y="12" width="256" height="31"/>
|
||||
<accessibility key="accessibilityConfiguration" hint="Press to select a track for this hour"/>
|
||||
<fontDescription key="fontDescription" name="FinkHeavy" family="FinkHeavy" pointSize="32"/>
|
||||
<color key="textColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
|
@ -178,6 +180,7 @@
|
|||
</segmentedControl>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vLK-eh-BHE">
|
||||
<rect key="frame" x="16" y="459" width="288" height="40"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Developer Information"/>
|
||||
<fontDescription key="fontDescription" name="FinkHeavy" family="FinkHeavy" pointSize="24"/>
|
||||
<color key="tintColor" red="0.86256664989999998" green="0.69524472950000005" blue="0.2422021627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<state key="normal" title="Developer Information">
|
||||
|
@ -221,7 +224,7 @@
|
|||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="4Nw-L8-lE0" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="748.125" y="359.15492957746477"/>
|
||||
<point key="canvasLocation" x="748" y="358"/>
|
||||
</scene>
|
||||
<!--Tab Bar Controller-->
|
||||
<scene sceneID="yl2-sM-qoP">
|
||||
|
@ -402,11 +405,38 @@
|
|||
</objects>
|
||||
<point key="canvasLocation" x="1507.5" y="358.0985915492958"/>
|
||||
</scene>
|
||||
<!--Tune Writer-->
|
||||
<scene sceneID="4HD-tT-eIY">
|
||||
<objects>
|
||||
<viewController title="Tune Writer" id="zOe-Zh-aR8" customClass="FourthViewController" customModule="Nook_Music" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="hB0-dI-9mZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hMG-YO-jSe" userLabel="Gradient View">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="519"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="VvP-4h-AlD"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
</view>
|
||||
<tabBarItem key="tabBarItem" title="Select Music" image="music.quarternote.3" catalog="system" id="AdX-qc-4Zh"/>
|
||||
<connections>
|
||||
<outlet property="gradientView" destination="hMG-YO-jSe" id="W5k-Ys-Jdm"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="IJj-FB-yVG" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="0.0" y="763"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="ACBackgroundDay" width="750" height="200"/>
|
||||
<image name="grass" width="530" height="93"/>
|
||||
<image name="music.note.list" catalog="system" width="128" height="115"/>
|
||||
<image name="music.quarternote.3" catalog="system" width="128" height="103"/>
|
||||
<image name="play.circle" catalog="system" width="128" height="121"/>
|
||||
<image name="play.fill" catalog="system" width="116" height="128"/>
|
||||
<systemColor name="labelColor">
|
||||
|
|
|
@ -226,6 +226,9 @@ public class musicHandler{
|
|||
//print(mediaQuery)
|
||||
//musicPlayer.play()
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(MPMusicPlayerController.applicationMusicPlayer.playbackState == MPMusicPlaybackState.playing){
|
||||
musicPlayer.play()
|
||||
}
|
||||
|
@ -437,10 +440,12 @@ class FirstViewController: UIViewController{
|
|||
|
||||
if (MPMusicPlayerController.applicationMusicPlayer.playbackState == MPMusicPlaybackState.playing) {
|
||||
GlobalVars.musicStarted = true
|
||||
controlButton.accessibilityLabel = "Pause Button"
|
||||
controlButton.setBackgroundImage(UIImage(systemName: "pause.circle"), for: UIControl.State.normal)
|
||||
UIView.animate(withDuration: 0.4, delay: 0,usingSpringWithDamping: 0.5,initialSpringVelocity: 0,animations: {self.PlayButtonSize.constant = 130;self.view.layoutIfNeeded()}, completion: nil)
|
||||
} else {
|
||||
GlobalVars.musicStarted = false
|
||||
controlButton.accessibilityLabel = "Play Button"
|
||||
controlButton.setBackgroundImage(UIImage(systemName: "play.circle"), for: UIControl.State.normal)
|
||||
UIView.animate(withDuration: 0.4, delay: 0,usingSpringWithDamping: 0.5,initialSpringVelocity: 0, animations: {self.PlayButtonSize.constant = 90;self.view.layoutIfNeeded()}, completion: nil)
|
||||
}
|
||||
|
@ -700,10 +705,12 @@ class FirstViewController: UIViewController{
|
|||
|
||||
if (MPMusicPlayerController.applicationMusicPlayer.playbackState == MPMusicPlaybackState.playing) {
|
||||
GlobalVars.musicStarted = true
|
||||
controlButton.accessibilityLabel = "Pause Button"
|
||||
controlButton.setBackgroundImage(UIImage(systemName: "pause.circle"), for: UIControl.State.normal)
|
||||
UIView.animate(withDuration: 0.4, delay: 0,usingSpringWithDamping: 0.5,initialSpringVelocity: 0,animations: {self.PlayButtonSize.constant = 130;self.view.layoutIfNeeded()}, completion: nil)
|
||||
} else {
|
||||
GlobalVars.musicStarted = false
|
||||
controlButton.accessibilityLabel = "Play Button"
|
||||
controlButton.setBackgroundImage(UIImage(systemName: "play.circle"), for: UIControl.State.normal)
|
||||
UIView.animate(withDuration: 0.4, delay: 0,usingSpringWithDamping: 0.5,initialSpringVelocity: 0, animations: {self.PlayButtonSize.constant = 90;self.view.layoutIfNeeded()}, completion: nil)
|
||||
}
|
||||
|
@ -779,6 +786,7 @@ class FirstViewController: UIViewController{
|
|||
//print("Song is missing for at one hour")
|
||||
|
||||
controlButton.isEnabled = false
|
||||
controlButton.accessibilityLabel = "Play Button. Music Cannot be played."
|
||||
} else {
|
||||
controlButton.isEnabled = true
|
||||
}
|
||||
|
@ -1071,6 +1079,7 @@ class FirstViewController: UIViewController{
|
|||
let musicPlayer = MPMusicPlayerController.applicationMusicPlayer
|
||||
musicPlayer.play()
|
||||
GlobalVars.musicStarted = true
|
||||
controlButton.accessibilityLabel = "Pause Button"
|
||||
controlButton.setBackgroundImage(UIImage(systemName: "pause.circle"), for: UIControl.State.normal)
|
||||
UIView.animate(withDuration: 0.4,delay:0,usingSpringWithDamping: 0.5,initialSpringVelocity: 0,animations: {self.PlayButtonSize.constant = 130;self.view.layoutIfNeeded()}, completion: nil)
|
||||
}
|
||||
|
@ -1078,6 +1087,7 @@ class FirstViewController: UIViewController{
|
|||
let musicPlayer = MPMusicPlayerController.applicationMusicPlayer
|
||||
musicPlayer.pause()
|
||||
GlobalVars.musicStarted = false
|
||||
controlButton.accessibilityLabel = "Play Button"
|
||||
controlButton.setBackgroundImage(UIImage(systemName: "play.circle"), for: UIControl.State.normal)
|
||||
UIView.animate(withDuration: 0.4, delay: 0,usingSpringWithDamping: 0.5,initialSpringVelocity: 0,animations: {self.PlayButtonSize.constant = 90;self.view.layoutIfNeeded()}, completion: nil)
|
||||
|
||||
|
|
113
grandfatherrock/FourthViewController.swift
Normal file
113
grandfatherrock/FourthViewController.swift
Normal file
|
@ -0,0 +1,113 @@
|
|||
//
|
||||
// SecondViewController.swift
|
||||
// grandfatherrock
|
||||
//
|
||||
// Created by Micah Gomez on 4/15/20.
|
||||
// Copyright © 2020 Micah Gomez. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import AudioToolbox
|
||||
|
||||
|
||||
class FourthViewController: UIViewController, UIPickerViewDelegate{
|
||||
|
||||
@IBOutlet var gradientView: UIView!
|
||||
|
||||
let defaults = UserDefaults.standard
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
/*let message = "\n\n\n\n\n\n"
|
||||
let alert = UIAlertController(title: "Please Select Note", message: message, preferredStyle: UIAlertController.Style.actionSheet)
|
||||
alert.isModalInPopover = true
|
||||
|
||||
let pickerFrame = UIPickerView(frame: CGRect(x: 5, y: 20, width: 400 - 20, height: 140)) // CGRectMake(left, top, width, height) - left and top are like margins
|
||||
pickerFrame.tag = 555
|
||||
//set the pickers datasource and delegate
|
||||
pickerFrame.delegate = self
|
||||
|
||||
//Add the picker to the alert controller
|
||||
alert.view.addSubview(pickerFrame)
|
||||
let okAction = UIAlertAction(title: "OK", style: .default, handler: {
|
||||
(alert: UIAlertAction!) -> Void in
|
||||
//Perform Action
|
||||
})
|
||||
alert.addAction(okAction)
|
||||
let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: nil)
|
||||
alert.addAction(cancelAction)
|
||||
self.parent!.present(alert, animated: true, completion: { })
|
||||
*/
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
|
||||
let prevHour = GlobalVars.hour
|
||||
GlobalVars.hour = Calendar.current.component(.hour, from: Date())
|
||||
if GlobalVars.hour != prevHour {
|
||||
musicHandler.updateMusic()
|
||||
}
|
||||
|
||||
// create the gradient layer
|
||||
let gradient = CAGradientLayer()
|
||||
gradient.frame = self.view.bounds
|
||||
//print("time: ", GlobalVars.hour)
|
||||
if((GlobalVars.hour >= 8) && (GlobalVars.hour <= 19)){ //Daytime
|
||||
//print("day")
|
||||
gradient.colors = [UIColor(red: 0.39, green: 0.69, blue: 1.00, alpha: 1).cgColor, UIColor(red: 0.07, green: 0.45, blue: 0.87, alpha: 1).cgColor]
|
||||
} else if((GlobalVars.hour >= 20) && (GlobalVars.hour <= 21)){//Sunset
|
||||
//print("sunset")
|
||||
gradient.colors = [UIColor(red: 0.00, green: 0.31, blue: 0.59, alpha: 1).cgColor, UIColor(red: 1.00, green: 0.78, blue: 0.88, alpha: 1).cgColor]
|
||||
} else if((GlobalVars.hour >= 22) || (GlobalVars.hour <= 5)){//Night
|
||||
//print("night")
|
||||
gradient.colors = [UIColor(red: 0.08, green: 0.27, blue: 0.59, alpha: 1).cgColor, UIColor(red: 0.00, green: 0.20, blue: 0.29, alpha: 1).cgColor]
|
||||
} else if((GlobalVars.hour >= 6) && (GlobalVars.hour <= 7)){//Sunrise
|
||||
//print("sunrise")
|
||||
gradient.colors = [UIColor(red: 0.02, green: 0.26, blue: 0.49, alpha: 1).cgColor, UIColor(red: 0.89, green: 0.68, blue: 0.60, alpha: 1).cgColor]
|
||||
}
|
||||
|
||||
gradient.locations = [0.00, 1.00]
|
||||
|
||||
gradientView.layer.addSublayer(gradient)
|
||||
|
||||
/// Create a sequence
|
||||
var sequence : MusicSequence? = nil
|
||||
var musicSequenceStatus = NewMusicSequence(&sequence)
|
||||
var track : MusicTrack? = nil
|
||||
/// Create a music track containg a sequence and a music track
|
||||
var musicTrack = MusicSequenceNewTrack(sequence!, &track)
|
||||
var time = MusicTimeStamp(1.0)
|
||||
|
||||
|
||||
// The notes of the song
|
||||
var notes: [UInt8] = [50,47,48,50/*,128*/,40,48,/*128,*/47,43,45,47/*,128*/,38,45]
|
||||
|
||||
for index:Int in 0...11 {
|
||||
var note = MIDINoteMessage(channel: 0,
|
||||
note: notes[index],
|
||||
velocity: 64,
|
||||
releaseVelocity: 0,
|
||||
duration: 1.0)
|
||||
guard let track = track else {fatalError()}
|
||||
musicTrack = MusicTrackNewMIDINoteEvent(track, time, ¬e)
|
||||
time += 1
|
||||
}
|
||||
|
||||
|
||||
// Creating a player
|
||||
var musicNotePlayer : MusicPlayer? = nil
|
||||
var player = NewMusicPlayer(&musicNotePlayer)
|
||||
|
||||
player = MusicPlayerSetSequence(musicNotePlayer!, sequence)
|
||||
player = MusicPlayerStart(musicNotePlayer!)
|
||||
}
|
||||
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
gradientView.layer.sublayers?.forEach { $0.removeFromSuperlayer() }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -78,48 +78,63 @@ class SecondViewController: UIViewController, UITableViewDelegate, UITableViewDa
|
|||
}
|
||||
|
||||
cell.hourLabel?.text = hourString
|
||||
cell.accessibilityLabel = cell.hourLabel.text
|
||||
cell.accessibilityLabel?.append(". ")
|
||||
|
||||
switch GlobalVars.selectedMusicList {
|
||||
case 0:
|
||||
cell.songLabel?.text = GlobalVars.musicSelection0[indexPath.row]
|
||||
if (GlobalVars.musicSelectionID0[indexPath.row] == 0){
|
||||
cell.accessoryType = .detailButton
|
||||
cell.accessibilityLabel?.append("No song set")
|
||||
} else {
|
||||
cell.accessoryType = .none
|
||||
cell.accessibilityLabel?.append(cell.songLabel.text!)
|
||||
}
|
||||
case 1:
|
||||
cell.songLabel?.text = GlobalVars.musicSelection1[indexPath.row]
|
||||
if (GlobalVars.musicSelectionID1[indexPath.row] == 0){
|
||||
cell.accessoryType = .detailButton
|
||||
cell.accessibilityLabel?.append("No song set")
|
||||
} else {
|
||||
cell.accessoryType = .none
|
||||
cell.accessibilityLabel?.append(cell.songLabel.text!)
|
||||
}
|
||||
case 2:
|
||||
cell.songLabel?.text = GlobalVars.musicSelection2[indexPath.row]
|
||||
if (GlobalVars.musicSelectionID2[indexPath.row] == 0){
|
||||
cell.accessoryType = .detailButton
|
||||
cell.accessibilityLabel?.append("No song set")
|
||||
} else {
|
||||
cell.accessoryType = .none
|
||||
cell.accessibilityLabel?.append(cell.songLabel.text!)
|
||||
}
|
||||
case 3:
|
||||
cell.songLabel?.text = GlobalVars.musicSelection3[indexPath.row]
|
||||
if (GlobalVars.musicSelectionID3[indexPath.row] == 0){
|
||||
cell.accessoryType = .detailButton
|
||||
cell.accessibilityLabel?.append("No song set")
|
||||
} else {
|
||||
cell.accessoryType = .none
|
||||
cell.accessibilityLabel?.append(cell.songLabel.text!)
|
||||
}
|
||||
case 4:
|
||||
cell.songLabel?.text = GlobalVars.musicSelection4[indexPath.row]
|
||||
if (GlobalVars.musicSelectionID4[indexPath.row] == 0){
|
||||
cell.accessoryType = .detailButton
|
||||
cell.accessibilityLabel?.append("No song set")
|
||||
} else {
|
||||
cell.accessoryType = .none
|
||||
cell.accessibilityLabel?.append(cell.songLabel.text!)
|
||||
}
|
||||
default:
|
||||
cell.songLabel?.text = "uh oh!"
|
||||
cell.accessoryType = .detailButton
|
||||
cell.accessibilityLabel?.append("No song set")
|
||||
}
|
||||
|
||||
cell.accessibilityHint?.append("Press to set a song for this hour")
|
||||
|
||||
return cell
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import MediaPlayer
|
|||
class ThirdViewController: UIViewController {
|
||||
|
||||
@IBAction func websiteButton(_ sender: Any) {
|
||||
if let url = URL(string: "https://micahpgomez.dev") {
|
||||
if let url = URL(string: "https://micahpgomez.com") {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class ThirdViewController: UIViewController {
|
|||
}
|
||||
|
||||
@IBAction func supportEmail(_ sender: Any) {
|
||||
if let url = URL(string: "mailto:support@micahpgomez.dev") {
|
||||
if let url = URL(string: "mailto:support@micahpgomez.com") {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,5 @@
|
|||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"properties" : {
|
||||
"compression-type" : "gpu-optimized-smallest"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,5 @@
|
|||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"properties" : {
|
||||
"compression-type" : "gpu-optimized-smallest"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,5 @@
|
|||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"properties" : {
|
||||
"compression-type" : "gpu-optimized-smallest"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
|
|
|
@ -26,6 +26,7 @@ struct Provider: TimelineProvider {
|
|||
let currentDate = Date()
|
||||
for hourOffset in 0 ..< 5 {
|
||||
let entryDate = Calendar.current.date(byAdding: .minute, value: hourOffset*5, to: currentDate)!
|
||||
print(entryDate)
|
||||
let entry = SimpleEntry(date: entryDate, hour: hourString(), c1: getC1(), c2: getC2(), sceneAsset: getSceneAsset())
|
||||
entries.append(entry)
|
||||
}
|
||||
|
|
Reference in a new issue