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).

2 Pages V   1 2 >  
Reply to this topicStart new topic
Developer Tutorials, for 0.9
foosion
post Mar 24 2006, 12:51
Post #1





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



The following is a list of the known tutorials for componet developers for foobar2000 0.9.

SDK readme
Not a real tutorial, but nevertheless a required read.

Included in the SDK.


General Component Tutorial
This tutorial explains how to use some of the commonly used features with an emphasis on general purpose features. The tutorial does not show how to create an input, output or DSP component.

Download


DSP Component Tutorial
This tutorial explains how to implement a DSP service - either with presets or without.
  • Tutorial DSP without presets
    This DSP does not alter the signal, but mangles with chunks for the sake of it.
  • Tutorial DSP with presets
    The focus here is on how to support presets in a DSP. Adapted from foo_dsp_delta's "Noise sharpening" DSP with kind permission from Marc Heubeck.
Download

This post has been edited by foosion: Mar 24 2006, 16:32


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
Synthetic Soul
post Mar 24 2006, 13:33
Post #2





Group: Super Moderator
Posts: 4887
Joined: 12-August 04
From: Exeter, UK
Member No.: 16217



Good work again foosion.

The comments are superb.

Is it dumb of me to point out that, once you have closed the window, it won't come back again?


--------------------
I'm on a horse.
Go to the top of the page
+Quote Post
foosion
post Mar 24 2006, 13:41
Post #3





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



No, I think you have found I bug there. I'll try to confirm (and fix) this later.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
foosion
post Mar 24 2006, 15:12
Post #4





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



  • Fixed foo_tutorial1
  • Added precompiled binaries for foo_tutorial1
  • Added DSP tutorial


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
Eric
post Mar 26 2006, 15:27
Post #5





Group: Members
Posts: 17
Joined: 6-May 05
Member No.: 21909



Hi,
I am new on this part of the forum. Since I am using Foobar for 2 years, I would like to have a look of a development process.

But what are the requirements ?

I have downloaded and installed
- Visual C++ 2005 Express edition
- Foobar2000 SDK
- and now, these tutorials.

I have seen that foo_tutorial1 solution need to have the projects of the SDK of the same directory level (meaning extracting the foo_ in "foobar2000" directory created by the SDK), each foobar2000_* is now loaded, but some projects are still missing: "components", "librairies" and "sdk".

Do I need the .NET SDK for that?

Other topic: is the database model documented? What kind of DB it is?
Go to the top of the page
+Quote Post
foosion
post Mar 26 2006, 17:54
Post #6





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



QUOTE (Eric @ Mar 26 2006, 03:27 PM)
I have downloaded and installed
- Visual C++ 2005 Express edition
- Foobar2000 SDK
- and now, these tutorials.
You also need the Windows Platform SDK.

QUOTE (Eric @ Mar 26 2006, 03:27 PM)
I have seen that foo_tutorial1 solution need to have the projects of the SDK of the same directory level (meaning extracting the foo_ in "foobar2000" directory created by the SDK), each foobar2000_*  is now loaded, but some projects are still missing: "components", "librairies" and "sdk".
Those are not projects, but "solution folders"; in other words, they are merely a means to organize projects in a VS solution.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
TrNSZ
post Mar 31 2006, 03:49
Post #7





Group: Developer
Posts: 717
Joined: 25-September 01
From: ... The Studio
Member No.: 20



QUOTE (foosion @ Mar 26 2006, 12:54 PM)
QUOTE (Eric @ Mar 26 2006, 03:27 PM)
I have downloaded and installed
- Visual C++ 2005 Express edition
- Foobar2000 SDK
- and now, these tutorials.
You also need the Windows Platform SDK.

QUOTE (Eric @ Mar 26 2006, 03:27 PM)
I have seen that foo_tutorial1 solution need to have the projects of the SDK of the same directory level (meaning extracting the foo_ in "foobar2000" directory created by the SDK), each foobar2000_*  is now loaded, but some projects are still missing: "components", "librairies" and "sdk".
Those are not projects, but "solution folders"; in other words, they are merely a means to organize projects in a VS solution.
*



Just to let you know that when using the (free) Microsoft Visual Studio 2005 Express releases, your projects do not import ("Solution Folders not supported in this version"). It is still possible to build the projects after you setup the various SDK dependencies manually.
Go to the top of the page
+Quote Post
mixcherry
post Mar 31 2006, 22:30
Post #8





Group: Developer
Posts: 255
Joined: 9-July 04
From: Poland / Warsaw
Member No.: 15201



What is preventing Peter from releasing source code for such plugins as Autoplaylist Manager or Playback Statistics?... That would help me a lot on my way to become The Plugin Developer wink.gif And, as far as I remember, there were a lot more sample plugins included in 0.8.3 SDK. Where have they gone?...


--------------------
http://foobar2000.pl/ :: unofficial polish forum
Go to the top of the page
+Quote Post
the_LefthAND
post Apr 1 2006, 00:00
Post #9





Group: Members
Posts: 6
Joined: 27-February 06
Member No.: 28111



Hi,

i'm a newbie in developing foobar plugin, and always I find people that use only Visual C++ to develop and compile foobar2000 plugin. What about using Mingw-32? Do somebody use it to compile foobar2000 plugins?

Bye,
the_lefThAND.
Go to the top of the page
+Quote Post
TrNSZ
post Apr 1 2006, 03:57
Post #10





Group: Developer
Posts: 717
Joined: 25-September 01
From: ... The Studio
Member No.: 20



QUOTE (the_LefthAND @ Mar 31 2006, 07:00 PM)
Hi,

i'm a newbie in developing foobar plugin, and always I find people that use only Visual C++ to develop and compile foobar2000 plugin. What about using Mingw-32? Do somebody use it to compile foobar2000 plugins?

Bye,
the_lefThAND.
*


GCC is not currently capable of compiling the source code due to bugs and missing C++ features. Hopefully this situation will change one day.

However, you should be aware that Microsoft Visual Studio Express and the required Platform SDK are both free downloads from Microsoft, for now.
Go to the top of the page
+Quote Post
foosion
post Apr 1 2006, 10:56
Post #11





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



QUOTE (TrNSZ @ Apr 1 2006, 03:57 AM)
GCC is not currently capable of compiling the source code due to bugs and missing C++ features.  Hopefully this situation will change one day.
*
You will also need C++ ABI compatibility with Microsoft's compilers, not only for the vtable but also for C++ exceptions.

QUOTE (TrNSZ @ Apr 1 2006, 03:57 AM)
However, you should be aware that Microsoft Visual Studio Express and the required Platform SDK are both free downloads from Microsoft, for now.
*
The Platform SDK has been free for quite some time; it contains the toolchain (including an optimizing compiler) and all the header files and stuff you need to produce Windows binaries.
Note that ATL or MFC are only available with the non-Express versions of Visual Studio; (some) resource editors are also missing in the Expresss version, in particular the dialog editor. Nonetheless, the resource compiler is included with the Platform SDK.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
the_LefthAND
post Apr 1 2006, 12:47
Post #12





Group: Members
Posts: 6
Joined: 27-February 06
Member No.: 28111



Thanks!

I didn't know these limits of gcc, so i will try to use visual c++ express.
Go to the top of the page
+Quote Post
andrei5008
post Jun 9 2006, 14:02
Post #13





Group: Members
Posts: 6
Joined: 9-June 06
Member No.: 31664



Hi,

is there any way to have the projects for Visual Studio 2003? Unfortuanatelly, VS2003 and VS 2005 can coexist peacefully on the same OS, and I really need 2003.

I tried to do build the projects manually, but unfortunatelly the tutorial give some compile error that doesn;t appear on 2005.
Go to the top of the page
+Quote Post
Florian
post Jun 9 2006, 14:23
Post #14


Mp3tag developer


Group: FB2K Moderator (Donating)
Posts: 854
Joined: 5-May 03
From: Dresden, Germany
Member No.: 6411



QUOTE (andrei5008 @ Jun 9 2006, 15:02) *
is there any way to have the projects for Visual Studio 2003? Unfortuanatelly, VS2003 and VS 2005 can coexist peacefully on the same OS, and I really need 2003.

The foobar2000 0.9 SDK is only available for Visual Studio 2005. There is also a freely available Express edition.


--------------------
Mp3tag - universal multi-format tag editor
http://www.mp3tag.de/en/
Go to the top of the page
+Quote Post
Moitah
post Jul 17 2006, 06:55
Post #15





Group: Members
Posts: 193
Joined: 5-June 02
From: Virginia Beach, VA
Member No.: 2227



Any idea why the DSP tutorial won't compile for me? I'm using the 2006-06-22 SDK and get this error:

CODE
c:\stuff\code\foobar2000 sdk 0.9.2\foobar2000\sdk\dsp.h(321) : error C2259: 'service_impl_t<T>' : cannot instantiate abstract class
with
[
T=dsp_tutorial_nopreset
]
due to following members:
'void dsp_impl_base_t<t_baseclass>::on_endoftrack(foobar2000_io::abort_callback &)' : is abstract
with
[
t_baseclass=dsp_v2
]
c:\stuff\code\foobar2000 sdk 0.9.2\foobar2000\sdk\dsp.h(121) : see declaration of 'dsp_impl_base_t<t_baseclass>::on_endoftrack'
with
[
t_baseclass=dsp_v2
]
'void dsp_impl_base_t<t_baseclass>::on_endofplayback(foobar2000_io::abort_callback &)' : is abstract
with
[
t_baseclass=dsp_v2
]
c:\stuff\code\foobar2000 sdk 0.9.2\foobar2000\sdk\dsp.h(127) : see declaration of 'dsp_impl_base_t<t_baseclass>::on_endofplayback'
with
[
t_baseclass=dsp_v2
]
'bool dsp_impl_base_t<t_baseclass>::on_chunk(audio_chunk *,foobar2000_io::abort_callback &)' : is abstract
with
[
t_baseclass=dsp_v2
]
c:\stuff\code\foobar2000 sdk 0.9.2\foobar2000\sdk\dsp.h(133) : see declaration of 'dsp_impl_base_t<t_baseclass>::on_chunk'
with
[
t_baseclass=dsp_v2
]
c:\stuff\code\foobar2000 sdk 0.9.2\foobar2000\sdk\dsp.h(318) : while compiling class template member function 'bool dsp_entry_impl_nopreset_t<T>::instantiate(service_ptr_t<dsp> &,const dsp_preset &)'
with
[
T=dsp_tutorial_nopreset
]
c:\stuff\code\foobar2000 sdk 0.9.2\foobar2000\sdk\service.h(406) : see reference to class template instantiation 'dsp_entry_impl_nopreset_t<T>' being compiled
with
[
T=dsp_tutorial_nopreset
]
c:\stuff\code\foobar2000 sdk 0.9.2\foobar2000\sdk\dsp.h(372) : see reference to class template instantiation 'service_factory_single_t<T>' being compiled
with
[
T=dsp_entry_impl_nopreset_t<dsp_tutorial_nopreset>
]
.\foo_dsp_tutorial.cpp(133) : see reference to class template instantiation 'dsp_factory_nopreset_t<T>' being compiled
with
[
T=dsp_tutorial_nopreset
]

If I comment out these lines in the tutorial:

CODE
static dsp_factory_nopreset_t<dsp_tutorial_nopreset> foo_dsp_tutorial_nopreset;
..
static dsp_factory_t<dsp_tutorial> foo_dsp_tutorial;

Everything compiles fine. But I kind of need those 2 lines wink.gif.
Go to the top of the page
+Quote Post
Moitah
post Jul 17 2006, 22:03
Post #16





Group: Members
Posts: 193
Joined: 5-June 02
From: Virginia Beach, VA
Member No.: 2227



Nevermind, I got it (a few things need to be changed in the tutorial to make it compatible with the latest SDK).
Go to the top of the page
+Quote Post
andrei5008
post Aug 9 2006, 16:07
Post #17





Group: Members
Posts: 6
Joined: 9-June 06
Member No.: 31664



What about some documentation of the API? There are a lot of classes and functions, but except the these tutorials, there's no other inspiration source.
At least some DOXYGEN generated API summary.
Thanks.
Go to the top of the page
+Quote Post
Zastai
post Oct 23 2006, 15:21
Post #18





Group: Members
Posts: 34
Joined: 27-May 03
Member No.: 6847



QUOTE (andrei5008 @ Jun 9 2006, 05:02) *
Hi,

is there any way to have the projects for Visual Studio 2003? Unfortuanatelly, VS2003 and VS 2005 can coexist peacefully on the same OS, and I really need 2003.

I tried to do build the projects manually, but unfortunatelly the tutorial give some compile error that doesn;t appear on 2005.


2003 & 2005 can work on same machine just fine - 2005 sets up explorer so that it opens solutions/projects with the same version that was used to create them. Just be sure to install 2003 first.
Go to the top of the page
+Quote Post
AndyCar
post Nov 16 2006, 19:23
Post #19





Group: Members
Posts: 11
Joined: 19-May 03
Member No.: 6715



QUOTE (Moitah @ Jul 18 2006, 01:03) *
Nevermind, I got it (a few things need to be changed in the tutorial to make it compatible with the latest SDK).


Moitah, could you please explain what did you do to the DSP tutorial to make it compile fine with the latest SDK?

Thanks
Go to the top of the page
+Quote Post
Spirit_of_the_oc...
post Nov 27 2006, 17:10
Post #20





Group: Members
Posts: 583
Joined: 12-September 06
Member No.: 35092



I have one question: I want to modify the window in step 2 to see if I understand at least a bit of what is in this tutorial.
I have Visual C++ Express 2005 Edition: How can I create a dll?
I am shure I read it in this somewhere in devellopers section but I can't find it anymore.
Go to the top of the page
+Quote Post
kanex
post Dec 28 2006, 17:27
Post #21





Group: Members
Posts: 3
Joined: 24-February 04
Member No.: 12238



QUOTE (AndyCar @ Nov 16 2006, 10:23) *
QUOTE (Moitah @ Jul 18 2006, 01:03) *

Nevermind, I got it (a few things need to be changed in the tutorial to make it compatible with the latest SDK).


Moitah, could you please explain what did you do to the DSP tutorial to make it compile fine with the latest SDK?

Thanks
Go to the top of the page
+Quote Post
Moitah
post Jan 1 2007, 23:57
Post #22





Group: Members
Posts: 193
Joined: 5-June 02
From: Virginia Beach, VA
Member No.: 2227



Sorry for taking so long to respond, I didn't see this until now. I think I just had to add an extra parameter to some functions:

virtual bool on_chunk(audio_chunk * chunk) {
becomes
virtual bool on_chunk(audio_chunk * chunk, abort_callback &) {

virtual void on_endofplayback() {
becomes
virtual void on_endofplayback(abort_callback &) {

Also I see this function in my code which isn't in the tutorial, I'm not sure if it was required to make it work or not:

virtual void on_endoftrack(abort_callback &) {
Go to the top of the page
+Quote Post
Hancoque
post Apr 28 2007, 15:38
Post #23





Group: Members
Posts: 291
Joined: 27-January 04
From: Germany
Member No.: 11530



@Moitah: I added the abort_callback parameter to the two functions but I still get a compile error. It seems that the implementation of the on_endoftrack function is required as you assumed. Can you (or anyone else) tell me how this function has to be implemented in foo_dsp_tutorial.cpp? I tried but didn't get it to work.

This is the exact compile error description:
CODE
c:\foobar2000\foobar2000\sdk\dsp.h(321) : error C2259: 'service_impl_t<T>' : cannot instantiate abstract class
with
[
T=dsp_tutorial_nopreset
]
due to following members:
'void dsp_impl_base_t<t_baseclass>::on_endoftrack(foobar2000_io::abort_callback &)' : is abstract
with
[
t_baseclass=dsp_v2
]
c:\foobar2000\foobar2000\sdk\dsp.h(121) : see declaration of 'dsp_impl_base_t<t_baseclass>::on_endoftrack'
with
[
t_baseclass=dsp_v2
]
c:\foobar2000\foobar2000\sdk\dsp.h(318) : while compiling class template member function 'bool dsp_entry_impl_nopreset_t<T>::instantiate(service_ptr_t<dsp> &,const dsp_preset &)'
with
[
T=dsp_tutorial_nopreset
]
c:\foobar2000\foobar2000\sdk\service.h(413) : see reference to class template instantiation 'dsp_entry_impl_nopreset_t<T>' being compiled
with
[
T=dsp_tutorial_nopreset
]
c:\foobar2000\foobar2000\sdk\dsp.h(372) : see reference to class template instantiation 'service_factory_single_t<T>' being compiled
with
[
T=dsp_entry_impl_nopreset_t<dsp_tutorial_nopreset>
]
c:\foobar2000\foobar2000\foo_dsp_tutorial\foo_dsp_tutorial.cpp(133) : see reference to class template instantiation 'dsp_factory_nopreset_t<T>' being compiled
with
[
T=dsp_tutorial_nopreset
]


This post has been edited by Hancoque: Apr 29 2007, 00:00
Go to the top of the page
+Quote Post
Hancoque
post Apr 29 2007, 01:00
Post #24





Group: Members
Posts: 291
Joined: 27-January 04
From: Germany
Member No.: 11530



It's working now. I didn't notice that I had to implement the function two times (for each class). I thought the error was still there when it was in fact a new error coming from the second class. But right after that I got new compile errors. For now I have removed the second class (with presets). The class without presets compiles without any new errors. So I finally have *something* to start with.
Go to the top of the page
+Quote Post
foosion
post Jul 3 2007, 12:37
Post #25





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



Update to foo_tutorial1. The component now queries and uses the global setting for showing keyboard shortcuts in menus. Only the on_contextmenu method in steps 3 and 4 is affected.

Before:
CODE
        // Create a menu_manager that will build the context menu.
        service_ptr_t<contextmenu_manager> cmm;
        contextmenu_manager::g_create(cmm);
        // Set up flags for contextmenu_manager::init_context.
        // Initialize menu_manager for using a context menu.
        cmm->init_context(items, contextmenu_manager::FLAG_SHOW_SHORTCUTS);


After:
CODE
        // Create a menu_manager that will build the context menu.
        service_ptr_t<contextmenu_manager> cmm;
        contextmenu_manager::g_create(cmm);
        // Query setting for showing keyboard shortcuts.
        const bool show_shortcuts = config_object::g_get_data_bool_simple(standard_config_objects::bool_show_keyboard_shortcuts_in_menus, false);
        // Set up flags for contextmenu_manager::init_context.
        unsigned flags = show_shortcuts ? contextmenu_manager::FLAG_SHOW_SHORTCUTS : 0;
        // Initialize menu_manager for using a context menu.
        cmm->init_context(items, flags);


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

2 Pages V   1 2 >
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: 18th April 2014 - 06:49