forxtra wrote:

> How about use foo_comserver2.dll(COM Automation Server) and com plugin?

Thanks for the suggestion, I already knew about that one too but never wanted 
to follow that route.

Based on your two scripts, I made one that works with default user interface 
and columns_ui with or without the buttons* (see comments in script below)
However, since I'm not a coder, I need help improving it.
First, I want to ask, if is there a need to remove/destroy(?) maps in the whole 
script after a condition is met since I'm using three maps in there.
Second, check the comments for the other question.

;--start

/* Tested with PowerPro 4.9j (4.9.1.4)
*   Foobar2000 0.9.6.8
*   with ColumnsUI plugin 0.3.7.8 */
*/

Function ControlFoobar(sParam)

local hWnd, hTlb, WM_COMMAND, fcui, fdui

hWnd = win.Handle("=foobar2000")
hTlb = win.ChildHandleList(hWnd, "c=ToolbarWindow32").word(1)
WM_COMMAND = 0x111

// with CUI (ColumnsUI)
fcui = win.Handle("c={E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}")

if (fcui) && (hTlb) do
jump foocui
elseif (!hTlb)

// menu and buttons share the same class name
// so, if buttons are hidden but the menu is visible
// the jump will fail because the result of (!hTlb) will be 0
// the jump will only occur if both b. and m. are hidden.

// How can I id both, appart from each other?

jump foo
endif

// with DUI (Default User Interface)
fdui = win.Handle("C={97E27FAA-C0B3-4b8e-A693-ED7881E99FC1}")

if (fdui) && (hTlb) do
jump foodui
elseif (!hTlb)

// with DUI the menu is not removable
// so, the jump will always occur when 
// the buttons are hidden

jump foo
endif

@foodui
local mDUI = map.Create(5)

mDUI["Stop"] = 1
mDUI["Play"] = 2
mDUI["Pause"] = 3
mDUI["Prev"] = 4
mDUI["Next"] = 5
mDUI["Random"] = 6

win.PostMessage(hTlb, WM_COMMAND, mDUI[sParam], 0)
quit

;;

@foocui
local mCUI = map.Create(6)

mCUI["Stop"] = 0
mCUI["Pause"] = 1
mCUI["Play"] = 2
mCUI["Prev"] = 3
mCUI["Next"] = 4
mCUI["Random"] = 5
mCUI["Open"] = 7

win.PostMessage(hTlb, WM_COMMAND, mCUI[sParam], 0x20614)
quit

;;

@foo
local fp, m
fp = win.ExePath("=foobar2000")

m = map.Create(6)
m["Stop"] = "/stop"
m["Pause"] = "/pause"
m["Play"] = "/play"
m["Prev"] = "/prev"
m["Next"] = "/next"
m["Random"] = "/rand"

do (fp, m[sParam])
endif
quit

;;;

;--end




David wrote:

> LOL, I made that page back in 2005 when I was making my "podcast play 
> faster" powerpro script with Foobar (which I still every week) . 
> Interesting to see people other than me using it =) Guess that who wiki 
> thing is worth it after all.....

Glad you made it David, it helped a lot!
I don't quite remember when I bookmarked the page but I started using Foobar2k 
when it was v.0.8.3 and by that time I didn't knew about PowerPro, so I made a 
toolbar in the taskbar of cli switches with play, pause buttons, worked great 
back then.

Thanks for taking the time.


Reply via email to