Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DenDmitriev committed Apr 3, 2024
2 parents 34b49df + 5a2bd66 commit cd2c981
Show file tree
Hide file tree
Showing 457 changed files with 18,095 additions and 5,971 deletions.
1,285 changes: 948 additions & 337 deletions GrabShot.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "dominantcolors",
"kind" : "remoteSourceControl",
"location" : "https://github.com/DenDmitriev/DominantColors",
"state" : {
"revision" : "0451ad209280afa1293e0d936a22ee2371624ade",
"version" : "1.0.6"
}
}
],
"version" : 2
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
18 changes: 18 additions & 0 deletions GrabShot.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@
"revision" : "f6c23b4489d76c3d468f689365e507d8f2967663",
"version" : "1.0.9"
}
},
{
"identity" : "metadatavideoffmpeg",
"kind" : "remoteSourceControl",
"location" : "https://github.com/DenDmitriev/MetadataVideoFFmpeg.git",
"state" : {
"revision" : "275afd16a26cdfc5447a1bb9afda1579f394a2bd",
"version" : "1.0.5"
}
},
{
"identity" : "youtubekit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/alexeichhorn/YouTubeKit",
"state" : {
"revision" : "723d13c8013bb08fdc37039c7865a7fab85fccc9",
"version" : "0.2.1"
}
}
],
"version" : 2
Expand Down
Binary file modified GrabShot/.DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions GrabShot/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
updateKeys()
}

func applicationWillTerminate(_ notification: Notification) {
FileService.clearJpegCache { _ in }
FileService.clearVideoCache { _ in }
}

private func updateKeys() {
guard
let currentVersionString,
Expand Down
46 changes: 46 additions & 0 deletions GrabShot/AppError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// GrabShotError.swift
// GrabShot
//
// Created by Denis Dmitriev on 16.08.2023.
//

import Foundation

enum AppError: Error {
case unknown
case map(errorDescription: String?, failureReason: String?)
case videoAlreadyExist
case accessVideoFailure(url: URL)
}

extension AppError: LocalizedError {
var errorDescription: String? {
let comment = "Grab shot error"
switch self {
case .unknown:
return NSLocalizedString("Unknown error", comment: comment)
case .map(let errorDescription, _):
return NSLocalizedString(errorDescription ?? "Unknown error", comment: comment)
case .videoAlreadyExist:
return String(localized: "The video has already been added before.", comment: "Error")
case .accessVideoFailure:
return String(localized: "No read access to file")
}
}

var failureReason: String? {
let comment = "Grab shot error recovery suggestion"
switch self {
case .unknown:
return NSLocalizedString("Unknown reaction", comment: comment)
case .map(_, let failureReason):
return failureReason
case .videoAlreadyExist:
return String(localized: "Check your video link.", comment: "Error")
case .accessVideoFailure(let url):
return String(localized: "Import the file \(url.pathForFFmpeg) via File -> Import video or add access to the directory through the system privacy and security settings")
}
}

}
Binary file modified GrabShot/Assets.xcassets/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.784",
"green" : "0.784",
"red" : "0.784"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.184",
"green" : "0.184",
"red" : "0.184"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
38 changes: 38 additions & 0 deletions GrabShot/Assets.xcassets/Colors/Bevel.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.251",
"green" : "0.251",
"red" : "0.251"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
38 changes: 38 additions & 0 deletions GrabShot/Assets.xcassets/Colors/BevelTwo.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions GrabShot/Assets.xcassets/Colors/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
38 changes: 38 additions & 0 deletions GrabShot/Assets.xcassets/Colors/Control.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.980",
"green" : "0.980",
"red" : "0.980"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.533",
"green" : "0.533",
"red" : "0.533"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
38 changes: 38 additions & 0 deletions GrabShot/Assets.xcassets/Colors/Deep.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.502",
"green" : "0.502",
"red" : "0.502"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
38 changes: 38 additions & 0 deletions GrabShot/Assets.xcassets/Colors/toolbar.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.941",
"green" : "0.945",
"red" : "0.945"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.220",
"green" : "0.227",
"red" : "0.227"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
16 changes: 16 additions & 0 deletions GrabShot/Assets.xcassets/GrabShotInvert.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "GrabShotInvert.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions GrabShot/Assets.xcassets/LinkVideoStack.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "LinkVideoStack.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading

0 comments on commit cd2c981

Please sign in to comment.