Beispiel #1
0
void PlayerEngine_vlc::get_File(std::string uri){
 /* Stop if something is playing */
    if (vlcPlayer && libvlc_media_player_is_playing(vlcPlayer))
        stopState();
    message =  "Status : Loading";
    
     /* Create a new Media */
    libvlc_media_t *vlcMedia = libvlc_media_new_path(vlcInstance,&uri[0]/*uri.c_str()*/);
    if (!vlcMedia)
     { 
       message =  "Error : failed to create media";
        return;
    }
    
     /* Create a new libvlc player */
    vlcPlayer = libvlc_media_player_new_from_media (vlcMedia);

    //gulong window_id;
  //libvlc_media_player_set_xwindow(vlcPlayer,window_id);
  
  //Player_ControlsGUI win;

  //win.set_xwindows_id(window_id);    





    /* Release the media */
    libvlc_media_release(vlcMedia);

    /* And start playback */
     /*
    libvlc_media_player_play (vlcPlayer);
    message =  "Status : Playing";
      */


// catch the exception from here

    


}
PlaylistDetailsWidget::PlaylistDetailsWidget(MainWindow* mw, QWidget* parent):
    QGridLayout()
{

    _mw = mw;
    _parent = (PlaylistHandlerWidget*) parent;

    _playlistNameLabel = new QLabel(tr("Playlist being played :"));
    _playlistDurationLabel = new QLabel(tr("Duration :"));
    _nbFilmsLabel = new QLabel(tr("Number of films :"));
    _playlistEndsInLabel = new QLabel(tr("Ends in :"));
    _playlistNameValue = new QLabel("-");
    _playlistDurationValue = new QLabel("--:--:--:");
    _nbFilmsValue = new QLabel("0");
    _playlistEndsInValue = new QLabel("--:--:--");
    _timer = new QTimer(this);

    addWidget(_playlistNameLabel,0,0);
    addWidget(_playlistNameValue,0,1);
    addWidget(_playlistDurationLabel,0,2);
    addWidget(_playlistDurationValue,0,3);
    addWidget(_nbFilmsLabel,1,0);
    addWidget(_nbFilmsValue,1,1);
    addWidget(_playlistEndsInLabel,1,2);
    addWidget(_playlistEndsInValue,1,3);

    _playlistEndsInLabel->hide();
    _playlistEndsInValue->hide();

    connect(_mw->playerControlWidget(), SIGNAL(playState()), this, SLOT(updatePlaylistWidgetEndsInPlay()));
    connect(_mw->playerControlWidget(), SIGNAL(pauseState()), this, SLOT(updatePlaylistWidgetEndsInPause()));
    connect(_mw->playerControlWidget(), SIGNAL(stopState()), this, SLOT(updatePlaylistWidgetEndsInStop()));
    connect(_mw->playerControlWidget()->seekWidget()->flipBar(), SIGNAL(positionManuallyChanged()), this, SLOT(updateEcart()));


}