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!