require mpd >= 0.16.0

This commit is contained in:
Andrzej Rybczak
2012-09-12 20:06:26 +02:00
parent 4b60214ed1
commit a8e3d0fd2d
4 changed files with 3 additions and 17 deletions

View File

@@ -1973,16 +1973,6 @@ void ToggleFindMode::Run()
Statusbar::msg("Search mode: %s", Config.wrapped_search ? "Wrapped" : "Normal"); Statusbar::msg("Search mode: %s", Config.wrapped_search ? "Wrapped" : "Normal");
} }
bool ToggleReplayGainMode::canBeRun() const
{
if (Mpd.Version() < 16)
{
Statusbar::msg("Replay gain mode control is supported in MPD >= 0.16.0");
return false;
}
return true;
}
void ToggleReplayGainMode::Run() void ToggleReplayGainMode::Run()
{ {
using Global::wFooter; using Global::wFooter;

View File

@@ -824,7 +824,6 @@ struct ToggleReplayGainMode : public Action
ToggleReplayGainMode() : Action(aToggleReplayGainMode, "toggle_replay_gain_mode") { } ToggleReplayGainMode() : Action(aToggleReplayGainMode, "toggle_replay_gain_mode") { }
protected: protected:
virtual bool canBeRun() const;
virtual void Run(); virtual void Run();
}; };

View File

@@ -124,9 +124,9 @@ int main(int argc, char **argv)
if (!Action::ConnectToMPD()) if (!Action::ConnectToMPD())
exit(1); exit(1);
if (Mpd.Version() < 14) if (Mpd.Version() < 16)
{ {
std::cout << "MPD < 0.14 is not supported, please upgrade.\n"; std::cout << "MPD < 0.16.0 is not supported, please upgrade.\n";
exit(1); exit(1);
} }

View File

@@ -1066,10 +1066,7 @@ bool TagEditor::WriteTags(MPD::MutableSong &s)
WriteID3v2("TCOM", tag, list); // composer WriteID3v2("TCOM", tag, list); // composer
GetTagList(list, s, &MPD::Song::getPerformer); GetTagList(list, s, &MPD::Song::getPerformer);
// in >=mpd-0.16 treating TOPE frame as performer tag WriteID3v2("TPE3", tag, list); // performer
// was dropped in favor of TPE3/TPE4 frames, so we have
// to write frame accurate to used mpd version
WriteID3v2(Mpd.Version() < 16 ? "TOPE" : "TPE3", tag, list); // performer
} }
else if (TagLib::Ogg::Vorbis::File *ogg_file = dynamic_cast<TagLib::Ogg::Vorbis::File *>(f.file())) else if (TagLib::Ogg::Vorbis::File *ogg_file = dynamic_cast<TagLib::Ogg::Vorbis::File *>(f.file()))
{ {