IPB

Welcome Guest ( Log In | Register )

> foobar2000 Development Forum Rules

This forum is for developer discussions only. If you have a problem / bug report / idea / feature request that isn't related to foobar2000 SDK, post it in an appropiate forum instead - tech support questions go to support forum, everything else goes to general forum.
All non-developer posts on this forum will be removed. Continued abuse of this forum will result in admin actions (warnings, account suspension).

Foobar as a UPnP renderer (player
Wadsbrau
post Dec 15 2008, 18:55
Post #1





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



I am in the initial stages of creating a plugin (my first) that will make Foobar2000 a player for UPnP. I am not unfamiliar to the general logic of prgramming. I experience is mainly in C.

My code for the UPnP will compile and run as a stand alone app. Although it doesn't have any player capability at this time.
I have been able to add the UPnP stack code (as dll) to the SDK and can build it and add it to foobar with no errors and no functionality.

My first step is that I merely need to have foobar launch the UPnP code when it starts up. Howvever, I have no knowledge of Foobar's objects and functions.

Can anyone help me get started with the code that is used to initialize my plugin when foobar starts up?

I have tried this but it doesnt work:

CODE
include "../SDK/foobar2000.h"
DECLARE_COMPONENT_VERSION("Test", "0.1", NULL);

class initquit_handler : public initquit
{
    virtual void on_init()
    {
         UPnPStart();
    }
    virtual void on_quit()
     {
    
     }
};
static initquit_factory_t<initquit_handler> foo_initquit;


After I get it to launch, I merely need to tell foobar to play, pause stop etc. Then have foobar send the play progress information back to the UPnP control point.

Please help,

Thank you
Darren
Go to the top of the page
+Quote Post
 
Start new topic
Replies
foosion
post Dec 18 2008, 20:28
Post #2





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



You can't just call a function that resides in another DLL EXE. It would also be an extremely bad idea to call a function in on_init() that essentially implements the main event loop of a separate application.

This post has been edited by foosion: Dec 19 2008, 01:43


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 18 2008, 22:21
Post #3





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



QUOTE (foosion @ Dec 18 2008, 13:28) *
You can't just call a function that resides in another DLL. It would also be an extremely bad idea to call a function in on_init() that essentially implements the main event loop of a separate application.


What do you mean another dll?

Imagine that I have 8 c files of code that were generated by the Intel UPnP device builder. I meremly need to have that stack running in the background for foobar (and its real small). So that, when a command is received by the UPnP stack (such as "play"), UPnP gives the URL of the music file to Foobar and plays it etc. I've received some advice on how not to do this. Does anyone have an idea regarding how I CAN get this working. There have been many threads on many forums (old and new) from pppl wanted a way to have UPnP fuctionality with a PC. No one seems to want to tackle this issue. So I thought I would dust off my memory for writing code and give it a try. There just isnt very much documentation regarding either SDK. Although I have been able to get the UPnP code to run as an exe and figured out most of the functions involved. I just need to know a few things about getting this to work with Foobar2000. Although, I really only need to implement code that will start some sort of player that uses ASIO or KS.

I just need some help to get started.

Thank you

Darren

This post has been edited by Wadsbrau: Dec 18 2008, 22:29
Go to the top of the page
+Quote Post
foosion
post Dec 19 2008, 01:42
Post #4





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



QUOTE (Wadsbrau @ Dec 18 2008, 22:21) *
QUOTE (foosion @ Dec 18 2008, 13:28) *

You can't just call a function that resides in another DLL. It would also be an extremely bad idea to call a function in on_init() that essentially implements the main event loop of a separate application.


What do you mean another dll?
Sorry, I meant to write EXE, not DLL.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post

Posts in this topic
- Wadsbrau   Foobar as a UPnP renderer (player   Dec 15 2008, 18:55
- - Canar   I would recommend specifically not relying on anot...   Dec 15 2008, 19:29
|- - Wadsbrau   QUOTE (Canar @ Dec 15 2008, 12:29) I woul...   Dec 15 2008, 19:51
- - Canar   CODE#include "../SDK/foobar2000.h" DECLARE...   Dec 15 2008, 20:01
|- - Wadsbrau   QUOTE (Canar @ Dec 15 2008, 13:01) CODE#i...   Dec 15 2008, 20:47
- - Frank Bicking   CODEstatic initquit_factory_t<initquit_handler...   Dec 15 2008, 21:06
|- - Wadsbrau   QUOTE (Frank Bicking @ Dec 15 2008, 14:06...   Dec 18 2008, 19:04
- - foosion   You can't just call a function that resides in...   Dec 18 2008, 20:28
|- - Wadsbrau   QUOTE (foosion @ Dec 18 2008, 13:28) You ...   Dec 18 2008, 22:21
|- - foosion   QUOTE (Wadsbrau @ Dec 18 2008, 22:21) QUO...   Dec 19 2008, 01:42
- - Yirkha   You should start a separate thread in on_init(), w...   Dec 18 2008, 22:42
- - Wadsbrau   Apparently I hadnt realized that because some of m...   Dec 19 2008, 20:38
- - Wadsbrau   Oh, and BTW, can someone tell me how i can can ste...   Dec 19 2008, 21:07
- - Wadsbrau   I was also wondering if it were possible to run Fo...   Dec 20 2008, 00:31
- - Yirkha   I'm sorry, I don't have time for more exha...   Dec 20 2008, 00:57
- - Wadsbrau   I can get the UPnP code to compile as dll now. Ho...   Dec 23 2008, 18:41
- - Wadsbrau   When the UPnP programs runs on its own, it runs in...   Dec 30 2008, 21:51
|- - foosion   QUOTE (Wadsbrau @ Dec 30 2008, 21:51) I u...   Jan 1 2009, 20:47
- - Canar   Maybe if you posted an archive with all the releva...   Dec 30 2008, 22:27
- - Wadsbrau   I could do that. Are you saying just put up a .zi...   Dec 31 2008, 00:04
|- - Yirkha   QUOTE (Wadsbrau @ Dec 31 2008, 00:04) Can...   Dec 31 2008, 09:37
|- - Wadsbrau   QUOTE (Yirkha @ Dec 31 2008, 02:37) QUOTE...   Dec 31 2008, 18:11
- - Yirkha   Why? C code usually compiles fine as C++, unless t...   Jan 1 2009, 10:58
- - Wadsbrau   I found the trouble, but having issues resolving i...   Jan 2 2009, 19:55
- - Wadsbrau   I figured out that if I put the includes in a diff...   Jan 2 2009, 20:35
- - Wadsbrau   Now I need to know what functions to call: to add ...   Jan 2 2009, 20:57
- - Wadsbrau   QUOTE (Yirkha @ Dec 31 2008, 02:37) QUOTE...   Jan 2 2009, 22:07
- - Yirkha   Use main_thread_callback. ETA: Sorry about that p...   Jan 2 2009, 22:33
|- - Wadsbrau   Thank you! Could you please give me an exampl...   Jan 2 2009, 23:10
- - Yirkha   Depends on where you want to use it. If it's f...   Jan 2 2009, 23:59
- - Wadsbrau   I am figuring this out. Still having a little tro...   Jan 3 2009, 01:54


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 31st October 2014 - 07:15