IPB

Welcome Guest ( Log In | Register )

7 Pages V  < 1 2 3 4 5 > »   
Reply to this topicStart new topic
COM Automation Server for 0.9, Public technology preview
foosion
post May 30 2006, 23:08
Post #51





Group: FB2K Moderator (Donating)
Posts: 4439
Joined: 24-February 03
Member No.: 5153



I would say it is still struggling for development time with all my other components. wink.gif


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
LTourist
post May 31 2006, 13:20
Post #52





Group: Members
Posts: 58
Joined: 19-September 05
Member No.: 24563



Ok thanks smile.gif Good luck wink.gif
Go to the top of the page
+Quote Post
seethru
post Jun 15 2006, 13:33
Post #53





Group: Members
Posts: 10
Joined: 3-May 05
Member No.: 21846



can anyone tell me how to get this working with the G15?
Go to the top of the page
+Quote Post
LTourist
post Jun 15 2006, 18:49
Post #54





Group: Members
Posts: 58
Joined: 19-September 05
Member No.: 24563



Well if you using windows API you can use GetAsyncKeyState one wink.gif
You just have to put a number as an argument wich correspond to a key on your keyboard, when the return value is different from 0, that's mean the key had been pressed since you check GetAsyncKeyState before wink.gif This is really a simple API to use smile.gif
In wich language do you need to use foo_comserver?
Go to the top of the page
+Quote Post
DrGreen
post Jun 16 2006, 19:50
Post #55





Group: Members
Posts: 29
Joined: 22-January 05
Member No.: 19216



I'm having a problem when I try to format a track with "%disc%" and the track doesn't have any disc tag.

In this case, I'm getting a OutOfMemoryException (if using with .NET) or an OutOfMemory Error (if using with vbs)

here's a vbs to show this (based on test-medialibrary.vbs from foosion's examples). See comments inside.

CODE
option explicit

dim fb2k, ml
dim t1, t2

SetupTest

'Get all tracks in media library
set t1 = ml.GetTracks()

'CHANGE
'Get a track with no disc tag. Change the index appropriately
set t2 = t1(93)

'OK, return the title
WScript.Echo t2.FormatTitle("%title%")

'OK, the track doesn't have a tag named %blabla%, so it returns '?'
WScript.Echo t2.FormatTitle("%blabla%")

'ERROR, the track doesn't have a %disc% tag, and an OutOfMemory error
'(OutOfMemoryException in .NET) is raised
WScript.Echo t2.FormatTitle("%disc%")

CleanupTest

WScript.Echo "Done"
WScript.Quit

rem *********************************************************
rem * helpers functions
rem *********************************************************

sub SetupTest()
dim ProgID
ProgID = "Foobar2000.Application.0.7"
rem WScript.Echo "Looking for existing instance..."
set fb2k = WScript.GetObject("", ProgID)
if isnull(fb2k) then
rem WScript.Echo "Creating new instance..."
set fb2k = WScript.CreateObject(ProgID)
if isnull(fb2k) then
WScript.Echo "Failed to get foobar2000 application object."
WScript.Quit
end if
end if
set ml = fb2k.MediaLibrary
if isnull(ml) then
WScript.Echo "Failed to get foobar2000 media library object."
WScript.Quit
end if

rem save settings
end sub

sub CleanupTest()
rem restore settings
end sub


Anyone else having this problem?
Go to the top of the page
+Quote Post
Ran Sagy
post Jun 17 2006, 11:18
Post #56





Group: Members
Posts: 462
Joined: 30-March 04
From: Israel
Member No.: 13133



Same here.
Go to the top of the page
+Quote Post
zieQ
post Jul 30 2006, 20:18
Post #57





Group: Members
Posts: 5
Joined: 25-July 06
From: Rennes, France
Member No.: 33289



First, thanks for this foobar2000 components, it's really helpful wink.gif

Second, I'm developping a foobar2000 remote control for Yahoo! Widget Engine (YWE) using the COM server. YWE use javascript language, I also used JScript to test the component. So I can provide a JScript test script if you want.

Third, it seems that there are issues with the getters of the component. Here are two examples.

CODE
foobarObj.Playback.SeekRelative(10.0);

This code doesn't seem to work well in YWE, maybe it's just a YWE bug. I have a microsoft error report window. I had also an issue with JScript but I'm unable to reproduce the bug.

Also, consider this code:
CODE
// ...

// CONNECT/DISCONNECT
// connect to Foobar2000
function connect() {
    try {
        foobarObj = WScript.createObject(foobarID); // connect to Foobar2000
        fooPlayback = foobarObj.Playback;
        fooSettings = fooPlayback.Settings;
        foobarObj.Minimized = true; // start minimized
        WScript.connectObject( fooPlayback, "Playback_"); // playback event sink
        WScript.connectObject( fooSettings, "Playback_"); // playback event sink
    }
    catch(ex) {
    WScript.echo("COM createObject failed: '"+ex+"', "+ex.name + ": " + ex.message);
    }
};

// disconnect Foobar2000 event sink
function disconnect() {
    WScript.disconnectObject(fooSettings);
    WScript.disconnectObject(fooPlayback);
};

// EVENT HANDLERS
function Playback_Started( bPaused ) {
  // this line is ok
  //WScript.echo("foobar started with volume " + fooSettings.Volume + " dB");

  // this line does not work
  WScript.echo("foobar started with volume " + fooPlayback.Settings.Volume + " dB");
};


In the event handler, the first line is ok, the second one lead to an exception. And, in fact, I had a number of problems whenever I used the XXX.YYY.ZZZ syntax. I was excepting all objects were singletons but it does not seem to be true at all. Is this normal?

Edit: another remark, titleformat support is incomplete in the FormatTitle method, will it be improved?

This post has been edited by zieQ: Jul 30 2006, 20:22
Go to the top of the page
+Quote Post
foosion
post Jul 30 2006, 21:49
Post #58





Group: FB2K Moderator (Donating)
Posts: 4439
Joined: 24-February 03
Member No.: 5153



QUOTE (zieQ @ Jul 30 2006, 21:18) *
CODE
foobarObj.Playback.SeekRelative(10.0);

This code doesn't seem to work well in YWE, maybe it's just a YWE bug. I have a microsoft error report window. I had also an issue with JScript but I'm unable to reproduce the bug.
This works fine for me when run in csript.exe.

QUOTE (zieQ @ Jul 30 2006, 21:18) *
Also, consider this code:
CODE
<snip>


In the event handler, the first line is ok, the second one lead to an exception. And, in fact, I had a number of problems whenever I used the XXX.YYY.ZZZ syntax. I was excepting all objects were singletons but it does not seem to be true at all. Is this normal?
I can reproduce this problem with cscript.exe, though I'm currently not sure what's causing it. I'll post more information once I've had time to investigate this further.

QUOTE (zieQ @ Jul 30 2006, 21:18) *
Edit: another remark, titleformat support is incomplete in the FormatTitle method, will it be improved?
I'm not sure what you are referring to. If this is about track objects not supporting playlist specific or dynamic information, well, that is intended. If you want dynamic information, you should use the titleformatting method on the Playback object and specify the desired display level.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
zieQ
post Jul 31 2006, 08:42
Post #59





Group: Members
Posts: 5
Joined: 25-July 06
From: Rennes, France
Member No.: 33289



QUOTE
QUOTE (zieQ @ Jul 30 2006, 21:18) *
Also, consider this code:
CODE
<snip>


In the event handler, the first line is ok, the second one lead to an exception. And, in fact, I had a number of problems whenever I used the XXX.YYY.ZZZ syntax. I was excepting all objects were singletons but it does not seem to be true at all. Is this normal?
I can reproduce this problem with cscript.exe, though I'm currently not sure what's causing it. I'll post more information once I've had time to investigate this further.


In fact, I use wscript that way: wscript //E:Jscript FooTest.js . The problems appear in wscript, I never tried cscript.

QUOTE
QUOTE (zieQ @ Jul 30 2006, 21:18) *
Edit: another remark, titleformat support is incomplete in the FormatTitle method, will it be improved?
I'm not sure what you are referring to. If this is about track objects not supporting playlist specific or dynamic information, well, that is intended. If you want dynamic information, you should use the titleformatting method on the Playback object and specify the desired display level.


Can you tell me a bit more about display levels? I may have missed something since I can't figure what it is for? In fact, I tried to use %playback_time% in Playback.FormatTitle() and a question mark appeared.
Go to the top of the page
+Quote Post
foosion
post Jul 31 2006, 09:39
Post #60





Group: FB2K Moderator (Donating)
Posts: 4439
Joined: 24-February 03
Member No.: 5153



QUOTE (zieQ @ Jul 31 2006, 09:42) *
Can you tell me a bit more about display levels? I may have missed something since I can't figure what it is for? In fact, I tried to use %playback_time% in Playback.FormatTitle() and a question mark appeared.

From foobar2000.idl:
CODE
/**
* Display level codes. Controls level of playback related information that is visible.
*/
[
    helpstring("fbDisplayLevel Enumeration")
]
enum fbDisplayLevel
{
    /** No playback-related info */
    fbDisplayLevelNone   = 0,
    /** Static info and is_playing/is_paused stats */
    fbDisplayLevelBasic  = 1,
    /** Like fbDisplayLevelBasic plus dynamic track titles on e.g. live streams */
    fbDisplayLevelTitles = 2,
    /** Like fbDisplayLevelTitles plus timing and VBR bitrate display etc */
    fbDisplayLevelAll    = 3,
};

You use this with the FormatTitleEx() method on the Playback object.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
zieQ
post Jul 31 2006, 10:31
Post #61





Group: Members
Posts: 5
Joined: 25-July 06
From: Rennes, France
Member No.: 33289



Oops, sorry, I got my IDL file from Microsoft OLE/COM object browser instead of looking at the one distributed with the component, so there was no comment. Me dumb blink.gif
Go to the top of the page
+Quote Post
foosion
post Jul 31 2006, 16:55
Post #62





Group: FB2K Moderator (Donating)
Posts: 4439
Joined: 24-February 03
Member No.: 5153



I found the problem with the getter for the Settings property. The key points are as follows:
  • Some of the COM objects are not singletons and are only created when needed. This is to avoid having (foobar2000) event handlers registered when no (COM) listeners are registered for those.
  • Creating a Settings object causes it to register an event handler for volume changes. However, registering event handlers inside event handlers is not allowed (foobar2000 0.9.3 actively checks for this).
I'm working on a fix now that does not break the current COM API, since that would require too much time right now. For the next version, I plan to make event sources separate (non-singleton) objects. The main ideas are that you can access the API without fear of accidentally registering an event handler on the foobar2000 side, and that you will be able to specify which events you are interested in. Right now, the server makes a (blocking) IPC even for events that you do not handle.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
zieQ
post Jul 31 2006, 17:28
Post #63





Group: Members
Posts: 5
Joined: 25-July 06
From: Rennes, France
Member No.: 33289



QUOTE (foosion @ Jul 31 2006, 17:55) *
I found the problem with the getter for the Settings property. The key points are as follows:
  • Some of the COM objects are not singletons and are only created when needed. This is to avoid having (foobar2000) event handlers registered when no (COM) listeners are registered for those.
  • Creating a Settings object causes it to register an event handler for volume changes. However, registering event handlers inside event handlers is not allowed (foobar2000 0.9.3 actively checks for this).
I'm working on a fix now that does not break the current COM API, since that would require too much time right now. For the next version, I plan to make event sources separate (non-singleton) objects. The main ideas are that you can access the API without fear of accidentally registering an event handler on the foobar2000 side, and that you will be able to specify which events you are interested in. Right now, the server makes a (blocking) IPC even for events that you do not handle.


Ok, thanks for your tech support wink.gif
Go to the top of the page
+Quote Post
foosion
post Jul 31 2006, 20:43
Post #64





Group: FB2K Moderator (Donating)
Posts: 4439
Joined: 24-February 03
Member No.: 5153



Version 0.7 alpha 6 of foo_comserver2 is available on my components page now.

It should fix problems with using playback related interfaces from callbacks. It also checks whether it is properly registered on startup. (This is meant for the situation where you have multiple foobar2000 with foo_comserver2 for some reason.) There is now a preferences page where you can view the registration and running state of the server and helper objects (Tools/COM Automation server).

Note that this version requires foobar2000 0.9.3.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
LTourist
post Jul 31 2006, 21:11
Post #65





Group: Members
Posts: 58
Joined: 19-September 05
Member No.: 24563



That's a great news!!!! biggrin.gif Can we hope see more news like that in future? smile.gif Thanks
Go to the top of the page
+Quote Post
zieQ
post Aug 1 2006, 08:39
Post #66





Group: Members
Posts: 5
Joined: 25-July 06
From: Rennes, France
Member No.: 33289



I still have the same SeekRelative problem with the new version but the bug may come from Yahoo! Widget Engine, so I'll tell you more about this issue when the next version of YWE is out!

This post has been edited by zieQ: Aug 1 2006, 08:39
Go to the top of the page
+Quote Post
Ran Sagy
post Aug 3 2006, 22:03
Post #67





Group: Members
Posts: 462
Joined: 30-March 04
From: Israel
Member No.: 13133



Nice to see more updates to this. Good work, foosion smile.gif
Go to the top of the page
+Quote Post
jimbo11883
post Aug 20 2006, 07:42
Post #68





Group: Members
Posts: 59
Joined: 28-September 04
Member No.: 17362



I've been attempting to get this to work using PHP 5, using the following code...
CODE
<?php

$foobar2000 = new COM("Foobar2000.Application.0.7");
$foobar2000->Playback->FormatTitle("%artist% - %title%");    
    
?>


Obviously very simple. But the script just hangs for a minute or two and then responds with:

QUOTE
Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `Foobar2000.Application.0.7': Server execution failed ' in D:\Server\www\nightiguana\com.php:5 Stack trace: #0 D:\Server\www\nightiguana\com.php(5): com->com('Foobar2000.Appl...') #1 {main} thrown in D:\Server\www\nightiguana\com.php on line 5


My guess is that PHP 5's com support is messed up, since I can't really access any COM objects, or that I have something setup wrong.

EDIT: I've tested PHP 5's COM support and it created a word document for me, so COM seems to be working.

This post has been edited by jimbo11883: Aug 20 2006, 08:11
Go to the top of the page
+Quote Post
foosion
post Aug 24 2006, 14:51
Post #69





Group: FB2K Moderator (Donating)
Posts: 4439
Joined: 24-February 03
Member No.: 5153



I just installed a fresh copy of PHP 5.1.5. The above script works flawlessly, when I invoke the PHP interpreter from the command line ("php.exe -f test.php"). Do any of the included examples work for you?


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
jimbo11883
post Aug 24 2006, 15:04
Post #70





Group: Members
Posts: 59
Joined: 28-September 04
Member No.: 17362



As I've re-wrote my code, I no longer use the PHP COM to do my bidding, I have written a VB app which works as a proxy between the web server and foobar by using XMLHTTPRequest to send song updates to the server, which the server then generates the now playing image.

Foosion, attempt to install the latest Apache server, and try running the script as a php file from the web browser. I may just have Apache/PHP set up wrong, but it doesn't apply anymore as I'm using a different approach.
Go to the top of the page
+Quote Post
Gulp
post Sep 24 2006, 18:51
Post #71





Group: Validating
Posts: 1
Joined: 22-June 03
Member No.: 7337



Hi,

I'm currently writing a c# client to control foobar from a remote pc. Are you planning to implement these features:

- Play track at playlist index
- Select track at playlist index
- Add / enqueue tracks to playlist

Would be great!

Sebastian
Go to the top of the page
+Quote Post
deandob
post Oct 6 2006, 05:54
Post #72





Group: Members
Posts: 5
Joined: 17-January 04
Member No.: 11297



Good plugin, saves trying to work with the foobar SDK. Thank you.

QUOTE (Gulp @ Sep 24 2006, 09:51) *
Hi,

I'm currently writing a c# client to control foobar from a remote pc. Are you planning to implement these features:

- Play track at playlist index
- Select track at playlist index
- Add / enqueue tracks to playlist

Would be great!

Sebastian


Like Sebastian, I am also looking for the object model to be updated to include add and remove a track from the active playlist. If you could consider this update for your next release it would be appreciated.

Regards,
Dean
Go to the top of the page
+Quote Post
kode54
post Oct 6 2006, 09:20
Post #73





Group: Admin
Posts: 4619
Joined: 15-December 02
Member No.: 4082



QUOTE (jimbo11883 @ Aug 24 2006, 07:04) *
As I've re-wrote my code, I no longer use the PHP COM to do my bidding, I have written a VB app which works as a proxy between the web server and foobar by using XMLHTTPRequest to send song updates to the server, which the server then generates the now playing image.

Foosion, attempt to install the latest Apache server, and try running the script as a php file from the web browser. I may just have Apache/PHP set up wrong, but it doesn't apply anymore as I'm using a different approach.

Is your Apache running as a service, and if so, is it configured to run as the same user account as foobar2000? I think the default Apache service is configured to run as a network service, and it's possible that this COM server does not work across user accounts.
Go to the top of the page
+Quote Post
Rasqual
post Oct 17 2006, 14:20
Post #74





Group: Members
Posts: 27
Joined: 15-October 05
Member No.: 25136



Nice work.

I have a question: Is it possible or planned to modify the contents of a playlist, or retrieve the currently playing index (if any), and so on?

Unless I'm wrong IVBTracks/IVBTrack allow to enumerate/query various info, but not what I need here.
Go to the top of the page
+Quote Post
Ran Sagy
post Oct 19 2006, 22:33
Post #75





Group: Members
Posts: 462
Joined: 30-March 04
From: Israel
Member No.: 13133



I believe foosion is working on that part, I'm not exactly sure though.
Go to the top of the page
+Quote Post

7 Pages V  < 1 2 3 4 5 > » 
Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th September 2014 - 13:18