AutoHotkey Community

It is currently May 27th, 2012, 12:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: February 26th, 2009, 6:24 pm 
Offline

Joined: February 24th, 2009, 12:04 pm
Posts: 4
Ok, I'll try to find something about this Avermedia's new driver. If any success in search, I'll post here. Thanks for help :)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 11th, 2009, 3:20 pm 
Offline

Joined: December 11th, 2009, 2:41 pm
Posts: 6
aver remote from USB 2.0 Plus device to control avertv.exe and media classic player. Shutdown computer when AUTOSCAN pressed for about 3 seconds.

Code:
; AverRemote for USB2.0 Plus remote
#NoEnv
#Persistent
SetBatchLines -1

DetectHiddenWindows, on

aver_path = %A_ProgramFiles%\AverTV USB 2.0 Plus\

DllCall("ole32\CoInitialize", UInt,0)
AverAPI := DllCall("LoadLibrary", "Str", aver_path . "averapi.dll")

if AverAPI = ""
   Goto, End_AverRemote ;

aver_keys_s := "49,48,5,6,7,9,10,11,13,14,15,18,17,19,23,16,"
   . "35,30,12,31,34,20,8,25,24,27,26,29,28,51,33,32,4,21"

aver_names_s := "TVFM,POWER,1,2,3,4,5,6,7,8,9,L,0,R,SNAPSHOT,16CHPREV,"
   . "CHUP,VOLDOWN,FULLSCREEN,VOLUP,CHDOWN,MUTE,AUDIO,REC,PLAY,STOP,"
   . "PAUSE,BACKWARD,FORWARD,TELETEXT,PREV,NEXT,SOURCE,AUTOSCAN"

StringSplit, aver_keys, aver_keys_s, `,
StringSplit, aver_names,aver_names_s, `,

AVER_GetRemoteData := DllCall("GetProcAddress", UInt, AverAPI, "str", "AVER_GetRemoteData")
AVER_HWInit := DllCall("GetProcAddress", UInt, AverAPI, "str", "AVER_HWInit")
AVER_Free := DllCall("GetProcAddress", UInt, AverAPI, "str", "AVER_Free")

DllCall(AVER_HWInit,Int,0,Str,"",Int,0,"Cdecl")

prevtime = 0
prevkey = -1
keyseqcount = 0

VarSetCapacity(rd,1,0)
SetTimer, AverLoop, 333
Goto, End_AverRemote

AverLoop:
   DllCall(AVER_GetRemoteData,"int",&rd,"Cdecl")
   key := NumGet(rd,0,"Char")
   if key != -1
   {
      now := A_TickCount
      since := now - prevtime
      
      if (prevkey = key and since < 333*1.1)
         keyseqcount++
      else
         keyseqcount = 0
         
      prevtime := now
      prevkey := key
      
      ;if keyseqcount = 0
         DoAverEvent()
   }
return


;DllCall(AVER_Free,"Cdecl")
;DllCall("ole32\CoUninitialize")
;ExitApp

DoAverEvent()
{
   global key,aver_keys0,aver_names0
   loop %aver_keys0%
   {
      if (key = aver_keys%A_Index%)
      {
         al := "Aver" . aver_names%A_Index%
         if IsLabel(al)
            Gosub %al%
         else
         {
            ToolTip % aver_names%A_Index%
            SetTimer, ClearToolTip, -3000
         }
         return
      }
   }
}

ClearToolTip:
ToolTip
return

AverFULLSCREEN:
   if keyseqcount = 0
   {
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC13, , , ahk_class AVerTVApp
   IfWinExist, ahk_class MediaPlayerClassicW
      WinActivate, ahk_class MediaPlayerClassicW
      Send {F11}
   }
return

AverCHUP:
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0F, , , ahk_class AVerTVApp
return

AverCHDOWN:
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0F, 1, , ahk_class AVerTVApp
return

AverVOLUP:
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0E, , , ahk_class AVerTVApp
   else IfWinActive, ahk_class MediaPlayerClassicW
      Send {Up}
   else
      Send {Volume_Up}   
return

AverVOLDOWN:
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0E, 1, , ahk_class AVerTVApp
   else IfWinActive, ahk_class MediaPlayerClassicW
      Send {Down}
   else
      Send {Volume_Down}
return

AverPOWER:
   if keyseqcount = 0
   {
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xBC6, , , ahk_class AVerTVApp
   else
      Run % aver_path . "AverTv.exe"
   }
return

AverAUTOSCAN:
   if (keyseqcount > 0)
   {
      SetTimer, ProgressOff, 1000
      Progress, b zh0 fs20 cwFF0000, % "SHUTDOWN COUNTDOWN: " . (10 -keyseqcount)
      if (keyseqcount >= 10)
         Shutdown, 9
   }
return

ProgressOff:
Progress, Off
return

AverMUTE:
   if keyseqcount = 0
   {
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0D, , , ahk_class AVerTVApp
   else
      Send {Volume_Mute}
   }
return

AverBACKWARD:
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW   
      Send ^{Left}
   }
return

AverFORWARD:
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW   
      Send ^{Right}
   }
return

AverNEXT:
   if keyseqcount = 0
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW   
      Send {Media_Next}
   }
return

AverPREV:
   if keyseqcount = 0
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW   
      Send {Media_Prev}
   }
return

AverPLAY:
AverPAUSE:
   if keyseqcount = 0
   {
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW
      Send {Space}
   }
   }
return

#T::
   IfWinNotExist, ahk_class AVerTVApp
      Run % aver_path . "AverTv.exe"
return

End_AverRemote:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2009, 6:21 pm 
Offline

Joined: May 8th, 2008, 2:58 pm
Posts: 39
Location: C:\ESTONIA\adavere\RIST.rar
is that work with AverTv ?

_________________
Keegi Siin ka Eestlane? :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thanks a lot!!
PostPosted: December 14th, 2009, 5:08 pm 
Offline

Joined: September 15th, 2006, 10:25 am
Posts: 567
First of all, a big thank you for your excellent work..

It prompted me to search for the Dll and DllCalls for my Tech-com TV tuner with Honestech TVR software..

I have posted my modification as a seperate thread here so that anybody searching for the specific model of TV tuner does not go through the same trouble i had to..

I have given full credits to your work on that thread too.

Thanks again.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: RemoteExplorer.ahk
PostPosted: December 18th, 2009, 7:58 am 
Offline

Joined: September 15th, 2006, 10:25 am
Posts: 567
My version of RemoteExplorer.ahk with some changes.. I have commented the changes and questions.

Code:
; Author:         dm <dm5555@gmail.com>
; Modified by Shajul

; Script Function:
;   Remote Explorer - explore your computer, run and delete files with RC.
;
#SingleInstance force
/* -----------------------------------------------------------------------------
    Behavior configuration.
*/

; Start directory
Dir                 = D:\

; Start display folders options
DispDir             = 1

;Ignore directory list
IgnoreDirList=$RECYCLE.BIN,Recycled,RECYCLER,System Volume Information,Temp

;Ignore file mask
IgnoreFileMask=sys,tmp,dat,ini,album,db,dll

/* -----------------------------------------------------------------------------
    Appearance configuration.
*/

; File
FontName            = Arial
FontSize            = 60
TextColor           = Green

; Folder
FontNameDir         = Arial
FontSizeDir         = 60
TextColorDir        = Blue
TemplateDir         = [ # ]

; Message
FontNameMsg         = Arial
FontSizeMsg         = 60
TextColorMsg        = CC3333
TemplateMsg         = < # >
TextNoItems         = No items to display
TextDelete          = Really delete "#"?    ; File/folder name will be substituted in #

; Filter
FontNameFilter      = Arial
FontSizeFilter      = 60
TextColorFilter     = FF9933
TextFilter0         = Display: Files
TextFilter1         = Display: Files and Folders

; String of characters to be replaced with spaces (so that filenames wrap)
StrReplace          = _
; String of characters to be enclosed with spaces (so that filenames wrap)
StrEnclose          = .-

/* -----------------------------------------------------------------------------
    Initialization.
*/

ModeDelete = 0
ExitModeDelete = 0

Gosub, ReadDir

Gui -Caption

X := 0.05*A_ScreenWidth
Y := 0.05*A_ScreenHeight
W := 0.90*A_ScreenWidth
H := 0.75*A_ScreenHeight
Gui, Add, Text, x%X% y%Y% w%W% h%H% vTxtItem

X := 0.05*A_ScreenWidth
Y := 0.85*A_ScreenHeight
W := 0.90*A_ScreenWidth
H := 0.10*A_ScreenHeight
Gui, Font, s%FontSizeFilter% c%TextColorFilter%, %FontNameFilter%
Gui, Add, Text, x%X% y%Y% w%W% h%H% vTxtFilter

Gosub, UpdateGUI
Gui, Show, Maximize, Remote Explorer

return

/* -----------------------------------------------------------------------------
    Auxilary routines.
*/

; Read the contents of the current directory into array
ReadDir:
    SetWorkingDir, %Dir%
    N = 1
    Item0 = 0
    if DispDir
    {
        Loop, *.*, 2
        {
            if A_LoopFileName in %IgnoreDirList%
                Continue
            Item0++

            Item%Item0% := A_LoopFileName
        }
    }
    Loop, *.*, 0
    {
        SplitPath,A_LoopFileName,,,ItemExt
        if ItemExt Contains %IgnoreFileMask%
            Continue
        Item0++
       
        Item%Item0% := A_LoopFileName
    }
    return
   
UpdateGUI:
    if ExitModeDelete
    {
        ModeDelete = 0
        ExitModeDelete = 0
    }
   
    if ( N > Item0 )
    {
        ; No items to display
        Gui, Font, s%FontSizeMsg% c%TextColorMsg%, %FontNameMsg%
        s := TextNoItems
        StringReplace, s, TemplateMsg, #, %s%
    }   
    else
    {
        IsDirItem := IsDir( Item%N% )
        s := Item%N%

        ; If item is file extract extension from string (if the file has extension)
        Ext =
        if ( !IsDirItem )
        {
            StringGetPos, StrPos, s, ., R
            if ( StrPos != -1 )
            {
                StringMid, Ext, s, StrPos + 1
                StringLeft, s, s, StrPos
            }
        }
       
        ; Replace entries of characters from StrReplace in s with spaces
        StringSplit, CharReplace, StrReplace
        Loop
        {
            if ( A_Index > CharReplace0 )
                break

            StringReplace, s, s, % CharReplace%A_Index%, %A_Space%, All
        }
        ; Enclose entries of characters from StrEnclose in s with spaces
        StringSplit, CharEnclose, StrEnclose
        Loop
        {
            if ( A_Index > CharEnclose0 )
                break
           
            CharEnclose := CharEnclose%A_Index%
            StringReplace, s, s, %CharEnclose%%A_Space%, %CharEnclose%, All
            StringReplace, s, s, %A_Space%%CharEnclose%, %CharEnclose%, All
            StringReplace, s, s, %CharEnclose%, %A_Space%%CharEnclose%%A_Space%, All
        }

        s = %s%%Ext%
       
        if ModeDelete
        {
            ExitModeDelete = 1
            Gui, Font, s%FontSizeMsg% c%TextColorMsg%, %FontNameMsg%
            StringReplace, s, TextDelete, #, %s%
            StringReplace, s, TemplateMsg, #, %s%
        }
        else
        {
            if ( IsDirItem )
                Gui, Font, s%FontSizeDir% c%TextColorDir%, %FontNameDir%
; Deleted a line here, dont know why it gave me gibberish instead of folder names
            else
                Gui, Font, s%FontSize% c%TextColor%, %FontName%
        }
    }
    GuiControl, Font, TxtItem
    GuiControl, Text, TxtItem, %s%
   
    GuiControl, Text, TxtFilter, % TextFilter%DispDir%
   
    return
   
ReadDirU:
    Gosub, ReadDir
    Gosub, UpdateGUI
    return
   
IsDir( Item )
{
    FileGetAttrib, Attributes, %Item%
    IfInString, Attributes, D
    {
        return true
    }
    return false
}
   
/* -----------------------------------------------------------------------------
    General hotkeys.
*/

; Hide (for debug)
^!Esc::
    Gui, Show, Hide
    return
   
; Exit
^!q::
    ExitApp

; Next file/folder
^!/::
    N++
    if ( N > Item0 )
    {
        N := 1
    }
    Gosub, UpdateGUI
    return
   
; Previous file/folder
^!'::
    N--
    if ( N < 1 )
    {
        N := Item0
    }
    Gosub, UpdateGUI
    return
   
; Open folder / run file
^!.::
    tItem := Item%N%
    SplitPath,tItem,,,my_ext
    if my_ext = lnk
        {
        FileGetShortcut,%tItem%,tItem
            res := IsDir( tItem )
            if ( res )
            {
                Dir := tItem . "\"
                Gosub, ReadDirU
            }
            else
            {
                Run, %tItem%
            }
        Return
        }
    res := IsDir( tItem )
    if ( res )
    {
        Dir := Dir . tItem . "\"
        Gosub, ReadDirU
    }
    else
    {
        Run, %tItem%
    }
    return
   
; Go up
^!,::
    StringGetPos, StrPos, Dir, \, R2
    if ( StrPos = -1 )
        return
    StringMid, Item, Dir, StrPos + 2
    StringTrimRight, Item, Item, 1
    StringLeft, Dir, Dir, StrPos + 1
    Gosub, ReadDir
    Loop
    {
        if ( A_Index > Item0 )
            break

        if ( Item = Item%A_Index% )
        {
            N := A_Index
            break
        }
    }
    Gosub, UpdateGUI
    return

; Recycle file/folder
^!d::
    ModeDelete = 1
    Gosub, UpdateGUI
    return
   
; Confirm
^!o::
    if ModeDelete
    {
        ModeDelete = 0
        ExitModeDelete = 0
       
        FileRecycle, % Item%N%
        NPrev := N
        Gosub, ReadDir
        if ( NPrev > 1 )
        {
            if ( NPrev > Item0 )
            {
                N := NPrev - 1
            }
            else
            {
                N := NPrev
            }
        }
        Gosub, UpdateGUI
    }
    return
       
; Toggle folders display options
^!Tab::
    DispDir := !DispDir
    Gosub, ReadDirU
    return
   
/* -----------------------------------------------------------------------------
    Drives and folders hotkeys.
*/

; Drive C
^!1::
    Dir = C:\
    Gosub, ReadDirU
    return
   
; Drive D
^!2::
    Dir = D:\Links
    Gosub, ReadDirU
    return
   
; Music
^!m::
    Dir = D:\Playlists\
    Gosub, ReadDirU
    return

; Video
^!v::
    Dir = D:\_Documents\Movies\
    Gosub, ReadDirU
    return
   
GuiClose:
ExitApp


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 18th, 2010, 9:22 am 
Offline

Joined: May 18th, 2010, 9:16 am
Posts: 1
I have to do automatic recording using Aver Media Tv tuner card by running a program. I use C/ C++ , Java coding. Kindly help me for the same.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2011, 7:52 am 
Offline

Joined: February 7th, 2009, 5:37 am
Posts: 43
For those using AVerTV 6, you can try AVerLIRC.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 29th, 2011, 6:16 pm 
Offline

Joined: September 20th, 2006, 2:05 pm
Posts: 73
micdelt wrote:
aver remote from USB 2.0 Plus device to control avertv.exe and media classic player. Shutdown computer when AUTOSCAN pressed for about 3 seconds.


Thank you for this.

Just bought a cheap old Avermedia analog tuner and modified your code to work for it:

Code:
; Avermedia AverTV GO (TVCapture 98)
#NoEnv
#Persistent
SetBatchLines -1

DetectHiddenWindows, on

aver_path = %A_ProgramFiles%\AVerTV\

Timer := 333

DllCall("ole32\CoInitialize", UInt,0)
AverAPI := DllCall("LoadLibrary", "Str", aver_path . "averapi.dll")

if AverAPI = ""
   Goto, End_AverRemote ;

aver_keys_s := "-126,2,-94,98,-30,-110,82,-46,-78,114,-14,74,-118,-54,-22,10,"
   . "-61,122,50,-6,67,42,18,-102,26,-38,90,-70,58,-62,-125,3,34,-86"

aver_names_s := "TVFM,POWER,1,2,3,4,5,6,7,8,9,L,0,R,SNAPSHOT,16CHPREV,"
   . "CHUP,VOLDOWN,FULLSCREEN,VOLUP,CHDOWN,MUTE,AUDIO,REC,PLAY,STOP,"
   . "PAUSE,BACKWARD,FORWARD,TELETEXT,PREV,NEXT,SOURCE,AUTOSCAN"

StringSplit, aver_keys, aver_keys_s, `,
StringSplit, aver_names,aver_names_s, `,

AVER_GetRemoteData := DllCall("GetProcAddress", UInt, AverAPI, "str", "AVER_GetRemoteData")
AVER_HWInit := DllCall("GetProcAddress", UInt, AverAPI, "str", "AVER_HWInit")
AVER_Free := DllCall("GetProcAddress", UInt, AverAPI, "str", "AVER_Free")

DllCall(AVER_HWInit,Int,0,Str,"",Int,0,"Cdecl")

prevtime = 0
prevkey = -1
keyseqcount = 0

VarSetCapacity(rd,1,0)
SetTimer, AverLoop, % Timer
Goto, End_AverRemote

AverLoop:
   DllCall(AVER_GetRemoteData,"int",&rd,"Cdecl")
   key := NumGet(rd,0,"Char")
    ;Fileappend, % key . "`n", R:\rd.txt
    If key != 0
      ToolTip, % key
   if key != -1
   {
      now := A_TickCount
      since := now - prevtime
     
      if (prevkey = key and since < %Timer%*1.1)
         keyseqcount++
      else
         keyseqcount = 0
         
      prevtime := now
      prevkey := key
     
      ;if keyseqcount = 0
         DoAverEvent()
   }
return


;DllCall(AVER_Free,"Cdecl")
;DllCall("ole32\CoUninitialize")
;ExitApp

DoAverEvent()
{
   global key,aver_keys0,aver_names0
   loop %aver_keys0%
   {
      if (key = aver_keys%A_Index%)
      {
         al := "Aver" . aver_names%A_Index%
         if IsLabel(al)
            Gosub %al%
         else
         {
            ToolTip % aver_names%A_Index%
            SetTimer, ClearToolTip, -3000
         }
         return
      }
   }
}

ClearToolTip:
ToolTip
return

AverTVFM:
return

AverFULLSCREEN:
   if keyseqcount = 0
   {
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC13, , , ahk_class AVerTVApp
   IfWinExist, ahk_class MediaPlayerClassicW
      WinActivate, ahk_class MediaPlayerClassicW
      Send {F11}
   }
return

AverCHUP:
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0F, , , ahk_class AVerTVApp
return

AverCHDOWN:
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0F, 1, , ahk_class AVerTVApp
return

AverVOLUP:
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0E, , , ahk_class AVerTVApp
   else IfWinActive, ahk_class MediaPlayerClassicW
      Send {Up}
   else
      Send {Volume_Up}   
return

AverVOLDOWN:
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0E, 1, , ahk_class AVerTVApp
   else IfWinActive, ahk_class MediaPlayerClassicW
      Send {Down}
   else
      Send {Volume_Down}
return

AverPOWER:
   if keyseqcount = 0
   {
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xBC6, , , ahk_class AVerTVApp
   else
      Run % aver_path . "AverTv.exe"
   }
return

AverAUTOSCAN:
   if (keyseqcount > 0)
   {
      SetTimer, ProgressOff, 1000
      Progress, b zh0 fs20 cwFF0000, % "SHUTDOWN COUNTDOWN: " . (10 -keyseqcount)
      if (keyseqcount >= 10)
         Shutdown, 9
   }
return

ProgressOff:
Progress, Off
return

AverMUTE:
   if keyseqcount = 0
   {
   IfWinExist, ahk_class AVerTVApp
      PostMessage, 0x497, 0xC0D, , , ahk_class AVerTVApp
   else
      Send {Volume_Mute}
   }
return

AverBACKWARD:
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW   
      Send ^{Left}
   }
return

AverFORWARD:
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW   
      Send ^{Right}
   }
return

AverNEXT:
   if keyseqcount = 0
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW   
      Send {Media_Next}
   }
return

AverPREV:
   if keyseqcount = 0
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW   
      Send {Media_Prev}
   }
return

AverPLAY:
AverPAUSE:
   if keyseqcount = 0
   {
   IfWinExist, ahk_class MediaPlayerClassicW
   {
      WinActivate, ahk_class MediaPlayerClassicW
      Send {Space}
   }
   }
return

#T::
   IfWinNotExist, ahk_class AVerTVApp
      Run % aver_path . "AverTv.exe"
return

End_AverRemote:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2011, 6:29 pm 
Good to know that it was useful!


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cristi®, Exabot [Bot], Google Feedfetcher, Stigg, Yahoo [Bot] and 33 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group