void SlotWheel::SpinWheel() { int odds = rand() % 100; try{ if (odds == 1) SetWheel("$$$"); else if (odds > 1 && odds < 20) SetWheel(" ~ "); else if (odds >= 20 && odds < 40) SetWheel(" 7 "); else if (odds >= 40 && odds < 70) SetWheel(" # "); else if (odds >= 70 && odds <= 80) SetWheel(" @ "); else if (odds >= 80 && odds < 100) SetWheel("***"); } catch(exception e) { if (e.what() == "InvalidLabel") { cout << "Unexpected Error: Invalid Slot Wheel Set...Exiting" << endl; exit(0); } } }
SlotWheel::SlotWheel() { SetWheel("***"); }
void CMfxEvent::setToDefaults() { SetTime( 0 ); SetPort( 0 ); SetChannel( 0 ); switch (GetType()) { case Note: SetKey( 60 ); SetVel( 64 ); SetDur( 120 ); break; case KeyAft: SetKey( 60 ); SetPressure( 0 ); break; case Control: SetCtrlNum( CTL_MODULATION ); SetCtrlVal( 0 ); break; case Patch: SetBankSelectMethod( Normal ); SetBank( BANK_NONE ); SetPatch( 0 ); break; case ChanAft: SetPressure( 0 ); break; case Wheel: SetWheel( 0 ); break; case RPN: case NRPN: SetCtrlNum( 0 ); SetCtrlVal( 0 ); break; case Sysx: case Text: case Lyric: m_hBuffer = NULL; break; case MuteMask: m_mfxChannel = 0; m_maskSet = 0; m_maskClear = 0; break; case VelOfs: case KeyOfs: m_mfxChannel = 0; m_nOfs = 0; break; case VelTrim: case KeyTrim: m_mfxChannel = 0; m_nTrim = 0; break; case ShortMsg: m_dwShortMsg = 0; break; default: ASSERT(FALSE); break; } }