Skip to content

Commit 98da95f

Browse files
committed
fixes
1 parent 36c0180 commit 98da95f

11 files changed

Lines changed: 116 additions & 43 deletions

File tree

0 Bytes
Binary file not shown.

native/app/Source/Application.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class Application {
248248

249249
if list.added.count > 0 {
250250
for added in list.added {
251-
if Output.isDeviceAllowed(added) {
251+
if Output.autoSelect(added) {
252252
selectOutput(device: added)
253253
break
254254
}

native/app/Source/Audio/Outputs/Output.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ import EmitterKit
1313
import AVFoundation
1414

1515
class Output {
16+
1617
static func isDeviceAllowed(_ device: AudioDevice) -> Bool {
1718
return device.transportType != nil && Constants.SUPPORTED_TRANSPORT_TYPES.contains(device.transportType!) && !device.isInputOnlyDevice()
1819
}
1920

21+
static func autoSelect (_ device: AudioDevice) -> Bool {
22+
let types: [TransportType] = [.bluetooth, .bluetoothLE, .builtIn]
23+
return Output.isDeviceAllowed(device) && types.contains(device.transportType!)
24+
}
25+
2026
static var allowedDevices: [AudioDevice] {
2127
return AudioDevice.allOutputDevices()
2228
.filter({ device in

native/app/Source/Constants.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import AMCoreAudio
1313
struct Constants {
1414

1515
#if DEBUG
16-
static let UI_ENDPOINT_URL = URL(string: "http://localhost:4200")!
17-
// static let UI_ENDPOINT_URL = URL(string: "https://ui-v1.eqmac.app")!
16+
// static let UI_ENDPOINT_URL = URL(string: "http://localhost:4200")!
17+
static let UI_ENDPOINT_URL = URL(string: "https://ui-v1.eqmac.app")!
1818
static let DEBUG = true
1919
#else
2020
static let DEBUG = false

native/app/Source/Helpers/Networking.swift

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,41 @@ import Foundation
1010
import Reachability
1111

1212
class Networking {
13+
// static func isReachable (_ host: String, _ callback: @escaping (Bool) -> Void) {
14+
// if let ping = try? SwiftyPing(
15+
// host: host,
16+
// configuration: PingConfiguration(interval: 0.1, with: 5),
17+
// queue: DispatchQueue.global()
18+
// ) {
19+
// ping.observer = { (response) in
20+
// callback(response.error == nil)
21+
// ping.stopPinging()
22+
// }
23+
// ping.startPinging()
24+
// } else {
25+
// callback(false)
26+
// }
27+
// }
28+
1329
static func isReachable (_ host: String, _ callback: @escaping (Bool) -> Void) {
14-
if let ping = try? SwiftyPing(
15-
host: host,
16-
configuration: PingConfiguration(interval: 0.1, with: 5),
17-
queue: DispatchQueue.global()
18-
) {
19-
ping.observer = { (response) in
20-
callback(response.error == nil)
21-
ping.stopPinging()
22-
}
23-
ping.startPinging()
24-
} else {
30+
let reachability = try! Reachability(hostname: host)
31+
32+
reachability.whenReachable = { reachability in
33+
reachability.stopNotifier()
34+
callback(true)
35+
}
36+
reachability.whenUnreachable = { _ in
37+
reachability.stopNotifier()
38+
callback(false)
39+
}
40+
41+
do {
42+
try reachability.startNotifier()
43+
} catch {
2544
callback(false)
2645
}
2746
}
28-
47+
2948
static func tcpPortIsAvailable(_ port: UInt) -> Bool {
3049

3150
let socketFileDescriptor = socket(AF_INET, SOCK_STREAM, 0)

native/app/Source/UI/Main.storyboard

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="Wg1-es-IGc">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="Wg1-es-IGc">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16096"/>
6-
<plugIn identifier="com.apple.WebKit2IBPlugin" version="16096"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097"/>
6+
<plugIn identifier="com.apple.WebKit2IBPlugin" version="16097"/>
77
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
88
</dependencies>
99
<scenes>
@@ -38,9 +38,9 @@
3838
<autoresizingMask key="autoresizingMask"/>
3939
<subviews>
4040
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="G6Y-R8-Z81">
41-
<rect key="frame" x="-2" y="32" width="272" height="17"/>
41+
<rect key="frame" x="-2" y="14" width="272" height="35"/>
4242
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
43-
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Installing Driver" id="3Xg-7Y-udV">
43+
<textFieldCell key="cell" lineBreakMode="truncatingTail" alignment="center" title="Installing Driver" id="3Xg-7Y-udV">
4444
<font key="font" usesAppearanceFont="YES"/>
4545
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
4646
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -58,7 +58,7 @@
5858
</connections>
5959
</viewController>
6060
</objects>
61-
<point key="canvasLocation" x="-471" y="70"/>
61+
<point key="canvasLocation" x="-471" y="69.5"/>
6262
</scene>
6363
<!--Application-->
6464
<scene sceneID="JPo-4y-FX3">

native/app/Source/UI/UI.swift

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -271,23 +271,30 @@ class UI: StoreSubscriber {
271271

272272
private func remoteIsReachable (_ completion: @escaping (Bool) -> Void) {
273273
var returned = false
274-
AF.request(Constants.UI_ENDPOINT_URL)
275-
.responseData { response in
276-
switch response.result {
277-
case .success:
278-
if !returned {
279-
returned = true
280-
completion(true)
281-
}
282-
case .failure:
283-
Console.log("Failed to load \(Constants.UI_ENDPOINT_URL)", response)
284-
if !returned {
285-
returned = true
286-
completion(false)
274+
Networking.isReachable(UI.domain) { reachable in
275+
if (!reachable) {
276+
returned = true
277+
return completion(false)
278+
}
279+
AF.request(Constants.UI_ENDPOINT_URL)
280+
.responseData { response in
281+
switch response.result {
282+
case .success:
283+
if !returned {
284+
returned = true
285+
completion(true)
286+
}
287+
case .failure:
288+
Console.log("Failed to load \(Constants.UI_ENDPOINT_URL)", response)
289+
if !returned {
290+
returned = true
291+
completion(false)
292+
}
287293
}
288-
}
294+
}
289295
}
290296

297+
291298
Utilities.delay(1000) {
292299
if (!returned) {
293300
returned = true

native/app/eqMac.xcodeproj/project.pbxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@
805805
);
806806
runOnlyForDeploymentPostprocessing = 0;
807807
shellPath = /bin/sh;
808-
shellScript = "\nLOCATION=\"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/LoginItems/LaunchAtLoginHelper.app\"\n\n# By default, use the configured code signing identity for the project/target\nIDENTITY=\"${CODE_SIGN_IDENTITY}\"\nif [ \"$IDENTITY\" == \"\" ]\nthen\n# If a code signing identity is not specified, use ad hoc signing\nIDENTITY=\"-\"\nfi\necho \"Hardening Launch At Login Helper with developer identity \\\"$IDENTITY\\\"...\"\ncodesign --verbose --force --deep -o runtime --sign \"$IDENTITY\" \"$LOCATION\"\n";
808+
shellScript = "if [[ $CONFIGURATION == \"Debug\" ]]; then\nexit 0\nfi\n\nLOCATION=\"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/LoginItems/LaunchAtLoginHelper.app\"\n\n# By default, use the configured code signing identity for the project/target\nIDENTITY=\"${CODE_SIGN_IDENTITY}\"\nif [ \"$IDENTITY\" == \"\" ]\nthen\n# If a code signing identity is not specified, use ad hoc signing\nIDENTITY=\"-\"\nfi\necho \"Hardening Launch At Login Helper with developer identity \\\"$IDENTITY\\\"...\"\ncodesign --verbose --force --deep -o runtime --sign \"$IDENTITY\" \"$LOCATION\"\n";
809809
};
810810
E0F4FD9A22888AC300BEB0A6 /* Run Script - LaunchAtLogin copy-helper */ = {
811811
isa = PBXShellScriptBuildPhase;
@@ -1038,7 +1038,7 @@
10381038
CODE_SIGN_IDENTITY = "Developer ID Application";
10391039
CODE_SIGN_STYLE = Manual;
10401040
COMBINE_HIDPI_IMAGES = YES;
1041-
CURRENT_PROJECT_VERSION = 0.3;
1041+
CURRENT_PROJECT_VERSION = 0.3.1;
10421042
DEFINES_MODULE = YES;
10431043
DEVELOPMENT_TEAM = JZA6C97KJA;
10441044
ENABLE_HARDENED_RUNTIME = YES;
@@ -1074,7 +1074,7 @@
10741074
"$(PROJECT_DIR)/Source/Vendor",
10751075
);
10761076
MACOSX_DEPLOYMENT_TARGET = 10.12;
1077-
MARKETING_VERSION = v0.3;
1077+
MARKETING_VERSION = v0.3.1;
10781078
PRODUCT_BUNDLE_IDENTIFIER = com.bitgapp.eqmac;
10791079
PRODUCT_NAME = "$(TARGET_NAME)";
10801080
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1098,7 +1098,7 @@
10981098
CODE_SIGN_IDENTITY = "Developer ID Application";
10991099
CODE_SIGN_STYLE = Manual;
11001100
COMBINE_HIDPI_IMAGES = YES;
1101-
CURRENT_PROJECT_VERSION = 0.3;
1101+
CURRENT_PROJECT_VERSION = 0.3.1;
11021102
DEFINES_MODULE = YES;
11031103
DEVELOPMENT_TEAM = JZA6C97KJA;
11041104
ENABLE_HARDENED_RUNTIME = YES;
@@ -1134,7 +1134,7 @@
11341134
"$(PROJECT_DIR)/Source/Vendor",
11351135
);
11361136
MACOSX_DEPLOYMENT_TARGET = 10.12;
1137-
MARKETING_VERSION = v0.3;
1137+
MARKETING_VERSION = v0.3.1;
11381138
PRODUCT_BUNDLE_IDENTIFIER = com.bitgapp.eqmac;
11391139
PRODUCT_NAME = "$(TARGET_NAME)";
11401140
PROVISIONING_PROFILE_SPECIFIER = "";

native/app/update/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# eqMac Changelog
22

3+
## v0.3.1
4+
* Fixed UI not loading when Internet is disabled
5+
* Device switching improvements
6+
7+
## v0.3
8+
* Updated Driver now doesn't show up if eqMac is not running (optional update)
9+
* Fixed no sound on some devices due so Sample Rate issues. Thanks @virtustilus
10+
* Fixed crashes during device changes. Thanks @virtustilus
11+
* Improved Volume handling
12+
* Fixed UI not loading for some users that have eqMac blocked from accessing network
13+
* Fixed Window showing up after first launch
14+
* Improved Driver installation/update experience
15+
* Added support for aggregate/multi-output devices
16+
317
## v0.2.0
418
* Added optional Peak Limiter to Basic EQ
519
* Added Popover / Window mode switch
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
<h1 id="eqmac-changelog">eqMac Changelog</h1>
2+
<h2 id="v0-3-1">v0.3.1</h2>
3+
<ul>
4+
<li>Fixed UI not loading when Internet is disabled</li>
5+
<li>Device switching improvements</li>
6+
</ul>
7+
<h2 id="v0-3">v0.3</h2>
8+
<ul>
9+
<li>Updated Driver now doesn&#39;t show up if eqMac is not running (optional update)</li>
10+
<li>Fixed no sound on some devices due so Sample Rate issues. Thanks @virtustilus</li>
11+
<li>Fixed crashes during device changes. Thanks @virtustilus</li>
12+
<li>Improved Volume handling</li>
13+
<li>Fixed UI not loading for some users that have eqMac blocked from accessing network</li>
14+
<li>Fixed Window showing up after first launch</li>
15+
<li>Improved Driver installation/update experience</li>
16+
<li>Added support for aggregate/multi-output devices</li>
17+
</ul>
218
<h2 id="v0-2-0">v0.2.0</h2>
319
<ul>
420
<li>Added optional Peak Limiter to Basic EQ</li>

0 commit comments

Comments
 (0)