show the frames being generated in alert
This commit is contained in:
1 parent
9ccc8e4317
commit
047c9e9504
4 files changed
+23
-16
No files matched your search
@@ -264,7 +264,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"Pocket Poster/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = 2P4CP47H76;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@@ -296,7 +296,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"Pocket Poster/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = 2P4CP47H76;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
|
||||
@@ -190,6 +190,7 @@ class PosterBoardManager: ObservableObject {
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
UIApplication.shared.change(title: "Applying Wallpapers...", body: "Extracting tendies...")
|
||||
for url in selectedTendies {
|
||||
let unzippedDir = try unzipFile(at: url)
|
||||
guard let descriptors = try getDescriptorsFromTendie(unzippedDir) else { continue } // TODO: Add error handling
|
||||
|
||||
@@ -91,11 +91,12 @@ class VideoHandler {
|
||||
|
||||
while let sampleBuffer = readerOutput.copyNextSampleBuffer(),
|
||||
let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) {
|
||||
let name = "\(frameCount).jpg"
|
||||
UIApplication.shared.change(title: "Generating Video...", body: "Creating assets/\(name)...")
|
||||
|
||||
let ciImage = CIImage(cvPixelBuffer: imageBuffer)
|
||||
let context = CIContext()
|
||||
if let cgImage = context.createCGImage(ciImage, from: ciImage.extent) {
|
||||
let name = "\(frameCount).jpg"
|
||||
if let img = cgImage.jpg {
|
||||
try img.write(to: assetsFolder.appendingPathComponent(name))
|
||||
camlData += "\t\t\t<CGImage src=\"assets/\(name)\"/>\n"
|
||||
@@ -107,6 +108,7 @@ class VideoHandler {
|
||||
} catch {
|
||||
print("Error reading asset: \(error)")
|
||||
}
|
||||
UIApplication.shared.change(title: "Generating Video...", body: "Creating CAML data...")
|
||||
|
||||
camlData += """
|
||||
</values>
|
||||
|
||||
@@ -136,9 +136,9 @@ struct ContentView: View {
|
||||
if !pbManager.selectedTendies.isEmpty || selectedVideo != nil {
|
||||
Button(action: {
|
||||
UIImpactFeedbackGenerator(style: .soft).impactOccurred()
|
||||
UIApplication.shared.alert(title: NSLocalizedString("Applying Tendies...", comment: ""), body: NSLocalizedString("Please wait", comment: ""), animated: false, withButton: false)
|
||||
UIApplication.shared.alert(title: NSLocalizedString("Applying Wallpapers...", comment: ""), body: NSLocalizedString("Please wait", comment: ""), animated: false, withButton: false)
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
do {
|
||||
var videoURL: URL? = nil
|
||||
switch loadState {
|
||||
@@ -148,26 +148,30 @@ struct ContentView: View {
|
||||
videoURL = nil
|
||||
}
|
||||
try pbManager.applyTendies(appHash: pbHash, videoURL: videoURL)
|
||||
pbManager.selectedTendies.removeAll()
|
||||
SymHandler.cleanup() // just to be extra sure
|
||||
try? FileManager.default.removeItem(at: pbManager.getTendiesStoreURL())
|
||||
if let videoURL = videoURL {
|
||||
try? FileManager.default.removeItem(at: videoURL)
|
||||
}
|
||||
Haptic.shared.notify(.success)
|
||||
UIApplication.shared.dismissAlert(animated: true)
|
||||
UIApplication.shared.confirmAlert(title: "Success!", body: "The PosterBoard app will now open. Please close it from the app switcher.", onOK: {
|
||||
if !pbManager.openPosterBoard() {
|
||||
UIApplication.shared.confirmAlert(title: "Falling Back to Shortcut", body: "PosterBoard failed to open directly. The fallback shortcut will now be opened.", onOK: {
|
||||
pbManager.runShortcut(named: "PosterBoard")
|
||||
}, noCancel: true)
|
||||
}
|
||||
}, noCancel: true)
|
||||
UIApplication.shared.dismissAlert(animated: false)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.35, execute: {
|
||||
pbManager.selectedTendies.removeAll()
|
||||
UIApplication.shared.confirmAlert(title: "Success!", body: "The PosterBoard app will now open. Please close it from the app switcher.", onOK: {
|
||||
if !pbManager.openPosterBoard() {
|
||||
UIApplication.shared.confirmAlert(title: "Falling Back to Shortcut", body: "PosterBoard failed to open directly. The fallback shortcut will now be opened.", onOK: {
|
||||
pbManager.runShortcut(named: "PosterBoard")
|
||||
}, noCancel: true)
|
||||
}
|
||||
}, noCancel: true)
|
||||
})
|
||||
} catch {
|
||||
Haptic.shared.notify(.error)
|
||||
SymHandler.cleanup()
|
||||
UIApplication.shared.dismissAlert(animated: true)
|
||||
UIApplication.shared.alert(body: error.localizedDescription)
|
||||
UIApplication.shared.dismissAlert(animated: false)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.35, execute: {
|
||||
UIApplication.shared.alert(body: error.localizedDescription)
|
||||
})
|
||||
}
|
||||
}
|
||||
}) {
|
||||
|
||||
Reference in new issue
Block a user