Skip to content

Commit

Permalink
add Mute, PanBalance actuators
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoward committed Jul 27, 2023
1 parent 23456dc commit 40b093d
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// Copyright (c) 2023 PADL Software Pty Ltd
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an 'AS IS' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation
import SwiftOCA

public class OcaMute: OcaActuator {
override public class var classID: OcaClassID { OcaClassID("1.1.1.2") }

@OcaDeviceProperty(
propertyID: OcaPropertyID("4.1"),
getMethodID: OcaMethodID("4.1"),
setMethodID: OcaMethodID("4.2")
)
public var state: OcaMuteState = .muted
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Copyright (c) 2023 PADL Software Pty Ltd
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an 'AS IS' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation
import SwiftOCA

public class OcaPanBalance: OcaActuator {
override public class var classID: OcaClassID { OcaClassID("1.1.1.6") }

@OcaBoundedDeviceProperty(
propertyID: OcaPropertyID("4.1"),
getMethodID: OcaMethodID("4.1"),
setMethodID: OcaMethodID("4.2")
)
public var position = OcaBoundedPropertyValue<OcaFloat32>(value: 0, in: -1.0...1.0)

@OcaBoundedDeviceProperty(
propertyID: OcaPropertyID("4.2"),
getMethodID: OcaMethodID("4.3"),
setMethodID: OcaMethodID("4.4")
)
public var midpointGain = OcaBoundedPropertyValue<OcaFloat32>(value: -3.0, in : -3.0 ... -3.0)
}
8 changes: 8 additions & 0 deletions SwiftOCA.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
D33B52CF2A706FB9001A1BA7 /* libSwiftOCA.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = D3E6E1642A3ACA0B00BF7095 /* libSwiftOCA.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
D33B52D42A706FD7001A1BA7 /* FlyingSocks in Frameworks */ = {isa = PBXBuildFile; productRef = D33B52D32A706FD7001A1BA7 /* FlyingSocks */; };
D351F2012A7132F8008C5513 /* BoundedDeviceProperty.swift in Sources */ = {isa = PBXBuildFile; fileRef = D351F2002A7132F8008C5513 /* BoundedDeviceProperty.swift */; };
D351F2032A727411008C5513 /* Mute.swift in Sources */ = {isa = PBXBuildFile; fileRef = D351F2022A727411008C5513 /* Mute.swift */; };
D351F2052A72780A008C5513 /* PanBalance.swift in Sources */ = {isa = PBXBuildFile; fileRef = D351F2042A72780A008C5513 /* PanBalance.swift */; };
D36ECA212A5AEB9B0015174A /* AES70OCP1FlyingSocksConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = D36ECA202A5AEB9B0015174A /* AES70OCP1FlyingSocksConnection.swift */; };
D36ECA2C2A5B24B30015174A /* AES70OCP1CFSocketConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = D36ECA2B2A5B24B30015174A /* AES70OCP1CFSocketConnection.swift */; };
D37F7E1B2A6D2602005F035F /* DeviceAddressToString.swift in Sources */ = {isa = PBXBuildFile; fileRef = D37F7E1A2A6D2602005F035F /* DeviceAddressToString.swift */; };
Expand Down Expand Up @@ -185,6 +187,8 @@
D33B52BC2A706201001A1BA7 /* OCADevice */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = OCADevice; sourceTree = BUILT_PRODUCTS_DIR; };
D33B52C52A706235001A1BA7 /* DeviceApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceApp.swift; sourceTree = "<group>"; };
D351F2002A7132F8008C5513 /* BoundedDeviceProperty.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoundedDeviceProperty.swift; sourceTree = "<group>"; };
D351F2022A727411008C5513 /* Mute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mute.swift; sourceTree = "<group>"; };
D351F2042A72780A008C5513 /* PanBalance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PanBalance.swift; sourceTree = "<group>"; };
D36ECA202A5AEB9B0015174A /* AES70OCP1FlyingSocksConnection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AES70OCP1FlyingSocksConnection.swift; sourceTree = "<group>"; };
D36ECA2B2A5B24B30015174A /* AES70OCP1CFSocketConnection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AES70OCP1CFSocketConnection.swift; sourceTree = "<group>"; };
D37F7E1A2A6D2602005F035F /* DeviceAddressToString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceAddressToString.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -463,7 +467,9 @@
isa = PBXGroup;
children = (
D33B52B32A7060BC001A1BA7 /* Actuator.swift */,
D351F2022A727411008C5513 /* Mute.swift */,
D33B52B52A7060E0001A1BA7 /* BasicActuators.swift */,
D351F2042A72780A008C5513 /* PanBalance.swift */,
);
path = Actuators;
sourceTree = "<group>";
Expand Down Expand Up @@ -1036,6 +1042,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D351F2032A727411008C5513 /* Mute.swift in Sources */,
D33B52B42A7060BC001A1BA7 /* Actuator.swift in Sources */,
D33B52882A6FD190001A1BA7 /* Device.swift in Sources */,
D33B52A52A702D04001A1BA7 /* Worker.swift in Sources */,
Expand All @@ -1051,6 +1058,7 @@
D33B52952A6FE075001A1BA7 /* Controller.swift in Sources */,
D33B52B02A703AEA001A1BA7 /* Root+Commands.swift in Sources */,
D33B52A82A702D29001A1BA7 /* Manager.swift in Sources */,
D351F2052A72780A008C5513 /* PanBalance.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

0 comments on commit 40b093d

Please sign in to comment.