Page 6 of 6

Re: OSE (On Screen Explorer)

Posted: Fri Apr 26, 2013 12:15 am
by molitar
Ok here is my configuration for it.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1610">
    <Folder Name="On screen explorer" Expanded="True">
        <Macro Name="Show explorer">
            <Event Name="DXusbPCR.MyPC" />
            <Action>
                EventGhost.NewJumpIf(XmlIdLink(242), 2, True)
            </Action>
            <Action>
                EventGhost.PythonCommand(u'eg.result = eg.globals.WindowsState == "Fullscreen"')
            </Action>
            <Action>
                EventGhost.NewJumpIf(XmlIdLink(474), 1, False)
            </Action>
            <Action>
                EventGhost.NewJumpIf(XmlIdLink(466), 2, False)
            </Action>
        </Macro>
        <Macro Name="Cursor Up">
            <Event Name="DXusbPCR.MouseUp" />
            <Action>
                OSE.MoveUp()
            </Action>
            <Action>
                EventGhost.AutoRepeat(0.5, 0.5, 0.10000000000000001, 0.0)
            </Action>
        </Macro>
        <Macro Name="Cursor Down">
            <Event Name="DXusbPCR.MouseDown" />
            <Action>
                OSE.MoveDown()
            </Action>
            <Action>
                EventGhost.AutoRepeat(0.5, 1.5, 0.10000000000000001, 0.0)
            </Action>
        </Macro>
        <Macro Name="Page Up">
            <Event Name="DXusbPCR.Page+" />
            <Action>
                OSE.PageUp()
            </Action>
        </Macro>
        <Macro Name="Page Down">
            <Event Name="DXusbPCR.Page-" />
            <Action>
                OSE.PageDown()
            </Action>
        </Macro>
        <Macro Name="Execute">
            <Event Name="DXusbPCR.LButton" />
            <Action>
                OSE.Execute()
            </Action>
        </Macro>
        <Macro Name="Cancel">
            <Event Name="DXusbPCR.Desktop" />
            <Event Name="DXusbPCR.Close" />
            <Action>
                OSE.Cancel()
            </Action>
        </Macro>
        <Macro Name="On screen explorer: Show explorer: D:\, [*.*] - Display 1 Tv" id="466">
            <Action>
                OSE.ShowLastMenu((75, 75, 75), (255, 255, 255), u'0;-49;0;0;0;400;0;0;0;0;3;2;1;50;\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af', u'OSE', u'Open', 0, '', u'*.*', False, (180, 180, 180), (75, 75, 75), True)
            </Action>
        </Macro>
        <Macro Name="Execute Directory">
            <Event Name="DXusbPCR.RButton" />
            <Action>
                OSE.Execute(36, u'', u'')
            </Action>
            <Action>
                EventGhost.PythonCommand(u'eg.path = \'"\' + eg.result + \'"\' + \' /play\' ')
            </Action>
            <Action>
                EventGhost.PythonCommand(u'print eg.path')
            </Action>
            <Action>
                System.Execute(u'C:\\Program Files\\Combined Community Codec Pack\\MPC\\mpc-hc.exe', u'{eg.path}', 0, False, 2, u'')
            </Action>
        </Macro>
        <Macro Name="On screen explorer: Show explorer: D:\, [*.*] - Display 2 Monitor" id="474">
            <Action>
                OSE.ShowLastMenu((75, 75, 75), (255, 255, 255), u'0;-49;0;0;0;400;0;0;0;0;3;2;1;50;\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af', u'OSE', u'Open', 1, '', u'*.*', False, (180, 180, 180), (75, 75, 75), True)
            </Action>
        </Macro>
        <Macro Name="On screen explorer: Go back">
            <Event Name="DXusbPCR.Backspace" />
            <Action>
                OSE.GoBack()
            </Action>
        </Macro>
        <Macro Name="On screen explorer: Get value: Get Menu item string">
            <Action>
                OSE.GetValue(0)
            </Action>
            <Action>
                EventGhost.PythonCommand(u'print eg.result')
            </Action>
            <Action Enabled="False">
                Window.SendKeys(u'{F5}', False)
            </Action>
        </Macro>
    </Folder>
</EventGhost>
With no Media Player Open or OSE open the commands for up and down are being called still

System.RemoteConnect [u'']
System.RemoteDisconnect [u'']
DXusbPCR.MouseUp
Cursor Up
On screen explorer: Cursor Up
Autorepeat current macro: 0.5
System.RemoteConnect [u'']

I would think commands for OSE would not operate like navigation unless it had an open Menu.

----------------------------------------------------------------------------------------------------------------------

Second issue is the version of OSE maybe not work correctly with the latest version of EventGhost? I tried downloading the older version v1.4 and tried it and I noticed this version does not ask for a path to the MPC-Home file so it is not opening up multiple Windows. So the problem seems to be in the version that comes with the latest EventGhost as I had to put in a path to the executable hence why it opens up two windows. So that was fixed the older version of Media Player Classic and it opening up 2 windows. But the above issue still remains when I am using the mouse cursor buttons on remote that the rest of the buttons stop working at all in EventGhost.

Re: OSE (On Screen Explorer)

Posted: Sun Apr 28, 2013 12:03 pm
by Pako
Yes, I found that feature
Plugin OSE has built-in a function "Stop processing this event", if the menu is shown on the screen and "Stop processing this macro", if the menu is not shown on the screen ...
(that previously worked) does not work now correctly.
I am really surprised and I have no explanation for it. I really do not know how it happened. :shock:

However, I've made ÔÇïÔÇïsome changes to the plugin and now it should work properly again.
Can you please try it?
Only if it's okay, I will incorporate a new version of plugin into install file.

Pako

Re: OSE (On Screen Explorer)

Posted: Sun Apr 28, 2013 12:46 pm
by molitar
Hmm.. still triggering off.


Log:
Main.OnInit
Task.Activated.EventGhost
DXusbPCR.MouseUp
Cursor Up
On screen explorer: Cursor Up
DXusbPCR.MouseDown
Cursor Down
On screen explorer: Cursor Down

Re: OSE (On Screen Explorer)

Posted: Sun Apr 28, 2013 1:05 pm
by Pako
Can you please create a configuration file (for example demo.xml) where I can see it?
Please make it as simple as possible.
But I do not want a snippet (part of the configuration tree, obtained by using copy / paste).
I want the whole tree, that immediately really works (but simple as possible).
Then maybe I'll finally be able to understand what is happening.

Pako

Re: OSE (On Screen Explorer)

Posted: Sun Apr 28, 2013 1:19 pm
by molitar
Ok here is the entire Media Player Classic snippet.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1572">
    <Folder Name="Media Player Classic" id="112">
        <Folder Name="Main controls" Expanded="True">
            <Folder Name="On screen explorer">
                <Macro Name="Show explorer">
                    <Event Name="DXusbPCR.MyPC" />
                    <Action>
                        EventGhost.NewJumpIf(XmlIdLink(287), 2, True)
                    </Action>
                    <Action>
                        EventGhost.PythonCommand(u'eg.result = eg.globals.WindowsState == "Fullscreen"')
                    </Action>
                    <Action>
                        EventGhost.NewJumpIf(XmlIdLink(150), 1, False)
                    </Action>
                    <Action>
                        EventGhost.NewJumpIf(XmlIdLink(142), 2, False)
                    </Action>
                </Macro>
                <Macro Name="Cursor Up">
                    <Event Name="DXusbPCR.MouseUp" />
                    <Action>
                        OSE.MoveUp()
                    </Action>
                    <Action>
                        EventGhost.AutoRepeat(0.5, 0.5, 0.10000000000000001, 0.0)
                    </Action>
                </Macro>
                <Macro Name="Cursor Down">
                    <Event Name="DXusbPCR.MouseDown" />
                    <Action>
                        OSE.MoveDown()
                    </Action>
                    <Action>
                        EventGhost.AutoRepeat(0.5, 1.5, 0.10000000000000001, 0.0)
                    </Action>
                </Macro>
                <Macro Name="Page Up">
                    <Event Name="DXusbPCR.Page+" />
                    <Action>
                        OSE.PageUp()
                    </Action>
                </Macro>
                <Macro Name="Page Down">
                    <Event Name="DXusbPCR.Page-" />
                    <Action>
                        OSE.PageDown()
                    </Action>
                </Macro>
                <Macro Name="Execute">
                    <Event Name="DXusbPCR.LButton" />
                    <Action>
                        OSE.Execute()
                    </Action>
                </Macro>
                <Macro Name="Cancel">
                    <Event Name="DXusbPCR.Desktop" />
                    <Event Name="DXusbPCR.Close" />
                    <Action>
                        OSE.Cancel()
                    </Action>
                </Macro>
                <Macro Name="On screen explorer: Show explorer: D:\, [*.*] - Display 1 Tv" id="142">
                    <Action>
                        OSE.ShowLastMenu((75, 75, 75), (255, 255, 255), u'0;-49;0;0;0;400;0;0;0;0;3;2;1;50;\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af', u'OSE', u'Open', 0, '', u'*.*', False, (180, 180, 180), (75, 75, 75), True)
                    </Action>
                </Macro>
                <Macro Name="Execute Directory">
                    <Event Name="DXusbPCR.RButton" />
                    <Action>
                        OSE.Execute(36, u'', u'')
                    </Action>
                    <Action>
                        EventGhost.PythonCommand(u'eg.path = \'"\' + eg.result + \'"\' + \' /play\' ')
                    </Action>
                    <Action>
                        EventGhost.PythonCommand(u'print eg.path')
                    </Action>
                    <Action>
                        System.Execute(u'C:\\Program Files\\Combined Community Codec Pack\\MPC\\mpc-hc.exe', u'{eg.path}', 0, False, 2, u'')
                    </Action>
                </Macro>
                <Macro Name="On screen explorer: Show explorer: D:\, [*.*] - Display 2 Monitor" id="150">
                    <Action>
                        OSE.ShowLastMenu((75, 75, 75), (255, 255, 255), u'0;-49;0;0;0;400;0;0;0;0;3;2;1;50;\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af', u'OSE', u'Open', 1, '', u'*.*', False, (180, 180, 180), (75, 75, 75), True)
                    </Action>
                </Macro>
                <Macro Name="On screen explorer: Go back">
                    <Event Name="DXusbPCR.Backspace" />
                    <Action>
                        OSE.GoBack()
                    </Action>
                </Macro>
                <Macro Name="On screen explorer: Get value: Get Menu item string">
                    <Action>
                        OSE.GetValue(0)
                    </Action>
                    <Action>
                        EventGhost.PythonCommand(u'print eg.result')
                    </Action>
                    <Action Enabled="False">
                        Window.SendKeys(u'{F5}', False)
                    </Action>
                </Macro>
            </Folder>
            <Folder Name="Volume Controls">
                <Macro Name="Volume Up">
                    <Event Name="DXusbPCR.Num2" />
                    <Event Name="DXusbPCR.Up_arrow" />
                    <Action>
                        EventGhost.NewJumpIf(XmlIdLink(287), 2, True)
                    </Action>
                    <Action>
                        MediaPlayerClassic.VolumeUp()
                    </Action>
                    <Action Name="Python Script">
                        EventGhost.PythonScript(u'from eg.WinApi.Dynamic import SendMessage\nTBM_GETPOS = 1024\nFind_MPC_Volume_Ctrl=eg.WindowMatcher(u\'mpc-hc.exe\', None, u\'MediaPlayerClassicW\', None, u\'msctls_trackbar32\', 1, True, 0.0, 0)\n\nhwnd = Find_MPC_Volume_Ctrl()\n\nif len(hwnd) > 0:\n    if eg.globals.WindowsState <> "Fullscreen":\n        mon = 1\n        top = 900\n    else:\n        mon = 2\n        top = 600\n    volume = SendMessage(hwnd[0], TBM_GETPOS, 0, 0)\n    osd = "Volume: %i%%"\n    if volume == 1 : volume = 0\n    eg.plugins.EventGhost.ShowOSD(osd % volume, u\'0;-64;0;0;0;700;0;0;0;238;3;2;1;66;Arial\', (255, 255, 255), (0, 0, 0), 5, (0, top), mon, 3.0, True)\nelse:\n    print "Window not found"')
                    </Action>
                    <Action>
                        EventGhost.AutoRepeat(0.5, 0.20000000000000001, 0.029999999999999999, 0.0)
                    </Action>
                </Macro>
                <Macro Name="Volume Down">
                    <Event Name="DXusbPCR.Num8" />
                    <Event Name="DXusbPCR.Down_arrow" />
                    <Action>
                        EventGhost.NewJumpIf(XmlIdLink(287), 2, True)
                    </Action>
                    <Action>
                        MediaPlayerClassic.VolumeDown()
                    </Action>
                    <Action Name="Python Script">
                        EventGhost.PythonScript(u'from eg.WinApi.Dynamic import SendMessage\nTBM_GETPOS = 1024\nFind_MPC_Volume_Ctrl=eg.WindowMatcher(u\'mpc-hc.exe\', None, u\'MediaPlayerClassicW\', None, u\'msctls_trackbar32\', 1, True, 0.0, 0)\n\nhwnd = Find_MPC_Volume_Ctrl()\n\nif len(hwnd) > 0:\n    if eg.globals.WindowsState <> "Fullscreen":\n        mon = 1\n        top = 900\n    else:\n        mon = 2\n        top = 600\n    volume = SendMessage(hwnd[0], TBM_GETPOS, 0, 0)\n    osd = "Volume: %i%%"\n    if volume == 1 : volume = 0\n    eg.plugins.EventGhost.ShowOSD(osd % volume, u\'0;-64;0;0;0;700;0;0;0;238;3;2;1;66;Arial\', (255, 255, 255), (0, 0, 0), 5, (0, top), mon, 3.0, True)\nelse:\n    print "Window not found"')
                    </Action>
                    <Action>
                        EventGhost.AutoRepeat(0.5, 0.20000000000000001, 0.029999999999999999, 0.0)
                    </Action>
                </Macro>
                <Macro Name="Volume Mute">
                    <Action>
                        MediaPlayerClassic.VolumeMute()
                    </Action>
                </Macro>
            </Folder>
            <Macro Name="Quit Application" id="176">
                <Action>
                    MediaPlayerClassic.Exit()
                </Action>
            </Macro>
            <Macro Name="Play/Pause">
                <Event Name="DXusbPCR.Play/Pause" />
                <Action>
                    MediaPlayerClassic.PlayPause()
                </Action>
            </Macro>
            <Macro Name="Play">
                <Action>
                    MediaPlayerClassic.Play()
                </Action>
            </Macro>
            <Macro Name="Pause">
                <Action>
                    MediaPlayerClassic.Pause()
                </Action>
            </Macro>
            <Macro Name="Stop">
                <Event Name="DXusbPCR.Stop" />
                <Action>
                    MediaPlayerClassic.Stop()
                </Action>
            </Macro>
            <Macro Name="Jump Forward Small">
                <Action>
                    MediaPlayerClassic.JumpForwardSmall()
                </Action>
                <Action>
                    EventGhost.FlushEvents()
                </Action>
            </Macro>
            <Macro Name="Jump Backward Small">
                <Action>
                    MediaPlayerClassic.JumpBackwardSmall()
                </Action>
                <Action>
                    EventGhost.FlushEvents()
                </Action>
            </Macro>
            <Macro Name="Jump Forward Medium">
                <Event Name="DXusbPCR.Page+" />
                <Action>
                    MediaPlayerClassic.JumpForwardMedium()
                </Action>
                <Action>
                    EventGhost.AutoRepeat(0.5, 0.20000000000000001, 0.029999999999999999, 0.0)
                </Action>
                <Action>
                    EventGhost.FlushEvents()
                </Action>
            </Macro>
            <Macro Name="Jump Backward Medium">
                <Event Name="DXusbPCR.Page-" />
                <Action>
                    MediaPlayerClassic.JumpBackwardMedium()
                </Action>
                <Action>
                    EventGhost.AutoRepeat(0.5, 0.20000000000000001, 0.029999999999999999, 0.0)
                </Action>
                <Action>
                    EventGhost.FlushEvents()
                </Action>
            </Macro>
            <Macro Name="Jump Forward Large">
                <Event Name="DXusbPCR.>>" />
                <Action>
                    MediaPlayerClassic.JumpForwardLarge()
                </Action>
                <Action>
                    EventGhost.AutoRepeat(0.5, 0.20000000000000001, 0.029999999999999999, 0.0)
                </Action>
                <Action>
                    EventGhost.FlushEvents()
                </Action>
            </Macro>
            <Macro Name="Jump Backward Large">
                <Event Name="DXusbPCR.<<" />
                <Action>
                    MediaPlayerClassic.JumpBackwardLarge()
                </Action>
                <Action>
                    EventGhost.AutoRepeat(0.5, 0.20000000000000001, 0.029999999999999999, 0.0)
                </Action>
                <Action>
                    EventGhost.FlushEvents()
                </Action>
            </Macro>
            <Macro Name="Jump Forward Keyframe">
                <Action>
                    MediaPlayerClassic.JumpForwardKeyframe()
                </Action>
            </Macro>
            <Macro Name="Jump Backward Keyframe">
                <Action>
                    MediaPlayerClassic.JumpBackwardKeyframe()
                </Action>
            </Macro>
            <Macro Name="Increase Rate">
                <Action>
                    MediaPlayerClassic.IncreaseRate()
                </Action>
            </Macro>
            <Macro Name="Decrease Rate">
                <Action>
                    MediaPlayerClassic.DecreaseRate()
                </Action>
            </Macro>
            <Macro Name="Reset Rate">
                <Action>
                    MediaPlayerClassic.ResetRate()
                </Action>
            </Macro>
            <Macro Name="Boss Key">
                <Action>
                    MediaPlayerClassic.BossKey()
                </Action>
            </Macro>
            <Macro Name="Next">
                <Event Name="DXusbPCR.>|" />
                <Action>
                    Window.FindWindow(None, None, u'MediaPlayerClassicW', None, None, None, False, 0.0, 0)
                </Action>
                <Action>
                    MediaPlayerClassic.UserMessage(u'922')
                </Action>
            </Macro>
            <Macro Name="Previous">
                <Event Name="DXusbPCR.|<" />
                <Action>
                    Window.FindWindow(None, None, u'MediaPlayerClassicW', None, None, None, False, 0.0, 0)
                </Action>
                <Action>
                    MediaPlayerClassic.UserMessage(u'921')
                </Action>
            </Macro>
            <Macro Name="Next Playlist Item">
                <Action>
                    MediaPlayerClassic.NextPlaylistItem()
                </Action>
            </Macro>
            <Macro Name="Previous Playlist Item">
                <Action>
                    MediaPlayerClassic.PreviousPlaylistItem()
                </Action>
            </Macro>
            <Macro Name="Open File">
                <Action>
                    MediaPlayerClassic.OpenFile()
                </Action>
            </Macro>
            <Macro Name="Open DVD">
                <Action>
                    MediaPlayerClassic.OpenDVD()
                </Action>
            </Macro>
            <Macro Name="Quick Open File">
                <Action>
                    MediaPlayerClassic.QuickOpen()
                </Action>
            </Macro>
            <Macro Name="Frame Step">
                <Event Name="DXusbPCR.Num6" />
                <Event Name="DXusbPCR.Right_arrow" />
                <Action>
                    Window.FindWindow(None, None, u'MediaPlayerClassicW', None, None, None, False, 0.0, 0)
                </Action>
                <Action>
                    MediaPlayerClassic.FrameStep()
                </Action>
                <Action>
                    EventGhost.AutoRepeat(0.29999999999999999, 0.10000000000000001, 0.0, 60.0)
                </Action>
            </Macro>
            <Macro Name="Frame Step Back">
                <Event Name="DXusbPCR.Num4" />
                <Event Name="DXusbPCR.Left_arrow" />
                <Action>
                    Window.FindWindow(None, None, u'MediaPlayerClassicW', None, None, None, False, 0.0, 0)
                </Action>
                <Action>
                    MediaPlayerClassic.FrameStepBack()
                </Action>
                <Action>
                    EventGhost.AutoRepeat(0.29999999999999999, 0.10000000000000001, 0.0, 60.0)
                </Action>
            </Macro>
            <Macro Name="Go To">
                <Action>
                    MediaPlayerClassic.GoTo()
                </Action>
            </Macro>
            <Macro Name="Audio Delay +10ms">
                <Action>
                    MediaPlayerClassic.AudioDelayAdd10ms()
                </Action>
            </Macro>
            <Macro Name="Audio Delay -10ms">
                <Action>
                    MediaPlayerClassic.AudioDelaySub10ms()
                </Action>
            </Macro>
            <Macro Name="If button is held down 2.0 sec, go to: Quit Application">
                <Event Name="DXusbPCR.Close" />
                <Action>
                    EventGhost.JumpIfLongPress(2.0, XmlIdLink(176))
                </Action>
            </Macro>
        </Folder>
        <Folder Name="View modes">
            <Folder Name="Display Toggles">
                <Macro Name="Toggle Maximize">
                    <Event Name="DXusbPCR.Num7" />
                    <Event Name="DXusbPCR.Open" />
                    <Action>
                        EventGhost.NewJumpIf(XmlIdLink(287), 2, True)
                    </Action>
                    <Action>
                        Window.FindWindow(None, None, u'MediaPlayerClassicW', None, None, None, False, 0.0, 0)
                    </Action>
                    <Action>
                        EventGhost.PythonScript(u'from eg.WinApi.Dynamic import GetWindowLong, ShowWindow, SW_RESTORE, SW_MAXIMIZE, SW_MINIMIZE\nfrom win32gui import SetWindowPos\nfrom ctypes import windll\n\n# Check that we have a window to try to maximize/restore\n# Use Find Window action before this script!\nif eg.globals.WindowsState != "Fullscreen":\n    if len(result) > 0:\n        # Check if WS_MAXIMIZE bit is set\n        if(GetWindowLong(result[0], -16) & 0x01000000):\n            eg.plugins.EventGhost.ShowOSD(\'Maximized \' + eg.WinApi.GetWindowText(eg.result[0]), None, (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 3.0, None)\n            ShowWindow(result[0], SW_RESTORE)\n            eg.plugins.MediaPlayerClassic.ViewNormal()\n            #Script Unhide Taskbar\n            eg.plugins.Taskbar.SetAutohideOff()\n        else:\n            eg.plugins.EventGhost.ShowOSD(\'Maximized \' + eg.WinApi.GetWindowText(eg.result[0]), None, (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 3.0, None)\n            eg.plugins.Taskbar.SetAutohideOn()\n            eg.plugins.MediaPlayerClassic.ViewMinimal()\n            ShowWindow(result[0], SW_MAXIMIZE)\n            #Script Hide Taskbar\n')
                    </Action>
                </Macro>
                <Macro Name="Toggle Minimize">
                    <Event Name="DXusbPCR.Num1" />
                    <Event Name="DXusbPCR.Tab" />
                    <Action>
                        EventGhost.NewJumpIf(XmlIdLink(287), 2, True)
                    </Action>
                    <Action>
                        Window.FindWindow(None, None, u'MediaPlayerClassicW', None, None, None, False, 0.0, 0)
                    </Action>
                    <Action>
                        EventGhost.PythonScript(u'from eg.WinApi.Dynamic import GetWindowLong, ShowWindow, SW_RESTORE, SW_MAXIMIZE, SW_MINIMIZE\n   \n# Check that we have a window to try to minimize/restore\n# Use Find Window action before this script!\nif eg.globals.WindowsState != "Fullscreen":\n    if len(result) > 0:\n    # Check if WS_MINIMIZE bit is set\n        if(GetWindowLong(result[0], -16) & 0x20000000):\n            eg.plugins.EventGhost.ShowOSD(\'Minimized \' + eg.WinApi.GetWindowText(eg.result[0]), None, (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 3.0, None)\n            ShowWindow(result[0], SW_RESTORE)\n        else:\n            eg.plugins.EventGhost.ShowOSD(\'Maximized \' + eg.WinApi.GetWindowText(eg.result[0]), None, (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 3.0, None)\n            ShowWindow(result[0], SW_MINIMIZE)')
                    </Action>
                </Macro>
                <Macro Name="Python Script">
                    <Action>
                        EventGhost.PythonScript(u'from win32gui import SetWindowPos\nfrom ctypes import windll\n\n#Script Hide Taskbar\nTOGGLE_HIDEWINDOW = 0x80\nhandleTaskBar = windll.user32.FindWindowA("Shell_TrayWnd", "")\nSetWindowPos(handleTaskBar, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW)\n\n#Script Unhide Taskbar\nTOGGLE_UNHIDEWINDOW = 0x40\nhandleTaskBar = windll.user32.FindWindowA("Shell_TrayWnd", "")\nSetWindowPos(handleTaskBar, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW)')
                    </Action>
                </Macro>
            </Folder>
            <Folder Name="Show OSD">
                <Macro Name="Display OSD" Expanded="True">
                    <Event Name="DXusbPCR.E-mail" />
                    <Action>
                        EventGhost.NewJumpIf(XmlIdLink(287), 2, True)
                    </Action>
                    <Action Name="Python Script">
                        EventGhost.PythonScript(u'import re\n\nmpc = eg.WindowMatcher(u\'mpc-hc.exe\', None, u\'MediaPlayerClassicW\', None, None, None, True, 0.0, 0)\nhWnd = mpc()\n\nif len(hWnd) > 0:\n    from eg.WinApi import GetWindowText\n    title = GetWindowText(hWnd[0])\n    if re.search(".mkv",title,re.I):\n        title = title.split(".mkv")[0]\n    elif re.search(".mp4",title,re.I):\n        title = title.split(".mp4")[0]\n    elif re.search(".avi",title,re.I):\n        title = title.split(".avi")[0]\n    elif re.search(".ogm",title,re.I):\n        title = title.split(".ogm") [0]\n    else:\n        title = title.split(".")[0]\n        \nelaps, rem, total = eg.plugins.MediaPlayerClassic.GetTimes()\n#print "elaps, rem, total =",elaps, rem, total\n\nx = 1\n\nwhile x < 4:\n\n    if elaps != "00:00:00":\n        if eg.globals.WindowsState == "Fullscreen": howManyBars = 100\n        if eg.globals.WindowsState != "Fullscreen": howManyBars = 100\n\n        secArray = elaps.split(\':\')\n        secArrayTotal = total.split(\':\')\n       \n        secondsTotal = int(secArrayTotal[0])*(3600)+int(secArrayTotal[1])*(60)+int(secArrayTotal[2])\n        secondsElapsed = int(secArray[0])*(3600)+int(secArray[1])*(60)+int(secArray[2])\n       \n        percent = (1.0*secondsElapsed)/(secondsTotal)*100\n        percent = int(round(percent))\n        bars = (percent * howManyBars)/100\n\n        #print "percent =",percent\n        #print "bars =",bars\n       \n        osd = title + "\\n \\n" + "[ " + "|" * bars + " " * (howManyBars - bars) + " ]" + "\\n" + " "*30 + elaps + " / " + total\n\n        if eg.globals.WindowsState <> "Fullscreen":\n            eg.plugins.EventGhost.ShowOSD(osd, u\'0;-40;0;0;0;700;0;0;0;0;3;2;1;49;Arial\', (0, 255, 255), (0, 0, 0), 4, (0, 0), 1, 1.0, False)\n        else:\n            eg.plugins.EventGhost.ShowOSD(osd, u\'0;-40;0;0;0;700;0;0;0;0;3;2;1;49;Arial\', (0, 255, 255), (0, 0, 0), 4, (0, 0), 2, 1.0, False)\n    eg.Wait(0.8)\n    #print x\n    x += 1')
                    </Action>
                </Macro>
            </Folder>
            <Folder Name="Windows State">
                <Macro Name="Windows State" id="287">
                    <Action>
                        Window.FindWindow(None, None, u'MediaPlayerClassicW', None, None, None, False, 0.0, 0)
                    </Action>
                    <Action>
                        EventGhost.PythonScript(u'from win32gui import GetWindowPlacement\n\n#SW_SHOWNORMAL = 1\n#SW_SHOWMINIMIZED = 2\n#SW_SHOWMAXIMIZED = 3\n\nFindWin = eg.WindowMatcher(None, None, u\'MediaPlayerClassicW\' , None, None, None, True, 0.0, 0)\nhwnd = FindWin()\n\ndef GetWindowStatus(hwnd):\n    showList  = ("None", "Normal", "Minimized", "Maximized")\n    placement = GetWindowPlacement(hwnd)\n    #unrem the below line to display the placement values that you need for the if placement[4] line\n    print placement\n   \n    if placement[4] == (1680, 1050, 2960, 1770):\n        return "Fullscreen"\n    else:\n        return showList[placement[1]]\n    \neg.globals.WindowsState = GetWindowStatus(hwnd[0])\n\nprint "Windows State = " + eg.globals.WindowsState')
                    </Action>
                </Macro>
            </Folder>
            <Macro Name="Fullscreen">
                <Action>
                    MediaPlayerClassic.Fullscreen()
                </Action>
            </Macro>
            <Macro Name="Fullscreen without resolution change">
                <Event Name="DXusbPCR.Full Screen" />
                <Event Name="PcRemoteController.FullScreen" />
                <Action>
                    MediaPlayerClassic.Pause()
                </Action>
                <Action>
                    EventGhost.Wait(1.0)
                </Action>
                <Action>
                    Window.FindWindow(None, None, u'MediaPlayerClassicW', None, None, None, False, 0.0, 0)
                </Action>
                <Action>
                    Window.BringToFront()
                </Action>
                <Action>
                    MediaPlayerClassic.FullscreenWOR()
                </Action>
                <Action>
                    EventGhost.Wait(2.0)
                </Action>
                <Action>
                    MediaPlayerClassic.Play()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Increase Size">
                <Action>
                    MediaPlayerClassic.PnSIncSize()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Decrease Size">
                <Action>
                    MediaPlayerClassic.PnSDecSize()
                </Action>
            </Macro>
            <Macro Name="View Minimal">
                <Action>
                    MediaPlayerClassic.ViewMinimal()
                </Action>
            </Macro>
            <Macro Name="View Compact">
                <Action>
                    MediaPlayerClassic.ViewCompact()
                </Action>
            </Macro>
            <Macro Name="View Normal">
                <Action>
                    MediaPlayerClassic.ViewNormal()
                </Action>
            </Macro>
            <Macro Name="Always On Top">
                <Action>
                    MediaPlayerClassic.AlwaysOnTop()
                </Action>
            </Macro>
            <Macro Name="Zoom 50%">
                <Action>
                    MediaPlayerClassic.Zoom50()
                </Action>
            </Macro>
            <Macro Name="Zoom 100%">
                <Action>
                    MediaPlayerClassic.Zoom100()
                </Action>
            </Macro>
            <Macro Name="Zoom 200%">
                <Action>
                    MediaPlayerClassic.Zoom200()
                </Action>
            </Macro>
            <Macro Name="Video Frame Half">
                <Action>
                    MediaPlayerClassic.VidFrmHalf()
                </Action>
            </Macro>
            <Macro Name="Video Frame Normal">
                <Action>
                    MediaPlayerClassic.VidFrmNormal()
                </Action>
            </Macro>
            <Macro Name="Video Frame Double">
                <Action>
                    MediaPlayerClassic.VidFrmDouble()
                </Action>
            </Macro>
            <Macro Name="Video Frame Stretch">
                <Action>
                    MediaPlayerClassic.VidFrmStretch()
                </Action>
            </Macro>
            <Macro Name="Video Frame Inside">
                <Action>
                    MediaPlayerClassic.VidFrmInside()
                </Action>
            </Macro>
            <Macro Name="Video Frame Outside">
                <Action>
                    MediaPlayerClassic.VidFrmOutside()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Reset">
                <Action>
                    MediaPlayerClassic.PnSReset()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Increase Width">
                <Action>
                    MediaPlayerClassic.PnSIncWidth()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Increase Height">
                <Action>
                    MediaPlayerClassic.PnSIncHeight()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Decrease Width">
                <Action>
                    MediaPlayerClassic.PnSDecWidth()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Decrease Height">
                <Action>
                    MediaPlayerClassic.PnSDecHeight()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Center">
                <Action>
                    MediaPlayerClassic.PnSCenter()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Left">
                <Action>
                    MediaPlayerClassic.PnSLeft()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Right">
                <Action>
                    MediaPlayerClassic.PnSRight()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Up">
                <Action>
                    MediaPlayerClassic.PnSUp()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Down">
                <Action>
                    MediaPlayerClassic.PnSDown()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Up/Left">
                <Action>
                    MediaPlayerClassic.PnSUpLeft()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Up/Right">
                <Action>
                    MediaPlayerClassic.PnSUpRight()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Down/Left">
                <Action>
                    MediaPlayerClassic.PnSDownLeft()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Down/Right">
                <Action>
                    MediaPlayerClassic.PnSDownRight()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Rotate X+">
                <Action>
                    MediaPlayerClassic.PnSRotateAddX()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Rotate X-">
                <Action>
                    MediaPlayerClassic.PnSRotateSubX()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Rotate Y+">
                <Action>
                    MediaPlayerClassic.PnSRotateAddY()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Rotate Z+">
                <Action>
                    MediaPlayerClassic.PnSRotateAddZ()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Rotate Z-">
                <Action>
                    MediaPlayerClassic.PnSRotateSubZ()
                </Action>
            </Macro>
        </Folder>
        <Folder Name="DVD controls">
            <Macro Name="DVD Title Menu">
                <Action>
                    MediaPlayerClassic.DVDTitleMenu()
                </Action>
            </Macro>
            <Macro Name="DVD Root Menu">
                <Action>
                    MediaPlayerClassic.DVDRootMenu()
                </Action>
            </Macro>
            <Macro Name="DVD Subtitle Menu">
                <Action>
                    MediaPlayerClassic.DVDSubtitleMenu()
                </Action>
            </Macro>
            <Macro Name="DVD Audio Menu">
                <Action>
                    MediaPlayerClassic.DVDAudioMenu()
                </Action>
            </Macro>
            <Macro Name="DVD Angle Menu">
                <Action>
                    MediaPlayerClassic.DVDAngleMenu()
                </Action>
            </Macro>
            <Macro Name="DVD Chapter Menu">
                <Action>
                    MediaPlayerClassic.DVDChapterMenu()
                </Action>
            </Macro>
            <Macro Name="DVD Menu Left">
                <Action>
                    MediaPlayerClassic.DVDMenuLeft()
                </Action>
            </Macro>
            <Macro Name="DVD Menu Right">
                <Action>
                    MediaPlayerClassic.DVDMenuRight()
                </Action>
            </Macro>
            <Macro Name="DVD Menu Up">
                <Action>
                    MediaPlayerClassic.DVDMenuUp()
                </Action>
            </Macro>
            <Macro Name="DVD Menu Down">
                <Action>
                    MediaPlayerClassic.DVDMenuDown()
                </Action>
            </Macro>
            <Macro Name="DVD Menu Activate">
                <Action>
                    MediaPlayerClassic.DVDMenuActivate()
                </Action>
            </Macro>
            <Macro Name="DVD Menu Back">
                <Action>
                    MediaPlayerClassic.DVDMenuBack()
                </Action>
            </Macro>
            <Macro Name="DVD Menu Leave">
                <Action>
                    MediaPlayerClassic.DVDMenuLeave()
                </Action>
            </Macro>
            <Macro Name="DVD Next Angle">
                <Action>
                    MediaPlayerClassic.DVDNextAngle()
                </Action>
            </Macro>
            <Macro Name="DVD Previous Angle">
                <Action>
                    MediaPlayerClassic.DVDPrevAngle()
                </Action>
            </Macro>
            <Macro Name="DVD Next Audio">
                <Action>
                    MediaPlayerClassic.DVDNextAudio()
                </Action>
            </Macro>
            <Macro Name="DVD Prev Audio">
                <Action>
                    MediaPlayerClassic.DVDPrevAudio()
                </Action>
            </Macro>
            <Macro Name="DVD Next Subtitle">
                <Action>
                    MediaPlayerClassic.DVDNextSubtitle()
                </Action>
            </Macro>
            <Macro Name="DVD Prev Subtitle">
                <Action>
                    MediaPlayerClassic.DVDPrevSubtitle()
                </Action>
            </Macro>
            <Macro Name="DVD On/Off Subtitle">
                <Action>
                    MediaPlayerClassic.DVDOnOffSubtitle()
                </Action>
            </Macro>
        </Folder>
        <Folder Name="Extended controls">
            <Macro Name="Open Device">
                <Action>
                    MediaPlayerClassic.OpenDevice()
                </Action>
            </Macro>
            <Macro Name="Save As">
                <Action>
                    MediaPlayerClassic.SaveAs()
                </Action>
            </Macro>
            <Macro Name="Save Image">
                <Action>
                    MediaPlayerClassic.SaveImage()
                </Action>
            </Macro>
            <Macro Name="Save Image Auto">
                <Action>
                    MediaPlayerClassic.SaveImageAuto()
                </Action>
            </Macro>
            <Macro Name="Load Subtitle">
                <Action>
                    MediaPlayerClassic.LoadSubTitle()
                </Action>
            </Macro>
            <Macro Name="Save Subtitle">
                <Action>
                    MediaPlayerClassic.SaveSubtitle()
                </Action>
            </Macro>
            <Macro Name="Close File">
                <Action>
                    MediaPlayerClassic.Close()
                </Action>
            </Macro>
            <Macro Name="Properties">
                <Action>
                    MediaPlayerClassic.Properties()
                </Action>
            </Macro>
            <Macro Name="Player Menu Short">
                <Action>
                    MediaPlayerClassic.PlayerMenuShort()
                </Action>
            </Macro>
            <Macro Name="Player Menu Long">
                <Action>
                    MediaPlayerClassic.PlayerMenuLong()
                </Action>
            </Macro>
            <Macro Name="Filters Menu">
                <Action>
                    MediaPlayerClassic.FiltersMenu()
                </Action>
            </Macro>
            <Macro Name="Options">
                <Action>
                    MediaPlayerClassic.Options()
                </Action>
            </Macro>
            <Macro Name="Next Audio">
                <Action>
                    MediaPlayerClassic.NextAudio()
                </Action>
            </Macro>
            <Macro Name="Previous Audio">
                <Action>
                    MediaPlayerClassic.PrevAudio()
                </Action>
            </Macro>
            <Macro Name="Next Subtitle">
                <Action>
                    MediaPlayerClassic.NextSubtitle()
                </Action>
            </Macro>
            <Macro Name="Prev Subtitle">
                <Action>
                    MediaPlayerClassic.PrevSubtitle()
                </Action>
            </Macro>
            <Macro Name="On/Off Subtitle">
                <Action>
                    MediaPlayerClassic.OnOffSubtitle()
                </Action>
            </Macro>
            <Macro Name="Reload Subtitles">
                <Action>
                    MediaPlayerClassic.ReloadSubtitles()
                </Action>
            </Macro>
            <Macro Name="Next Audio OGM">
                <Action>
                    MediaPlayerClassic.NextAudioOGM()
                </Action>
            </Macro>
            <Macro Name="Previous Audio OGM">
                <Action>
                    MediaPlayerClassic.PrevAudioOGM()
                </Action>
            </Macro>
            <Macro Name="Next Subtitle OGM">
                <Action>
                    MediaPlayerClassic.NextSubtitleOGM()
                </Action>
            </Macro>
            <Macro Name="Previous Subtitle OGM">
                <Action>
                    MediaPlayerClassic.PrevSubtitleOGM()
                </Action>
            </Macro>
        </Folder>
        <Folder Name="Toggle player controls">
            <Macro Name="Toggle Caption Menu">
                <Action>
                    MediaPlayerClassic.ToggleCaptionMenu()
                </Action>
            </Macro>
            <Macro Name="Toggle Seeker">
                <Action>
                    MediaPlayerClassic.ToggleSeeker()
                </Action>
            </Macro>
            <Macro Name="Toggle Controls">
                <Action>
                    MediaPlayerClassic.ToggleControls()
                </Action>
            </Macro>
            <Macro Name="Toggle Information">
                <Action>
                    MediaPlayerClassic.ToggleInformation()
                </Action>
            </Macro>
            <Macro Name="Toggle Statistics">
                <Action>
                    MediaPlayerClassic.ToggleStatistics()
                </Action>
            </Macro>
            <Macro Name="Toggle Status">
                <Action>
                    MediaPlayerClassic.ToggleStatus()
                </Action>
            </Macro>
            <Macro Name="Pan & Scan Rotate Y-">
                <Action>
                    MediaPlayerClassic.PnsRotateSubY()
                </Action>
            </Macro>
            <Macro Name="Toggle Subresync Bar">
                <Action>
                    MediaPlayerClassic.ToggleSubresyncBar()
                </Action>
            </Macro>
            <Macro Name="Toggle Playlist Bar">
                <Action>
                    MediaPlayerClassic.TogglePlaylistBar()
                </Action>
            </Macro>
            <Macro Name="Toggle Capture Bar">
                <Action>
                    MediaPlayerClassic.ToggleCaptureBar()
                </Action>
            </Macro>
            <Macro Name="Toggle Shader Editor Bar">
                <Action>
                    MediaPlayerClassic.ToggleShaderEditorBar()
                </Action>
            </Macro>
            <Macro Name="Toggle Default Subtitle On/Off">
                <Event Name="DXusbPCR.WWW" />
                <Action>
                    MediaPlayerClassic.UserMessage(u'2304')
                </Action>
                <Action>
                    EventGhost.ShowOSD(u'Toggle Default Subtitles', u'0;-32;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (255, 0, 0), (0, 0, 0), 0, (10, 50), 1, 2.0, False)
                </Action>
            </Macro>
        </Folder>
        <Folder Name="Test">
            <Macro Name="Media Player Classic: Show MPC menu">
                <Action>
                    EventGhost.PythonCommand("MediaPlayerClassic.ShowMenu((255, 255, 128), (0, 0, 0), '0;-35;0;0;0;700;0;0;0;0;3;2;1;34;Arial', 1, (180, 180, 180), (75, 75, 75), [[], [], [], [], []], False)")
                </Action>
            </Macro>
            <Macro Name="Media Player Classic: Get Times">
                <Action>
                    EventGhost.PythonCommand('MediaPlayerClassic.GetTimes()')
                </Action>
                <Action>
                    EventGhost.ShowOSD(u'          Total: {eg.result[2]}\nTime: {eg.result[0]} / {eg.result[1]}\n\n', u'0;-48;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (0, 255, 255), (0, 0, 0), 6, (0, 0), 0, 4.0, False)
                </Action>
            </Macro>
            <Macro Name="Media Player Classic: On Screen Go To ...">
                <Action>
                    EventGhost.PythonCommand("MediaPlayerClassic.GoTo_OSD((255, 255, 128), (0, 0, 0), u'\\uff2d\\uff33 \\u30b4\\u30b7\\u30c3\\u30af', 40, 1, (0, 0, 0), (255, 255, 128), [[], [], [], [], []], False, True)")
                </Action>
            </Macro>
        </Folder>
        <Macro Name="Clear Pending Events">
            <Event Name="DXusbPCR.SwitchWindows" />
            <Action>
                EventGhost.FlushEvents()
            </Action>
        </Macro>
    </Folder>
</EventGhost>

Re: OSE (On Screen Explorer)

Posted: Sun Apr 28, 2013 1:26 pm
by Pako
It is not possible to open as a xxxxx.xml.
It does not work. Try it yourself.

Pako

Re: OSE (On Screen Explorer)

Posted: Sun Apr 28, 2013 7:14 pm
by molitar
Ok than only other way I know is to upload the entire default.xml I was thinking you wanted me to copy the entire tree so you could paste it in EventGhost.

Re: OSE (On Screen Explorer)

Posted: Sat May 04, 2013 11:46 am
by Pako
I try to be patient. But sometimes it is difficult.
You are using EventGhost at least about 3 and a half years.
And (despite the above fact) is unsolvable task for you to delete unnecessary parts of the configuration tree.
molitar wrote:Ok than only other way I know is to upload the entire default.xml.
For example, Winamp plugin (and related parts in the configuration tree) we do not need to demonstrate your problem.
It is also possible to erase even some of the configuration tree, belonging to the plugin MPC-HC. Etc., etc.
So if you want to solve your problem, then I need you to do something about it.
I would like to get from you some simple (as much as possible) configuration tree
(it is obvious , that you must first make a backup of your working configuration).
Then I would like to know the exact procedure (step by step) how I can reproduce the problem.
Or I ask other users: Can anyone help us?

Pako

Re: OSE (On Screen Explorer)

Posted: Sat May 04, 2013 1:14 pm
by molitar
Good thing I had a backup here. I tried to clean it up and end up breaking just about everything because calls I had made in code to direct actions I did not remember stopped working.. Hence why I never deleted anything in this xml.

Ok took me quite a few attempts but I think I got all the unused macro commands removed from the xml file now that I am using. So it's alot smaller and cleaner than the original code.

Re: OSE (On Screen Explorer)

Posted: Wed Oct 16, 2013 5:00 am
by molitar
I got a problem for some dumb reason the system volume information folder started to display in my menu? Why the heck is hidden system folders showing in menu? It crashed OSE. It never use to show it before.

Re: OSE (On Screen Explorer)

Posted: Wed Oct 16, 2013 3:40 pm
by Sem;colon
Hello molitar,

did you maybe enable the function "show hidden files" (or something) in the "open explorer" action?

Re: OSE (On Screen Explorer)

Posted: Thu Aug 18, 2016 2:16 pm
by jachin99
Would there be a way to configure this plugin to read events from something like pushbullet, and have this plugin read notifications out loud?