Help needed! wxMediaCtrl - Load method

Rodrigo Chacon rochacon.cursos at gmail.com
Wed Apr 4 00:35:55 PDT 2007


Hi all !
I'm new to wxWidgets and recently I'm creating a simple and multi-platform
media player using just C++ and wxWidgets (2.8.2).
The app is pretty simple, some buttons (play, pause and etc functions.) and
a playlist is all what I need.

I didn't know how to describe my problem correctly (with my poor english,
I'm brazilian) so I will just say what I do and what happen.
When I start the app and add some files to the playlist its all ok. When I
try to play some song for the first time (double clicking the wxListItem) it
play nicelly, but when I stop (or not) this song and try another one the app
just close itself. "Debuging" (Did I spell it correctly?) a little I find
that the problem occurs when I try to use the wxMediaCtrl->Load method to
the second time trying to open another file.

Since I think its not clear enough I will paste the method that is used to
do this.


// Here is the event handler to the Playlist double click
void JP_Frame::Playlist_DoubleClick( wxListEvent &event )
{
    if( ! event.GetItem().GetData() ) return;
    if( pMediaCtrl->GetState() !=3D wxMEDIASTATE_STOPPED )
        pMediaCtrl->Stop();

    pMediaCtrl->Load( (*((wxString*) event.GetItem().GetData())) );
}

PS. That "bug" is happening in Windows (I didn't try to compile it in Linux
yet).


Any help will be welcome.

Thanks you all!
Rodrigo Chacon
MSN: oreia.bnh AT gmail DOT com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20070404/11d=
90907/attachment.htm


More information about the wx-users mailing list