Skip to content

Commit 68afdda

Browse files
committed
♻️ Refactoring
- Key handling is now done in the app, close MonitorControl#3 - All code linted with SwiftLint, close MonitorControl#4 - Better handling of built-in screen Signed-off-by: Guillaume Broder <[email protected]>
1 parent 4557756 commit 68afdda

25 files changed

Lines changed: 510 additions & 289 deletions

.gitignore

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11

2-
# Created by https://www.gitignore.io/api/xcode
2+
# Created by https://www.gitignore.io/api/macos,xcode,cocoapods
3+
4+
### CocoaPods ###
5+
## CocoaPods GitIgnore Template
6+
7+
# CocoaPods - Only use to conserve bandwidth / Save time on Pushing
8+
# - Also handy if you have a large number of dependant pods
9+
# - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGNORE THE LOCK FILE
10+
Pods/
11+
12+
### macOS ###
13+
*.DS_Store
14+
.AppleDouble
15+
.LSOverride
16+
17+
# Icon must end with two \r
18+
Icon
19+
20+
# Thumbnails
21+
._*
22+
23+
# Files that might appear in the root of a volume
24+
.DocumentRevisions-V100
25+
.fseventsd
26+
.Spotlight-V100
27+
.TemporaryItems
28+
.Trashes
29+
.VolumeIcon.icns
30+
.com.apple.timemachine.donotpresent
31+
32+
# Directories potentially created on remote AFP share
33+
.AppleDB
34+
.AppleDesktop
35+
Network Trash Folder
36+
Temporary Items
37+
.apdisk
338

439
### Xcode ###
540
# Xcode
@@ -25,4 +60,10 @@ xcuserdata/
2560
*.moved-aside
2661
*.xccheckout
2762
*.xcscmblueprint
28-
*.xcscheme
63+
64+
### Xcode Patch ###
65+
*.xcodeproj/*
66+
!*.xcodeproj/project.pbxproj
67+
!*.xcodeproj/xcshareddata/
68+
!*.xcworkspace/contents.xcworkspacedata
69+
/*.gcno

.swiftlint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
disabled_rules:
2+
- line_length
3+
- function_body_length
4+
excluded:
5+
- Pods
6+
type_body_length:
7+
- warning: 500
8+
file_length:
9+
- warning: 500

MonitorControl.xcodeproj/project.pbxproj

Lines changed: 97 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212
56754EAF1D9A4016007BCDC5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56754EAE1D9A4016007BCDC5 /* AppDelegate.swift */; };
1313
56754EB11D9A4016007BCDC5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 56754EB01D9A4016007BCDC5 /* Assets.xcassets */; };
1414
56754EB41D9A4016007BCDC5 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 56754EB21D9A4016007BCDC5 /* MainMenu.xib */; };
15+
9A19D3B73485870616B6D4E0 /* Pods_MonitorControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 398F482D5C8816B29F16AAEB /* Pods_MonitorControl.framework */; };
16+
F03A8DF21FFBAA6F0034DC27 /* Display.swift in Sources */ = {isa = PBXBuildFile; fileRef = F03A8DF11FFBAA6F0034DC27 /* Display.swift */; };
1517
F091C9B31F6EA6110096FD65 /* SliderHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F091C9B21F6EA6110096FD65 /* SliderHandler.swift */; };
1618
F091C9B81F6EA79B0096FD65 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F091C9B71F6EA79B0096FD65 /* Utils.swift */; };
1719
F0A987E81F77B40E009B603D /* OSD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0A987D61F77B290009B603D /* OSD.framework */; };
1820
F0EB972F1F6ED7C800686D2A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F091C9C11F6EB8660096FD65 /* Localizable.strings */; };
1921
/* End PBXBuildFile section */
2022

2123
/* Begin PBXFileReference section */
24+
31E16D90527EBD3F8A12BE0B /* Pods-MonitorControl.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MonitorControl.release.xcconfig"; path = "Pods/Target Support Files/Pods-MonitorControl/Pods-MonitorControl.release.xcconfig"; sourceTree = "<group>"; };
25+
398F482D5C8816B29F16AAEB /* Pods_MonitorControl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MonitorControl.framework; sourceTree = BUILT_PRODUCTS_DIR; };
26+
42B61ABC1D7907131330228A /* Pods-MonitorControl.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MonitorControl.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MonitorControl/Pods-MonitorControl.debug.xcconfig"; sourceTree = "<group>"; };
2227
55359E331E2737EC002671BC /* DDC.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DDC.c; sourceTree = "<group>"; };
2328
55359E341E2737EC002671BC /* DDC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDC.h; sourceTree = "<group>"; };
2429
55359E351E2737EC002671BC /* ddcctl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ddcctl.m; sourceTree = "<group>"; };
@@ -30,6 +35,7 @@
3035
56754EB01D9A4016007BCDC5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3136
56754EB31D9A4016007BCDC5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
3237
56754EB51D9A4016007BCDC5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
38+
F03A8DF11FFBAA6F0034DC27 /* Display.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Display.swift; sourceTree = "<group>"; };
3339
F091C9B21F6EA6110096FD65 /* SliderHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderHandler.swift; sourceTree = "<group>"; };
3440
F091C9B71F6EA79B0096FD65 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
3541
F091C9B91F6EB43B0096FD65 /* fr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; lineEnding = 0; name = fr; path = fr.lproj/MainMenu.strings; sourceTree = "<group>"; };
@@ -57,6 +63,7 @@
5763
buildActionMask = 2147483647;
5864
files = (
5965
F0A987E81F77B40E009B603D /* OSD.framework in Frameworks */,
66+
9A19D3B73485870616B6D4E0 /* Pods_MonitorControl.framework in Frameworks */,
6067
);
6168
runOnlyForDeploymentPostprocessing = 0;
6269
};
@@ -84,6 +91,7 @@
8491
55359E321E2737EC002671BC /* ddcctl */,
8592
56754EAC1D9A4016007BCDC5 /* Products */,
8693
F0A987D71F77B404009B603D /* Frameworks */,
94+
EFFC2F3E35BEC9ACFA754137 /* Pods */,
8795
);
8896
sourceTree = "<group>";
8997
};
@@ -110,10 +118,20 @@
110118
path = MonitorControl;
111119
sourceTree = "<group>";
112120
};
121+
EFFC2F3E35BEC9ACFA754137 /* Pods */ = {
122+
isa = PBXGroup;
123+
children = (
124+
42B61ABC1D7907131330228A /* Pods-MonitorControl.debug.xcconfig */,
125+
31E16D90527EBD3F8A12BE0B /* Pods-MonitorControl.release.xcconfig */,
126+
);
127+
name = Pods;
128+
sourceTree = "<group>";
129+
};
113130
F091C9B41F6EA6180096FD65 /* Objects */ = {
114131
isa = PBXGroup;
115132
children = (
116133
F091C9B21F6EA6110096FD65 /* SliderHandler.swift */,
134+
F03A8DF11FFBAA6F0034DC27 /* Display.swift */,
117135
);
118136
path = Objects;
119137
sourceTree = "<group>";
@@ -122,6 +140,7 @@
122140
isa = PBXGroup;
123141
children = (
124142
F0A987D81F77B404009B603D /* MonitorControl */,
143+
398F482D5C8816B29F16AAEB /* Pods_MonitorControl.framework */,
125144
);
126145
name = Frameworks;
127146
sourceTree = "<group>";
@@ -157,9 +176,13 @@
157176
isa = PBXNativeTarget;
158177
buildConfigurationList = 56754EB81D9A4016007BCDC5 /* Build configuration list for PBXNativeTarget "MonitorControl" */;
159178
buildPhases = (
179+
C0EF20D28FC7408CBE89A686 /* [CP] Check Pods Manifest.lock */,
180+
F03A8DF01FFB9D4C0034DC27 /* [Lint] Run SwiftLint */,
160181
56754EA71D9A4016007BCDC5 /* Sources */,
161182
56754EA81D9A4016007BCDC5 /* Frameworks */,
162183
56754EA91D9A4016007BCDC5 /* Resources */,
184+
9DD5968596EFAF0E2EB56496 /* [CP] Embed Pods Frameworks */,
185+
3ACE91333FC1E781FB2E44E5 /* [CP] Copy Pods Resources */,
163186
);
164187
buildRules = (
165188
);
@@ -182,6 +205,7 @@
182205
TargetAttributes = {
183206
56754EAA1D9A4016007BCDC5 = {
184207
CreatedOnToolsVersion = 8.0;
208+
DevelopmentTeam = KGY56RWR9A;
185209
LastSwiftMigration = 0900;
186210
ProvisioningStyle = Automatic;
187211
};
@@ -220,11 +244,80 @@
220244
};
221245
/* End PBXResourcesBuildPhase section */
222246

247+
/* Begin PBXShellScriptBuildPhase section */
248+
3ACE91333FC1E781FB2E44E5 /* [CP] Copy Pods Resources */ = {
249+
isa = PBXShellScriptBuildPhase;
250+
buildActionMask = 2147483647;
251+
files = (
252+
);
253+
inputPaths = (
254+
);
255+
name = "[CP] Copy Pods Resources";
256+
outputPaths = (
257+
);
258+
runOnlyForDeploymentPostprocessing = 0;
259+
shellPath = /bin/sh;
260+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MonitorControl/Pods-MonitorControl-resources.sh\"\n";
261+
showEnvVarsInLog = 0;
262+
};
263+
9DD5968596EFAF0E2EB56496 /* [CP] Embed Pods Frameworks */ = {
264+
isa = PBXShellScriptBuildPhase;
265+
buildActionMask = 2147483647;
266+
files = (
267+
);
268+
inputPaths = (
269+
"${SRCROOT}/Pods/Target Support Files/Pods-MonitorControl/Pods-MonitorControl-frameworks.sh",
270+
"${BUILT_PRODUCTS_DIR}/MediaKeyTap/MediaKeyTap.framework",
271+
);
272+
name = "[CP] Embed Pods Frameworks";
273+
outputPaths = (
274+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MediaKeyTap.framework",
275+
);
276+
runOnlyForDeploymentPostprocessing = 0;
277+
shellPath = /bin/sh;
278+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MonitorControl/Pods-MonitorControl-frameworks.sh\"\n";
279+
showEnvVarsInLog = 0;
280+
};
281+
C0EF20D28FC7408CBE89A686 /* [CP] Check Pods Manifest.lock */ = {
282+
isa = PBXShellScriptBuildPhase;
283+
buildActionMask = 2147483647;
284+
files = (
285+
);
286+
inputPaths = (
287+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
288+
"${PODS_ROOT}/Manifest.lock",
289+
);
290+
name = "[CP] Check Pods Manifest.lock";
291+
outputPaths = (
292+
"$(DERIVED_FILE_DIR)/Pods-MonitorControl-checkManifestLockResult.txt",
293+
);
294+
runOnlyForDeploymentPostprocessing = 0;
295+
shellPath = /bin/sh;
296+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
297+
showEnvVarsInLog = 0;
298+
};
299+
F03A8DF01FFB9D4C0034DC27 /* [Lint] Run SwiftLint */ = {
300+
isa = PBXShellScriptBuildPhase;
301+
buildActionMask = 2147483647;
302+
files = (
303+
);
304+
inputPaths = (
305+
);
306+
name = "[Lint] Run SwiftLint";
307+
outputPaths = (
308+
);
309+
runOnlyForDeploymentPostprocessing = 0;
310+
shellPath = /bin/sh;
311+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
312+
};
313+
/* End PBXShellScriptBuildPhase section */
314+
223315
/* Begin PBXSourcesBuildPhase section */
224316
56754EA71D9A4016007BCDC5 /* Sources */ = {
225317
isa = PBXSourcesBuildPhase;
226318
buildActionMask = 2147483647;
227319
files = (
320+
F03A8DF21FFBAA6F0034DC27 /* Display.swift in Sources */,
228321
F091C9B31F6EA6110096FD65 /* SliderHandler.swift in Sources */,
229322
56754EAF1D9A4016007BCDC5 /* AppDelegate.swift in Sources */,
230323
55359E391E2737EC002671BC /* DDC.c in Sources */,
@@ -393,13 +486,13 @@
393486
};
394487
56754EB91D9A4016007BCDC5 /* Debug */ = {
395488
isa = XCBuildConfiguration;
489+
baseConfigurationReference = 42B61ABC1D7907131330228A /* Pods-MonitorControl.debug.xcconfig */;
396490
buildSettings = {
397491
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
398492
CODE_SIGN_IDENTITY = "Mac Developer";
399493
CODE_SIGN_STYLE = Automatic;
400494
COMBINE_HIDPI_IMAGES = YES;
401-
DEVELOPMENT_TEAM = "";
402-
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/**";
495+
DEVELOPMENT_TEAM = KGY56RWR9A;
403496
INFOPLIST_FILE = "$(SRCROOT)/MonitorControl/Info.plist";
404497
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
405498
PRODUCT_BUNDLE_IDENTIFIER = me.guillaumeb.MonitorControl;
@@ -412,13 +505,13 @@
412505
};
413506
56754EBA1D9A4016007BCDC5 /* Release */ = {
414507
isa = XCBuildConfiguration;
508+
baseConfigurationReference = 31E16D90527EBD3F8A12BE0B /* Pods-MonitorControl.release.xcconfig */;
415509
buildSettings = {
416510
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
417511
CODE_SIGN_IDENTITY = "Mac Developer";
418512
CODE_SIGN_STYLE = Automatic;
419513
COMBINE_HIDPI_IMAGES = YES;
420-
DEVELOPMENT_TEAM = "";
421-
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/**";
514+
DEVELOPMENT_TEAM = KGY56RWR9A;
422515
INFOPLIST_FILE = "$(SRCROOT)/MonitorControl/Info.plist";
423516
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
424517
PRODUCT_BUNDLE_IDENTIFIER = me.guillaumeb.MonitorControl;

MonitorControl.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)