【HSP3】GOM PlayerをHSPで操作してみるサンプル

GOM PlayerをHSPで操作してみるサンプルです。当然ながらGomPlayerが必要です。インストールしてあるのに動かない場合はGomX.dllをregsvr32する必要あるかも?

GOM PlayerをHSPで操作してみるサンプルです。当然ながらGomPlayerが必要です。インストールしてあるのに動かない場合はGomX.dllをregsvr32する必要あるかも?

tt = "GOM PlayerHSP"
// GomX
axobj GomX, "{632CC9D6-5602-4854-AFD2-6EFC59177DE5}", 640, 480
//
comevent GomXEvent, GomX, "{46899D92-473E-413E-9F47-8D0765860AE9}", *event
//
;GomX->"AboutBox"
//
;dialog GomX("Version")
//
; -mode:normal
; -mode:nude
;GomX("UiMode") = "-mode:nude"
// 0
;GomX("EnableContextMenu") = 0
// 0
;GomX("Enabled") = 0
// 0
;GomX("EnableMessage") = 1
// 1
GomX("AutoStart") = 1
//
;0 =
;1 = Overlay Mixer()
;2 = Video Renderer
;3 = VMR7 Windowed mode
;4 = VMR9 Windowed mode
;5 = VMR7 Renderless mode
;6 = VMR9 Renderless mode
;7 = Enhanced Video Renderer
GomX("RenderMode") = 0
// 1
;GomX("StretchToFit") = 1
// (httprtspOK)
dialog "*", 16
if stat == 0 : end
GomX("Url") = refstr
//
;GomX("SubUrl") = ""
//
GomX->"play"
//
;dialog GomX("GetMediaFormat") // GomX->"GetMediaFormat" comres
//
;GomX->"stop"
//
;GomX->"pause"
// 1.0
;GomX("Rate") = 2.0 ; 2
// 1
;GomX("Mute") = 1
// 50
;GomX("Balance") = 0
// 50 0100
;GomX("Volume") = 50
// 1
;GomX("FullScreen") = 1
// ()
;GomX("EnableSubtitle") = 0
// ()
;GomX("SubtitleSize") = 0
// ()
;GomX("SubtitleMode") = 0
// ()
;GomX("LogoUrl") = ""
// ()
;GomX("SpeakerMode") = 1
//
;dialog GomX("GetVideoWidth") // GomX->"GetVideoWidth" comres
//
;dialog GomX("GetVideoHeight") // GomX->"GetVideoHeight" comres
// 10
;GomX->"fastForward"
// 10
;GomX->"fastRewind"
// 30
;GomX("CurrentPosition") = 30.0
//
// BMPJPEG
;GomX->"CapImageFile" "C:\\dump.jpg"
//
// AsyncCapture(BSTR sSrcPath,BSTR sDstPath, long dSec)
;GomX->"AsyncCapture" "", "", 0 //
//
;GomX->"Command" ""
repeat
//
;GomX("CurrentPositionString")
//
;GomX("DurationString")
// ()
;GomX("CurrentPosition")
// ()
;GomX("Duration")
// 4 = , 3 = , 2 = , 1 = , 0 =
;GomX("GetPlayState") // GomX->"GetPlayState" comres
switch GomX("GetPlayState")
case 0
st = "" : swbreak
case 1
st = "(1)" : swbreak
case 2
st = "" : swbreak
case 3
st = "" : swbreak
case 4
st = "" : swbreak
default
st = "()" : swbreak
swend
title tt + " "+ GomX("CurrentPositionString") + "/" + GomX("DurationString") + " " + st
wait 12
loop
stop
*event
//
dispid = comevdisp(GomXEvent)
switch dispid
case 1 // EndOfStream(long Result)
dialog ""
swbreak
case 2 // GomxError(long ErrorCode)
comevarg e, GomXEvent, 0, 0
dialog ": "+e+" "
swbreak
case 3 // GomxState(long State)
comevarg state, GomXEvent, 0, 0
logmes str(state)
swbreak
default
swbreak
swend
return
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX