Skip to content

Commit 1b60029

Browse files
authored
Merge pull request #6 from ololx/develop
Added the saving settings in local storage (`defaults`)
2 parents b754318 + 0cd52c7 commit 1b60029

19 files changed

Lines changed: 570 additions & 116 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1010

1111
- Other UI elements for the SBC codec settings.
1212

13+
## [3.1.0] - 2020-12-09
14+
15+
### Added
16+
17+
- The saving settings in local storage (`defaults`).
18+
1319
## [3.0.0] - 2020-11-28
1420

1521
### Changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is a simple tool for the sound quality improving of wireless headphones with the sbc codec on a mac.
44

5-
[![status](https://img.shields.io/badge/status-frozen-inactive?style=flat-square)](BADGES_GUIDE.md#status) [![version](https://img.shields.io/badge/version-3.0.0-informational?style=flat-square)](BADGES_GUIDE.md@version) [![oss lifecycle](https://img.shields.io/badge/oss_lifecycle-maintenance-important?style=flat-square)](BADGES_GUIDE.md#oss-lifecycle) [![maintenance](https://img.shields.io/badge/maintenance-yes-informational?style=flat-square)](BADGES_GUIDE.md#maintenance) [![latest release date](https://img.shields.io/badge/latest_release_date-November_28,_2020-informational?style=flat-square)](BADGES_GUIDE.md#release-date) [![last commit](https://img.shields.io/badge/last_commit-November_28,_2020-informational?style=flat-square)](BADGES_GUIDE.md#commit-date)
5+
[![status](https://img.shields.io/badge/status-frozen-inactive?style=flat-square)](BADGES_GUIDE.md#status) [![version](https://img.shields.io/badge/version-3.1.0-informational?style=flat-square)](BADGES_GUIDE.md@version) [![oss lifecycle](https://img.shields.io/badge/oss_lifecycle-maintenance-important?style=flat-square)](BADGES_GUIDE.md#oss-lifecycle) [![maintenance](https://img.shields.io/badge/maintenance-yes-informational?style=flat-square)](BADGES_GUIDE.md#maintenance) [![latest release date](https://img.shields.io/badge/latest_release_date-December_09,_2020-informational?style=flat-square)](BADGES_GUIDE.md#release-date) [![last commit](https://img.shields.io/badge/last_commit-December_09,_2020-informational?style=flat-square)](BADGES_GUIDE.md#commit-date)
66

77
[![license](https://img.shields.io/badge/license-MIT-informational?style=flat-square)](LICENSE) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](code_of_conduct.md)
88

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
- [x] To automate the increasing process of the sbc bluetooth audio bit rate.
77
- [x] Add the UI dialog for the requesting values of minimal Bitpool for the setting it.
88
- [x] Add the UI dialog for the requesting values of current and maximum Bitpool for the setting it.
9-
- [x ] Add the UI element on main window with check button for setting dual channels.
9+
- [x] Add the UI element on main window with check button for setting dual channels.
1010

1111
---

sbc bitpool expander.xcodeproj/project.pbxproj

Lines changed: 94 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,42 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
A313E7A1257CFD8100C7AC6C /* BluetoothAudioDefaultsProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = A313E7A0257CFD8100C7AC6C /* BluetoothAudioDefaultsProtocol.swift */; };
11+
A313E7A6257CFFE200C7AC6C /* BluetoothAudioDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = A313E7A5257CFFE200C7AC6C /* BluetoothAudioDefaults.swift */; };
1012
A34E91802570BC73000DB3F4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A34E917F2570BC73000DB3F4 /* AppDelegate.swift */; };
11-
A34E91822570BC73000DB3F4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A34E91812570BC73000DB3F4 /* ViewController.swift */; };
13+
A34E91822570BC73000DB3F4 /* SbcViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A34E91812570BC73000DB3F4 /* SbcViewController.swift */; };
1214
A34E91852570BC73000DB3F4 /* sbc_bitpool_expander.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = A34E91832570BC73000DB3F4 /* sbc_bitpool_expander.xcdatamodeld */; };
1315
A34E91872570BC74000DB3F4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A34E91862570BC74000DB3F4 /* Assets.xcassets */; };
1416
A34E918A2570BC74000DB3F4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A34E91882570BC74000DB3F4 /* Main.storyboard */; };
17+
A3681907257BE32700438C80 /* ChannelDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3681906257BE32700438C80 /* ChannelDetail.swift */; };
18+
A3A4BF38257E6AB600F06042 /* SbcBitpoolExpanderDefaultsProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3A4BF37257E6AB600F06042 /* SbcBitpoolExpanderDefaultsProtocol.swift */; };
19+
A3A4BF40257E862F00F06042 /* SbcAssemblyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3A4BF3F257E862F00F06042 /* SbcAssemblyProtocol.swift */; };
20+
A3A4BF45257E86A100F06042 /* SbcAssembly.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3A4BF44257E86A100F06042 /* SbcAssembly.swift */; };
21+
A3A4BF4C257E8C3D00F06042 /* SbcServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3A4BF4B257E8C3D00F06042 /* SbcServiceProtocol.swift */; };
22+
A3D064402577E51200CF800B /* SbcBitpoolExpanderDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D0643F2577E51200CF800B /* SbcBitpoolExpanderDefaults.swift */; };
23+
A3DCA541257E9065005459EE /* SbcService.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3DCA540257E9065005459EE /* SbcService.swift */; };
24+
A3E001462577838A00B42B52 /* BitpoolDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3E001452577838A00B42B52 /* BitpoolDetail.swift */; };
1525
/* End PBXBuildFile section */
1626

1727
/* Begin PBXFileReference section */
28+
A313E7A0257CFD8100C7AC6C /* BluetoothAudioDefaultsProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BluetoothAudioDefaultsProtocol.swift; sourceTree = "<group>"; };
29+
A313E7A5257CFFE200C7AC6C /* BluetoothAudioDefaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BluetoothAudioDefaults.swift; sourceTree = "<group>"; };
1830
A34E917C2570BC73000DB3F4 /* sbc bitpool expander.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "sbc bitpool expander.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1931
A34E917F2570BC73000DB3F4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
20-
A34E91812570BC73000DB3F4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
32+
A34E91812570BC73000DB3F4 /* SbcViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SbcViewController.swift; sourceTree = "<group>"; };
2133
A34E91842570BC73000DB3F4 /* sbc_bitpool_expander.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = sbc_bitpool_expander.xcdatamodel; sourceTree = "<group>"; };
2234
A34E91862570BC74000DB3F4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2335
A34E91892570BC74000DB3F4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
2436
A34E918B2570BC74000DB3F4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2537
A34E918C2570BC74000DB3F4 /* sbc_bitpool_expander.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = sbc_bitpool_expander.entitlements; sourceTree = "<group>"; };
38+
A3681906257BE32700438C80 /* ChannelDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelDetail.swift; sourceTree = "<group>"; };
39+
A3A4BF37257E6AB600F06042 /* SbcBitpoolExpanderDefaultsProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SbcBitpoolExpanderDefaultsProtocol.swift; sourceTree = "<group>"; };
40+
A3A4BF3F257E862F00F06042 /* SbcAssemblyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SbcAssemblyProtocol.swift; sourceTree = "<group>"; };
41+
A3A4BF44257E86A100F06042 /* SbcAssembly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SbcAssembly.swift; sourceTree = "<group>"; };
42+
A3A4BF4B257E8C3D00F06042 /* SbcServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SbcServiceProtocol.swift; sourceTree = "<group>"; };
43+
A3D0643F2577E51200CF800B /* SbcBitpoolExpanderDefaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SbcBitpoolExpanderDefaults.swift; sourceTree = "<group>"; };
44+
A3DCA540257E9065005459EE /* SbcService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SbcService.swift; sourceTree = "<group>"; };
45+
A3E001452577838A00B42B52 /* BitpoolDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BitpoolDetail.swift; sourceTree = "<group>"; };
2646
/* End PBXFileReference section */
2747

2848
/* Begin PBXFrameworksBuildPhase section */
@@ -36,6 +56,15 @@
3656
/* End PBXFrameworksBuildPhase section */
3757

3858
/* Begin PBXGroup section */
59+
A313E7AE257D071D00C7AC6C /* entity */ = {
60+
isa = PBXGroup;
61+
children = (
62+
A3E001452577838A00B42B52 /* BitpoolDetail.swift */,
63+
A3681906257BE32700438C80 /* ChannelDetail.swift */,
64+
);
65+
path = entity;
66+
sourceTree = "<group>";
67+
};
3968
A34E91732570BC73000DB3F4 = {
4069
isa = PBXGroup;
4170
children = (
@@ -55,17 +84,66 @@
5584
A34E917E2570BC73000DB3F4 /* sbc bitpool expander */ = {
5685
isa = PBXGroup;
5786
children = (
58-
A34E917F2570BC73000DB3F4 /* AppDelegate.swift */,
59-
A34E91812570BC73000DB3F4 /* ViewController.swift */,
87+
A3F044492580F47B009F370F /* assembly */,
88+
A3F044482580EFFB009F370F /* route */,
89+
A313E7AE257D071D00C7AC6C /* entity */,
90+
A3681910257BE6AC00438C80 /* presenter */,
91+
A368190F257BE69F00438C80 /* interactor */,
92+
A3681903257BDFD000438C80 /* view */,
6093
A34E91862570BC74000DB3F4 /* Assets.xcassets */,
61-
A34E91882570BC74000DB3F4 /* Main.storyboard */,
6294
A34E918B2570BC74000DB3F4 /* Info.plist */,
6395
A34E918C2570BC74000DB3F4 /* sbc_bitpool_expander.entitlements */,
6496
A34E91832570BC73000DB3F4 /* sbc_bitpool_expander.xcdatamodeld */,
6597
);
6698
path = "sbc bitpool expander";
6799
sourceTree = "<group>";
68100
};
101+
A3681903257BDFD000438C80 /* view */ = {
102+
isa = PBXGroup;
103+
children = (
104+
A34E91882570BC74000DB3F4 /* Main.storyboard */,
105+
A34E91812570BC73000DB3F4 /* SbcViewController.swift */,
106+
);
107+
path = view;
108+
sourceTree = "<group>";
109+
};
110+
A368190F257BE69F00438C80 /* interactor */ = {
111+
isa = PBXGroup;
112+
children = (
113+
A313E7A0257CFD8100C7AC6C /* BluetoothAudioDefaultsProtocol.swift */,
114+
A313E7A5257CFFE200C7AC6C /* BluetoothAudioDefaults.swift */,
115+
A3A4BF37257E6AB600F06042 /* SbcBitpoolExpanderDefaultsProtocol.swift */,
116+
A3D0643F2577E51200CF800B /* SbcBitpoolExpanderDefaults.swift */,
117+
);
118+
path = interactor;
119+
sourceTree = "<group>";
120+
};
121+
A3681910257BE6AC00438C80 /* presenter */ = {
122+
isa = PBXGroup;
123+
children = (
124+
A3A4BF4B257E8C3D00F06042 /* SbcServiceProtocol.swift */,
125+
A3DCA540257E9065005459EE /* SbcService.swift */,
126+
);
127+
path = presenter;
128+
sourceTree = "<group>";
129+
};
130+
A3F044482580EFFB009F370F /* route */ = {
131+
isa = PBXGroup;
132+
children = (
133+
A34E917F2570BC73000DB3F4 /* AppDelegate.swift */,
134+
);
135+
path = route;
136+
sourceTree = "<group>";
137+
};
138+
A3F044492580F47B009F370F /* assembly */ = {
139+
isa = PBXGroup;
140+
children = (
141+
A3A4BF3F257E862F00F06042 /* SbcAssemblyProtocol.swift */,
142+
A3A4BF44257E86A100F06042 /* SbcAssembly.swift */,
143+
);
144+
path = assembly;
145+
sourceTree = "<group>";
146+
};
69147
/* End PBXGroup section */
70148

71149
/* Begin PBXNativeTarget section */
@@ -135,9 +213,19 @@
135213
isa = PBXSourcesBuildPhase;
136214
buildActionMask = 2147483647;
137215
files = (
138-
A34E91822570BC73000DB3F4 /* ViewController.swift in Sources */,
216+
A3681907257BE32700438C80 /* ChannelDetail.swift in Sources */,
217+
A3DCA541257E9065005459EE /* SbcService.swift in Sources */,
218+
A3A4BF4C257E8C3D00F06042 /* SbcServiceProtocol.swift in Sources */,
219+
A34E91822570BC73000DB3F4 /* SbcViewController.swift in Sources */,
220+
A3A4BF45257E86A100F06042 /* SbcAssembly.swift in Sources */,
221+
A313E7A1257CFD8100C7AC6C /* BluetoothAudioDefaultsProtocol.swift in Sources */,
222+
A3D064402577E51200CF800B /* SbcBitpoolExpanderDefaults.swift in Sources */,
139223
A34E91852570BC73000DB3F4 /* sbc_bitpool_expander.xcdatamodeld in Sources */,
140224
A34E91802570BC73000DB3F4 /* AppDelegate.swift in Sources */,
225+
A3A4BF40257E862F00F06042 /* SbcAssemblyProtocol.swift in Sources */,
226+
A3E001462577838A00B42B52 /* BitpoolDetail.swift in Sources */,
227+
A3A4BF38257E6AB600F06042 /* SbcBitpoolExpanderDefaultsProtocol.swift in Sources */,
228+
A313E7A6257CFFE200C7AC6C /* BluetoothAudioDefaults.swift in Sources */,
141229
);
142230
runOnlyForDeploymentPostprocessing = 0;
143231
};

sbc bitpool expander/ViewController.swift

Lines changed: 0 additions & 83 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// SbcAssembly.swift
3+
// sbc bitpool expander
4+
//
5+
// Created by Alexander A. Kropotin on 07.12.2020.
6+
//
7+
8+
import Foundation
9+
10+
public class SbcAssembly: SbcAssemblyProtocol {
11+
12+
func configure(with viewController: SbcViewController) {
13+
//Create components
14+
let sbcService = SbcService.init(view: viewController);
15+
let bluetoothAudioDefaults = BluetoothAudioDefaults.init(presenter: sbcService);
16+
let sbcBitpoolExpanderDefaults = SbcBitpoolExpanderDefaults.init(presenter: sbcService);
17+
18+
//Inject components
19+
viewController.scbService = sbcService;
20+
sbcService.bluetoothAudioDefaults = bluetoothAudioDefaults;
21+
sbcService.sbcBitpoolExpanderDefaults = sbcBitpoolExpanderDefaults;
22+
}
23+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// SbcAssemblyProtocol.swift
3+
// sbc bitpool expander
4+
//
5+
// Created by Alexander A. Kropotin on 07.12.2020.
6+
//
7+
8+
import Foundation
9+
10+
protocol SbcAssemblyProtocol: class {
11+
12+
func configure(with viewController: SbcViewController)
13+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
//
2+
// BitpoolDetail.swift
3+
// sbc bitpool expander
4+
//
5+
// Created by Alexander A. Kropotin on 02.12.2020.
6+
//
7+
8+
public struct BitpoolDetail {
9+
10+
public class BitpoolDetailBuilder {
11+
12+
private var obj: BitpoolDetail!;
13+
14+
public init() {
15+
self.obj = BitpoolDetail();
16+
}
17+
18+
public func buid() -> BitpoolDetail {
19+
return self.obj;
20+
}
21+
22+
public func curr(_ curr: Int!) -> BitpoolDetailBuilder {
23+
self.obj.curr = curr;
24+
25+
return self;
26+
}
27+
28+
public func min(_ min: Int!) -> BitpoolDetailBuilder {
29+
self.obj.min = min;
30+
31+
return self;
32+
}
33+
34+
public func max(_ max: Int!) -> BitpoolDetailBuilder {
35+
self.obj.max = max;
36+
37+
return self;
38+
}
39+
}
40+
41+
public static func builder() -> BitpoolDetailBuilder {
42+
return BitpoolDetailBuilder();
43+
}
44+
45+
//The current/initial bitpool value
46+
private var curr: Int!
47+
48+
//The minimum bitpool value
49+
private var min: Int!
50+
51+
//The maximum bitpool value
52+
private var max: Int!
53+
54+
init() {
55+
self.curr = 40;
56+
self.min = 2;
57+
self.max = 53;
58+
}
59+
60+
public init(curr: Int!, min: Int!, max: Int!) {
61+
self.curr = curr;
62+
self.min = min;
63+
self.max = max;
64+
}
65+
66+
public func getCurr() -> Int {
67+
return self.curr;
68+
}
69+
70+
public func getMin() -> Int {
71+
return self.min;
72+
}
73+
74+
public func getMax() -> Int {
75+
return self.max;
76+
}
77+
}

0 commit comments

Comments
 (0)