Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

Commit 84e00ac

Browse files
committed
Add UI sounds similar to Front Row
Add Settings toggle for UI sounds Simplify Dark Mode code (the workaround didn't work anyway) Update build to 40, version to 1.3 Update bundled XML files Update README.md
1 parent 3eec0f0 commit 84e00ac

File tree

14 files changed

+155
-63
lines changed

14 files changed

+155
-63
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ This app does not collect any personally identifiable information. See [Privacy]
4747
See [License](LICENSE) for details about the source code license.
4848

4949
Two XML files from iTunes Movie Trailers are included with the project for reference and educational purposes. The [License](LICENSE) does not cover these XML files.
50+
Four AIFF files from [Front Row](https://en.wikipedia.org/wiki/Front_Row_(software)) are included with the project. These files are also not covered by the [License](LICENSE).
5051

51-
The Apple Logo, AirPlay, iOS, and iTunes are trademarks of Apple Inc., registered in the U.S. and other countries.
52+
The Apple Logo, AirPlay, iOS, iTunes, and Front Row are trademarks of Apple Inc., registered in the U.S. and other countries.
5253
FRIENDSGIVING is © 2020 SABAN FILMS.

TheatricalMovieTrailers.xcodeproj/project.pbxproj

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
834FFDC4254085ED007E63C2 /* AVPlayerViewController+enterFullScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834FFDC3254085ED007E63C2 /* AVPlayerViewController+enterFullScreen.swift */; };
4343
8379E84F25A0904400A1CDF2 /* CoverFlowRotatingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834ADB3C25398496002D9F1E /* CoverFlowRotatingView.swift */; };
4444
8379E86025A09EC100A1CDF2 /* LargePosterReflectionWithTitle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8379E85D25A09CFB00A1CDF2 /* LargePosterReflectionWithTitle.swift */; };
45+
837BFE0E265C4E3400E2B86A /* Limit.aif in Resources */ = {isa = PBXBuildFile; fileRef = 837BFE0D265C4E1C00E2B86A /* Limit.aif */; };
46+
837BFE0F265C4E3600E2B86A /* Selection.aif in Resources */ = {isa = PBXBuildFile; fileRef = 837BFE0C265C4E1C00E2B86A /* Selection.aif */; };
47+
837BFE12265C4EE900E2B86A /* Exit.aif in Resources */ = {isa = PBXBuildFile; fileRef = 837BFE10265C4EE500E2B86A /* Exit.aif */; };
48+
837BFE13265C4EE900E2B86A /* SelectionChange.aif in Resources */ = {isa = PBXBuildFile; fileRef = 837BFE11265C4EE500E2B86A /* SelectionChange.aif */; };
4549
837DB1402548CE200071CB2E /* ShareSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 837DB13F2548CE200071CB2E /* ShareSheet.swift */; };
4650
837DB1432548D5E30071CB2E /* AppStoreReviewsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 837DB1422548D5E30071CB2E /* AppStoreReviewsManager.swift */; };
4751
8380C59C24A665B000CA1EB4 /* TrailerMetaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8380C59B24A665B000CA1EB4 /* TrailerMetaView.swift */; };
@@ -127,6 +131,10 @@
127131
834FF5BC2572A43F00A4AF39 /* TrailersWidgetExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TrailersWidgetExtension.entitlements; sourceTree = "<group>"; };
128132
834FFDC3254085ED007E63C2 /* AVPlayerViewController+enterFullScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AVPlayerViewController+enterFullScreen.swift"; sourceTree = "<group>"; };
129133
8379E85D25A09CFB00A1CDF2 /* LargePosterReflectionWithTitle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LargePosterReflectionWithTitle.swift; sourceTree = "<group>"; };
134+
837BFE0C265C4E1C00E2B86A /* Selection.aif */ = {isa = PBXFileReference; lastKnownFileType = file; path = Selection.aif; sourceTree = "<group>"; };
135+
837BFE0D265C4E1C00E2B86A /* Limit.aif */ = {isa = PBXFileReference; lastKnownFileType = file; path = Limit.aif; sourceTree = "<group>"; };
136+
837BFE10265C4EE500E2B86A /* Exit.aif */ = {isa = PBXFileReference; lastKnownFileType = file; path = Exit.aif; sourceTree = "<group>"; };
137+
837BFE11265C4EE500E2B86A /* SelectionChange.aif */ = {isa = PBXFileReference; lastKnownFileType = file; path = SelectionChange.aif; sourceTree = "<group>"; };
130138
837DB13F2548CE200071CB2E /* ShareSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareSheet.swift; sourceTree = "<group>"; };
131139
837DB1422548D5E30071CB2E /* AppStoreReviewsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppStoreReviewsManager.swift; sourceTree = "<group>"; };
132140
8380C59B24A665B000CA1EB4 /* TrailerMetaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrailerMetaView.swift; sourceTree = "<group>"; };
@@ -240,9 +248,21 @@
240248
path = TrailersWidget;
241249
sourceTree = "<group>";
242250
};
251+
837BFE0B265C4E1500E2B86A /* Audio Files */ = {
252+
isa = PBXGroup;
253+
children = (
254+
837BFE10265C4EE500E2B86A /* Exit.aif */,
255+
837BFE11265C4EE500E2B86A /* SelectionChange.aif */,
256+
837BFE0C265C4E1C00E2B86A /* Selection.aif */,
257+
837BFE0D265C4E1C00E2B86A /* Limit.aif */,
258+
);
259+
path = "Audio Files";
260+
sourceTree = "<group>";
261+
};
243262
8380C59F24A670D800CA1EB4 /* Supporting Files */ = {
244263
isa = PBXGroup;
245264
children = (
265+
837BFE0B265C4E1500E2B86A /* Audio Files */,
246266
83AC6270255018CE00197B0B /* API Extensions */,
247267
831F1B5D2549792A008D24D4 /* currentTrailers.bundle */,
248268
8316E0EE24A64AD400467F14 /* LaunchScreen.storyboard */,
@@ -396,6 +416,10 @@
396416
8316E0ED24A64AD400467F14 /* Preview Assets.xcassets in Resources */,
397417
8316E0EA24A64AD400467F14 /* Assets.xcassets in Resources */,
398418
831F1B5E2549792A008D24D4 /* currentTrailers.bundle in Resources */,
419+
837BFE0E265C4E3400E2B86A /* Limit.aif in Resources */,
420+
837BFE13265C4EE900E2B86A /* SelectionChange.aif in Resources */,
421+
837BFE0F265C4E3600E2B86A /* Selection.aif in Resources */,
422+
837BFE12265C4EE900E2B86A /* Exit.aif in Resources */,
399423
);
400424
runOnlyForDeploymentPostprocessing = 0;
401425
};
@@ -622,7 +646,7 @@
622646
CODE_SIGN_ENTITLEMENTS = TheatricalMovieTrailers/TheatricalMovieTrailers.entitlements;
623647
CODE_SIGN_IDENTITY = "Apple Development";
624648
CODE_SIGN_STYLE = Automatic;
625-
CURRENT_PROJECT_VERSION = 36;
649+
CURRENT_PROJECT_VERSION = 40;
626650
DEVELOPMENT_ASSET_PATHS = "\"TheatricalMovieTrailers/Preview Content\"";
627651
DEVELOPMENT_TEAM = U96PJYMZWW;
628652
ENABLE_PREVIEWS = YES;
@@ -632,7 +656,7 @@
632656
"$(inherited)",
633657
"@executable_path/Frameworks",
634658
);
635-
MARKETING_VERSION = 1.2;
659+
MARKETING_VERSION = 1.3;
636660
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt;
637661
PRODUCT_NAME = "$(TARGET_NAME)";
638662
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -650,7 +674,7 @@
650674
CODE_SIGN_ENTITLEMENTS = TheatricalMovieTrailers/TheatricalMovieTrailers.entitlements;
651675
CODE_SIGN_IDENTITY = "Apple Development";
652676
CODE_SIGN_STYLE = Automatic;
653-
CURRENT_PROJECT_VERSION = 36;
677+
CURRENT_PROJECT_VERSION = 40;
654678
DEVELOPMENT_ASSET_PATHS = "\"TheatricalMovieTrailers/Preview Content\"";
655679
DEVELOPMENT_TEAM = U96PJYMZWW;
656680
ENABLE_PREVIEWS = YES;
@@ -660,7 +684,7 @@
660684
"$(inherited)",
661685
"@executable_path/Frameworks",
662686
);
663-
MARKETING_VERSION = 1.2;
687+
MARKETING_VERSION = 1.3;
664688
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt;
665689
PRODUCT_NAME = "$(TARGET_NAME)";
666690
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -677,7 +701,7 @@
677701
CODE_SIGN_ENTITLEMENTS = TrailersWidgetExtension.entitlements;
678702
CODE_SIGN_IDENTITY = "Apple Development";
679703
CODE_SIGN_STYLE = Automatic;
680-
CURRENT_PROJECT_VERSION = 36;
704+
CURRENT_PROJECT_VERSION = 40;
681705
DEVELOPMENT_TEAM = U96PJYMZWW;
682706
INFOPLIST_FILE = TrailersWidget/Info.plist;
683707
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
@@ -686,7 +710,7 @@
686710
"@executable_path/Frameworks",
687711
"@executable_path/../../Frameworks",
688712
);
689-
MARKETING_VERSION = 1.2;
713+
MARKETING_VERSION = 1.3;
690714
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt.TrailersWidget;
691715
PRODUCT_NAME = "$(TARGET_NAME)";
692716
SKIP_INSTALL = YES;
@@ -703,7 +727,7 @@
703727
CODE_SIGN_ENTITLEMENTS = TrailersWidgetExtension.entitlements;
704728
CODE_SIGN_IDENTITY = "Apple Development";
705729
CODE_SIGN_STYLE = Automatic;
706-
CURRENT_PROJECT_VERSION = 36;
730+
CURRENT_PROJECT_VERSION = 40;
707731
DEVELOPMENT_TEAM = U96PJYMZWW;
708732
INFOPLIST_FILE = TrailersWidget/Info.plist;
709733
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
@@ -712,7 +736,7 @@
712736
"@executable_path/Frameworks",
713737
"@executable_path/../../Frameworks",
714738
);
715-
MARKETING_VERSION = 1.2;
739+
MARKETING_VERSION = 1.3;
716740
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt.TrailersWidget;
717741
PRODUCT_NAME = "$(TARGET_NAME)";
718742
SKIP_INSTALL = YES;

TheatricalMovieTrailers/Model/Settings.swift

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ fileprivate extension String {
1414
static let loadHighDefinition = "loadHighDefinition"
1515
static let firstLaunchedDate = "firstLaunchedDate"
1616
static let lastReviewRequestAppVersion = "lastReviewRequestAppVersion"
17+
static let playUISounds = "playUISounds"
1718
}
1819

1920
class Settings: ObservableObject {
@@ -53,14 +54,22 @@ class Settings: ObservableObject {
5354
defaults.synchronize()
5455
}
5556
}
57+
/// Added in Build 40
58+
/// Whether to play FrontRow-inspired UI sounds
59+
@Published var playUISounds = true {
60+
didSet {
61+
let defaults = Self.userDefaults
62+
defaults.setValue(playUISounds, forKey: .playUISounds)
63+
defaults.synchronize()
64+
}
65+
}
5666

5767
private init() {
5868
let defaults = Self.userDefaults
5969
/// Check for version upgrade
6070
let lastBuild = defaults.string(forKey: .lastBuildNumber)
6171
if lastBuild == nil {
6272
let oldDefaults = UserDefaults()
63-
/// If last build is 31, that used non-specific UserDefaults suite. Must migrate!
6473
let oldBuild = oldDefaults.string(forKey: .lastBuildNumber)
6574
if let old = oldBuild, let oldNumber = Int(old) {
6675
if oldNumber < 30 {
@@ -70,6 +79,7 @@ class Settings: ObservableObject {
7079
firstLaunchedDate = oldDefaults.value(forKey: .firstLaunchedDate) as! Date
7180
}
7281
}
82+
/// If last build is older than 30, that used non-specific UserDefaults suite. Must migrate!
7383
if oldDefaults.string(forKey: .lastBuildNumber) == "31" {
7484
/// Migrate settings to new defaults suite
7585
let isAutoDark = oldDefaults.integer(forKey: .autoDark) == ValueAutomaticDark
@@ -91,8 +101,13 @@ class Settings: ObservableObject {
91101
defaults.setValue(Date(), forKey: .firstLaunchedDate)
92102
}
93103
} else if let prevBuild = lastBuild, prevBuild != UIApplication.build {
104+
let prevBuild = Int(prevBuild)!
94105
/// Version upgrade happened
95-
/// There are no changes yet in the new settings.
106+
/// Upgrade from older to 40
107+
if prevBuild < 40 {
108+
/// Added playUISounds key; default value should be true but it's false for a boolean
109+
defaults.setValue(true, forKey: .playUISounds)
110+
}
96111
defaults.setValue(UIApplication.build, forKey: .lastBuildNumber)
97112
}
98113
/// Load settings
@@ -103,5 +118,7 @@ class Settings: ObservableObject {
103118
/// App Store Reviews Manager metadata
104119
firstLaunchedDate = defaults.value(forKey: .firstLaunchedDate) as! Date
105120
lastReviewRequestAppVersion = defaults.string(forKey: .lastReviewRequestAppVersion)
121+
/// UI Sounds
122+
playUISounds = defaults.bool(forKey: .playUISounds)
106123
}
107124
}

TheatricalMovieTrailers/Supporting Files/API Extensions/CustomDarkAppearance.swift

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,8 @@ struct CustomDarkAppearance: ViewModifier {
1111
@ObservedObject var settings = Settings.instance
1212

1313
func body(content: Content) -> some View {
14-
if settings.prefersDarkAppearance {
15-
return AnyView(
16-
content
17-
.preferredColorScheme(.dark)
18-
)
19-
} else {
20-
return AnyView(
21-
content
22-
.preferredColorScheme(
23-
// using .none does cause the ContentView to update properly
24-
// if prefersDarkAppearance was switched from true to false
25-
UITraitCollection().userInterfaceStyle == .dark ? .dark : .light
26-
)
27-
)
28-
}
14+
AnyView(
15+
content.preferredColorScheme(settings.prefersDarkAppearance ? .some(.dark) : .none)
16+
)
2917
}
3018
}
25.5 KB
Binary file not shown.
59.4 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

TheatricalMovieTrailers/Supporting Files/currentTrailers.bundle/current.xml

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

TheatricalMovieTrailers/Supporting Files/currentTrailers.bundle/current_720p.xml

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)