Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pulsemixer
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ class PulseVolume(DebugMixin):

class Bar():
# should be in correct order
LEFT, RIGHT, RLEFT, RRIGHT, CENTER, SUB, SLEFT, SRIGHT, NONE = range(9)
NONE, LEFT, RIGHT, RLEFT, RRIGHT, CENTER, SUB, SLEFT, SRIGHT = range(-1, 8)

def __init__(self, pa):
if type(pa) is str:
Expand Down Expand Up @@ -1159,6 +1159,11 @@ class Screen():
selected = 'output' if type(self.selected[0].pa) is PulseSinkInputInfo else 'input'
self.menu = "Select new {} device:|{}".format(selected, curses.A_NORMAL)

@staticmethod
def format_side(side):
name = Screen.SIDES.get(side, None)
return '%d (%s)' % (side, name) if name is not None else str(side)

def update_info(self):
focus, bottom = self.focus_line_num + self.top_line_num + 1, self.top_line_num + self.lines
try:
Expand All @@ -1170,7 +1175,7 @@ class Screen():
if side is Bar.NONE:
self.info = str
return
side = 'All' if bar.locked else 'Mono' if bar.channels == 1 else self.SIDES[side]
side = 'All' if bar.locked else 'Mono' if bar.channels == 1 else Screen.format_side(side)
more = '↕' if bottom < self.n_lines and self.top_line_num > 0 else '↑' if self.top_line_num > 0 else '↓' if bottom < self.n_lines else ' '
name = '{}: {}'.format(bar.name, side)
if len(name) > self.cols - 8:
Expand Down