ebt.pszTitle = _T("Bluetooth Device Name");
ebt.ttiIcon = TTI_INFO;
Edit_ShowBalloonTip(hDevName, &ebt);
- }
- else {
+ } else {
TCHAR devNameBuf[BT_DEV_NAME_MAX_LEN + 1];
BtDeviceName* btDevName = reinterpret_cast<BtDeviceName*>(GetWindowLongPtr(hDlg, GWLP_USERDATA));
if (btDevName != nullptr) {
Edit_GetText(hDevName, devNameBuf, ARRAY_SIZE(devNameBuf));
btDevName->devName = devNameBuf;
EndDialog(hDlg, 0);
- }
- else {
+ } else {
EndDialog(hDlg, 1);
}
}
if (LOWORD(wParam) == IDC_ENABLE_BLUETOOTH_MUTE) {
DWORD checked = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLE_BLUETOOTH_MUTE));
Button_Enable(GetDlgItem(hDlg, IDC_ENABLE_BLUETOOTH_MUTE_DEVICE_LIST), checked == BST_CHECKED);
- }
- else if (LOWORD(wParam) == IDC_BLUETOOTH_LIST) {
+ } else if (LOWORD(wParam) == IDC_BLUETOOTH_LIST) {
HWND hList = GetDlgItem(hDlg, IDC_BLUETOOTH_LIST);
if (HIWORD(wParam) == LBN_SELCHANGE || HIWORD(wParam) == LBN_SELCANCEL) {
bool entrySelected = (ListBox_GetCurSel(hList) != LB_ERR);
Button_Enable(GetDlgItem(hDlg, IDC_BLUETOOTH_EDIT), entrySelected);
Button_Enable(GetDlgItem(hDlg, IDC_BLUETOOTH_REMOVE), entrySelected);
}
- }
- else if (LOWORD(wParam) == IDC_BLUETOOTH_ADD) {
+ } else if (LOWORD(wParam) == IDC_BLUETOOTH_ADD) {
BtDeviceName btDeviceName;
if (DialogBoxParam(
NULL,
}
}
}
- }
- else if (LOWORD(wParam) == IDC_BLUETOOTH_EDIT) {
+ } else if (LOWORD(wParam) == IDC_BLUETOOTH_EDIT) {
HWND hList = GetDlgItem(hDlg, IDC_BLUETOOTH_LIST);
WPARAM sel = ListBox_GetCurSel(hList);
if (sel != LB_ERR) {
}
}
}
- }
- else if (LOWORD(wParam) == IDC_WIFI_REMOVE) {
- HWND hList = GetDlgItem(hDlg, IDC_WIFI_LIST);
+ } else if (LOWORD(wParam) == IDC_BLUETOOTH_REMOVE) {
+ HWND hList = GetDlgItem(hDlg, IDC_BLUETOOTH_LIST);
WPARAM sel = ListBox_GetCurSel(hList);
if (sel != LB_ERR) {
ListBox_DeleteString(hList, sel);
Button_Enable(GetDlgItem(hDlg, IDC_BLUETOOTH_REMOVEALL), FALSE);
}
}
- }
- else if (LOWORD(wParam) == IDC_BLUETOOTH_REMOVEALL) {
+ } else if (LOWORD(wParam) == IDC_BLUETOOTH_REMOVEALL) {
ListBox_ResetContent(GetDlgItem(hDlg, IDC_BLUETOOTH_LIST));
Button_Enable(GetDlgItem(hDlg, IDC_BLUETOOTH_EDIT), FALSE);
Button_Enable(GetDlgItem(hDlg, IDC_BLUETOOTH_REMOVE), FALSE);
muteConfig_.muteOnBluetooth = settings_.QueryValue(SettingsKey::MUTE_ON_BLUETOOTH);
if (!muteConfig_.muteOnBluetooth) {
btDetector_.Unload();
- } else if (!btDetector_.Init(hWnd_)) {
- trayIcon_.ShowPopup(
- _T("Bluetooth muting disabled"),
- _T("Bluetooth is not available or disabled. ")
- _T("Bluetooth muting will be disabled on this computer"));
- settings_.SetValue(SettingsKey::MUTE_ON_BLUETOOTH, FALSE);
+ } else {
+ if (!btDetector_.Init(hWnd_)) {
+ trayIcon_.ShowPopup(
+ _T("Bluetooth muting disabled"),
+ _T("Bluetooth is not available or disabled. ")
+ _T("Bluetooth muting will be disabled on this computer"));
+ settings_.SetValue(SettingsKey::MUTE_ON_BLUETOOTH, FALSE);
+ } else {
+ bool muteOnWithDeviceList = settings_.QueryValue(SettingsKey::MUTE_ON_BLUETOOTH_DEVICELIST);
+ btDetector_.SetDeviceList(settings_.GetBluetoothDevicesA(), muteOnWithDeviceList);
+ }
}
muteConfig_.muteOnWlan = settings_.QueryValue(SettingsKey::MUTE_ON_WLAN);
if (muteConfig_.muteOnBluetooth) {
const auto btStatus = btDetector_.GetBluetoothStatus(msg, wParam, lParam);
if (btStatus == BluetoothDetector::BluetoothStatus::Connected) {
+ if (settings_.QueryValue(SettingsKey::NOTIFICATIONS_ENABLED)) {
+ trayIcon_.ShowPopup(
+ _T("Bluetooth muting"),
+ _T("Bluetooth device connected: Restoring audio"));
+ }
muteCtrl_.SetMute(false);
} else if (btStatus == BluetoothDetector::BluetoothStatus::Disconnected) {
+ if (settings_.QueryValue(SettingsKey::NOTIFICATIONS_ENABLED)) {
+ trayIcon_.ShowPopup(
+ _T("Bluetooth muting"),
+ _T("Bluetooth device disconnected: Muting"));
+ }
muteCtrl_.SetMute(true);
}
}