<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Смена устройства воспроизведения по умолчанию]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=12380</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12380&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Смена устройства воспроизведения по умолчанию».]]></description>
		<lastBuildDate>Mon, 30 Jan 2017 17:37:15 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Смена устройства воспроизведения по умолчанию]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=111666#p111666</link>
			<description><![CDATA[<p>Спасибо, все работает.</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Mon, 30 Jan 2017 17:37:15 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=111666#p111666</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Смена устройства воспроизведения по умолчанию]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=111665#p111665</link>
			<description><![CDATA[<p>Требуется <a href="https://autohotkey.com/board/topic/21984-/">библиотека VA</a>.<br /><a href="https://autohotkey.com/board/topic/2306-changing-default-audio-device/page-7#entry595947">Оригинал</a>.<br /></p><div class="codebox"><pre><code>
loop
	MsgBox % SwapAudioDevice(&quot;AAA-8&quot;, &quot;Динамики&quot;)

SwapAudioDevice(device_A, device_B)
{
    ; Get device IDs.
    A := VA_GetDevice(device_A), VA_IMMDevice_GetId(A, A_id)
    B := VA_GetDevice(device_B), VA_IMMDevice_GetId(B, B_id)
    if A &amp;&amp; B
    {
        ; Get ID of default playback device.
        default := VA_GetDevice(&quot;playback&quot;)
        VA_IMMDevice_GetId(default, default_id)
        ObjRelease(default) 
        ; If device A is default, set device B; otherwise set device A.
        VA_SetDefaultEndpoint(default_id == A_id ? B : A, 0)
    }
    ObjRelease(B)
    ObjRelease(A)
    if !(A &amp;&amp; B)
        throw Exception(&quot;Unknown audio device&quot;, -1, A ? device_B : device_A)
	Return default_id == A_id ? device_B : device_A
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 30 Jan 2017 16:12:13 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=111665#p111665</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Смена устройства воспроизведения по умолчанию]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=111660#p111660</link>
			<description><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=6315/">Тут</a> написано.</p>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Mon, 30 Jan 2017 15:11:06 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=111660#p111660</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Смена устройства воспроизведения по умолчанию]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=111658#p111658</link>
			<description><![CDATA[<p>Здравствуйте, появилась необходимость быстро менять устройство по умолчанию. Мне будет удобно, если это будет на AHK, потому обращаюсь к вам. Вот скриншот моих устройств воспроизведения:</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p><span class="postimg"><img src="http://image.prntscr.com/image/827026aee9fc4bfea0b5af3d6803d3bc.png" alt="http://image.prntscr.com/image/827026aee9fc4bfea0b5af3d6803d3bc.png" /></span></p></div></div><p>Мне нужно, чтобы я смог сменить устройство &quot;Динамики&quot; на &quot;AAA-8&quot; и обратно соответственно. Есть два варианта:<br />1) Проверка какое устройство сейчас по умолчанию и переключение на другое;<br />2) Два отдельных скрипта, при запуске которого каждый ставит по умолчанию свое устройство.</p><p>Первый вариант мне предпочтительнее конечно, но не буду требовать от вас слишком многого. Надеюсь на вашу помощь.</p><p>P.S. Устройство Headphone мне не нужно совсем, его можете не учитывать.</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Mon, 30 Jan 2017 14:23:34 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=111658#p111658</guid>
		</item>
	</channel>
</rss>
