Skip to main content

Topic: COM Automation Server for 0.9 (Read 555467 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • jimbo11883
  • [*][*]
COM Automation Server for 0.9
Reply #25
Thanks foosion... I don't know what I'd do without you and the COM Automation Server...

  • Ran Sagy
  • [*][*][*][*]
COM Automation Server for 0.9
Reply #26
Pull out your hair from the frustration of writing a COM server plugin?

  • jimbo11883
  • [*][*]
COM Automation Server for 0.9
Reply #27
lol

  • jimbo11883
  • [*][*]
COM Automation Server for 0.9
Reply #28
Quote
Thanks for reporting. This was due to a bug in the SDK. Fixed version of COM server should be up tomorrow.
[a href="index.php?act=findpost&pid=367306"][{POST_SNAPBACK}][/a]

I just downloaded the current version available and still have the problem... Did you fix this bug yet? Thanks for your help.

  • foosion
  • [*][*][*][*][*]
  • Moderator
COM Automation Server for 0.9
Reply #29
It seems the fixed versions was not uploaded correctly. The correct version is now available for download.
http://foosion.foobar2000.org/ - my components for foobar2000

  • jimbo11883
  • [*][*]
COM Automation Server for 0.9
Reply #30
Thanks foosion!!!

EDIT:

I received this error after un-installing the older version of the plugin, then downloading the new version and installing it. I even tried re-downloading the latest 0.9 beta and installing that too.

Failed to load DLL: foo_comserver2.dll
Reason: Wrong version number; this component appears to have been built with newer version of foobar2000 SDK, please download latest version of foobar2000 in order to use it.
  • Last Edit: 10 March, 2006, 01:31:09 PM by jimbo11883

  • foosion
  • [*][*][*][*][*]
  • Moderator
COM Automation Server for 0.9
Reply #31
 That's what happens, when you don't check twice. My development machine already has the latest internal version and matching SDK installed. Sorry for that. I'm not sure what will happen first: me recompiling the component with an older SDK (provided I can still find it here), or Peter releasing a new RC. We'll see.
http://foosion.foobar2000.org/ - my components for foobar2000

  • jimbo11883
  • [*][*]
COM Automation Server for 0.9
Reply #32
OK. I know how crazy it can get developing with an ever changing SDK/API...

  • foosion
  • [*][*][*][*][*]
  • Moderator
COM Automation Server for 0.9
Reply #33
Luckily, the SDK will be stable, once 0.9 goes final, so that's another good reason not to release it before that.

By the way, the version of foo_comserver2 on my page should work with the now current RC (2006-03-11).
http://foosion.foobar2000.org/ - my components for foobar2000

  • jimbo11883
  • [*][*]
COM Automation Server for 0.9
Reply #34
Thanks foosion!

  • LTourist
  • [*][*]
COM Automation Server for 0.9
Reply #35
So next weekend, if we have the chance to see developement of COM server advanced again?  Thx foosion and all the foobar stuuf for the wonderful job you do  I'll continue my remote control of foobar soft with all the media library and playlist display on a LCD screen and the ability to manage it with remote (like remote wonder)...  THX
  • Last Edit: 11 March, 2006, 07:02:56 PM by LTourist

COM Automation Server for 0.9
Reply #36
foosian,

I really like this and it works great.

One addition, when appropriate would be a method supporting the enqueue function in 0.9 - so that we could remotely add an item to the playback queue.

That would be perfect!

Thanks again,
R

  • LTourist
  • [*][*]
COM Automation Server for 0.9
Reply #37
This existed in the previous 0.8.3 version... Foosion will include this later he told me

  • Ran Sagy
  • [*][*][*][*]
COM Automation Server for 0.9
Reply #38
Here's a simple now playing COM Client i made for mIRC. Just put all the files in one place and load the .mrc file inside mirc. The script should then register the DLL (I wonder if there's a way to automatethe registering better) and the F1\Ctrl+F1 keys handle displaying the info.

Have a look in the script and source files if you wanna know more. Basically used foosion's C# example and another "C# dlls in mirc howto" document, Nothing fancy.

http://rapidshare.de/files/15719603/NowPlaying.rar.html

  • LTourist
  • [*][*]
COM Automation Server for 0.9
Reply #39
Foosion, you said on your page that the components should work with Final, but the link for COM automation server is dead on the first post

  • foosion
  • [*][*][*][*][*]
  • Moderator
COM Automation Server for 0.9
Reply #40
The download link on my components page works though.
http://foosion.foobar2000.org/ - my components for foobar2000

  • Chaser
  • [*][*][*][*]
COM Automation Server for 0.9
Reply #41
Great to see an example for VB6. I really (!) like to see that. Will play with it soon.
One annotation: You could update the license.rtf (2005 is over).

Servus
Chaser

  • LTourist
  • [*][*]
COM Automation Server for 0.9
Reply #42
Does a new version planned soon?  I can't wait this plugin advanced, so wonderful
Regards

  • Ran Sagy
  • [*][*][*][*]
COM Automation Server for 0.9
Reply #43
I wonder how easy to do will be a c++ example. Since COM is atriciouly hard to do right in cpp.

  • LTourist
  • [*][*]
COM Automation Server for 0.9
Reply #44
Any news about this plugin developpement foosion?

Regards

COM Automation Server for 0.9
Reply #45
I wrote a simple COM client in Ruby, mainly to use for fetching album art for songs in the media library.  Since I (or someone smarter than me) will probably come up with better uses for it in the future, I set up a project page at RubyForge.

The simplest use of the script can be summed up in:
Code: [Select]
require "fetch_album_art"

fetch = FetchAlbumArt.new
fetch.fetch_now_playing  # searches for the album art on Amazon for the currently playing track in foobar2000
fetch.download  # downloads the album art using titleformat script "$crc32(%artist% - %album%).jpg"

The documentation should explain a lot on how everything works.  As of now, the source files are only on SVN.  Once I clean them up a little more, I'll probably package it into a nice installer (so you won't have to mess with the actual code as much).

To incorporate this back into foobar2000, I have the foo_uie_albumart search for album art in "E:\Art\$crc32(%artist% - %album%)".

Excellent plugin foosion.

  • Ran Sagy
  • [*][*][*][*]
COM Automation Server for 0.9
Reply #46
Foosion, Do you know what basic steps are needed for writing a very simple C++ client?
I've tried including the interface definitions and header files, but couldn't get any of the instances to work properly. My experience with COM is mainly COM+ .NET style, and not much at 'old world COM', sadly.

Anything to help would be appriciated (Right now, as a very ugly workaround, i have a C++ DLL calling a .NET DLL that communicates with foobar's COM Server - i wanna get rid of the .NET dll for compabiltiy with other software).

I could post the very simple c# code im using - more or less get a playback instance, grabs the title format for the current playing track along with some other minor details (foobar version, active playlist index and length) and thats about it.

Again, Any help by anyone with knowledge in COM would be appriciated, Thanks in advance.

  • foosion
  • [*][*][*][*][*]
  • Moderator
COM Automation Server for 0.9
Reply #47
Here is a very simple C++ console application that writes some information about the currently playing song to stdout. Note that it requires ATL which does not work all that well with Visual C++ 2005 Express Edition, though the code can be converted to plain COM code. On the other hand, it compiles under VS2003 or even VC6 (untested). You also have to link foobar2000_i.c from the comserver2/include directory with your code.

stdafx.h:
Code: [Select]
#pragma once

#include <iostream>
#include <tchar.h>
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors are explicit

#include <atlbase.h>

#include <foobar2000_h.h> // add comserver2/include to your project's include directories

cpptest.cpp:
Code: [Select]
// cpptest.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

static void g_report_error(HRESULT hRes, LPCTSTR pszInfo) {
HLOCAL hBuffer = NULL;
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
NULL, hRes, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), (LPTSTR)(LPVOID)&hBuffer, 0, NULL) > 0) {
LPCTSTR pszMessage = (LPCTSTR)::LocalLock(hBuffer);
if (pszMessage != NULL) {
_tprintf(_T("%s: %s"), pszInfo, pszMessage);
::LocalUnlock(hBuffer);
}
} else {
_tprintf(_T("%s: 0x%08X"), pszInfo, hRes);
}
if (hBuffer != NULL)
::LocalFree(hBuffer);
}

static void g_test() {
CComPtr<IVBApplication> pApp;
HRESULT hRes = pApp.CoCreateInstance(CLSID_Application07);
if (FAILED(hRes)) {
g_report_error(hRes, _T("Object could not be created"));
return;
}

CComPtr<IVBPlayback> pPlayback;
hRes = pApp->get_Playback(&pPlayback);
if (FAILED(hRes)) {
g_report_error(hRes, _T("Playback control could not be accessed"));
return;
}

CComBSTR strFormat;
strFormat = L"%artist% - %title%";
CComBSTR strResult;
hRes = pPlayback->FormatTitle(strFormat, &strResult);
if (FAILED(hRes)) {
g_report_error(hRes, _T("Title formatting failed"));
return;
}

#ifdef _UNICODE
_tprintf(strResult);
#else
#error port me!
#endif
}

int _tmain(int argc, _TCHAR* argv[]) {
::CoInitialize(NULL);
// TODO parse arguments

g_test();

::CoUninitialize();

return 0;
}
http://foosion.foobar2000.org/ - my components for foobar2000

  • Ran Sagy
  • [*][*][*][*]
COM Automation Server for 0.9
Reply #48
Most of that makes sense to me, I'll give it a shot tommorow night or the night after when I'm home.

I have the professional version of 2005 at home, Lets hope ATL works decently with that, or with 2005 at all.

I've seem some mentioning in MSDN docs about ATL and 2005, but they were more refering to the fact that some things wouldn't compile on 2005 anymore (like BSTR concatnation, needs to be wrapped with some other type of class, CString\CStringW).

Anyway, thanks for the example, appriciated.

  • LTourist
  • [*][*]
COM Automation Server for 0.9
Reply #49
Foosion, please, I don't want you answer me "Yes, a new version is coming at the %date% ^^". I would know if this plugin is sill under developpement or not (or still under developement, but paused at the moment), because I need it for my project, and if it's not under developpement yet, then I'll search an other way to do what I want to...Not a problem

Regards
LTourist