[wdmaudiodev] Re: Programmatically changing a default play back device
- From: Eugene Muzychenko <reg.wad@xxxxxxxxxxxxxx>
- To: Matthew van Eerde <wdmaudiodev@xxxxxxxxxxxxx>
- Date: Thu, 14 Feb 2019 10:36:05 +0100
Reordering WinMM devices to put the default first is definitely
intentional for compatibility with apps that blindly use waveOutOpen(0).
What can be the meaning of supporting such applications? Even in the
early 90's, under Win3.x, such MME/WinMM application should specify
"-1" for the default (and controllable) device, instead of the "0" for
the first (and uncontrollable) one. If an application always specifies
"0", it is definitely poorly designed. But device reordering was
introduced only in XP (2001). Why MS started to support such poor
design many years later adding MME/WinMM, and continues to support it
for almost twenty years?
The WinMM APIs do have a mechanism to discover the underlying
WASAPI endpoint ID, for apps that are interested in identifying
devices with more specificity than “order in the list”.
Of course, but even a simple name scan is quite enough to identify the
proper endpoint in the list. The problem is that endpoints can be
reordered during application's activity. Most audio applications query
playback/recording endpoint names only on startup, and re-query them
only on demand. Since a particular endpoint is selected by the user,
its number is considered unchanged, until the endpoint exists in the
system. Sudden endpoint reordering is uncomfortable for every user and
application developer, except those inept developers who persistently
use the "0" instead of "-1".
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
URL to WDMAUDIODEV page:
Other related posts: