MediaInfo Au

Pro uživatele

MediaInfo Au je alternativa k programu MediaInfo Lite. MediaInfo Au je program poskytující informace o audio a video souborech. MediaInfo Au umožňuje zobrazovat základní výpis, kompletní výpis, uložit výpis, otevřít soubor pro získání výpisu přes open file dialog nebo drag and drop. MediaInfo Au lze spustit s výpisem pomocí kontextové nabídky (pouze pokud je nainstalovaný přes setup.exe).

Nabídka v programu je dostupná přes pravý klik na myši na záhlaví okna.

Pro Programátory

MediaInfo Au je naprogramován v autoitu. Instalátor je vytvořen v Inno Setup. K běhu programu je potřeba mediainfo.dll.

MediaInfo Au

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=icon.ico
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Comment=MediaInfo
#AutoIt3Wrapper_Res_Description=MediaInfoAu
#AutoIt3Wrapper_Res_Fileversion=2015.12.18.1
#AutoIt3Wrapper_Res_Language=1033
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <FontConstants.au3>

$sFileVersion = FileGetVersion("MediaInfo.dll")

GUICreate("MediaInfo " & $sFileVersion, 600, 600, -1, -1, $WS_SIZEBOX, $WS_EX_ACCEPTFILES)

If $CmdLine[0] > 0 Then
	$_file = $CmdLine[1]
Else
	$_file = ""
EndIf

Local $info = GUICtrlCreateEdit( "", 0, 0, 598, 575, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY)
If $_file <> "" Then
	$data = _ArrayToString(_MediaInfodll($_file, ""), @CRLF)
	GUICtrlSetData($info, $data)
EndIf
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetFont($info, 9, $FW_DONTCARE, $GUI_FONTNORMAL, "Consolas")
GUICtrlSetState ( $info, $GUI_FOCUS )



Local $idContextmenu = GUICtrlCreateContextMenu()
Local $idOpen = GUICtrlCreateMenuItem("Otevřít", $idContextmenu)
GUICtrlCreateMenuItem("", $idContextmenu) ; separator
Local $idMenuLite = GUICtrlCreateMenuItem("Základní výpis", $idContextmenu)
Local $idMenuFull = GUICtrlCreateMenuItem("Kompletní výpis", $idContextmenu)
Local $idSave = GUICtrlCreateMenuItem("Uložit výpis", $idContextmenu)
GUICtrlCreateMenuItem("", $idContextmenu) ; separator
Local $idMenuInfo = GUICtrlCreateMenuItem("O programu", $idContextmenu)

GUISetState(@SW_SHOW)

While 1
	Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE
			ExitLoop
		Case $idMenuFull
			$data = _ArrayToString(_MediaInfodll($_file, "1"), @CRLF)
			GUICtrlSetData($info, $data)
		Case $idMenuLite
			$data = _ArrayToString(_MediaInfodll($_file, ""), @CRLF)
			GUICtrlSetData($info, $data)
		Case $idMenuInfo
			MsgBox(0, " O programu MediaInfoKK", "Vytvořil Krakatoa" & @CRLF & "http://krakatoa.www3.cz/")
		Case $GUI_EVENT_DROPPED
			If @GUI_DropId = $info Then
				$_file = @GUI_DragFile
				$data = _ArrayToString(_MediaInfodll($_file, ""), @CRLF)
				GUICtrlSetData($info, $data)
			EndIf
		Case $idOpen
			$_file_tmp = FileOpenDialog("Otevřít", @HomeDrive, "Vše (*.*)")
			If not @error Then
				$_file = $_file_tmp
				$data = _ArrayToString(_MediaInfodll($_file, ""), @CRLF)
				GUICtrlSetData($info, $data)
			EndIf
		Case $idSave
			$sFilePath = FileSaveDialog("Uložit", @HomeDrive, "Log (*.txt)", "log")
			If not @error Then
				Local $hFileOpen = FileOpen($sFilePath, 2)
				If not @error Then FileWrite($hFileOpen, $data)
			EndIf
	EndSwitch
WEnd

Func _MediaInfodll ( $_file, $complete )
    $_Dll = DllOpen ( "MediaInfo.dll" )
    $_Handle = DllCall ( $_Dll, "ptr", "MediaInfo_New" )
    DllCall ( $_Dll, "int", "MediaInfo_Open", "ptr", $_Handle[0], "wstr", $_file )
    DllCall ( $_Dll, "wstr", "MediaInfo_Option", "ptr", 0, "wstr", "Complete", "wstr", $complete )
    $_Inform = DllCall ( $_Dll, "wstr", "MediaInfo_Inform", "ptr", $_Handle[0], "int", 0 )
    DllClose ( $_Dll )
    $_Return = StringSplit ( $_Inform[0], @lf )
    If Not @error Then
        Return $_Return
    Else
        Return 0
    EndIf
EndFunc

Instalátor

[Setup]
AppName=MediaInfo
AppVersion=2015.12.18.01
DefaultDirName={pf}\MediaInfo
DefaultGroupName=MediaInfo
UninstallDisplayIcon={pf}\MediaInfo\MediaInfo.exe
SolidCompression=yes
; Pouze 64bit:
ArchitecturesInstallIn64BitMode=x64

[Files]
Source: "{app}\MediaInfo.exe"; DestDir: "{app}"
Source: "{app}\MediaInfo.dll"; DestDir: "{app}"

[Registry]
Root: HKCR; Subkey: "*\shell\MediaInfo"; Flags: uninsdeletekey
Root: HKCR; Subkey: "*\shell\MediaInfo"; ValueType: string; ValueName: "Icon"; ValueData: "{app}\MediaInfo.exe"
Root: HKCR; Subkey: "*\shell\MediaInfo\Command"; ValueType: string; ValueData: """{app}\MediaInfo.exe"" ""%1"""

[UninstallDelete]
Type: filesandordirs; Name: "{app}"

[Icons]
Name: "{group}\MediaInfo"; Filename: "{app}\MediaInfo.exe"

[Languages]
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl";