Skip to content
Snippets Groups Projects
Commit 423f51e7 authored by Vincent Lucas's avatar Vincent Lucas
Browse files

Activates the use of model identifier for audio device.

parent b3fa7044
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,7 @@ public ExtendedCaptureDeviceInfo getDevice( ...@@ -73,7 +73,7 @@ public ExtendedCaptureDeviceInfo getDevice(
ExtendedCaptureDeviceInfo activeDevice = activeDevices.get(i); ExtendedCaptureDeviceInfo activeDevice = activeDevices.get(i);
if(!devicePreferences.contains( if(!devicePreferences.contains(
activeDevice.getIdentifier())) activeDevice.getModelIdentifier()))
{ {
// Adds the device in the preference list (to the end of the // Adds the device in the preference list (to the end of the
// list, but the save device will push it to the top of // list, but the save device will push it to the top of
...@@ -98,7 +98,7 @@ public ExtendedCaptureDeviceInfo getDevice( ...@@ -98,7 +98,7 @@ public ExtendedCaptureDeviceInfo getDevice(
// If we have found the "preferred" device among active // If we have found the "preferred" device among active
// device. // device.
if(devicePreference.equals( if(devicePreference.equals(
activeDevice.getIdentifier())) activeDevice.getModelIdentifier()))
{ {
return activeDevice; return activeDevice;
} }
...@@ -210,7 +210,7 @@ private void saveDevice( ...@@ -210,7 +210,7 @@ private void saveDevice(
String selectedDeviceIdentifier String selectedDeviceIdentifier
= (device == null) = (device == null)
? NoneAudioSystem.LOCATOR_PROTOCOL ? NoneAudioSystem.LOCATOR_PROTOCOL
: device.getIdentifier(); : device.getModelIdentifier();
// Sorts the user preferences to put the selected device on top. // Sorts the user preferences to put the selected device on top.
addToDevicePreferences( addToDevicePreferences(
...@@ -306,7 +306,7 @@ private void addToDevicePreferences( ...@@ -306,7 +306,7 @@ private void addToDevicePreferences(
for(ExtendedCaptureDeviceInfo activeDevice : activeDevices) for(ExtendedCaptureDeviceInfo activeDevice : activeDevices)
{ {
if(devicePreference.equals( if(devicePreference.equals(
activeDevice.getIdentifier()) activeDevice.getModelIdentifier())
|| devicePreference.equals( || devicePreference.equals(
NoneAudioSystem.LOCATOR_PROTOCOL)) NoneAudioSystem.LOCATOR_PROTOCOL))
{ {
...@@ -337,12 +337,12 @@ private void renameOldFashionedIdentifier( ...@@ -337,12 +337,12 @@ private void renameOldFashionedIdentifier(
for(ExtendedCaptureDeviceInfo activeDevice : activeDevices) for(ExtendedCaptureDeviceInfo activeDevice : activeDevices)
{ {
String name = activeDevice.getName(); String name = activeDevice.getName();
String id = activeDevice.getIdentifier(); String id = activeDevice.getModelIdentifier();
// We can only switch to the new fashioned notation, only if the OS // We can only switch to the new fashioned notation, only if the OS
// API gives us a unique identifier (different from the device // API gives us a unique identifier (different from the device
// name). // name).
if(id != null) if(!name.equals(id))
{ {
synchronized(devicePreferences) synchronized(devicePreferences)
{ {
......
...@@ -142,7 +142,7 @@ public String getUID() ...@@ -142,7 +142,7 @@ public String getUID()
*/ */
public String getModelIdentifier() public String getModelIdentifier()
{ {
return modelIdentifier; return (modelIdentifier == null) ? name : modelIdentifier;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment