Skip to content

Commit

Permalink
Fix audio input settings when device has more than 2 input channels
Browse files Browse the repository at this point in the history
  • Loading branch information
tlecomte committed Oct 16, 2015
1 parent f71e9d9 commit e7d79f3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions friture/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def __init__(self, parent, logger, audiobackend):

# signals
self.comboBox_inputDevice.currentIndexChanged.connect(self.input_device_changed)
self.comboBox_firstChannel.currentIndexChanged.connect(self.first_channel_changed)
self.comboBox_secondChannel.currentIndexChanged.connect(self.second_channel_changed)
self.comboBox_firstChannel.activated.connect(self.first_channel_changed)
self.comboBox_secondChannel.activated.connect(self.second_channel_changed)
self.radioButton_single.toggled.connect(self.single_input_type_selected)
self.radioButton_duo.toggled.connect(self.duo_input_type_selected)

Expand All @@ -94,6 +94,15 @@ def input_device_changed(self, index):
error_message.showMessage("Impossible to use the selected input device, reverting to the previous one")

# reset the channels
channels = self.audiobackend.get_readable_current_channels()

self.comboBox_firstChannel.clear()
self.comboBox_secondChannel.clear()

for channel in channels:
self.comboBox_firstChannel.addItem(channel)
self.comboBox_secondChannel.addItem(channel)

first_channel = self.audiobackend.get_current_first_channel()
self.comboBox_firstChannel.setCurrentIndex(first_channel)
second_channel = self.audiobackend.get_current_second_channel()
Expand Down

0 comments on commit e7d79f3

Please sign in to comment.