Classes in wx/mediactrl.h aren't recognized

94 views
Skip to first unread message

Stefano Mtangoo

unread,
Feb 7, 2013, 4:04:35 AM2/7/13
to wx-users
I have class that I want to use with libvlc (well it is not a backend
for wx but a class I want to use in my MM app)
I want to take advantage of stuffs in wxMediaBackendCommonBase but
each time I use it is not recognized. It seems even media state is not
recognized and anything to do with header is not recognized.

If I do something like

class wxVLCBackend : public wxMediaBackendCommonBase{.......};
I get errors

/home/stefano/Documents/developer/Hosanna/Kasuku/Application/backend.h:
11:1: error: expected class-name before ‘{’ token
/home/stefano/Documents/developer/Hosanna/Kasuku/Application/backend.h:
39:10: error: ‘wxMediaState’ does not name a type

But if I change it to wxPanel/wxString/wxControl (for testing purpose)
It works well!

class wxVLCBackend : public wxPanel{.....};

No error!

Why is that anything in wx/mediactrl is not recognized? setup.h have
Mediactrl enabled and here is relevant part

#ifndef __WXVLCBACKEND_H__
#define __WXVLCBACKEND_H__


#include <wx/wx.h>
#include <vlc/vlc.h>
#include <wx/mediactrl.h>

class wxVLCBackend : public wxMediaBackendCommonBase
{
public:
wxVLCBackend();

~wxVLCBackend();
//..............................

};

full code http://pastebin.com/z8UKGd9y


stevec...@gmail.com

unread,
Feb 7, 2013, 7:14:01 AM2/7/13
to wx-u...@googlegroups.com
Hi Stefano,

> class wxVLCBackend : public wxMediaBackendCommonBase{.......};
> I get errors

As a wxPerl user myself, I don't really have much to say on these errors
except to say "good job".

I'm very pleased to see this work happening. I guess you've already looked
at the existing vlc backend:

http://wiki.videolan.org/WxVLCBackend

Also wxMediaCtrl has a number of dependencies. I'm not sure quite how they
might affect you, but on Linux if, for instance, you don't have GStreamer
installed wxMediaCtrl won't compile at all:

apt-get install libgconf2-dev
apt-get install libgstreamer0.10-dev
apt-get install libgstreamer-plugins-base0.10-dev
../configure --with-gtk --enable-debug --enable-mediactrl

(see http://wiki.wxwidgets.org/Linking_With_Gtk_And_Running_On_Any_Linux)

Finally, do you need to include the mediactrlcmn.h or similar file?

Regards

Steve

Stefano Mtangoo

unread,
Feb 7, 2013, 7:28:54 AM2/7/13
to wx-users


On Feb 7, 3:14 pm, <steveco.1...@gmail.com> wrote:
> Hi Stefano,
>
> > class wxVLCBackend : public wxMediaBackendCommonBase{.......};
> > I get errors
>
> As a wxPerl user myself, I don't really have much to say on these errors
> except to say "good job".
>
> I'm very pleased to see this work happening.  I guess you've already looked
> at the existing vlc backend:
>
> http://wiki.videolan.org/WxVLCBackend
>
Its not going to be wxVLC Backend per se. I have seen a patch that wa
not accepted and one responsible fainted!
I want to include it in my app and may be in future it might qualify
to wxWidgets (who knows?)
See this link for what I am saying
http://trac.wxwidgets.org/ticket/10264

> Also wxMediaCtrl has a number of dependencies.  I'm not sure quite how they
> might affect you, but on Linux if, for instance, you don't have GStreamer
> installed wxMediaCtrl won't compile at all:
>
>     apt-get install libgconf2-dev
>     apt-get install libgstreamer0.10-dev
>     apt-get install libgstreamer-plugins-base0.10-dev
>     ../configure --with-gtk --enable-debug --enable-mediactrl
>
> (seehttp://wiki.wxwidgets.org/Linking_With_Gtk_And_Running_On_Any_Linux)

I don't need GStreamer in this case since am using the Base and not
the MediaCtrl with GStreamer backend itself!
I would like to know if this can cause such problems somehow though!
>
> Finally, do you need to include the mediactrlcmn.h or similar file?

I don't think so. I checked the classes are in wx/mediactrl.h
It puzzles me that they aren't recognized!
>
> Regards
>
> Steve

stevec...@gmail.com

unread,
Feb 7, 2013, 9:07:36 AM2/7/13
to wx-u...@googlegroups.com

> I don't need GStreamer in this case since am using the Base and not
> the MediaCtrl with GStreamer backend itself!
> I would like to know if this can cause such problems somehow though!

But if you don't include it, the standard compile script will skip the
compile statement, so nothing will happen.

If you look in your configure file, there is a lot of logic around media
control. It's a bit different around 2.9.x and 2.8.x, so check yours, but
the bottom line is it looks through and checks dependencies, one of which is
GStreamer ( there are others). If they don't exist, it sets USE_MEDIA = 0
otherwise USE_MEDIA = 1.

If USE_MEDIA = 0, the script doesn't try to compile mediactrl.cpp, etc.

If you are not using the standard script then ignore all the above.

We're rootin' for you here!

Regards

Steve

Stefano Mtangoo

unread,
Feb 7, 2013, 11:08:18 AM2/7/13
to wx-users
I use standard script.
I am installing them and will come back
Thanks
>
> Regards
>
> Steve

Stefano Mtangoo

unread,
Feb 7, 2013, 1:20:39 PM2/7/13
to wx-users


On Feb 7, 5:07 pm, <steveco.1...@gmail.com> wrote:
You are right, its working now.
I wonder if there should be a form of error message if feature it is
available??
Status quo is confusing!
>
> Regards
>
> Steve

stevec...@gmail.com

unread,
Feb 7, 2013, 3:35:15 PM2/7/13
to wx-u...@googlegroups.com
> You are right, its working now.
> I wonder if there should be a form of error message if feature it is
> available??
> Status quo is confusing!

Well personally, I don't think MediaCtrl should be treated like an optional
extra.

I think the script should install all the dependencies without forcing the
user to find out about them, because as you have discovered, it is not at
all intuitive.

However the current approach is used for a number of modules, including for
example OpenGL.

I think everything should be installed by default but specialist users could
opt out if they wish.

Casual users just expect things to work.

I'm glad you got it working!

Regards,

Steve

Reply all
Reply to author
Forward
0 new messages