Skip to content

Commit 830878e

Browse files
JoniVRthe0neyouseek
authored andcommitted
Project upgrade, stability improvements, new features (MonitorControl#59)
PR MonitorControl#59 with enhancements and fixes (Changes done by @JoniVR): - Code migration to **Swift 4.2** - **Fixed** the **MonitorControl scheme** which was gone for me - **Updated the screenshots and readme** - **Added a feature that detects the default sound output device and only intercepts when an external display is set as default output**, so Airpods, internal macbook volume and other non-monitor devices will be ignored (MonitorControl#48, MonitorControl#15) - **Fixed app unresponsiveness and high CPU on launch** (might be related to MonitorControl#50, MonitorControl#37, please do keep in mind that on initial launch there will still be a little unresponsiveness because the underlying framework - called [ddcctl](https://github.com/kfix/ddcctl) - attempts to read your volume settings 10 times) - Added a **version and build number** to the main preferences panel: ![menugeneral](https://user-images.githubusercontent.com/7591717/51052474-0c4c7500-15d7-11e9-883d-804051577bc7.png) - Added a build script that increases the build number on each run. Version number still needs to be set manually. - refactored some parts of the code to make it a bit more readable.
1 parent 2f4107c commit 830878e

File tree

19 files changed

+549
-335
lines changed

19 files changed

+549
-335
lines changed

.github/menudisplay.png

74.9 KB
Loading

.github/menugeneral.png

73.5 KB
Loading

.github/menukeys.png

57.2 KB
Loading

.github/menulet-outdated.png

23.1 KB
Loading

.github/menulet.png

134 KB
Loading

.github/osd.jpg

60.9 KB
Loading

.github/osd.png

-2.31 KB
Binary file not shown.

MonitorControl.xcodeproj/project.pbxproj

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
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+
6C778D5A21E91060000A4D5F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6C778D5821E91060000A4D5F /* Main.storyboard */; };
1516
9A19D3B73485870616B6D4E0 /* Pods_MonitorControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 398F482D5C8816B29F16AAEB /* Pods_MonitorControl.framework */; };
1617
F03A8DF21FFBAA6F0034DC27 /* Display.swift in Sources */ = {isa = PBXBuildFile; fileRef = F03A8DF11FFBAA6F0034DC27 /* Display.swift */; };
1718
F0445D3820023E710025AE82 /* MainPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0445D3720023E710025AE82 /* MainPrefsViewController.swift */; };
1819
F0445D3D200254FA0025AE82 /* KeysPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0445D3B200254FA0025AE82 /* KeysPrefsViewController.swift */; };
1920
F0445D40200259C10025AE82 /* DisplayPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0445D3F200259C10025AE82 /* DisplayPrefsViewController.swift */; };
20-
F0445D41200282E60025AE82 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F0445D43200282E60025AE82 /* Main.storyboard */; };
2121
F0445D4D200294AB0025AE82 /* ButtonCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0445D4C200294AB0025AE82 /* ButtonCellView.swift */; };
2222
F06792EA200A73460066C438 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F06792E9200A73460066C438 /* AppDelegate.swift */; };
2323
F06792F6200A745F0066C438 /* MonitorControlHelper.app in [Login] Copy Helper to start at Login */ = {isa = PBXBuildFile; fileRef = F06792E7200A73460066C438 /* MonitorControlHelper.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
@@ -56,13 +56,13 @@
5656
56754EB01D9A4016007BCDC5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5757
56754EB31D9A4016007BCDC5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
5858
56754EB51D9A4016007BCDC5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
59+
6C778D5921E91060000A4D5F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
60+
6C778D5E21E910A2000A4D5F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; };
61+
6C778D5F21E910A6000A4D5F /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Main.strings; sourceTree = "<group>"; };
5962
F03A8DF11FFBAA6F0034DC27 /* Display.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Display.swift; sourceTree = "<group>"; };
6063
F0445D3720023E710025AE82 /* MainPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainPrefsViewController.swift; sourceTree = "<group>"; };
6164
F0445D3B200254FA0025AE82 /* KeysPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeysPrefsViewController.swift; sourceTree = "<group>"; };
6265
F0445D3F200259C10025AE82 /* DisplayPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayPrefsViewController.swift; sourceTree = "<group>"; };
63-
F0445D42200282E60025AE82 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
64-
F0445D45200282EB0025AE82 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Main.strings; sourceTree = "<group>"; };
65-
F0445D47200282F80025AE82 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; };
6666
F0445D49200285690025AE82 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/MainMenu.strings; sourceTree = "<group>"; };
6767
F0445D4B2002856C0025AE82 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/MainMenu.strings; sourceTree = "<group>"; };
6868
F0445D4C200294AB0025AE82 /* ButtonCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonCellView.swift; sourceTree = "<group>"; };
@@ -149,7 +149,7 @@
149149
children = (
150150
56754EAE1D9A4016007BCDC5 /* AppDelegate.swift */,
151151
F091C9B71F6EA79B0096FD65 /* Utils.swift */,
152-
F0445D43200282E60025AE82 /* Main.storyboard */,
152+
6C778D5821E91060000A4D5F /* Main.storyboard */,
153153
56754EB21D9A4016007BCDC5 /* MainMenu.xib */,
154154
F0445D3620023D5B0025AE82 /* Prefs */,
155155
F091C9B41F6EA6180096FD65 /* Objects */,
@@ -247,6 +247,7 @@
247247
56754EA91D9A4016007BCDC5 /* Resources */,
248248
9DD5968596EFAF0E2EB56496 /* [CP] Embed Pods Frameworks */,
249249
F06792F5200A73FA0066C438 /* [Login] Copy Helper to start at Login */,
250+
6C778D4D21E90DA1000A4D5F /* ShellScript */,
250251
);
251252
buildRules = (
252253
);
@@ -286,13 +287,14 @@
286287
TargetAttributes = {
287288
56754EAA1D9A4016007BCDC5 = {
288289
CreatedOnToolsVersion = 8.0;
289-
DevelopmentTeam = KGY56RWR9A;
290-
LastSwiftMigration = 0900;
290+
DevelopmentTeam = CYC8C8R4K9;
291+
LastSwiftMigration = 1010;
291292
ProvisioningStyle = Automatic;
292293
};
293294
F06792E6200A73460066C438 = {
294295
CreatedOnToolsVersion = 9.2;
295-
DevelopmentTeam = KGY56RWR9A;
296+
DevelopmentTeam = CYC8C8R4K9;
297+
LastSwiftMigration = 1010;
296298
ProvisioningStyle = Automatic;
297299
};
298300
};
@@ -323,8 +325,8 @@
323325
buildActionMask = 2147483647;
324326
files = (
325327
56754EB11D9A4016007BCDC5 /* Assets.xcassets in Resources */,
326-
F0445D41200282E60025AE82 /* Main.storyboard in Resources */,
327328
F0EB972F1F6ED7C800686D2A /* Localizable.strings in Resources */,
329+
6C778D5A21E91060000A4D5F /* Main.storyboard in Resources */,
328330
55359E3B1E2737EC002671BC /* ddcctl.sh in Resources */,
329331
56754EB41D9A4016007BCDC5 /* MainMenu.xib in Resources */,
330332
);
@@ -340,18 +342,37 @@
340342
/* End PBXResourcesBuildPhase section */
341343

342344
/* Begin PBXShellScriptBuildPhase section */
345+
6C778D4D21E90DA1000A4D5F /* ShellScript */ = {
346+
isa = PBXShellScriptBuildPhase;
347+
buildActionMask = 2147483647;
348+
files = (
349+
);
350+
inputFileListPaths = (
351+
);
352+
inputPaths = (
353+
);
354+
outputFileListPaths = (
355+
);
356+
outputPaths = (
357+
);
358+
runOnlyForDeploymentPostprocessing = 0;
359+
shellPath = /bin/sh;
360+
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nbuildNumber=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"${INFOPLIST_FILE}\")\nbuildNumber=$(($buildNumber + 1))\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"${INFOPLIST_FILE}\"\n\n";
361+
};
343362
9DD5968596EFAF0E2EB56496 /* [CP] Embed Pods Frameworks */ = {
344363
isa = PBXShellScriptBuildPhase;
345364
buildActionMask = 2147483647;
346365
files = (
347366
);
348367
inputPaths = (
349368
"${SRCROOT}/Pods/Target Support Files/Pods-MonitorControl/Pods-MonitorControl-frameworks.sh",
369+
"${BUILT_PRODUCTS_DIR}/AMCoreAudio/AMCoreAudio.framework",
350370
"${BUILT_PRODUCTS_DIR}/MASPreferences/MASPreferences.framework",
351371
"${BUILT_PRODUCTS_DIR}/MediaKeyTap/MediaKeyTap.framework",
352372
);
353373
name = "[CP] Embed Pods Frameworks";
354374
outputPaths = (
375+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AMCoreAudio.framework",
355376
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MASPreferences.framework",
356377
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MediaKeyTap.framework",
357378
);
@@ -432,12 +453,12 @@
432453
name = MainMenu.xib;
433454
sourceTree = "<group>";
434455
};
435-
F0445D43200282E60025AE82 /* Main.storyboard */ = {
456+
6C778D5821E91060000A4D5F /* Main.storyboard */ = {
436457
isa = PBXVariantGroup;
437458
children = (
438-
F0445D42200282E60025AE82 /* Base */,
439-
F0445D45200282EB0025AE82 /* fr */,
440-
F0445D47200282F80025AE82 /* en */,
459+
6C778D5921E91060000A4D5F /* Base */,
460+
6C778D5E21E910A2000A4D5F /* en */,
461+
6C778D5F21E910A6000A4D5F /* fr */,
441462
);
442463
name = Main.storyboard;
443464
sourceTree = "<group>";
@@ -600,14 +621,14 @@
600621
CODE_SIGN_IDENTITY = "Mac Developer";
601622
CODE_SIGN_STYLE = Automatic;
602623
COMBINE_HIDPI_IMAGES = YES;
603-
DEVELOPMENT_TEAM = KGY56RWR9A;
624+
DEVELOPMENT_TEAM = CYC8C8R4K9;
604625
INFOPLIST_FILE = "$(SRCROOT)/MonitorControl/Info.plist";
605626
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
606627
PRODUCT_BUNDLE_IDENTIFIER = me.guillaumeb.MonitorControl;
607628
PRODUCT_NAME = "$(TARGET_NAME)";
608629
PROVISIONING_PROFILE_SPECIFIER = "";
609630
SWIFT_OBJC_BRIDGING_HEADER = "MonitorControl/Bridging-Header.h";
610-
SWIFT_VERSION = 4.0;
631+
SWIFT_VERSION = 4.2;
611632
};
612633
name = Debug;
613634
};
@@ -619,14 +640,14 @@
619640
CODE_SIGN_IDENTITY = "Mac Developer";
620641
CODE_SIGN_STYLE = Automatic;
621642
COMBINE_HIDPI_IMAGES = YES;
622-
DEVELOPMENT_TEAM = KGY56RWR9A;
643+
DEVELOPMENT_TEAM = CYC8C8R4K9;
623644
INFOPLIST_FILE = "$(SRCROOT)/MonitorControl/Info.plist";
624645
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
625646
PRODUCT_BUNDLE_IDENTIFIER = me.guillaumeb.MonitorControl;
626647
PRODUCT_NAME = "$(TARGET_NAME)";
627648
PROVISIONING_PROFILE_SPECIFIER = "";
628649
SWIFT_OBJC_BRIDGING_HEADER = "MonitorControl/Bridging-Header.h";
629-
SWIFT_VERSION = 4.0;
650+
SWIFT_VERSION = 4.2;
630651
};
631652
name = Release;
632653
};
@@ -641,15 +662,15 @@
641662
CODE_SIGN_IDENTITY = "Mac Developer";
642663
CODE_SIGN_STYLE = Automatic;
643664
COMBINE_HIDPI_IMAGES = YES;
644-
DEVELOPMENT_TEAM = KGY56RWR9A;
665+
DEVELOPMENT_TEAM = CYC8C8R4K9;
645666
GCC_C_LANGUAGE_STANDARD = gnu11;
646667
INFOPLIST_FILE = MonitorControlHelper/Info.plist;
647668
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
648669
MACOSX_DEPLOYMENT_TARGET = 10.13;
649670
PRODUCT_BUNDLE_IDENTIFIER = me.guillaumeb.MonitorControlHelper;
650671
PRODUCT_NAME = "$(TARGET_NAME)";
651672
SKIP_INSTALL = YES;
652-
SWIFT_VERSION = 4.0;
673+
SWIFT_VERSION = 4.2;
653674
};
654675
name = Debug;
655676
};
@@ -664,15 +685,15 @@
664685
CODE_SIGN_IDENTITY = "Mac Developer";
665686
CODE_SIGN_STYLE = Automatic;
666687
COMBINE_HIDPI_IMAGES = YES;
667-
DEVELOPMENT_TEAM = KGY56RWR9A;
688+
DEVELOPMENT_TEAM = CYC8C8R4K9;
668689
GCC_C_LANGUAGE_STANDARD = gnu11;
669690
INFOPLIST_FILE = MonitorControlHelper/Info.plist;
670691
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
671692
MACOSX_DEPLOYMENT_TARGET = 10.13;
672693
PRODUCT_BUNDLE_IDENTIFIER = me.guillaumeb.MonitorControlHelper;
673694
PRODUCT_NAME = "$(TARGET_NAME)";
674695
SKIP_INSTALL = YES;
675-
SWIFT_VERSION = 4.0;
696+
SWIFT_VERSION = 4.2;
676697
};
677698
name = Release;
678699
};
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1010"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "56754EAA1D9A4016007BCDC5"
18+
BuildableName = "MonitorControl.app"
19+
BlueprintName = "MonitorControl"
20+
ReferencedContainer = "container:MonitorControl.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "56754EAA1D9A4016007BCDC5"
36+
BuildableName = "MonitorControl.app"
37+
BlueprintName = "MonitorControl"
38+
ReferencedContainer = "container:MonitorControl.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
41+
<AdditionalOptions>
42+
</AdditionalOptions>
43+
</TestAction>
44+
<LaunchAction
45+
buildConfiguration = "Debug"
46+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
47+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48+
launchStyle = "0"
49+
useCustomWorkingDirectory = "NO"
50+
ignoresPersistentStateOnLaunch = "NO"
51+
debugDocumentVersioning = "YES"
52+
debugServiceExtension = "internal"
53+
allowLocationSimulation = "YES">
54+
<BuildableProductRunnable
55+
runnableDebuggingMode = "0">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "56754EAA1D9A4016007BCDC5"
59+
BuildableName = "MonitorControl.app"
60+
BlueprintName = "MonitorControl"
61+
ReferencedContainer = "container:MonitorControl.xcodeproj">
62+
</BuildableReference>
63+
</BuildableProductRunnable>
64+
<AdditionalOptions>
65+
</AdditionalOptions>
66+
</LaunchAction>
67+
<ProfileAction
68+
buildConfiguration = "Release"
69+
shouldUseLaunchSchemeArgsEnv = "YES"
70+
savedToolIdentifier = ""
71+
useCustomWorkingDirectory = "NO"
72+
debugDocumentVersioning = "YES">
73+
<BuildableProductRunnable
74+
runnableDebuggingMode = "0">
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "56754EAA1D9A4016007BCDC5"
78+
BuildableName = "MonitorControl.app"
79+
BlueprintName = "MonitorControl"
80+
ReferencedContainer = "container:MonitorControl.xcodeproj">
81+
</BuildableReference>
82+
</BuildableProductRunnable>
83+
</ProfileAction>
84+
<AnalyzeAction
85+
buildConfiguration = "Debug">
86+
</AnalyzeAction>
87+
<ArchiveAction
88+
buildConfiguration = "Release"
89+
revealArchiveInOrganizer = "YES">
90+
</ArchiveAction>
91+
</Scheme>

0 commit comments

Comments
 (0)