Skip to content

Commit

Permalink
Remove the background image function
Browse files Browse the repository at this point in the history
  • Loading branch information
tattn committed Sep 23, 2023
1 parent 482817e commit 9bef119
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 67 deletions.
1 change: 1 addition & 0 deletions app/xcode/Sources/VCamCamera/CoreMediaIO+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ public extension CMIOObjectPropertySelector {
static let systemObject = Self.init(kCMIOObjectSystemObject)
static let hardwarePropertyDevices = Self.init(kCMIOHardwarePropertyDevices)
static let deviceUID = Self.init(kCMIODevicePropertyDeviceUID)
static let devicePropertyStreams = Self.init(kCMIODevicePropertyStreams)
}
6 changes: 3 additions & 3 deletions app/xcode/Sources/VCamCamera/CoreMediaSinkStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ public final class CoreMediaSinkStream: NSObject {
var dataSize: UInt32 = 0
var dataUsed: UInt32 = 0
var opa = CMIOObjectPropertyAddress(
mSelector: CMIOObjectPropertySelector(kCMIODevicePropertyStreams),
mScope: CMIOObjectPropertyScope(kCMIOObjectPropertyScopeGlobal),
mElement: CMIOObjectPropertyElement(kCMIOObjectPropertyElementMain)
mSelector: .devicePropertyStreams,
mScope: .global,
mElement: .main
)
CMIOObjectGetPropertyDataSize(deviceId, &opa, 0, nil, &dataSize)

Expand Down
2 changes: 2 additions & 0 deletions app/xcode/Sources/VCamLocalization/Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ public enum L10n {
public static let seeDocumentation = LocalizedString(lookupKey: "seeDocumentation")
/// Select All
public static let selectAll = LocalizedString(lookupKey: "selectAll")
/// Set As Background
public static let setAsBackground = LocalizedString(lookupKey: "setAsBackground")
/// Settings
public static let settings = LocalizedString(lookupKey: "settings")
/// Set up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"deleteSelectedObject" = "Delete Selected Object";
"interact" = "Interact";
"localFile" = "Local File";
"setAsBackground" = "Set As Background";

"moveInitialPosition" = "Reset position";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"deleteSelectedObject" = "選択中のオブジェクトを削除する";
"interact" = "操作";
"localFile" = "ローカルファイル";
"setAsBackground" = "背景に設定する";

"moveInitialPosition" = "カメラを初期位置に戻す";

Expand Down
8 changes: 4 additions & 4 deletions app/xcode/Sources/VCamUI/Toolbar/VCamMainToolbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import SwiftUI
import VCamEntity

public struct VCamMainToolbar: View {
public init(photoPicker: VCamMainToolbarPhotoPicker, emojiPicker: VCamMainToolbarEmojiPicker, motionPicker: VCamMainToolbarMotionPicker, blendShapePicker: VCamMainToolbarBlendShapePicker) {
public init(photoPicker: VCamMainToolbarBackgroundColorPicker, emojiPicker: VCamMainToolbarEmojiPicker, motionPicker: VCamMainToolbarMotionPicker, blendShapePicker: VCamMainToolbarBlendShapePicker) {
self.photoPicker = photoPicker
self.emojiPicker = emojiPicker
self.motionPicker = motionPicker
self.blendShapePicker = blendShapePicker
}

let photoPicker: VCamMainToolbarPhotoPicker
let photoPicker: VCamMainToolbarBackgroundColorPicker
let emojiPicker: VCamMainToolbarEmojiPicker
let motionPicker: VCamMainToolbarMotionPicker
let blendShapePicker: VCamMainToolbarBlendShapePicker
Expand All @@ -34,7 +34,7 @@ public struct VCamMainToolbar: View {
Item {
isPhotoPopover.toggle()
} label: {
Image(systemName: "photo")
Image(systemName: "paintpalette.fill")
}
.popover(isPresented: $isPhotoPopover) {
VCamPopoverContainer(L10n.background.key) {
Expand Down Expand Up @@ -118,7 +118,7 @@ public struct VCamMainToolbar: View {
struct VCamMainToolbar_Previews: PreviewProvider {
static var previews: some View {
VCamMainToolbar(
photoPicker: VCamMainToolbarPhotoPicker(backgroundColor: .constant(.red), loadBackgroundImage: { _ in }, removeBackgroundImage: {}),
photoPicker: VCamMainToolbarBackgroundColorPicker(backgroundColor: .constant(.red)),
emojiPicker: VCamMainToolbarEmojiPicker(),
motionPicker: VCamMainToolbarMotionPicker(motionHello: {}, motionBye: { .constant(false) }, motionJump: {}, motionYear: {}, motionWhat: {}, motionWin: {}, motionNod: { .constant(false) }, motionShakeHead: { .constant(false) }, motionShakeBody: { .constant(false) }, motionRun: { .constant(false) }),
blendShapePicker: VCamMainToolbarBlendShapePicker(blendShapes: [], selectedBlendShape: { .constant(nil) })
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// VCamMainToolbarBackgroundColorPicker.swift
//
//
// Created by Tatsuya Tanaka on 2023/02/12.
//

import SwiftUI
import VCamUIFoundation

public struct VCamMainToolbarBackgroundColorPicker: View {
public init(backgroundColor: Binding<Color>) {
self._backgroundColor = backgroundColor
}

@Binding var backgroundColor: Color

public var body: some View {
GroupBox {
Form {
HStack {
Text(L10n.color.key, bundle: .localize)
.fixedSize(horizontal: true, vertical: false)
ColorEditField(L10n.color.key, value: $backgroundColor)
.labelsHidden()
}
}
}
}
}

struct VCamMainToolbarPhotoPicker_Previews: PreviewProvider {
static var previews: some View {
VCamMainToolbarBackgroundColorPicker(backgroundColor: .constant(.red))
}
}
60 changes: 0 additions & 60 deletions app/xcode/Sources/VCamUI/Toolbar/VCamMainToolbarPhotoPicker.swift

This file was deleted.

0 comments on commit 9bef119

Please sign in to comment.