context menu for preset switching. bug fix selecting presets from

projectM.  moved preset change related code from key handler to 
projectm. 


git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1262 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
w1z7ard
2009-08-16 22:47:22 +00:00
parent 4c663aabe6
commit 445a53892a
6 changed files with 333 additions and 280 deletions

View File

@ -216,82 +216,5 @@ void projectM::default_key_handler( projectMEvent event, projectMKeycode keycode
break;
}
}
void projectM::selectRandom(const bool hardCut) {
if (m_presetChooser->empty())
return;
if (!hardCut) {
timeKeeper->StartSmoothing();
}
*m_presetPos = m_presetChooser->weightedRandom();
if (!hardCut) {
switchPreset(m_activePreset2);
} else {
switchPreset(m_activePreset);
timeKeeper->StartPreset();
}
presetSwitchedEvent(hardCut, **m_presetPos);
}
void projectM::selectPrevious(const bool hardCut) {
if (m_presetChooser->empty())
return;
if (!hardCut) {
timeKeeper->StartSmoothing();
}
m_presetChooser->previousPreset(*m_presetPos);
if (!hardCut) {
switchPreset(m_activePreset2);
} else {
switchPreset(m_activePreset);
timeKeeper->StartPreset();
}
presetSwitchedEvent(hardCut, **m_presetPos);
// m_activePreset = m_presetPos->allocate();
// renderer->SetPipeline(m_activePreset->pipeline());
// renderer->setPresetName(m_activePreset->name());
//timeKeeper->StartPreset();
}
void projectM::selectNext(const bool hardCut) {
if (m_presetChooser->empty())
return;
if (!hardCut) {
timeKeeper->StartSmoothing();
std::cout << "start smoothing" << std::endl;
}
std::cout << "getting next preset" << std::endl;
m_presetChooser->nextPreset(*m_presetPos);
if (!hardCut) {
switchPreset(m_activePreset2);
} else {
switchPreset(m_activePreset);
timeKeeper->StartPreset();
}
presetSwitchedEvent(hardCut, **m_presetPos);
}