1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-12-29 07:04:15 +02:00

Remove hardcoded MHz values, use the defined main/max clocks instead

This commit is contained in:
Paul Cercueil 2012-12-06 20:53:39 -03:00
parent df7fb985a3
commit 473949bb4f
3 changed files with 9 additions and 23 deletions

View File

@ -1210,7 +1210,7 @@ void GMenu2X::editLink() {
#ifdef HAVE_LIBOPK #ifdef HAVE_LIBOPK
} }
#endif #endif
sd.addSetting(new MenuSettingInt(this, ts, tr["Clock (default: 336)"], tr["Cpu clock frequency to set when launching this link"], &linkClock, cpuFreqMin, confInt["maxClock"], cpuFreqMultiple)); sd.addSetting(new MenuSettingInt(this, ts, tr["Clock frequency"], tr["Cpu clock frequency to set when launching this link"], &linkClock, cpuFreqMin, confInt["maxClock"], cpuFreqMultiple));
sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Directory"], tr["Directory to scan for the selector"], &linkSelDir)); sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Directory"], tr["Directory to scan for the selector"], &linkSelDir));
sd.addSetting(new MenuSettingBool(this, ts, tr["Selector Browser"], tr["Allow the selector to change directory"], &linkSelBrowser)); sd.addSetting(new MenuSettingBool(this, ts, tr["Selector Browser"], tr["Allow the selector to change directory"], &linkSelBrowser));
#ifdef HAVE_LIBOPK #ifdef HAVE_LIBOPK
@ -1350,13 +1350,7 @@ void GMenu2X::scanner() {
#ifdef PLATFORM_PANDORA #ifdef PLATFORM_PANDORA
//char *configpath = pnd_conf_query_searchpath(); //char *configpath = pnd_conf_query_searchpath();
#else #else
if (confInt["menuClock"]<336) { setSafeMaxClock();
setClock(336);
scanbg.write(font,tr["Raising cpu clock to 336MHz"],5,lineY);
scanbg.blit(s,0,0);
s->flip();
lineY += 26;
}
scanbg.write(font,tr["Scanning filesystem..."],5,lineY); scanbg.write(font,tr["Scanning filesystem..."],5,lineY);
scanbg.blit(s,0,0); scanbg.blit(s,0,0);
@ -1399,14 +1393,7 @@ void GMenu2X::scanner() {
s->flip(); s->flip();
lineY += 26; lineY += 26;
if (confInt["menuClock"]<336) { setMenuClock();
setClock(confInt["menuClock"]);
scanbg.write(font,tr["Decreasing cpu clock"],5,lineY);
scanbg.blit(s,0,0);
s->flip();
lineY += 26;
}
sync(); sync();
#endif #endif

View File

@ -159,6 +159,9 @@ public:
void changeWallpaper(); void changeWallpaper();
void setClock(unsigned mhz); void setClock(unsigned mhz);
unsigned getDefaultAppClock() { return cpuFreqAppDefault; }
void setMenuClock() { setClock(cpuFreqMenuDefault); }
void setSafeMaxClock() { setClock(cpuFreqSafeMax); }
void setInputSpeed(); void setInputSpeed();

View File

@ -68,7 +68,7 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_,
manual = ""; manual = "";
file = linkfile; file = linkfile;
dontleave = false; dontleave = false;
setClock(336); setClock(gmenu2x->getDefaultAppClock());
selectordir = ""; selectordir = "";
selectorfilter = ""; selectorfilter = "";
icon = iconPath = ""; icon = iconPath = "";
@ -418,7 +418,7 @@ void LinkApp::showManual() {
string ext8 = manual.substr(manual.size()-8,8); string ext8 = manual.substr(manual.size()-8,8);
if (ext8==".man.png" || ext8==".man.bmp" || ext8==".man.jpg" || manual.substr(manual.size()-9,9)==".man.jpeg") { if (ext8==".man.png" || ext8==".man.bmp" || ext8==".man.jpg" || manual.substr(manual.size()-9,9)==".man.jpeg") {
//Raise the clock to speed-up the loading of the manual //Raise the clock to speed-up the loading of the manual
gmenu2x->setClock(336); gmenu2x->setSafeMaxClock();
Surface *pngman = Surface::loadImage(manual); Surface *pngman = Surface::loadImage(manual);
if (!pngman) { if (!pngman) {
@ -441,7 +441,7 @@ void LinkApp::showManual() {
ss >> spagecount; ss >> spagecount;
//Lower the clock //Lower the clock
gmenu2x->setClock(gmenu2x->confInt["menuClock"]); gmenu2x->setMenuClock();
while (!close) { while (!close) {
if (repaint) { if (repaint) {
@ -496,12 +496,10 @@ void LinkApp::showManual() {
string line; string line;
ifstream infile(manual.c_str(), ios_base::in); ifstream infile(manual.c_str(), ios_base::in);
if (infile.is_open()) { if (infile.is_open()) {
gmenu2x->setClock(336);
while (getline(infile, line, '\n')) txtman.push_back(line); while (getline(infile, line, '\n')) txtman.push_back(line);
infile.close(); infile.close();
TextManualDialog tmd(gmenu2x, getTitle(), getIconPath(), &txtman); TextManualDialog tmd(gmenu2x, getTitle(), getIconPath(), &txtman);
gmenu2x->setClock(gmenu2x->confInt["menuClock"]);
tmd.exec(); tmd.exec();
} }
@ -514,12 +512,10 @@ void LinkApp::showManual() {
string line; string line;
ifstream infile(manual.c_str(), ios_base::in); ifstream infile(manual.c_str(), ios_base::in);
if (infile.is_open()) { if (infile.is_open()) {
gmenu2x->setClock(336);
while (getline(infile, line, '\n')) readme.push_back(line); while (getline(infile, line, '\n')) readme.push_back(line);
infile.close(); infile.close();
TextDialog td(gmenu2x, getTitle(), "ReadMe", getIconPath(), &readme); TextDialog td(gmenu2x, getTitle(), "ReadMe", getIconPath(), &readme);
gmenu2x->setClock(gmenu2x->confInt["menuClock"]);
td.exec(); td.exec();
} }
} }