void FeatureArray::save(ostream* os, bool bin) { if (size() <= 0) return; if (bin) { savebin(os); } else { savetxt(os); } }
void ScoreArray::save(ostream* os, const string& score_type, bool bin) { if (size() <= 0) return; if (bin) { savebin(os, score_type); } else { savetxt(os, score_type); } }
/** * Graphical character keys handler */ char gcWindowHandler(struct panelw *p, int c) { int i; switch(c) { case KEY_DOWN: gcWindowCursor(p, p->col, p->row + 1); break; case KEY_UP: gcWindowCursor(p, p->col, p->row - 1); break; case KEY_RIGHT: gcWindowCursor(p, p->col + 1, p->row); break; case KEY_LEFT: gcWindowCursor(p, p->col - 1, p->row); break; case KEY_PPAGE: p->gcn = p->gcn == 0 ? p->gcn = 7 : (p->gcn - 1); gcActivateHandler(p); break; case KEY_NPAGE: p->gcn = (p->gcn + 1) % 8; gcActivateHandler(p); break; case 'S': savebin(p); break; case KEY_F(1): memset(p->gc, 0, 8); gcPrintGC(p); lcdSetGC(p->lcd, p->gcn, p->gc); return 0; case KEY_F(2): for(i=0; i < 8; i++) p->gc[i] = (~p->gc[i]) & 0x1f; gcPrintGC(p); lcdSetGC(p->lcd, p->gcn, p->gc); return 0; case ' ': p->gc[p->row] ^= (1 << (4 - p->col)); gcPrintGC(p); gcWindowCursor(p, p->col, p->row); lcdSetGC(p->lcd, p->gcn, p->gc); return 0; }; return 0; }
void ScoreArray::save(std::ofstream& inFile, const std::string& sctype, bool bin) { if (size()>0) (bin)?savebin(inFile, sctype):savetxt(inFile, sctype); }