int main(int argc, char **argv) { wavSound*s; FILE *fin; FILE *fout; if (argc < 4 || argc > 6) { printf("Usage 1: %s <file.wav> <output.c> <soundname>\n", argv[0]); printf("Usage 2: %s <file.wav> <output.c> <soundname> <amount of samples>\n", argv[0]); exit(0); } fin = fopen(argv[1], "r"); s = loadWaveHeader(fin); if (s == NULL) { printf("Invalid wave !\n"); exit(0); } fout = fopen(argv[2], "w"); switch (argc) { case 4: saveWave(fin, s, fout, argv[3]); break; case 5: saveWave_(fin, s, fout, argv[3], atoi(argv[4])); break; default: break; } return 0; }
RenderController::RenderController(MainWindow *mainWindow, QObject *parent): QObject(parent) { this->mainWindow = mainWindow; light = new DirectionalLight; arcBall = new ArcBall(500); wireframe = false; lightRotation = false; this->display = new GLDisplay(); mainWindow->setGLDisplay(display); { // esta ordem deve ser mantida display->updateGL(); scene = new Scene3D(mainWindow); connect(display, SIGNAL(drawModel()), this, SLOT(drawModel())); connect(display, SIGNAL(lightSetup()), this, SLOT(lightSetup())); } connect(display, SIGNAL(mouseLefthFinish(QPoint,QPoint)), this, SLOT(mouseLefthFinish(QPoint,QPoint))); connect(display, SIGNAL(mouseLeftMove(QPoint,QPoint)), this, SLOT(mouseLeftMove(QPoint,QPoint))); connect(display, SIGNAL(mouseCancel()), this, SLOT(mouseCancel())); connect(mainWindow, SIGNAL(loadWave(QString)), this, SLOT(loadWave(QString))); connect(mainWindow, SIGNAL(saveWave(QString)), this, SLOT(saveWave(QString))); connect(mainWindow->actionClose, SIGNAL(triggered()), this, SLOT(closeScene())); connect(mainWindow->actionWireFrame, SIGNAL(triggered()), this, SLOT(wireFrameToggle())); connect(&timer, SIGNAL(timeout()), this, SLOT(timeOut())); timer.start(30); mainWindow->showMaximized(); }