/** Begin play a movie in the playlist. * Private method. */ void PlaylistFrame::BeginPlayFile() { if (m_itemPlaying < m_playlist.GetSize()) { const Channel *channel = m_appInterface->GetCurrentChannel(); //Get channel bitrate Mode mode; ModeList modeList = channel->GetModeList(); modeList.FindMode(IRM_MODE_CHANNEL_BITRATE, mode); long bitrate; mode.GetParameter().ToLong(&bitrate); PlaylistItem item; std::list<PlaylistItem>::const_iterator it; it = m_playlist.Begin(); for(int i = 0;i<m_itemPlaying;i++) it++; item = *it; bool ret = m_appInterface->MovieBeginTransmission(channel->GetName(), item.GetPath(), bitrate); SetFieldsStates(ret); m_lstBoxPlaylist->SetSelection(m_itemPlaying); SetStatusText(wxString::Format(_("Playing file: %s"), item.GetFilename().c_str())); if (!ret) { wxString msg = wxString::Format(_("Error while attempt play %s"), item.GetFilename().c_str()); wxMessageBox(msg, wxMessageBoxCaptionStr, wxOK|wxICON_ERROR, this); } } else { if (m_chkBoxRepeat->IsChecked()) { m_itemPlaying = 0; BeginPlayFile(); } else { wxString msg = _("Finished send transmission of Playlist"); wxMessageBox(msg, _("Information"), wxICON_INFORMATION|wxOK, this); m_appInterface->MovieCancelTransmission(m_mediaId); SetFieldsStates(false); SetStatusText(wxEmptyString); } } }
/** Updates the playlist listbox. * */ void PlaylistFrame::UpdatePlaylist() { //Clear playlist m_lstBoxPlaylist->Clear(); m_lstBoxPlaylist->SetForegroundColour(wxColour(0,255,0)); PlaylistItem item; std::list<PlaylistItem>::const_iterator it; for(it = m_playlist.Begin(); it != m_playlist.End(); it++) { item = *it; m_lstBoxPlaylist->Append(item.GetFilename()); } }