Orion9

|
Posted: Thu Feb 12, 2026 14:02 Post subject: |
|
|
Внес некоторые изменения в модуль MediaInfo.aucfg.
Раньше была возможность разделить панель на три области, чтобы отображать в каждой области свою подсказку. Теперь при удержании Shift в подсказке также отображаются данные из плагинов, тем самым общее количество подсказок возросло до шести!
Если добавить сюда переключение полей (функция реализована в модуле как SetHintFields, вызывается по Alt+F12), количество подсказок можно увеличивать до беспредела
Однако пока Alt+F12 ограничивается только переключением на ExifHint и JoinHint, при этом JoinHint больше не актульна, хотя может быть использована в качестве примера вывода данных в окно подсказки.
Алгоритм вывода данных из плагинов ранее был реализован в функции JoinHint. Я перенес его в модуль MediaInfo.aucfg и добавил небольшие изменения.
Как это работает. В подсказку выводятся все непустые поля из заранее указанных плагинов в файле WdxHint.cfg. Пример файла:
| Code: | File.wdx;UnicodeTest.wdx;FileX.wdx
Permissions.wdx;NTLinks.wdx;NTFSFileStreams.wdx
anytag.wdx
Script.wdx;WinScriptsAdv.wdx |
Соответственно, первая строка в файле выводит в первую область панели данные из плагинов File.wdx, UnicodeTest.wdx и FileX.wdx. Вторая строка выводит во вторую область панели, а третья в третью. Комбинация плагинов в строке может быть любой. Путь к файлу WdxHint.cfg указывается в глобальной переменной наряду с другими параметрами подсказки MediaInfo:
| Code: | Global gHintPipe = "", _
gHintClipb = true, _
gHintLines = 60, _
gHintWait = 0, _
gHintShift = "duration.txt", _
gHintCaps = true
Global gHintWdx = 0, _
gHintWdxList = List(), _
gHintWdxCfg = COMMANDER_PATH & "\Ini\WdxHint.cfg"
Global gHintLayout = List(10, 75, 15), _
gHintContent = List("size.txt", "Inform", "hint.txt"), _
gHintSleep = List(0, 0, 0) |
Переменные должны быть объявлены в модуле autorun.cfg, желательно сразу после инструкции Pragma AutorunPluginFields, чтобы избежать ошибки инициализации при запуске ТС (об этом подробнее по первой ссылке).
gHintPipe, gHintWdx и gHintWdxList используются для внутренних целей, менять их значения не нужно. Остальных переменные описавались ранее, как и примеры их использования:
 Hidden text gHintClipb - копировать в буфер всю подсказку при отображении в страничном режиме
gHintLines - число строк подсказки, больше 60 быть не может
gHintWait - задержка для всех секций перед отображением
gHintShift - шаблон для смены "на лету", только для левой секции
gHintCaps - если false, подсказка будет отображаться без CapsLock или Ctrl
gHintLayout - размер каждой секции в процентах
gHintContent - шаблон для каждой секции; если пустой "", в секцию ничего не попадает, кроме самой подсказки ТС или проводника; если "Inform" - стандартный отчет MediaInfo; если имя файла, то шаблон из файла (файлы должны находиться в каталоге MediaInfo.dll, существование файла не проверяется, в случае отсутствия сообщений об ошибке не будет, отобразится сырой результат отчета MediaInfo).
gHintSleep - задержка для каждой секции.
Пара примеров.
| Code: | gHintCaps = false
gHintLayout = List(15, 70, 15)
gHintContent = List("Inform", "", "duration.txt")
gHintSleep = List(500, 0, 0) |
Подсказка будет вызываться всегда (CapsLock отключен). Левая секция - 15%, Центр - 70%, Правая секция - 15%. В левой секции стандартный отчет MediaInfo с задержкой 500 млс, в центре ничего не выводится, в правой секции шаблон duration.txt.
| Code: | gHintCaps = true
gHintLayout = List(10, 80, 10)
gHintContent = List("size.txt", "hint.txt", "Inform")
gHintSleep = List(0, 0, 0) |
Подсказка вызывается дополнительно (CapsLock включен). Левая секция - 10%, Центр - 80%, Правая секция - 10%. В левой секции шаблон size.txt, в центре шаблон hint.txt, в правой секции стандартный отчет MediaInfo. Отдельных задержек перед вызовом нет.
Дополнительно шаблон в левой секции может меняться "на лету" с тем, что указан в gHintShift. Комбинация для смены Alt+5.
Кроме Alt+5 действуют еще 4 комбинации: Alt+1..Alt+4. Каждая из этих комбинаций выводит одну страницу последней подсказки и опционально копирует ее в буфер. Такое применение удобно на очень больших подсказках, которые обрезаются на 60-и строках, оставляя одну страницу просмотра. Нажав Alt+2 можно переместиться на вторую страницу и так далее. Всего четыре страницы.
В подсказке используются шаблоны MediaInfo: текстовые файлы с собственной разметкой и синтаксисом. Внося изменения в эти файлы, можно подстраивать под себя вывод из MediaInfo.dll. Сейчас используются три шаблона hint.txt, size.txt и duration.txt, можно создать другие или полностью передлать эти.
 hint.txt General;"Name: %FileName%.%FileExtension%\nSize: %FileSize/String4%\n[Duration: %Duration%]\n[Duration: %Duration/String1%]\n[Duration: %Duration/String5%]\n
[General: %BitRate/String%][(%BitRate_Mode%)][, %Format%]$if(%Cover%,\, Cover)$if(%IsStreamable%,\, Streamable)[, %FrameRate/String%]"\n
Video;Video #%StreamKindID%: [%Width%x%Height%][, %Format%][(%Format/Family%)][, %Language%][, %AspectRatio/String% (%AspectRatio%)][, %Resolution/String%][, %FrameRate/String%][, %BitRate/String%][(%BitRate_Mode%)]\n
Video_Begin;
Video_Middle;
Video_End;\n
Audio;Audio #%StreamKindID%: [%Channel(s)%ch][, %SamplingRate/String%][, %BitRate/String%][ (%BitRate_Mode%)][, %Format%][, %Format_Profile%][, %Language%][, %FrameRate/String%]\n
Audio_Begin;
Audio_Middle;
Audio_End;\n
Text;Text #%StreamKindID%: %Format%[, %Language/String3%][, %StreamSize/String3%][, %BitRate/String%][, %FrameRate/String%][, %SamplingRate/String%]\n
Text_End;\n
Chapters;Chapters #%StreamKindID%: %Total% chapters\n
Image;Image #%StreamKindID%: [%Width%x%Height%pix][, %Format%][, %StreamSize/String5%][, %ColorSpace% (%ChromaSubsampling%)][, %BitDepth/String%][, %ColorSpace_ICC%]\n
Menu;Menu #%StreamKindID%: [%MenuID/String%][, Format:%Format/String%][ Chapters: \[%Chapters_Pos_Begin%-%Chapters_Pos_End%\]]
 size.txt General;Name: %FileName%.%FileExtension%\r\nSize: %FileSize/String4%\r\nGeneral: [%StreamSize/String%]\r\n
Video;Video #%StreamKindID%: [%StreamSize/String%]\r\n
Audio;Audio #%StreamKindID%: %StreamSize/String%[ - %Language/String%][ | %Title%]\r\n
 duration.txt General;Name: %FileName%.%FileExtension%\r\nSize: %FileSize/String4%\r\nGeneral:\r\n [Duration: %Duration%]\r\n [Duration: %Duration/String1%]\r\n [Duration: %Duration/String5%]\r\n
Video;Video #%StreamKindID%: \r\n [Duration: %Duration%]\r\n [Duration: %Duration/String1%]\r\n [Duration: %Duration/String5%]\r\n
Audio;Audio #%StreamKindID%: \r\n [Duration: %Duration%]\r\n [Duration: %Duration/String1%]\r\n [Duration: %Duration/String5%]\r\n
Шаблоны должны находиться в каталоге библиотеки.
Также в файле autorun.cfg самой первой строкой должны быть прописаны поля подсказки в инструкции Pragma AutorunPluginFields:
| Code: | Pragma AutorunPluginFields "C1:::MediaHint" "C2:::MediaHint" "C3:::MediaHint" "C4:::MediaHint" "C5:::MediaHint" "C6:::MediaHint" "C7:::MediaHint" "C8:::MediaHint" "C9:::MediaHint" "C10:::MediaHint" "C11:::MediaHint" "C12:::MediaHint" "C13:::MediaHint" "C14:::MediaHint" "C15:::MediaHint" "C16:::MediaHint" "C17:::MediaHint" "C18:::MediaHint" "C19:::MediaHint" "C20:::MediaHint" "C21:::MediaHint" "C22:::MediaHint" "C23:::MediaHint" "C24:::MediaHint" "C25:::MediaHint" "C26:::MediaHint" "C27:::MediaHint" "C28:::MediaHint" "C29:::MediaHint" "C30:::MediaHint" "C31:::MediaHint" "C32:::MediaHint" "C33:::MediaHint" "C34:::MediaHint" "C35:::MediaHint" "C36:::MediaHint" "C37:::MediaHint" "C38:::MediaHint" "C39:::MediaHint" "C40:::MediaHint" "C41:::MediaHint" "C42:::MediaHint" "C43:::MediaHint" "C44:::MediaHint" "C45:::MediaHint" "C46:::MediaHint" "C47:::MediaHint" "C48:::MediaHint" "C49:::MediaHint" "C50:::MediaHint" "C51:::MediaHint" "C52:::MediaHint" "C53:::MediaHint" "C55:::MediaHint" "C55:::MediaHint" "C56:::MediaHint" "C57:::MediaHint" "C58:::MediaHint" "C59:::MediaHint" "C60:::MediaHint" |
Указанные 60 полей должны быть предварительно добавлены в секцию HintsCustomField основной конфигурации ТС, т.е. в секции должны быть два щаблона *.* по 30 полей каждый, которые должны ее замыкать.
Возможные сценарии.
1) Если в секции нет других расширений. Достаточно просто применить готовый вариант:
 Hidden text | Code: | [HintsCustomField]
0exts=*.*
0fields=[=autorun.C1]\n[=autorun.C2]\n[=autorun.C3]\n[=autorun.C4]\n[=autorun.C5]\n[=autorun.C6]\n[=autorun.C7]\n[=autorun.C8]\n[=autorun.C9]\n[=autorun.C10]\n[=autorun.C11]\n[=autorun.C12]\n[=autorun.C13]\n[=autorun.C14]\n[=autorun.C15]\n[=autorun.C16]\n[=autorun.C17]\n[=autorun.C18]\n[=autorun.C19]\n[=autorun.C20]\n[=autorun.C21]\n[=autorun.C22]\n[=autorun.C23]\n[=autorun.C24]\n[=autorun.C25]\n[=autorun.C26]\n[=autorun.C27]\n[=autorun.C28]\n[=autorun.C29]\n[=autorun.C30]
1exts=*.*
1fields=[=autorun.C31]\n[=autorun.C32]\n[=autorun.C33]\n[=autorun.C34]\n[=autorun.C35]\n[=autorun.C36]\n[=autorun.C37]\n[=autorun.C38]\n[=autorun.C39]\n[=autorun.C40]\n[=autorun.C41]\n[=autorun.C42]\n[=autorun.C43]\n[=autorun.C44]\n[=autorun.C45]\n[=autorun.C46]\n[=autorun.C47]\n[=autorun.C48]\n[=autorun.C49]\n[=autorun.C50]\n[=autorun.C51]\n[=autorun.C52]\n[=autorun.C53]\n[=autorun.C54]\n[=autorun.C55]\n[=autorun.C56]\n[=autorun.C57]\n[=autorun.C58]\n[=autorun.C59]\n[=autorun.C60] |
2) Если в секции есть другие шаблоны и маски. Нужно добавить по последнему номеру, например:
 Hidden text | Code: | [HintsCustomField]
0exts=>NTFS Ссылка
0fields=[=ntlinks.Obj_Type]\n[=ntlinks.Obj_RealPath.Natural]
1exts=*.apk
1fields=Название: [=apk.Application Name ru]\nВерсия: [=apk.Version] ([=apk.Version Code])\nПакет: [=apk.Package]\nAndroid: [=apk.Min SDK Name]
2exts=*.aucfg; autorun.cfg;*.ini;*.ahk; ;*.au3; *.vbs; *.bat; *.ps1
2fields=Число строк: [=linebreakinfo.CRLF Count]\nБайт прочитано: [=linebreakinfo.Bytes Read] |
Ключи в секции заканчиваются вторым номером (0ext-2ext). Новые ключи нужно добавлять с третьего:
| Code: | [HintsCustomField]
0exts=>NTFS Ссылка
0fields=[=ntlinks.Obj_Type]\n[=ntlinks.Obj_RealPath.Natural]
1exts=*.apk
1fields=Название: [=apk.Application Name ru]\nВерсия: [=apk.Version] ([=apk.Version Code])\nПакет: [=apk.Package]\nAndroid: [=apk.Min SDK Name]
2exts=*.aucfg; autorun.cfg;*.ini;*.ahk; ;*.au3; *.vbs; *.bat; *.ps1
2fields=Число строк: [=linebreakinfo.CRLF Count]\nБайт прочитано: [=linebreakinfo.Bytes Read]
3exts=*.*
3fields=[=autorun.C1]\n[=autorun.C2]\n[=autorun.C3]\n[=autorun.C4]\n[=autorun.C5]\n[=autorun.C6]\n[=autorun.C7]\n[=autorun.C8]\n[=autorun.C9]\n[=autorun.C10]\n[=autorun.C11]\n[=autorun.C12]\n[=autorun.C13]\n[=autorun.C14]\n[=autorun.C15]\n[=autorun.C16]\n[=autorun.C17]\n[=autorun.C18]\n[=autorun.C19]\n[=autorun.C20]\n[=autorun.C21]\n[=autorun.C22]\n[=autorun.C23]\n[=autorun.C24]\n[=autorun.C25]\n[=autorun.C26]\n[=autorun.C27]\n[=autorun.C28]\n[=autorun.C29]\n[=autorun.C30]
4exts=*.*
4fields=[=autorun.C31]\n[=autorun.C32]\n[=autorun.C33]\n[=autorun.C34]\n[=autorun.C35]\n[=autorun.C36]\n[=autorun.C37]\n[=autorun.C38]\n[=autorun.C39]\n[=autorun.C40]\n[=autorun.C41]\n[=autorun.C42]\n[=autorun.C43]\n[=autorun.C44]\n[=autorun.C45]\n[=autorun.C46]\n[=autorun.C47]\n[=autorun.C48]\n[=autorun.C49]\n[=autorun.C50]\n[=autorun.C51]\n[=autorun.C52]\n[=autorun.C53]\n[=autorun.C54]\n[=autorun.C55]\n[=autorun.C56]\n[=autorun.C57]\n[=autorun.C58]\n[=autorun.C59]\n[=autorun.C60] |
После добавления полей в секцию, нужно зайти в диалог Настройки -> Содержимое панелей -> Пользовательские и поставить галочку "Объединять все подсказки, подходящие по типу файлов".
Всё. Предварительная часть установки завершена. Осталось подключить модуль.
Модуль подключается стандартно, директивой Pragma Include, в основной конфигурации Autorun:
| Code: | Pragma Include %COMMANDER_PATH%\Ini\Scripts\MediaInfo.aucfg |
После перезапуска ТС альтернативная подсказка из модуля должна отображаться на панелях при наведении курсора мыши на нужный файл с удержанием CTRL или включеном CapsLock. Однако CTRL работает только в 32-битной версии ТС из-за некоторых ограничений.
Окно панели поделится на 3 части: 10% справа, 75% центр, 15% слева. В каждой области отображается своя подсказка из MediaInfo.dll. Удержание Shift переключает отображение на плагины. Поскольку Shift не работает в TCx64, как и CTRL, переключением доступно только через Win+CapsLock. Данная комбинация работает и в TCx32.
Кроме подсказки, в модуле реализована кнопка для подсчета времени воспроизведения у выделенных файлов и каталогов. Код кнопки 71000. Подробнее о функционале здесь
Сам по себе модуль автономный, если не считать манипуляций описанных выше, связанных прежде всего с установкой подсказки в качестве альтернативной. В заголовке модуля требуется только указать корректные пути к библиотеке MediaHint.dll и утилите ExiTool:
 MediaInfo.aucfg | Code: | Pragma IncludeOnce
# 71000-71099
RegisterCommand 71000 "Duration"
RegisterCommand 71010 "MediaInfoTest"
# Alt+F12
SetHotkeyAction /K:A /H:F12 SetHintFields
# Alt+1(..5)
SetHotkeyAction /K:A /H:1 /DM /S ShowPipeEx 0 1
SetHotkeyAction /K:A /H:2 /DM /S ShowPipeEx 0 2
SetHotkeyAction /K:A /H:3 /DM /S ShowPipeEx 0 3
SetHotkeyAction /K:A /H:4 /DM /S ShowPipeEx 0 4
SetHotkeyAction /K:A /H:5 /DM /S LeftsideHintType
# Win+CapsLock
SetHotkeyAction /V:20 /K:W MediaHintType
Global gMediaInfoX32 = COMMANDER_PATH & "\Ini\Tools\Libs\MediaInfo_i386.dll"
Global gMediaInfoX64 = COMMANDER_PATH & "\Ini\Tools\Libs\MediaInfo.dll"
Global gMediaExifX32 = COMMANDER_PATH & "\Plugins\wlx\ExifToolView\exiftool.exe"
Global gDurationInfo = 0, gDurationBreak = false, gDurationBaloon = 1, gDurationTXT
Global gFilterAudio = ".aac .ac3 .aif .aiff .aifc .afc .ape .au .snd .cda .dsf .dts .dtswav .dtshd .dtsma .eac3 .flac .fla .m1a .m2a .mka .mpa .mp1 .mp2 .mp3 .mp4 .m4a .m4b .m4r .mod .mpc .mp+ .mpp .oga .ogx .ogg .ra .spx .opus .qoa .svx .8svx .tak .tta .wav .wave .w64 .bwf .rf64 .wma .wv"
Global gFilterVideo = ".avi .wmv .wmp .wm .asf .mpg .mpeg .mpe .m1v .m2v .mpv2 .mp2v .ts .tp .tpr .trp .vob .ifo .ogm .ogv .mp4 .m4v .m4p .m4b .3gp .3gpp .3g2 .3gp2 .mkv .rm .ram .rmvb .rpm .flv .swf .mov .qt .amr .nsv .dpg .m2ts .m2t .mts .dvr-ms .k3g .skm .evo .nsr .amv .divx .webm .wtv .f4v .mxf"
Global gBTipWndProc, gBTipWnd = Map(), gBTip = 0
Global gBText = Buffer(1024*4), gBTool = Buffer(auX64 ? 56 : 40)
Global gBTipX, gBTipY
Global gBTipWP = Callback("BTipWndProc", "hwnd;uint;wparam;lparam")
Func Duration(lParam)
If gDurationInfo > 0 Then
gDurationBreak = true
Sleep(250)
Return
EndIf
If gDurationBaloon Then
gBTip = CreateBaloonTip("MediaInfo", 1, 200)
If gBTip = 0 Then Return MsgBox("Не удалось создать окно подсказки BaloonTip")
EndIf
RunThread DurationInfo
EndFunc
Func DurationInfo()
Local T1 = GetUptime(), T2 = T1
Local bCaps = BitAND(DllCall("GetKeyState", "int", 0x14, "short"), 1)
Local bCtrl = IsPressed(0x11), bShift = IsPressed(0x10), bAlt = IsPressed(0x12)
Static sLib = auX64 ? gMediaInfoX64 : gMediaInfoX32
Static hLib = DllCall("LoadLibrary", "wstr", sLib, "ptr")
Static sExt = gFilterAudio & " " & gFilterVideo
If Not bAlt Then
If hLib = 0 Then
ShowMediaHint("Error LoadLibrary " & sLib)
Return
EndIf
Static pNew = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_New", "Ptr")
Static pOpen = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Open", "Ptr")
Static pGet = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Get", "Ptr")
Static pDel = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Delete", "Ptr")
Local hMI = DllCall(pNew, "Ptr")
If hMI = 0 Then
ShowMediaHint("MediaInfo.dll couldn't create new object")
Return
Endif
Else
Local obj = Plugin("TCMediaInfo")
If ERROR <> 0 Then
ShowMediaHint("TCMediaInfo.wdx plugin error " & ERROR)
Return
Endif
EndIf
Local sDuration
Local aSel = List()
aSel.Text = GetSelectedItems(3, 0)
Local sPath = RequestCopyDataInfo("SP")
Local sName = RequestCopyDataInfo("SN")
Local sFile = sPath & sName
If aSel.Count = 0 Then
If Not FileExist(sFile) Then
ShowMediaHint("Файл не существует " & sFile)
Free(aSel)
If bAlt Then Free(obj)
Return
Endif
EndIf
If aSel.Count = 0 And Not StrPos(FileGetAttr(sFile), "D") Then
Free(aSel)
If bAlt Then
obj.FileName = sFile
sDuration = obj.GetValue(0) # duration
Free(obj)
Else
If DllCall(pOpen, "Ptr", hMI, "Wstr", sFile, "Uint") <> 1 Then
Return ShowMediaHint("MediaInfo.dll coudn't open file " & sFile)
EndIf
sDuration = DllCall(pGet, "Ptr", hMI, "Int", 0, "Int", 0, _
"Wstr", "Duration/String3", "Int", 1, "Int", 0, "Wstr")
EndIf
Return ShowMediaHint("Файл: " & sName & auCRLF & "Длительность: " & sDuration, 1)
Endif
gDurationInfo = 1
gDurationBreak = false
ShowMediaHint("Загрузка", 1)
Local i, j, valid = 0
Local dirs = 0, files = 0, errs = 0, item = 0, aFiles = List(), seconds = 0, b_Hint = 0
Local depth = (bCtrl ? 1 : 0), ms = 0, vc, ac
bExtLog = false
# загрузка файлов в массив
If aSel.Count > 0 Then
For j = 0 To aSel.Count - 1
sFile = sPath & aSel[j]
If FileExist(sFile) Then
valid += 1
aFiles.Add(sFile)
If StrPos(FileGetAttr(sFile), "D") Then
If ListMediaFiles(sFile, aFiles, depth) > 0 Then aFiles.Count = 0
EndIf
EndIf
Next
sName = aSel.Count & "/" & valid
Else
aFiles.Add(sFile)
ListMediaFiles(sFile, aFiles, depth)
EndIf
Free(aSel)
If aFiles.Count > 1 Then
ShowMediaHint("Depth: " & depth & auCRLF & _
"Filter: " & (Not bShift ? "Yes" : "No") & auCRLF & _
(bAlt ? "TCMediaInfo.wdx" : "MediaInfo.dll") & auCRLF & _
"Элементов: " & aFiles.Count & auCRLF & _
"Подсчёт времени...", 1)
EndIf
T2 = GetUptime()
DurationLogString("Duration.Name:" & sName)
DurationLogString("Duration.Items:" & aFiles.Count)
For i = 0 To aFiles.Count - 1
If bExtLog Then DurationLogString("Duration.File:" & aFiles[i])
If StrPos(FileGetAttr(aFiles[i]), "D") Then
dirs += 1
If bExtLog Then DurationLogString("Duration.Directory:" & aFiles[i])
Continue
EndIf
item += 1
If bAlt Then
obj.FileName = aFiles[i]
ms = obj.GetValue(0,3) # duration -> milliseconds
Else
ext = FileGetExt(aFiles[i])
If Not bShift Then
If Not StrPos(sExt, '.' & ext) Then
DurationLogString("Duration.Filter:" & aFiles[i])
Continue
EndIf
EndIf
If DllCall(pOpen, "Ptr", hMI, "Wstr", aFiles[i], "Uint") <> 1 Then
errs += 1
DurationLogString("Duration.Error:" & aFiles[i])
Continue
EndIf
ms = DllCall(pGet, "Ptr", hMI, "Int", 0, "Int", 0, _
"Wstr", "Duration", "Int", 1, "Int", 0, "Wstr")
vc = DllCall(pGet, "Ptr", hMI, "Int", 0, "Int", 0, _
"Wstr", "VideoCount", "Int", 1, "Int", 0, "Wstr")
ac = DllCall(pGet, "Ptr", hMI, "Int", 0, "Int", 0, _
"Wstr", "AudioCount", "Int", 1, "Int", 0, "Wstr")
If ms > 0 And vc = "" And ac = "" Then
DurationLogString("Duration.Warning:" & aFiles[i])
Continue
EndIf
EndIf
If ms > 0 Then
seconds += ms
files += 1
Else
DurationLogString("Duration.Empty:" & aFiles[i])
EndIf
If gDurationBreak = true Or (IsPressed (0x11) And IsPressed (0x1B)) Then
ShowMediaHint("Операция прервана", 1)
Sleep(500)
If gDurationBaloon Then
Static buf = Buffer(160)
buf.Zero()
buf.SetStr("Прервано" & Chr(0))
SendMessage(gBTip, 1057, 3, buf.ptr)
EndIf
Break
EndIf
If Round(GetUptime() - T2, 0) > 500 Then
ShowMediaHint("Depth: " & depth & auCRLF & _
"Filter: " & (Not bShift ? "Yes" : "No") & auCRLF & _
(bAlt ? "TCMediaInfo.wdx" : "MediaInfo.dll") & auCRLF & _
"Элементов: " & aFiles.Count & auCRLF & _
"Обработка: " & i & " из " & aFiles.Count, 1)
T2 = GetUptime()
EndIf
Next
If bAlt Then Free(obj)
If Not bAlt And hMI <> 0 Then DllCall(pDel, "Ptr", hMI)
gDurationInfo = 0
gDurationBreak = false
seconds = Floor(seconds / 1000)
Local day = Floor(seconds / 86400)
Local hour = Floor((seconds - (day * 86400)) / 3600)
Local min = Floor(((seconds - (day * 86400)) - (hour * 3600)) / 60)
Local sec = seconds - (day * 86400 + hour * 3600 + min * 60)
Local total = StrFormat("%02d:%02d:%02d:%02d",day,hour,min,sec)
Local tl = Round(GetUptime() - T1, 0) / 1000
Local txt = "Имя: " & sName & auCRLF & _
"Каталогов: " & dirs & auCRLF & _
"Элементов: " & aFiles.Count & auCRLF & _
"Обработано: " & files & " из " & item & auCRLF & _
"Ошибки DLL: " & errs & auCRLF & _
"Секунды: " & seconds & auCRLF & _
"Минуты: " & Round(seconds / 60, 2) & auCRLF & _
"Часы: " & Round(seconds / 3600, 2) & auCRLF & _
"Сутки: " & Round(seconds / 86400, 2) & auCRLF & _
"Время: " & Chr(0x2211) & " "& total & auCRLF & _
"Powered by " & (bAlt ? "TCMediaInfo.wdx" : "MediaInfo.dll") & auCRLF & _
"Время операции: " & StrFormat("%.3f", tl) & " sec"
DurationLogString(txt & auCRLF & auCRLF)
Free(aFiles)
ClipPut(txt)
ShowMediaHint(txt, 1)
EndFunc
Func ListMediaFiles(sPath, ByRef aList, nDepth = 1)
Local sFile, nAttr
Local ffd = Buffer(604), bEsc = false
Local hf = DllCall("FindFirstFileW", "wstr", sPath & "\*.*", "ptr", ffd.Ptr)
If hf <> 0 then
While True
sFile = ffd.GetStr(44) # cFileName
nAttr = ffd.GetNum(0, "dword") # dwFileAttributes
If BitAND(nAttr, 16) Then
If Not ((sFile = ".") Or (sFile = "..")) Then
aList.Add(sPath & "\" & sFile)
If nDepth <> 1 Then
ListMediaFiles(sPath & "\" & sFile, aList, nDepth - 1)
EndIf
EndIf
Else
aList.Add(sPath & "\" & sFile)
Endif
If DllCall("FindNextFileW", "handle", hf, "ptr", ffd.Ptr) = 0 Then Break
If IsPressed (0x1B) Then
bEsc = true
Break
EndIf
Wend
DllCall("FindClose", "handle", hf)
Endif
Free(ffd)
Return bEsc
EndFunc
Func DurationLogString(LogString)
gDurationTXT &= LogString & auCRLF
EndFunc
Func ShowMediaHint(MediaHint, Persist = false)
# удаление подсказки тотала
If gDurationBaloon And gBTip > 0 Then
Local hTip = WinFind(0, "TToolTip")
If hTip > 0 Then SendMessage(hTip, 0x0010, 0, 0)
UpdateBaloonTip(gBTip, MediaHint)
Return
EndIf
SetHintParam("ShowHint", "Font", 11, "Arial")
#SetHintParam("ShowHint", "BackColor", 0x000000)
#SetHintParam("ShowHint", "Text", 0xFFFFFF)
SetHintParam("ShowHint", "DarkBackColor", 0xFF0000)
SetHintParam("ShowHint", "DarkText", 0xFFFFFF)
If Persist Then
ShowHint(MediaHint)
Else
ShowHint(MediaHint, "", "", 3000, 1)
EndIf
Sleep(10)
SetHintParam("ShowHint", "Reload")
EndFunc
Func MediaInfoTest(lParam)
Local sFile = RequestCopyDataInfo("SP") & RequestCopyDataInfo("SN")
If Not FileExist(sFile) Then
ShowHint("Файл не существует " & sFile)
Return
Endif
If StrPos(FileGetAttr(sFile), "D") Then
ShowHint("Каталог " & sFile)
Return
Endif
Static sLib = auX64 ? gMediaInfoX64 : gMediaInfoX32
Static hLib = DllCall("LoadLibrary", "wstr", sLib, "ptr")
If hLib = 0 Then
ShowHint("Error LoadLibrary " & sLib)
Return
EndIf
Static sPath = FileGetDir(sLib)
Static sLang ="file://" & sPath & "\ru.csv"
Static pNew = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_New", "Ptr")
Static pOpen = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Open", "Ptr")
Static pGet = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Get", "Ptr")
Static pDel = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Delete", "Ptr")
Static pOpt = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Option", "Ptr")
Static pInfo = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Inform", "Ptr")
Local hMI = DllCall(pNew, "Ptr")
If hMI = 0 Then
ShowHint("MediaInfo.dll couldn't create new object")
Return
Endif
If DllCall(pOpen, 'ptr', hMI, "wstr", sFile, "uint") <> 1 Then
DllCall(pDel, "Ptr", hMI)
Return ShowHint("MediaInfo.dll couldn't open file " & sFile)
EndIf
Local sMI
sMI &= "Duration: "
sMI &= DllCall(pGet, 'ptr', hMI, "int", 0, "int", 0, "wstr", "Duration", "int", 1, "int", 0, "wstr") & auCRLF
sMI &= "Video: "
sMI &= DllCall(pGet, 'ptr', hMI, "int", 0, "int", 0, "wstr", "VideoCount", "int", 1, "int", 0, "wstr") & auCRLF
sMI &= "Audio: "
sMI &= DllCall(pGet, 'ptr', hMI, "int", 0, "int", 0, "wstr", "AudioCount", "int", 1, "int", 0, "wstr") & auCRLF
sMI &= "Recorded: "
sMI &= DllCall(pGet, 'ptr', hMI, "int", 0, "int", 0, "wstr", "Recorded_Date", "int", 1, "int", 0, "wstr") & auCRLF
sMI &= "Cover: "
sMI &= DllCall(pGet, 'ptr', hMI, "int", 0, "int", 0, "wstr", "Cover", "int", 1, "int", 0, "wstr") & auCRLF
sMI &= "Cover Mime: "
sMI &= DllCall(pGet, 'ptr', hMI, "int", 0, "int", 0, "wstr", "Cover_Mime", "int", 1, "int", 0, "wstr") & auCRLF
sMI &= "Track/Position: "
sMI &= DllCall(pGet, 'ptr', hMI, "int", 0, "int", 0, "wstr", "Track/Position", "int", 1, "int", 0, "wstr")
If IsPressed(0x11) Then
sMI = ""
DllCall(pOpt, "Ptr", hMI, "Wstr", "Complete", "Wstr", "0", "Wstr")
DllCall(pOpt, 'Ptr', hMI, "Wstr", "Language", "Wstr", sLang, "Wstr")
DllCall(pOpt, "Ptr", hMI, "Wstr", "Output", "Wstr", "Inform", "Wstr")
Local lst = List()
lst.Text = DllCall(pInfo, "Ptr", hMI, "Uint", 0, "Wstr")
For line in lst
sMI &= FixSpaces(line) & auCRLF
Next
Free(lst)
EndIf
DllCall(pDel, "Ptr", hMI)
If gDurationBaloon Then
gBTip = CreateBaloonTip("MediaInfo", 1, 300)
If gBTip = 0 Then Return MsgBox("Не удалось создать окно подсказки BaloonTip")
EndIf
If StrTrim(sMI) = "" Then sMI = "нет данных"
ShowMediaHint(sMI)
EndFunc
Func CreateBaloonTip(TipTitle, TipIcon, TipWidth)
Static TTM_TRACKACTIVATE = 1041, _
TTM_TRACKPOSITION = 1042, _
TTM_SETMAXTIPWIDTH = 1048, _
TTM_SETTITLE = 1057, _
TTM_ADDTOOL = 1074
Local hTip
hTip = DllCall("CreateWindowExW", _
"dword", 8, _
"wstr", "tooltips_class32", _
"wstr", "", _
"dword", 0x00000c0, _
"int", 0, "int", 0, "int", 0, "int", 0, _
"handle", AUTORUN_TCHANDLE, _
"handle", 0, "handle", 0, "ptr", 0, "handle")
If hTip = 0 Then Return 0
MouseGetPos("gBTipX","gBTipY")
#gBTipWnd.Set(hTip, MakeInt(gBTipX, gBTipY, 2))
gBTipWndProc = DllCall("SetWindowLong" & (auX64 ? "PtrW" : "W"), _
"hwnd", hTip, "int", -4, "long_ptr", gBTipWP.Ptr, "ptr")
Local buf = Buffer(160)
buf.Zero()
buf.SetStr(TipTitle & Chr(0))
SendMessage(hTip, TTM_SETTITLE, TipIcon, buf.ptr)
gBText.Zero()
gBText.SetStr("Инициализация" & Chr(0))
gBTool.Zero() # TTTOOLINFO
If auX64 Then
gBTool.SetNum(0, "uint", gBTool.size, _
"uint", 0x00a0, _
"hwnd", AUTORUN_TCHANDLE, _
"uint_ptr", 0)
gBTool.SetNum(48, "ptr", gBText.ptr)
Else
gBTool.SetNum(0, "uint", gBTool.size, _
"uint", 0x00a0, _
"hwnd", AUTORUN_TCHANDLE, _
"uint_ptr", 0, _
"long", 0, _
"long", 0, _
"long", 0, _
"long", 0, _
"ptr", 0, _
"ptr", gBText.ptr)
EndIf
SendMessage(hTip, TTM_SETMAXTIPWIDTH, 0, TipWidth)
SendMessage(hTip, TTM_ADDTOOL, 0, gBTool.ptr)
SendMessage(hTip, TTM_TRACKACTIVATE, 1, gBTool.ptr)
SendMessage(hTip, TTM_TRACKPOSITION, 0, MakeInt(gBTipX, gBTipY, 0))
Free(buf)
Return hTip
EndFunc
Func UpdateBaloonTip(hTip, TipText)
Static TTM_UPDATETIPTEXT = 1081
gBText.Zero()
gBText.SetStr(TipText & Chr(0))
SendMessage(gBTip, TTM_UPDATETIPTEXT, 0, gBTool.ptr)
EndFunc
Func BTipWndProcTest(hWnd, uMsg, wParam, lParam)
Static IsDrag = 0, _
MK_LBUTTON = 0x0001, _
WM_MOUSEMOVE = 0x0200, _
WM_LBUTTONDOWN = 0x0201, _
WM_LBUTTONUP = 0x0202, _
TTM_TRACKPOSITION = 1042
Static tx, ty
Switch uMsg
Case WM_LBUTTONDOWN
If IsDrag = 0 Then
MouseGetPos("tx","ty")
If DllCall("DragDetect", "hwnd", hWnd, "int64", MakeInt(ty, tx, 2)) Then
IsDrag = 1
DllCall("SetCapture", "hwnd", hWnd, "hwnd")
EndIf
EndIf
Case WM_LBUTTONUP
If IsDrag = 1 Then
WinGetPos("gBTipX", "gBTipY", "", "", hWnd)
IsDrag = 0
DllCall("ReleaseCapture")
Else
DllCall("DestroyWindow", "handle", hWnd)
EndIf
Case WM_MOUSEMOVE
If IsDrag = 1 And BitAND(wParam, MK_LBUTTON) Then
MouseGetPos("x","y")
SendMessage(hWnd, TTM_TRACKPOSITION, 0, MakeInt(gBTipX+(x-tx), gBTipY+(y-ty), 0))
EndIf
EndSwitch
Return DllCall("CallWindowProcW", _
"ptr", gBTipWndProc, "hwnd", hWnd, "uint", uMsg, "wparam", wParam, "lparam", lParam)
EndFunc
Func BTipWndProc(hWnd, uMsg, wParam, lParam)
Static IsDrag = 0, _
WM_CREATE = 0x0001, _
WM_DESTROY = 0x0002, _
WM_SHOWWINDOW = 0x0018, _
MK_LBUTTON = 0x0001, _
WM_MOUSEMOVE = 0x0200, _
WM_LBUTTONDOWN = 0x0201, _
WM_LBUTTONUP = 0x0202, _
WM_RBUTTONUP = 0x0205, _
TTM_TRACKACTIVATE = 1041, _
TTM_TRACKPOSITION = 1042
Static SM_CXDRAG = 68, _
SM_CYDRAG = 69, _
DragWidth = GetSystemMetrics(SM_CXDRAG), _
DragHeight = GetSystemMetrics(SM_CYDRAG), _
StartX = 0, _
StartY = 0
Local x, y
Static tx, ty, buf = Buffer(8)
Switch uMsg
Case WM_SHOWWINDOW
If wParam = 0 Then DllCall("DestroyWindow", "handle", hWnd)
Case WM_DESTROY
If gDurationInfo Then
gDurationBreak = true
MsgBox("Операция отменена")
Return 0
EndIf
Case WM_LBUTTONDOWN
If IsDrag = 0 Then
buf.Zero()
x = BitAND(lParam, 0xFFFF)
y = BitAND(BitShift(lParam,16), 0xFFFF)
StartX = x
StartY = y
buf.SetNum(0, "int", x, "int", y)
DllCall("ClientToScreen", "hwnd", hWnd, "ptr", buf.ptr)
tx = buf.GetNum(0)
ty = buf.GetNum(4)
IsDrag = 1
DllCall("SetCapture", "hwnd", hWnd, "hwnd")
EndIf
Case WM_LBUTTONUP
If IsDrag = 1 Then
WinGetPos("gBTipX", "gBTipY", "", "", hWnd)
IsDrag = 0
DllCall("ReleaseCapture")
Else
DllCall("DestroyWindow", "handle", hWnd)
EndIf
Case WM_MOUSEMOVE
If IsDrag = 1 And BitAND(wParam, MK_LBUTTON) Then
x = BitAND(lParam, 0xFFFF)
y = BitAND(BitShift(lParam,16), 0xFFFF)
If Abs(x - startX) > DragWidth Or Abs(y - startY) > DragHeight Then
buf.Zero()
buf.SetNum(0, "int", x, "int", y)
DllCall("ClientToScreen", "hwnd", hWnd, "ptr", buf.ptr)
x = buf.GetNum(0)
y = buf.GetNum(4)
SendMessage(hWnd, TTM_TRACKPOSITION, 0, MakeInt(gBTipX+(x-tx), gBTipY+(y-ty), 0))
EndIf
EndIf
Case WM_RBUTTONUP
BTipShowMenu(hWnd)
EndSwitch
Return DllCall("CallWindowProcW", _
"ptr", gBTipWndProc, "hwnd", hWnd, "uint", uMsg, "wparam", wParam, "lparam", lParam)
EndFunc
Func BTipShowMenu(hWnd)
ShowPopupMenu /D /F /I:0 "BTipCreateMenu"
EndFunc
Func BTipCreateMenu()
Local txt
txt &= 'MENUITEM "Лог операций", em_aucmd ' & (gDurationTXT <> "" ? "" : "/D") & ' -1 DurationText' & auCRLF
Return txt
EndFunc
Func DurationText()
Local sLogFile = TEMP & "\duration.txt"
FileWrite(sLogFile, gDurationTXT)
ShellExec(sLogFile)
EndFunc
Func MediaHint(FileName, FieldIndex, UnitIndex)
If FieldIndex > gHintLines Then Return
If StrPos(FileGetAttr(FileName), "D") Then Return ""
Local bCaps = DllCall("GetKeyState", "int", 0x14, "short")
Local bCtrl = BitAND(bCaps, 1), bShift = IsPressed(0x10)
If gHintWdx Then bShift = true
If Not bCtrl then bCtrl = IsPressed (0x11)
If gHintCaps And Not bCtrl Then Return
Static sLib = auX64 ? gMediaInfoX64 : gMediaInfoX32
Static hLib = DllCall("LoadLibrary", "Wstr", sLib, "Ptr")
Static sPath = FileGetDir(sLib) & "\"
Static sLang ="file://" & sPath & "ru.csv", _
sHint ="file://" & sPath & "hint.txt", _
sSize ="file://" & sPath & "size.txt"
Static bLang = true, nWait = 0, _
pNew, pOpen, pDel, pOpt, pInfo
If hLib = 0 And FieldIndex > 1 Then Return
If FieldIndex = 1 Then
If hLib = 0 Then Return "Error LoadLibrary " & sLib
Idx = 0
pNew = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_New", "Ptr")
pOpen = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Open", "Ptr")
pDel = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Delete", "Ptr")
pOpt = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Option", "Ptr")
pInfo = DllCall("GetProcAddress", "Ptr", hLib, "Str", "MediaInfo_Inform", "Ptr")
nWait = 0
bLang = true
sMode = "Inform"
If gHintWait > 0 Then Sleep(gHintWait)
Local x, y, w, nCase = 0
Local hWnd = RequestInfo(ItemAtCursor("panel"))
WinGetPos("", "", "w", "", hWnd)
If w > 0 Then
MouseGetPos("x","y")
Static buf = Buffer(8) # POINT
buf.Zero()
buf.SetNum(0, "long", x, "long", y)
DllCall("ScreenToClient", "hwnd", hWnd, "ptr", buf.ptr)
x = buf.GetNum(0)
Switch Round(x/w*100,0)
Case 0 To gHintLayout[0]-1
nCase = 0
Case gHintLayout[0] To gHintLayout[0]+gHintLayout[1]-1
nCase = 1
Case 100-gHintLayout[2] To 100
nCase = 2
EndSwitch
nWait = gHintSleep[nCase]
sMode = gHintContent[nCase]
EndIf
If bShift Then
If gHintWdxList.Count <= nCase Then
gHintPipe = "" & auCRLF & "Autorun: No data in " & gHintWdxCfg
Return
EndIf
gHintPipe = ""
Static aWdx = List()
aWdx.Count = 0
aWdx.Split(gHintWdxList[nCase], ";")
For i = 0 To aWdx.Count - 1
gHintPipe &= MediaHintWDX(aWdx[i], FileName)
Next
gHintPipe = StrTrim(gHintPipe)
If gHintPipe = "" Then
gHintPipe = "" & auCRLF & "Autorun: No data in " & gHintWdxCfg
Return
EndIf
gHintPipe = "" & auCRLF & gHintPipe
Return
EndIf
If nWait > 0 Then Sleep(nWait)
If sMode = "" Then
gHintPipe = ""
Return
ElseIf sMode <> "Inform" Then
bLang = false
sMode ="file://" & sPath & sMode
EndIf
Local hMI = DllCall(pNew, "Ptr")
If hMI = 0 Then Return "MediaInfo.dll couldn't create new object"
If DllCall(pOpen, 'Ptr', hMI, "Wstr", FileName, "Uint") <> 1 Then
DllCall(pDel, "Ptr", hMI)
Return "MediaInfo.dll couldn't open file " & FileName
EndIf
If bShift Then
DllCall(pOpt, 'Ptr', hMI, "Wstr", "Complete", "Wstr", "1", "Wstr")
Else
DllCall(pOpt, 'Ptr', hMI, "Wstr", "Complete", "Wstr", "0", "Wstr")
EndIf
DllCall(pOpt, "Ptr", hMI, "Wstr", "Output", "Wstr", sMode, "Wstr")
DllCall(pOpt, 'Ptr', hMI, "Wstr", "Language", "Wstr", (Not bLang ? "" : sLang), "Wstr")
gHintPipe = DllCall(pInfo, 'Ptr', hMI, "Uint", 0, "Wstr")
#{
If StrPos(sMode, "hint.txt") Then
gHintPipe = StrReplace(gHintPipe, "DTS HD Master Audio", "DTS-HD MA")
gHintPipe = StrReplace(gHintPipe, "Dolby Digital", "DD")
EndIf
#}
If Not bLang Then gHintPipe = StrReplace(gHintPipe, Chr(32), Chr(160))
DllCall(pOpt, 'Ptr', hMI, "Wstr", "Language", "Wstr", "", "Wstr")
DllCall(pDel, "Ptr", hMI)
Endif
If Not bLang Then Return StrPart(gHintPipe, auCRLF, FieldIndex)
Return FixSpaces(StrPart(gHintPipe, auCRLF, FieldIndex))
EndFunc
Func FixSpaces(String)
Local a, b
If Not StrPos(String, ":") Then Return String
a = StrPart(String, ":", 1)
b = StrPart(String, ":", 2) & StrPart(String, ":", 3)
Return StrTrim(a) & ": " & FixCodePage(StrTrim(b))
EndFunc
Func FixCodePage(String)
Local bUsedRepl
# iso-8859-1 = 28591
DllCall("WideCharToMultiByte", _
"uint", 28591, _
"dword", 0, _
"wstr", String, _
"int", -1, _
"ptr", 0, _
"int", 0, _
"ptr", 0, _
"bool*", @bUsedRepl)
If bUsedRepl Then Return String
Local nSize = StrLen(String)
Local buf = Buffer(nSize)
buf.Zero()
DllCall("WideCharToMultiByte", _
"uint", 28591, _
"dword", 0, _
"wstr", String, _
"int", -1, _
"ptr", buf.ptr, _
"int", nSize, _
"ptr", 0, _
"ptr", 0)
Local fixed = buf.GetStr(0, nSize, "ANSI")
Free(buf)
Return fixed
EndFunc
Func FixCodePageEx(String)
Local bUsedRepl
# iso-8859-1 = 28591
DllCall("WideCharToMultiByte", _
"uint", 28591, _
"dword", 0, _
"wstr", String, _
"int", -1, _
"ptr", 0, _
"int", 0, _
"ptr", 0, _
"bool*", @bUsedRepl)
If bUsedRepl Then Return String
Local nSize = StrLen(String)
Local buf = Buffer(nSize)
buf.Zero()
buf.SetStr(String, 0, nSize, "CP:28591")
Local fixed = buf.GetStr(0, nSize, "ANSI")
Free(buf)
Return fixed
EndFunc
Func ShowPipeEx(lParam, nPage)
Local sPipe, nLines = gHintLines
Local aPipe = List(), j, nSect = 0
Local nEnd = nPage*nLines, nStart = nEnd - nLines
If gHintClipb Then ClipPut(gHintPipe)
aPipe.Text = gHintPipe
For j = 0 To aPipe.Count - 1
If aPipe[j] = "" Then nSect += 1
If (j + 1) >= nStart And (j + 1) <= nEnd Then
sPipe &= StrLeft(FixSpaces(aPipe[j]),84) & auCRLF
EndIf
Next
Free(aPipe)
If sPipe = "" Then sPipe = "Out of range"
ShowHint(StrTrim(sPipe))
#Return -1
EndFunc
Func LeftsideHintType()
Static init = gHintContent[0]
If gHintContent[0] = init Then
gHintContent[0] = gHintShift
Else
gHintContent[0] = init
EndIf
ShowRedInfoHint("Left side is " & gHintContent[0])
EndFunc
Func SetHintFields()
Local i, sHint
Static c = 0, aHints = List("MediaHint", "ExifHint", "JoinHint")
c += 1
If c > 2 Then c = 0
sHint = aHints[c]
For i = 1 to 60
SetFieldsParam("Func", "C" & i, sHint)
Next
ShowRedInfoHint("Поля подсказки " & sHint)
EndFunc
Func ShowRedInfoHint(HintText)
SetHintParam("ShowHint", "Font", 15, "Arial")
SetHintParam("ShowHint", "BackColor", 0xFF0000)
SetHintParam("ShowHint", "Text", 0xFFFFFF)
ShowHint(HintText, 0, 0, 1000, 1)
WinAlign(LAST_HINT_WINDOW)
Sleep(100)
SetHintParam("ShowHint", "Reload")
EndFunc
Func ExifHint(FileName, FieldIndex, UnitIndex)
If FieldIndex > gHintLines Then Return
If StrPos(FileGetAttr(FileName), "D") Then Return
Local bCtrl = BitAND(DllCall("GetKeyState", "int", 0x14, "short"), 1)
If Not bCtrl then bCtrl = IsPressed (0x11)
If gHintCaps And Not bCtrl Then Return
If FieldIndex = 1 Then
ProcessExecGetOutput gHintPipe %gMediaExifX32% ' -G -S -lang ru "%FileName%"'
Endif
Return StrPart(gHintPipe, auLF, FieldIndex)
EndFunc
ReadWdxHintCfg()
Func ReadWdxHintCfg()
gHintWdxList.Count = 0
gHintWdxList.LoadFromFile(gHintWdxCfg)
EndFunc
Func MediaHintWDX(WdxName, Filename)
If Not FileExist(Filename) Then
Return auCRLF & auCRLF & "Файл не существует " & Filename
Endif
Local obj = Plugin(WdxName)
If ERROR <> 0 Then
Return auCRLF & auCRLF & "Autorun: " & WdxName & " plugin error " & ERROR
EndIf
Local i, txt, data
obj.FileName = Filename
For i = 0 To obj.FieldCount -1
data = obj.GetValue(i)
If data = "" Then Continue
txt &= obj.FieldName(i) & ": " & data & auCRLF
Next
Free(obj)
txt = StrTrim(txt)
If StrLen(txt) > 0 Then txt = auCRLF & auCRLF & txt
Return txt
EndFunc
Func MediaHintType()
# переключение переменной
gHintWdx = Not gHintWdx
ShowRedInfoHint("WdxHint.cfg " & (gHintWdx ? "включен" : "выключен"))
EndFunc |
|
|