本文整理汇总了C++中mpd::Song::GetTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ Song::GetTitle方法的具体用法?C++ Song::GetTitle怎么用?C++ Song::GetTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpd::Song
的用法示例。
在下文中一共展示了Song::GetTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenerateFilename
std::string Lyrics::GenerateFilename(const MPD::Song &s)
{
std::string filename;
if (Config.store_lyrics_in_song_dir)
{
if (s.isFromDB())
{
filename = Config.mpd_music_dir;
filename += "/";
filename += s.GetFile();
}
else
filename = s.GetFile();
// replace song's extension with .txt
size_t dot = filename.rfind('.');
assert(dot != std::string::npos);
filename.resize(dot);
filename += ".txt";
}
else
{
std::string file = locale_to_utf_cpy(s.GetArtist());
file += " - ";
file += locale_to_utf_cpy(s.GetTitle());
file += ".txt";
EscapeUnallowedChars(file);
filename = Config.lyrics_directory;
filename += "/";
filename += file;
}
return filename;
}
示例2: updatePlayer
void updatePlayer(MPD::Client *, MPD::StatusChanges changed, void *) {
if (changed.SongID) {
if (MPD::Client::GetInstance()->isPlaying()) {
#if DEBUG
std::cout << "Song changed" << std::endl;
#endif
MPD::Song song = MPD::Client::GetInstance()->GetCurrentSong();
// set song parameters to storage
Storage::GetInstance()->loadNewSong(song);
// run agents
AgentManager::GetInstance()->songChanged();
// set text widgets
GUI::MainWindow::GetInstance()->setSongLabel(song.GetArtist() + " - " + song.GetTitle());
GUI::MainWindow::GetInstance()->setArtist(song.GetArtist());
GUI::MainWindow::GetInstance()->setTitle(song.GetTitle());
GUI::MainWindow::GetInstance()->setAlbum(song.GetAlbum());
GUI::MainWindow::GetInstance()->setGenre(song.GetGenre());
GUI::MainWindow::GetInstance()->setTimeScale(MPD::Client::GetInstance()->GetElapsedTime(), MPD::Client::GetInstance()->GetTotalTime());
}
}
if (changed.ElapsedTime) {
// if (!Config::GetInstance()->isAgentsEnabled()) {
// AgentManager::GetInstance()->killAgents();
// }
//
// AgentManager::GetInstance()->isSourcesChanged();
// load new info to widgets
GUI::MainWindow::GetInstance()->articlesWidget->updateArticlesWidget();
GUI::MainWindow::GetInstance()->slideshowWidget->updateSlideshowWidget();
// GUI::MainWindow::GetInstance()->coverWidget->updateCoverWidget();
GUI::MainWindow::GetInstance()->setTimeScale(MPD::Client::GetInstance()->GetElapsedTime(), MPD::Client::GetInstance()->GetTotalTime());
if (MPD::Client::GetInstance()->isPlaying()) {
MPD::Song song = MPD::Client::GetInstance()->GetCurrentSong();
GUI::MainWindow::GetInstance()->setSongLabel(song.GetArtist() + " - " + song.GetTitle());
GUI::MainWindow::GetInstance()->setStatusBar(_("IMPC Playing: ") + song.GetFile());
}
}
if (changed.PlayerState) {
MPD::PlayerState s = MPD::Client::GetInstance()->GetState();
if (s == MPD::psPlay) {
GUI::MainWindow::GetInstance()->on_play();
GUI::MainWindow::GetInstance()->setPlayButtonActive(true);
GUI::MainWindow::GetInstance()->setBitrate(MPD::Client::GetInstance()->GetBitrate());
} else if (s == MPD::psPause) {
GUI::MainWindow::GetInstance()->on_pause();
GUI::MainWindow::GetInstance()->setPlayButtonActive(false);
} else if (s == MPD::psStop) {
GUI::MainWindow::GetInstance()->on_stop();
GUI::MainWindow::GetInstance()->articlesWidget->clearArticlesWidget();
GUI::MainWindow::GetInstance()->slideshowWidget->clearSlide();
}
}
if (changed.DBUpdating) {
GUI::MainWindow::GetInstance()->artistsWidget->reload();
}
if (changed.Volume) {
// we set default volume
GUI::MainWindow::GetInstance()->setVolume((double) MPD::Client::GetInstance()->GetVolume());
}
AgentManager::GetInstance()->checkIfAgentsEnabled();
}