@@ -1251,51 +1251,6 @@ def msg_cb_new(*args, **kwargs):
1251
1251
if args [0 ].find ("sound-card" ) >= 0 :
1252
1252
device_signal = 1
1253
1253
return
1254
- '''# check to see if any new cards
1255
- with open('/proc/asound/cards', "r") as card_file:
1256
- my_cards_f = card_file.read()
1257
- if my_cards_f == cards_f:
1258
- logging.debug("card file not changed, skip")
1259
- return
1260
- else:
1261
- cards_f = my_cards_f
1262
- # remake database
1263
- old_devs_db = copy.deepcopy(conf_db['devices'])
1264
- import_config("msg_cb_new")
1265
- dev_db = {}
1266
- for dev_name in conf_db['devices']:
1267
- dev_db = conf_db['devices'][dev_name]
1268
- # we only care about usb devices that are plugged in and have audio
1269
- if dev_db['usb'] and dev_db['number'] != -1 and len(dev_db['sub']):
1270
- # check if it was not in db before or "card number" has changed
1271
- if dev_name not in old_devs_db or dev_db[
1272
- 'number'] != old_devs_db[dev_name]['number']:
1273
- # tell gui devicelist has changed so it can up date
1274
- # device dropdowns
1275
- sendbs.state(version, 'usb')
1276
- logging.debug(f"USB device {dev_name} has been plugged in")
1277
-
1278
- for subn in dev_db['sub']:
1279
- subname = f"{dev_name},{str(subn)},0"
1280
- if subname == last_master:
1281
- # this device is current master
1282
- # maybe jack did a reset?
1283
- continue
1284
- sub_db = dev_db['sub'][subn]
1285
- if (conf_db['jack']['driver'] == "alsa") and (
1286
- conf_db['jack']['usbdev'] == subname):
1287
- logging.debug(
1288
- f"Changing jack master to: {subname}")
1289
- config_start()
1290
- return
1291
- if sub_db['play-pid'] or sub_db['cap-pid']:
1292
- # device in use already
1293
- continue
1294
- if conf_db['extra']['usbauto']:
1295
- # extra_devices()
1296
- start_slave(subname)
1297
- if subname == conf_db['extra']['phone-device']:
1298
- phones_switch(True)'''
1299
1254
1300
1255
1301
1256
def device_new ():
0 commit comments