Skip to content

Commit

Permalink
Remove LUT quick buttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
eerimoq committed Jan 25, 2025
1 parent 92982d8 commit 94944ab
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 32 deletions.
22 changes: 11 additions & 11 deletions Moblin.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
034FA1BB2C151E3600695825 /* AdaptiveBitrateRistExperiment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 034FA1BA2C151E3600695825 /* AdaptiveBitrateRistExperiment.swift */; };
03507F6B2B45DD5A0075648B /* GameControllersControllerButtonSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03507F6A2B45DD5A0075648B /* GameControllersControllerButtonSettingsView.swift */; };
03510DDC2C7661A400FD3A27 /* SpeechToText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03510DDB2C7661A400FD3A27 /* SpeechToText.swift */; };
035192E02B53EF2C00B09E3B /* GlobalQuickButtonsButtonSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035192DF2B53EF2C00B09E3B /* GlobalQuickButtonsButtonSettingsView.swift */; };
035192E02B53EF2C00B09E3B /* QuickButtonsButtonSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035192DF2B53EF2C00B09E3B /* QuickButtonsButtonSettingsView.swift */; };
0352679E2B99A00C00B49B72 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 03F853B22B151FA700719B89 /* Localizable.xcstrings */; };
03559E7E2BDCEB14002D0886 /* FaceEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03559E7D2BDCEB14002D0886 /* FaceEffect.swift */; };
035735802BC62FDC00F4E87D /* WatchLocalOverlaysSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0357357F2BC62FDC00F4E87D /* WatchLocalOverlaysSettingsView.swift */; };
Expand Down Expand Up @@ -444,7 +444,7 @@
03DEA1F92BFA66DC00154631 /* MetalPetal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03DEA1F82BFA66DC00154631 /* MetalPetal.swift */; };
03E3E3922C431E0900932B00 /* DjiDeviceSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E3E3912C431E0900932B00 /* DjiDeviceSettingsView.swift */; };
03E6F7F92CE5B4B100D9198A /* BondingStatisticsFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E6F7F82CE5B4AB00D9198A /* BondingStatisticsFormatter.swift */; };
03E877F72B2DB27800086355 /* GlobalQuickButtonsSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E877F62B2DB27800086355 /* GlobalQuickButtonsSettingsView.swift */; };
03E877F72B2DB27800086355 /* QuickButtonsSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E877F62B2DB27800086355 /* QuickButtonsSettingsView.swift */; };
03E95AC62ADAF58900DAE2DF /* ZoomSwitchToSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E95AC52ADAF58900DAE2DF /* ZoomSwitchToSettingsView.swift */; };
03E95AE42ADB7B3D00DAE2DF /* TapScreenToFocusSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E95AE32ADB7B3D00DAE2DF /* TapScreenToFocusSettingsView.swift */; };
03E972CD2D3AB52700888FAB /* MoblinkScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E972CC2D3AB52200888FAB /* MoblinkScanner.swift */; };
Expand Down Expand Up @@ -674,7 +674,7 @@
034FA1BA2C151E3600695825 /* AdaptiveBitrateRistExperiment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdaptiveBitrateRistExperiment.swift; sourceTree = "<group>"; };
03507F6A2B45DD5A0075648B /* GameControllersControllerButtonSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameControllersControllerButtonSettingsView.swift; sourceTree = "<group>"; };
03510DDB2C7661A400FD3A27 /* SpeechToText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpeechToText.swift; sourceTree = "<group>"; };
035192DF2B53EF2C00B09E3B /* GlobalQuickButtonsButtonSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalQuickButtonsButtonSettingsView.swift; sourceTree = "<group>"; };
035192DF2B53EF2C00B09E3B /* QuickButtonsButtonSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickButtonsButtonSettingsView.swift; sourceTree = "<group>"; };
0352DDF22BFFCAA60079AC7B /* SampleBufferCommon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleBufferCommon.swift; sourceTree = "<group>"; };
03559E7D2BDCEB14002D0886 /* FaceEffect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaceEffect.swift; sourceTree = "<group>"; };
0357357F2BC62FDC00F4E87D /* WatchLocalOverlaysSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchLocalOverlaysSettingsView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1006,7 +1006,7 @@
03DEA1F82BFA66DC00154631 /* MetalPetal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MetalPetal.swift; sourceTree = "<group>"; };
03E3E3912C431E0900932B00 /* DjiDeviceSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DjiDeviceSettingsView.swift; sourceTree = "<group>"; };
03E6F7F82CE5B4AB00D9198A /* BondingStatisticsFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BondingStatisticsFormatter.swift; sourceTree = "<group>"; };
03E877F62B2DB27800086355 /* GlobalQuickButtonsSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalQuickButtonsSettingsView.swift; sourceTree = "<group>"; };
03E877F62B2DB27800086355 /* QuickButtonsSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickButtonsSettingsView.swift; sourceTree = "<group>"; };
03E95AC52ADAF58900DAE2DF /* ZoomSwitchToSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZoomSwitchToSettingsView.swift; sourceTree = "<group>"; };
03E95AE32ADB7B3D00DAE2DF /* TapScreenToFocusSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TapScreenToFocusSettingsView.swift; sourceTree = "<group>"; };
03E972CC2D3AB52200888FAB /* MoblinkScanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoblinkScanner.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2295,7 +2295,7 @@
children = (
03AD44072B78A88B00B1B9B9 /* StreamButton */,
0379BBA32AAD944000B718B6 /* LocalOverlays */,
03E877F52B2DB26100086355 /* GlobalButtons */,
03E877F52B2DB26100086355 /* QuickButtons */,
038ED3D92B403633005DEC08 /* NetworkInterfaceNames */,
03B16A302B35D74800E5AB07 /* DisplaySettingsView.swift */,
);
Expand Down Expand Up @@ -2690,13 +2690,13 @@
path = DjiDevices;
sourceTree = "<group>";
};
03E877F52B2DB26100086355 /* GlobalButtons */ = {
03E877F52B2DB26100086355 /* QuickButtons */ = {
isa = PBXGroup;
children = (
03E877F62B2DB27800086355 /* GlobalQuickButtonsSettingsView.swift */,
035192DF2B53EF2C00B09E3B /* GlobalQuickButtonsButtonSettingsView.swift */,
03E877F62B2DB27800086355 /* QuickButtonsSettingsView.swift */,
035192DF2B53EF2C00B09E3B /* QuickButtonsButtonSettingsView.swift */,
);
path = GlobalButtons;
path = QuickButtons;
sourceTree = "<group>";
};
03E95AE22ADB7B2200DAE2DF /* TapScreenToFocus */ = {
Expand Down Expand Up @@ -3248,7 +3248,7 @@
0359F8FC2BD3DA61005BFDA8 /* SrtSocket.swift in Sources */,
03C357562D081D9100B8B29F /* RtmpUserControlMessage.swift in Sources */,
03B507A72C88B8F6003CDEDF /* CatPrinter.swift in Sources */,
035192E02B53EF2C00B09E3B /* GlobalQuickButtonsButtonSettingsView.swift in Sources */,
035192E02B53EF2C00B09E3B /* QuickButtonsButtonSettingsView.swift in Sources */,
0359F8DD2BD3DA61005BFDA8 /* MpegTsVideoConfigHevc.swift in Sources */,
03A983692A9A05D7008FF0DB /* CreateButtonView.swift in Sources */,
0364662C2B456B25005AB9FA /* StreamWizardCustomSrtSettingsView.swift in Sources */,
Expand Down Expand Up @@ -3377,7 +3377,7 @@
032815DF2AC9885C001F8A85 /* TripleEffect.swift in Sources */,
03584BED2BE49B1B007E61F6 /* FaceView.swift in Sources */,
03B374022AA0354C0028DDD5 /* GrayScaleEffect.swift in Sources */,
03E877F72B2DB27800086355 /* GlobalQuickButtonsSettingsView.swift in Sources */,
03E877F72B2DB27800086355 /* QuickButtonsSettingsView.swift in Sources */,
032FDC022B0B11C5007BE85E /* SizeEditView.swift in Sources */,
032B4EDE2C34927C00204547 /* SegmentedPicker.swift in Sources */,
0359F8AE2BD3DA61005BFDA8 /* VideoCodec.swift in Sources */,
Expand Down
21 changes: 0 additions & 21 deletions Moblin/Various/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1536,11 +1536,6 @@ private let allBundledLuts = [
SettingsColorLut(type: .bundled, name: "Moblin Meme"),
]

private let bundledLutsButtonIcons = [
"Apple Log To Rec 709": "apple.logo",
"Moblin Meme": "tornado",
]

class SettingsColor: Codable {
var space: SettingsColorSpace = .srgb
var lutEnabled: Bool = true
Expand Down Expand Up @@ -3057,31 +3052,15 @@ private func addMissingDeepLinkQuickButtons(database: Database) {
}
}

private func addMissingBundledLutButton(database: Database, lut: SettingsColorLut) {
if lut.buttonId == nil {
let button = SettingsButton(name: lut.name)
button.type = .lut
lut.buttonId = button.id
database.globalButtons!.append(button)
}
if let button = database.globalButtons!.first(where: { $0.id == lut.buttonId }) {
let imageName = bundledLutsButtonIcons[lut.name] ?? "apple.logo"
button.systemImageNameOn = imageName
button.systemImageNameOff = imageName
}
}

private func addMissingBundledLuts(database: Database) {
if database.color == nil {
database.color = .init()
}
var bundledLuts: [SettingsColorLut] = []
for lut in allBundledLuts {
if let existingLut = database.color!.bundledLuts.first(where: { $0.name == lut.name }) {
addMissingBundledLutButton(database: database, lut: existingLut)
bundledLuts.append(existingLut)
} else {
addMissingBundledLutButton(database: database, lut: lut)
bundledLuts.append(lut)
}
}
Expand Down

0 comments on commit 94944ab

Please sign in to comment.