本文整理汇总了C++中PlaylistItem::GetPath方法的典型用法代码示例。如果您正苦于以下问题:C++ PlaylistItem::GetPath方法的具体用法?C++ PlaylistItem::GetPath怎么用?C++ PlaylistItem::GetPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlaylistItem
的用法示例。
在下文中一共展示了PlaylistItem::GetPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BeginPlayFile
/** 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);
}
}
}
示例2: SavePlaylist
/** Save playlist to file.
* Private method. Return true if file was saved or false if occurs a error.
*/
bool PlaylistFrame::SavePlaylist()
{
//If don�t have playlist, don�t create file
if (m_playlist.GetSize() == 0)
return false;
wxString wildcard = _("Playlist|*.ivl");
wxFileDialog fileDlg(this, wxFileSelectorPromptStr, wxEmptyString, wxEmptyString, wildcard, wxFD_SAVE);
if (fileDlg.ShowModal() == wxID_OK)
{
wxString filePath = fileDlg.GetPath();
if (wxFile::Access(filePath, wxFile::write))
{
MessageDialog msgDlg(this, _("Confirm"), _("Overwite file?"));
if ( msgDlg.ShowModal() == ID_MESSAGEDIALOG_BTN_NO)
return false;
}
#ifdef __WXGTK__
filePath += wxT(".ivl");
ofstream playlistFile(WX_TO_FILE_CSTR(filePath));
#else
ofstream playlistFile(WX_TO_FILE_CSTR(filePath));
#endif
PlaylistItem item;
std::list<PlaylistItem>::iterator it;
for(it = m_playlist.Begin(); it != m_playlist.End(); it++)
{
item = *it;
playlistFile << WX_TO_FILE_CSTR(item.GetPath()) << "\n";
}
playlistFile.close();
wxMessageBox(_("Playlist saved successfully."), _("Information"), wxOK, this);
}
return true;
}