StartRandom now uses SongManager->GetRandomSong() instead of a shuffling method.

I made the change because I could notice to many recurring patterns in the songs being played, the distribution of random songs was too clumped.
This commit is contained in:
Christopher Pitman
2003-09-26 08:44:10 +00:00
parent 78130f2ec6
commit 56cf66195c
+13 -8
View File
@@ -1230,18 +1230,23 @@ void MusicWheel::StartRoulette()
void MusicWheel::StartRandom() void MusicWheel::StartRandom()
{ {
/* Shuffle the roulette wheel. */ /* Shuffle the roulette wheel. */
unsigned total = m_WheelItemDatas[SORT_ROULETTE].size(); //unsigned total = m_WheelItemDatas[SORT_ROULETTE].size();
for(unsigned i = 0; i < total; ++i) //for(unsigned i = 0; i < total; ++i)
swap(m_WheelItemDatas[SORT_ROULETTE][i], m_WheelItemDatas[SORT_ROULETTE][rand() % total]); // swap(m_WheelItemDatas[SORT_ROULETTE][i], m_WheelItemDatas[SORT_ROULETTE][rand() % total]);
SetOpenGroup("", SongSortOrder(SORT_ROULETTE)); //SetOpenGroup("", SongSortOrder(SORT_ROULETTE));
m_Moving = -1; //m_Moving = -1;
m_TimeBeforeMovingBegins = 0; //m_TimeBeforeMovingBegins = 0;
m_SpinSpeed = 1.0f/ROULETTE_SWITCH_SECONDS; //m_SpinSpeed = 1.0f/ROULETTE_SWITCH_SECONDS;
m_SpinSpeed *= 20.0f; /* faster! */ //m_SpinSpeed *= 20.0f; /* faster! */
//Simplify Random to make it more random than previously
m_WheelState = STATE_RANDOM_SPINNING; m_WheelState = STATE_RANDOM_SPINNING;
SelectSong(SONGMAN->GetRandomSong());
this->Select(); this->Select();
RebuildMusicWheelItems(); RebuildMusicWheelItems();
} }