|
From: Yoda-JM <yo...@us...> - 2010-10-19 06:56:05
|
Module: performous
Branch: master
Commit: 809fbbc4b1c2d415e66e0a907b8caf6f9feb7655
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Oct 19 08:55:46 2010 +0200
Fixed problem when going from a multiple vocal track to a single one
---
game/song.hh | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/game/song.hh b/game/song.hh
index 2f62346..c592271 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -65,12 +65,20 @@ class Song: boost::noncopyable {
vocalTracks.erase(vocalTrack);
vocalTracks.insert(std::make_pair<std::string, VocalTrack>(vocalTrack, track));
};
- // Change default value to HARMONIC_{1,2,3} to sing harmonics
+ // Get a selected track, or LEAD_VOCAL if not found or the first one if not found
VocalTrack& getVocalTrack(std::string vocalTrack = TrackName::LEAD_VOCAL) {
if(vocalTracks.find(vocalTrack) != vocalTracks.end()) {
return vocalTracks.find(vocalTrack)->second;
} else {
- return dummyVocal;
+ if(vocalTracks.find(TrackName::LEAD_VOCAL) != vocalTracks.end()) {
+ return vocalTracks.find(TrackName::LEAD_VOCAL)->second;
+ } else {
+ if(!vocalTracks.empty()) {
+ vocalTracks.begin()->second;
+ } else {
+ return dummyVocal;
+ }
+ }
}
};
std::vector<std::string> getVocalTrackNames() {
|