本文整理汇总了C++中Playlist::SaveAs方法的典型用法代码示例。如果您正苦于以下问题:C++ Playlist::SaveAs方法的具体用法?C++ Playlist::SaveAs怎么用?C++ Playlist::SaveAs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist::SaveAs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: str
iwMusicPlayer::~iwMusicPlayer()
{
// Playlist ggf. speichern, die ausgewählt ist, falls eine ausgewählt ist
unsigned short selection = GetCtrl<ctrlComboBox>(2)->GetSelection();
// Entsprechende Datei speichern
if(selection != 0xFFFF)
{
Playlist pl;
pl.ReadMusicPlayer(this);
std::string str(GetCtrl<ctrlComboBox>(2)->GetText(selection));
// RTTR-Playlisten dürfen nicht gelöscht werden
if(str == "S2_Standard")
return;
if(!pl.SaveAs(GetFullPlaylistPath(str), true))
// Fehler, konnte nicht gespeichert werden
WINDOWMANAGER.Show(new iwMsgbox(_("Error"), _("The specified file couldn't be saved!"), this, MSB_OK, MSB_EXCLAMATIONRED));
}
// Entsprechenden Dateipfad speichern
if(selection != 0xFFFF)
SETTINGS.sound.playlist = GetCtrl<ctrlComboBox>(2)->GetText(selection);
// Werte in Musikplayer bringen
if(changed)
{
MUSICPLAYER.GetPlaylist().ReadMusicPlayer(this);
MUSICPLAYER.Play();
}
}
示例2: Msg_Input
void iwMusicPlayer::Msg_Input(const unsigned int win_id, const std::string& msg)
{
switch(win_id)
{
// Add Track - Window
case 0:
{
bool valid = false;
// Existiert diese Datei nicht?
if(ValidateFile(msg))
valid = true;
else
{
// Evtl ein Siedlerstück ("sNN")?
if(msg.length() == 3)
{
if(atoi(msg.substr(1).c_str()) <= 14)
valid = true;
}
}
// Gültiges Siedlerstück?
if(valid)
{
// Hinzufügen
GetCtrl<ctrlList>(0)->AddString(msg);
changed = true;
}
else
WINDOWMANAGER.Show(new iwMsgbox(_("Error"), _("The specified file couldn't be opened!"), this, MSB_OK, MSB_EXCLAMATIONRED));
} break;
// Add Playlist
case 1:
{
bool valid = true;
// Ungültige Namen ausschließen
if(msg.length() == 0) valid = false;
else if(!((msg[0] >= 'a' && msg[0] <= 'z') || (msg[0] >= 'A' && msg[0] <= 'Z'))) valid = false;
Playlist pl;
if(!pl.SaveAs(GetFullPlaylistPath(msg), true))
valid = false;
if(valid)
{
// Combobox updaten
UpdatePlaylistCombo(msg);
changed = true;
}
else
{
// Fehler, konnte nicht gespeichert werden
WINDOWMANAGER.Show(new iwMsgbox(_("Error"), _("The specified file couldn't be saved!"), this, MSB_OK, MSB_EXCLAMATIONRED));
}
} break;
// Add Track directory of tracks - Window
case 2:
{
std::list<std::string> lst;
ListDir(msg + "/*.ogg", false, NULL, NULL, &lst);
for(std::list<std::string>::iterator it = lst.begin(); it != lst.end(); ++it)
GetCtrl<ctrlList>(0)->AddString(*it);
changed = true;
} break;
}
}