QTfrontend/hwform.cpp
changeset 7392 bc3306c59a08
parent 7376 48b79b3ca592
child 7565 00568d3054d0
equal deleted inserted replaced
7390:27bfd8bbde7e 7392:bc3306c59a08
   140 
   140 
   141     ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions());
   141     ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions());
   142 
   142 
   143     config = new GameUIConfig(this, cfgdir->absolutePath() + "/hedgewars.ini");
   143     config = new GameUIConfig(this, cfgdir->absolutePath() + "/hedgewars.ini");
   144 
   144 
   145     ui.pageVideos->config = config;
   145     ui.pageVideos->init(config);
   146 
   146 
   147 #ifdef __APPLE__
   147 #ifdef __APPLE__
   148     panel = new M3Panel;
   148     panel = new M3Panel;
   149 
   149 
   150 #ifdef SPARKLE_ENABLED
   150 #ifdef SPARKLE_ENABLED
  1426             demofile.write(demo);
  1426             demofile.write(demo);
  1427             demofile.close();
  1427             demofile.close();
  1428         }
  1428         }
  1429     }
  1429     }
  1430 
  1430 
  1431     // encode videos
  1431     ui.pageVideos->startEncoding(record);
  1432     QDir videosDir(cfgdir->absolutePath() + "/VideoTemp/");
       
  1433     QStringList files = videosDir.entryList(QStringList("*.txtout"), QDir::Files);
       
  1434     foreach (const QString & str, files)
       
  1435     {
       
  1436         QString prefix = str;
       
  1437         prefix.chop(7); // remove ".txtout"
       
  1438         videosDir.rename(prefix + ".txtout", prefix + ".txtin"); // rename this file to not open it twice
       
  1439         HWRecorder* pRecorder = new HWRecorder(config, prefix);
       
  1440         ui.pageVideos->addRecorder(pRecorder);
       
  1441         pRecorder->EncodeVideo(record);
       
  1442     }
       
  1443 }
  1432 }
  1444 
  1433 
  1445 void HWForm::startTraining(const QString & scriptName)
  1434 void HWForm::startTraining(const QString & scriptName)
  1446 {
  1435 {
  1447     CreateGame(0, 0, 0);
  1436     CreateGame(0, 0, 0);