Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ all: build test-ui-preview
build: test-package build-ui-preview

test-package:
cd app/xcode && swift test -Xswiftc -DCI_TESTING
cd app/xcode && xcodebuild -scheme VCam-Package test -destination 'platform=macOS'

build-ui-preview:
cd app/xcode/App && xcodebuild -project VCam.xcodeproj -scheme VCamUIPreview -derivedDataPath /tmp/build clean build

test-ui-preview:
cd app/xcode/App && xcodebuild -project VCam.xcodeproj -scheme VCamUIPreviewUITests -derivedDataPath /tmp/build -resultBundlePath /tmp/UITestResults test ONLY_ACTIVE_ARCH=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO CODE_SIGN_ENTITLEMENTS=""

1 change: 1 addition & 0 deletions app/xcode/App/VCam.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
knownRegions = (
en,
Base,
ja,
);
mainGroup = 061238592ADE9A8300B67618;
productRefGroup = 061238632ADE9A8300B67618 /* Products */;
Expand Down
43 changes: 20 additions & 23 deletions app/xcode/App/VCamUIPreviewUITests/LaunchScreenshotTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import XCTest
import VCamLocalization
import VCamUI

final class LaunchScreenshotTests: XCTestCase {
Expand All @@ -10,61 +9,59 @@ final class LaunchScreenshotTests: XCTestCase {

override func setUpWithError() throws {
continueAfterFailure = false
LocalizationEnvironment.currentLocaleIdentifier = { "en_US" }
}

func testLaunch() throws {
let app = XCUIApplication.make()
app.launchArguments += ["-AppleLanguages", "(en)", "-AppleLocale", "en_US"]
app.launch()

XCTContext.runActivity(named: "Launch Screen") { activity in
add(.keepAlways(screenshot: app.screenshot(), activity: activity))
}

XCTContext.runActivity(named: "\(L10n.screenEffect.text) Screen") { activity in
app.buttons.contains(label: L10n.screenEffect.text).click()
_ = app.staticTexts[L10n.startRecording.text].waitForExistence(timeout: 5)
XCTContext.runActivity(named: "Screen Effect Screen") { activity in
app.buttons["menu.screenEffect"].click()
_ = app.buttons["recording.startButton"].waitForExistence(timeout: 5)
add(.keepAlways(screenshot: app.screenshot(), activity: activity))
}

XCTContext.runActivity(named: "\(L10n.recording.text) Screen") { activity in
app.buttons.contains(label: L10n.recording.text).click()
_ = app.staticTexts[L10n.whiteBalance.text].waitForExistence(timeout: 5)
XCTContext.runActivity(named: "Recording Screen") { activity in
app.buttons["menu.recording"].click()
_ = app.descendants(matching: .any)["display.whiteBalance"].waitForExistence(timeout: 5)
add(.keepAlways(screenshot: app.screenshot(), activity: activity))
}

XCTContext.runActivity(named: "\(L10n.settings.text) Screen") { activity in
XCTContext.runActivity(named: "Settings Screen") { activity in
app.buttons["btn_settings"].click()
_ = app.staticTexts[L10n.settings.text].waitForExistence(timeout: 5)
_ = app.buttons["settings.tab.general"].waitForExistence(timeout: 5)
add(.keepAlways(screenshot: app.screenshot(), activity: activity))
XCTAssertTrue(app.cells.firstMatch.isSelected)

XCTContext.runActivity(named: "\(activity.name) - \(L10n.rendering.text)") { activity in
app.cells.staticTexts[L10n.rendering.text].click()
_ = app.staticTexts[L10n.renderingQuality.text].waitForExistence(timeout: 5)
XCTContext.runActivity(named: "\(activity.name) - Rendering") { activity in
app.cells["settings.tab.rendering"].click()
_ = app.descendants(matching: .any)["settings.rendering.quality"].waitForExistence(timeout: 5)
add(.keepAlways(screenshot: app.screenshot(), activity: activity))
}

XCTContext.runActivity(named: "\(activity.name) - \(L10n.tracking.text)") { activity in
app.cells.staticTexts[L10n.tracking.text].click()
_ = app.staticTexts[L10n.fpsCamera.text].waitForExistence(timeout: 5)
XCTContext.runActivity(named: "\(activity.name) - Tracking") { activity in
app.cells["settings.tab.tracking"].click()
add(.keepAlways(screenshot: app.screenshot(), activity: activity))
}

XCTContext.runActivity(named: "\(activity.name) - \(L10n.virtualCamera.text)") { activity in
app.cells.staticTexts[L10n.virtualCamera.text].click()
_ = app.staticTexts[L10n.noteEnableNewCameraExtension.text].waitForExistence(timeout: 5)
XCTContext.runActivity(named: "\(activity.name) - Virtual Camera") { activity in
app.cells["settings.tab.virtualCamera"].click()
add(.keepAlways(screenshot: app.screenshot(), activity: activity))
}

XCTContext.runActivity(named: "\(activity.name) - \(L10n.integration.text)") { activity in
app.cells.staticTexts[L10n.integration.text].click()
XCTContext.runActivity(named: "\(activity.name) - Integration") { activity in
app.cells["settings.tab.integration"].click()
_ = app.staticTexts["VCamMocap"].waitForExistence(timeout: 5)
add(.keepAlways(screenshot: app.screenshot(), activity: activity))
}

XCTContext.runActivity(named: "\(activity.name) - \(L10n.experiment.text)") { activity in
app.cells.staticTexts[L10n.experiment.text].click()
XCTContext.runActivity(named: "\(activity.name) - Experiment") { activity in
app.cells["settings.tab.experiment"].click()
add(.keepAlways(screenshot: app.screenshot(), activity: activity))
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/xcode/App/VCamUIPreviewUITests/VCamUIPreviewUITests.swift
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import XCTest
import VCamLocalization
import VCamUI

final class VCamUIPreviewUITests: XCTestCase {

override func setUpWithError() throws {
continueAfterFailure = false
LocalizationEnvironment.currentLocaleIdentifier = { "en_US" }
}

override func tearDownWithError() throws {
}

func testLaunchApp() throws {
let app = XCUIApplication.make()
app.launchArguments += ["-AppleLanguages", "(en)", "-AppleLocale", "en_US"]
app.launch()

XCTContext.runActivity(named: "Check VCamUI") { _ in
XCTAssertTrue(app.buttons.contains(label: L10n.main.text).exists)
XCTAssertTrue(app.buttons["menu.main"].exists)
}
}
}
8 changes: 3 additions & 5 deletions app/xcode/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ let package = Package(

.library(name: "VCamDefaults", targets: ["VCamDefaults"]),
.library(name: "VCamAppExtension", targets: ["VCamAppExtension"]),
.library(name: "VCamLocalization", targets: ["VCamLocalization"]),

.library(name: "VCamStub", targets: ["VCamStub"]),
],
Expand All @@ -22,16 +21,15 @@ let package = Package(
],
targets: [
.target(name: "VCamUI", dependencies: [
"VCamUIFoundation", "VCamTracking", "VCamCamera", "VCamData", "VCamLocalization", "VCamBridge", "VCamWorkaround",
"VCamUIFoundation", "VCamTracking", "VCamCamera", "VCamData", "VCamBridge", "VCamWorkaround",
], resources: [
.process("Resources"),
]),
.target(name: "VCamUIFoundation"),
.target(name: "VCamData", dependencies: ["VCamBridge", "VCamEntity"]),
.target(name: "VCamEntity", dependencies: ["VCamDefaults", "VCamLocalization"]),
.target(name: "VCamLocalization", resources: [.process("VCamResources")]),
.target(name: "VCamEntity", dependencies: ["VCamDefaults"]),
.target(name: "VCamMedia", dependencies: ["VCamEntity", "VCamAppExtension", "VCamLogger"]),
.target(name: "VCamBridge", dependencies: ["VCamEntity", "VCamUIFoundation", "VCamLocalization"]),
.target(name: "VCamBridge", dependencies: ["VCamEntity", "VCamUIFoundation"]),
.target(name: "VCamTracking", dependencies: ["VCamCamera"]),
.target(name: "VCamCamera", dependencies: ["VCamMedia", "VCamData", "VCamLogger"]),

Expand Down
24 changes: 1 addition & 23 deletions app/xcode/Sources/VCamBridge/LensFlare.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
//
// LensFlare.swift
//
//
// Created by Tatsuya Tanaka on 2022/03/22.
//

import Foundation
import VCamLocalization

public enum LensFlare: Int32, CaseIterable, Identifiable, CustomStringConvertible {
public enum LensFlare: Int32, CaseIterable, Identifiable {
case none, type1, type2, type3, type4

public var id: Self { self }
Expand All @@ -17,18 +9,4 @@ public enum LensFlare: Int32, CaseIterable, Identifiable, CustomStringConvertibl
.init(rawValue: value) ?? .none
}

public var description: String {
switch self {
case .none:
return L10n.none.text
case .type1:
return L10n.typeNo("1").text
case .type2:
return L10n.typeNo("2").text
case .type3:
return L10n.typeNo("3").text
case .type4:
return L10n.typeNo("4").text
}
}
}
10 changes: 0 additions & 10 deletions app/xcode/Sources/VCamBridge/TrackingMappingEntry.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import Foundation
import SwiftUI
import simd
import VCamLocalization

public struct TrackingMappingEntry: Codable, Sendable, Hashable, Identifiable {
public let id: UUID
Expand Down Expand Up @@ -106,15 +104,7 @@ public extension TrackingMappingEntry {
}

public extension TrackingMappingEntry.Key {
var isVCamKey: Bool { key.hasPrefix("_") }
var id: String { key }
var nameKey: LocalizedStringKey {
if isVCamKey {
L10n.key("trackingInput_\(key)").key
} else {
"\(key)"
}
}
}

private enum RangeKeyCodingKeys: String, CodingKey {
Expand Down
5 changes: 2 additions & 3 deletions app/xcode/Sources/VCamData/DisplayParameter.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Foundation
import SwiftUI
import AppKit
import VCamLocalization

public struct DisplayParameter: Codable, Identifiable, Equatable {
public struct Value: Codable, Equatable {
Expand Down Expand Up @@ -66,7 +65,7 @@ public struct DisplayParameter: Codable, Identifiable, Equatable {
public let id: String
public var value: Value

public init(name: String = L10n.newPreset.text, id: String = UUID().uuidString, value: Value = Value()) {
public init(name: String = "", id: String = UUID().uuidString, value: Value = Value()) {
self.name = name
self.id = id
self.value = value
Expand Down Expand Up @@ -159,7 +158,7 @@ public final class DisplayParameterPresets {
// MARK: - DisplayParameterPreset (for UI compatibility)

public struct DisplayParameterPreset: Hashable, Identifiable, CustomStringConvertible, Sendable {
public static let newPreset = Self.init(id: "", description: L10n.newPreset.text)
public static let newPreset = Self.init(id: "", description: "")

public let id: String
public var description: String
Expand Down
5 changes: 2 additions & 3 deletions app/xcode/Sources/VCamData/VCamSceneDataStore.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Foundation
import VCamEntity
import VCamLocalization
import VCamBridge

public struct VCamSceneDataStore {
Expand Down Expand Up @@ -76,8 +75,8 @@ extension VCamSceneDataStore {

public func makeNewScene() -> VCamScene {
try? addSceneIdIfNeeded()
return .init(id: sceneId, name: L10n.scene.text, objects: [
.init(id: SceneObject.avatarID, name: L10n.model.text, type: .avatar(state: .zero), isHidden: false, isLocked: false)
return .init(id: sceneId, name: "", objects: [
.init(id: SceneObject.avatarID, name: "", type: .avatar(state: .zero), isHidden: false, isLocked: false)
], aspectRatio: MainTexture.shared.aspectRatio)
}

Expand Down
27 changes: 1 addition & 26 deletions app/xcode/Sources/VCamEntity/SceneObject.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
//
// SceneObject.swift
//
//
// Created by Tatsuya Tanaka on 2023/03/24.
//

import Foundation
import CoreGraphics
import VCamLocalization
import simd

public protocol SceneObjectCroppableTexture: AnyObject {
Expand All @@ -19,7 +11,7 @@ public struct SceneObject: Identifiable {
public init(id: Int32 = .random(in: 0..<Int32.max), type: ObjectType, name: String? = nil, isHidden: Bool, isLocked: Bool) {
self.id = id
self.type = type
self.name = name ?? type.name
self.name = name ?? ""
self.isHidden = isHidden
self.isLocked = isLocked
}
Expand All @@ -42,23 +34,6 @@ public extension SceneObject {
case web(Web)
case wind(Wind = .random)

var name: String {
switch self {
case .avatar:
return L10n.model.text
case .image:
return L10n.image.text
case .screen:
return L10n.screen.text
case .videoCapture:
return L10n.videoCapture.text
case .web:
return L10n.web.text
case .wind:
return L10n.wind.text
}
}

public var croppableTexture: (any SceneObjectCroppableTexture)? {
switch self {
case .avatar, .image, .wind: return nil
Expand Down
1 change: 0 additions & 1 deletion app/xcode/Sources/VCamEntity/VCamAvatarMotion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import Foundation
import VCamLocalization

public enum VCamAvatarMotion: String, CaseIterable, Codable, Sendable {
case hi, bye, jump, cheer, what, pose, nod, no, shudder, run
Expand Down
10 changes: 0 additions & 10 deletions app/xcode/Sources/VCamEntity/VideoFormat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,10 @@
//

import Foundation
import VCamLocalization

public enum VideoFormat: String, CaseIterable, Identifiable, Sendable {
case mp4, mov, m4v, hevcWithAlpha

public var name: String {
switch self {
case .mp4: "mp4"
case .mov: "mov"
case .m4v: "m4v"
case .hevcWithAlpha: L10n.videoFormatHEVC.text
}
}

public var `extension`: String {
switch self {
case .mp4: "mp4"
Expand Down
Loading