Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
engineerjoe440 authored Jan 15, 2023
1 parent 3c183d7 commit 8e9afb0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pipewire_python/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
class InvalidLink(ValueError):
"""Invalid link configuration."""


class PortType(Enum):
"""Pipewire Channel Type - Input or Output."""

Expand Down Expand Up @@ -259,7 +260,8 @@ def connect(
if len(connections) > 1:
return StereoLink(left=connections[0], right=connections[1])
return connections

return None

def disconnect(
self,
other: Union["StereoOutput", "StereoLink", "Link"]
Expand Down Expand Up @@ -335,6 +337,7 @@ def connect(
if len(connections) > 1:
return StereoLink(left=connections[0], right=connections[1])
return connections
return None

def disconnect(
self,
Expand Down Expand Up @@ -403,6 +406,7 @@ def reconnect(self):
self.left.reconnect()
self.right.reconnect()


def _split_id_from_data(command) -> List[List[str]]:
"""Helper function to generate a list of channels"""
stdout, _ = _execute_shell_command([PW_LINK_COMMAND, command, "--id"])
Expand Down Expand Up @@ -463,15 +467,15 @@ def list_inputs(pair_stereo: bool = True) -> List[Union[StereoInput, Input]]:
# Identify Left and Right ports
if "FL" in ports[i].name.upper():
inputs.append(StereoInput(
left = ports[i],
right = ports[i-1]
left=ports[i],
right=ports[i-1]
))
i += 1
continue
if "FR" in ports[i].name.upper():
inputs.append(StereoInput(
right = ports[i],
left = ports[i-1]
right=ports[i],
left=ports[i-1]
))
i += 1
continue
Expand Down

0 comments on commit 8e9afb0

Please sign in to comment.