Kirix Support Forums

wxMediaCtrl problem?

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

wxMediaCtrl problem?

Postby psteele on Fri Jun 02, 2006 4:01 pm

Hi,
I was wondering if anyone could help me. I'm using wxWidgets and wxAui in an application and I seem to have come across a problem with wxMediaCtrl. If I do the following:

Code: Select all
MyFrame::MyFrame(...)
{
   ...
   wxMediaCtrl* pMediaCtrl = new wxMediaCtrl( this, wxID_ANY, "blah.avi" );
   pMediaCtrl->ShowPlayerControls();
   m_pFrameManager->AddPane( pMediaCtrl );
   m_pFrameManager->Update();
}


the code will work fine and I will see a panel with the file able to play in it. What I need to do though is something along the lines of:

Code: Select all
class MyPanel : wxPanel
{
public:
   MyPanel( wxWindow* pParent, wxWindowId windowId, const wxString& filename )
   {
      wxPanel( pParent, windowId );

      m_pMediaCtrl = new wxMediaCtrl( this, MEDIA_CTRL_ENUM, filename );
      m_pMediaCtrl->ShowPlayerControls();
   }
private:
   wxMediaCtrl*      m_pMediaCtrl;
};

...

MyFrame::MyFrame(...)
{
   ...
   MyPanel* pPanel = new MyPanel( this, wxID_ANY, "blah.avi" );
   
   m_pFrameManager->AddPane( pPanel );
   m_pFrameManager->Update();
}


This time I will be able to hear the audio from the file but I will no longer be able to get any visuals :( The only real difference I can see between them is that in the first case, the wxMediaCtrl parent is MyFrame. In the second case, the wxMediaCtrl parent is MyPanel, and in turn the MyPanel parent is MyFrame. I have tested out this same code using wxTextCtrl and that works fine for both versions but it won't work for wxMediaCtrl. Is there anything in wxWidgets or wxAui that I am not doing correctly? Any help greatly appreciated!
psteele
Registered User
 
Posts: 1
Joined: Fri Jun 02, 2006 3:53 pm

Postby Joel on Sat Jun 03, 2006 1:01 am

Shouldnt you be doing
Code: Select all
class MyPanel : wxPanel
{
public:
   MyPanel( wxWindow* pParent, wxWindowId windowId, const wxString& filename )
   : wxPanel( pParent, windowId );
   {
      m_pMediaCtrl = new wxMediaCtrl( this, MEDIA_CTRL_ENUM, filename );
      m_pMediaCtrl->ShowPlayerControls();
   }
private:
   wxMediaCtrl*      m_pMediaCtrl;
};
?
Joel's Place
Project Administrator for the UPX GUI and developer for wxDev-C++

I want a legal copy of VS Professional! :P
Joel
Registered User
 
Posts: 37
Joined: Mon Jan 09, 2006 1:32 pm
Location: Singapore

Return to wxAUI Questions, Thoughts & Feedback