<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Вывод информации о треке из AIMP]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=7643</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7643&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Вывод информации о треке из AIMP».]]></description>
		<lastBuildDate>Wed, 22 May 2013 10:07:55 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72345#p72345</link>
			<description><![CDATA[<p>creature.ws, спасибо Вам за помощь</p>]]></description>
			<author><![CDATA[null@example.com (Тимур)]]></author>
			<pubDate>Wed, 22 May 2013 10:07:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72345#p72345</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72227#p72227</link>
			<description><![CDATA[<div class="codebox"><pre><code>«Оно» — id, передаваемый в wParam окну, слушающему WM_AIMP_NOTIFY. Зарегистрировать окно скрипта в качестве получателя уведомлений о (в часности) смене трека можно с помощью WM_AIMP_COMMAND и AIMP_RA_CMD_REGISTER_NOTIFY.</code></pre></div><p>Спасибо, буду пробовать.<br /></p><div class="codebox"><pre><code>Я плеером обсуждаемым не пользуюсь, в допиливании полноценной библиотеки не заинтересован.</code></pre></div><p> Плеером пользуюсь, но потребностей в полноценной библиотеке тоже нет. Интересуют пока только методы решения задач. <br /></p><div class="quotebox"><blockquote><p>Отнюдь не зря! Из кода, который в посте #14 можно извлечь всю информацию о треке. А из поста #23 - только имя исполнителя и название песни</p></blockquote></div><p>23 тоже не зря, я и неподумал про то что у аимп есть другие окна кроме ahk_class TAIMPMainForm, а окон у него оказалось 25 штук. Единственно что одного параметра ahk_class Winamp v1.x может быть недостаточно, например главное окно kmplayer тоже имеет такой класс, и нетолько kmplayer. Я бы записал как &quot;ahk_class Winamp v1.x&nbsp; ahk_exe AIMP3.exe&quot;.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 17 May 2013 17:37:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72227#p72227</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72221#p72221</link>
			<description><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><div class="quotebox"><blockquote><p>Дайте код, пожалуйста, на AHK 1.0.48.05 (Не L)</p></blockquote></div><p>И чтоб под windows 95 работал. 4 года с окончания поддержки — слишком малый срок для отказа от приложения.</p></blockquote></div><p>Я до сих пор на нем работаю <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (Тимур)]]></author>
			<pubDate>Fri, 17 May 2013 14:27:36 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72221#p72221</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72220#p72220</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Дайте код, пожалуйста, на AHK 1.0.48.05 (Не L)</p></blockquote></div><p>И чтоб под windows 95 работал. 4 года с окончания поддержки — слишком малый срок для отказа от приложения.</p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Fri, 17 May 2013 14:16:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72220#p72220</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72219#p72219</link>
			<description><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>В файле AIMPSDKRemote.h описаны способы взаимодействия с плеером «извне».<br />Получение информации о треке:<br /></p><div class="codebox"><pre><code>AIMP_GetTrackInfo() {
    static AIMPRemoteAccessClass := &quot;AIMP2_RemoteInfo&quot;
        , AIMPRemoteAccessMapFileSize := 2048
        , FILE_MAP_READ := 4


    if !hFile := DllCall(&quot;OpenFileMapping&quot;
        , &quot;UInt&quot;, FILE_MAP_READ
        , &quot;UInt&quot;, true
        , &quot;Ptr&quot;,  &amp;AIMPRemoteAccessClass)
    {
        return false
    }

    info := DllCall(&quot;MapViewOfFile&quot;
        , &quot;Ptr&quot;,  hFile
        , &quot;UInt&quot;, FILE_MAP_READ
        , &quot;UInt&quot;, 0
        , &quot;UInt&quot;, 0
        , &quot;Ptr&quot;,  AIMPRemoteAccessMapFileSize)

    size := NumGet(info|0, 0, &quot;UInt&quot;)
    textOffset := info + size

    albumLen    := NumGet(info|0, 40, &quot;UInt&quot;)
    artistLen   := NumGet(info|0, 44, &quot;UInt&quot;)
    dateLen     := NumGet(info|0, 48, &quot;UInt&quot;)
    fileNameLen := NumGet(info|0, 52, &quot;UInt&quot;)
    genreLen    := NumGet(info|0, 56, &quot;UInt&quot;)
    titleLen    := NumGet(info|0, 60, &quot;UInt&quot;)

    TrackInfo := {
    (Join,
        active     : NumGet(info|0, 4,  &quot;Int&quot;)
        bitRate    : NumGet(info|0, 8,  &quot;UInt&quot;)
        channels   : NumGet(info|0, 12, &quot;UInt&quot;)
        duration   : NumGet(info|0, 16, &quot;UInt&quot;)
        fileSize   : NumGet(info|0, 20, &quot;Int64&quot;)
        rating     : NumGet(info|0, 28, &quot;UInt&quot;)
        sampleRate : NumGet(info|0, 32, &quot;UInt&quot;)
        trackID    : NumGet(info|0, 36, &quot;UInt&quot;)
        album      : StrGet(textOffset,                    albumLen)
        artist     : StrGet(textOffset += albumLen * 2,    artistLen)
        date       : StrGet(textOffset += artistLen * 2,   dateLen)
        fileName   : StrGet(textOffset += dateLen * 2,     fileNameLen)
        genre      : StrGet(textOffset += fileNameLen * 2, genreLen)
        title      : StrGet(textOffset += genreLen * 2,    titleLen)
    )}

    DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, hFile)
    return TrackInfo
}</code></pre></div><p>Результат работы функции — ассоциативный массив, содержащий в соответствующих полях всю доступную информацию о файле, или 0, если «что-то пошло не так».</p><div class="codebox"><pre><code>Space::
    track := AIMP_GetTrackInfo()
    MsgBox % track.artist &quot; — &quot; track.title
    return</code></pre></div><p>При нажатии пробела — «вывод названия исполнителя и трека».</p></blockquote></div><p>Дайте код, пожалуйста, на AHK 1.0.48.05 (Не L)</p>]]></description>
			<author><![CDATA[null@example.com (Тимур)]]></author>
			<pubDate>Fri, 17 May 2013 14:02:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72219#p72219</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72214#p72214</link>
			<description><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>Браво. Код из сообщения #14 написан зря.</p></blockquote></div><p>Отнюдь не зря! Из кода, который в посте #14 можно извлечь всю информацию о треке. А из поста #23 - только имя исполнителя и название песни</p>]]></description>
			<author><![CDATA[null@example.com (Тимур)]]></author>
			<pubDate>Fri, 17 May 2013 13:08:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72214#p72214</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72213#p72213</link>
			<description><![CDATA[<p>Браво. Код из сообщения #14 написан зря.</p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Fri, 17 May 2013 13:04:36 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72213#p72213</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72211#p72211</link>
			<description><![CDATA[<p>Вот, что у меня получилось)<br /></p><div class="codebox"><pre><code>
DetectHiddenWindows, on
IfWinExist, ahk_class Winamp v1.x ; проверяем включен ли АИМП
{
    SendMessage, 0x400,, 104,, ahk_class Winamp v1.x ; проверяем не стоит ли на паузе
    if ErrorLevel = 1
    {
        WinGetTitle, Title, ahk_class Winamp v1.x ; получаем заголовок окна; он содержит имя исполнителя и название песни
        FoundPos := RegExMatch(Title, &quot;. &quot;) 
        StringTrimLeft, FoundPos, Title, FoundPos+1
        StringTrimRight, Title, FoundPos, 8    ; обрезаем и записываем в переменную Title
    }
}
Space::
msgbox %Title%
return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Тимур)]]></author>
			<pubDate>Fri, 17 May 2013 13:03:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72211#p72211</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72204#p72204</link>
			<description><![CDATA[<p>«Оно» — id, передаваемый в wParam окну, слушающему WM_AIMP_NOTIFY. Зарегистрировать окно скрипта в качестве получателя уведомлений о (в часности) смене трека можно с помощью WM_AIMP_COMMAND и AIMP_RA_CMD_REGISTER_NOTIFY.<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;-</div><div class="fancy_spoiler"><p><span style="color: silver">Я плеером обсуждаемым не пользуюсь, в допиливании полноценной библиотеки не заинтересован.</span></p></div></div>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Fri, 17 May 2013 10:50:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72204#p72204</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72160#p72160</link>
			<description><![CDATA[<p><strong>creature.ws</strong><br />Спасибо, понял.<br />Узнать громкость:<br /></p><div class="codebox"><pre><code>SendMessage, 0x0400+0x77, 0x50 , , , ahk_class AIMP2_RemoteInfo
MsgBox % ErrorLevel</code></pre></div><p>Установить громкость:<br /></p><div class="codebox"><pre><code>SendMessage, 0x0400+0x77, 0x50 | 1, 100, , ahk_class AIMP2_RemoteInfo</code></pre></div><br /><p>Ещё вопрос, как использовать это: &quot;AIMP_RA_NOTIFY_TRACK_INFO = AIMP_RA_NOTIFY_BASE + 1&quot; так понял оно тоже должно получать инфо о треке?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 16 May 2013 11:37:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72160#p72160</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72158#p72158</link>
			<description><![CDATA[<p>Константа AIMPRemoteAccessClass содержит имя класса окна в которое следует отправлять упомянутые сообщения.</p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Thu, 16 May 2013 11:03:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72158#p72158</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72156#p72156</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Первая ссылка в гугле</p></blockquote></div><p>Как всегда, очки на носу потерял <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Подумал что файл должен быть в папке с программой.</p><p>Так понял что есть ещё оконные сообщения, но непонял как ими пользоватся:<br /></p><div class="codebox"><pre><code>
WM_USER := 0x400
WM_AIMP_PROPERTY := WM_USER + 0x77
AIMP_RA_PROPVALUE_GET := 0 
AIMP_RA_PROPERTY_VERSION := 0x10

/* 
// Messages, which you can send to window with &quot;AIMPRemoteAccessClass&quot; class
// You can receive Window Handle via FindWindow function (see MSDN for details)
// + How to:
//     GET:  SendMessage(Handle, WM_AIMP_PROPERTY, PropertyID | AIMP_RA_PROPVALUE_GET, 0);
//     SET:  SendMessage(Handle, WM_AIMP_PROPERTY, PropertyID | AIMP_RA_PROPVALUE_SET, NewValue);
//
//     Receive Change Notification:
//       1) You should register notification hook using AIMP_RA_CMD_REGISTER_NOTIFY command
//       2) When property will change you receive WM_AIMP_NOTIFY message with following params:
//          WParam: AIMP_RA_NOTIFY_PROPERTY (Notification ID)
//          LParam: Property ID
*/

SendMessage, WM_AIMP_PROPERTY, AIMP_RA_PROPERTY_VERSION | AIMP_RA_PROPVALUE_GET, 0, , AIMP3
MsgBox % ErrorLevel
Return
</code></pre></div><p>Структура сообщения неверная, и что-то про окно &quot;AIMPRemoteAccessClass&quot;, может не то окно указываю.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 16 May 2013 10:39:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72156#p72156</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72155#p72155</link>
			<description><![CDATA[<p><a href="http://code.google.com/p/aimp-control-plugin/source/browse/src/aimp/aimp3_sdk/AIMPSDKRemote.h?name=default">Первая ссылка в гугле</a></p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Thu, 16 May 2013 09:57:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72155#p72155</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72154#p72154</link>
			<description><![CDATA[<p>А где лежит AIMPSDKRemote.h, я его ненашёл.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 16 May 2013 09:21:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72154#p72154</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Вывод информации о треке из AIMP]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=72153#p72153</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>получить весь текущий плейлист</p></blockquote></div><p>В AIMPSDKRemote.h нет упоминаний о подобном.</p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Thu, 16 May 2013 09:19:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=72153#p72153</guid>
		</item>
	</channel>
</rss>
