void MainWindow::show( int uid ) { Show *show = eventShow(); if(show) show->show( manager()->event( uid ) ); else edit( uid ); }
bool ShowTree::addEpisode(QString title, int season, int episode, QString language, int theMovieDbId) { Show *show = this->findOrInsert(title, theMovieDbId); show->addEpisode(season, episode, language, ""); return true; }
void showr( const string & d, Show & data, int lev, std::vector<Summary> * sum, WordCount * wc ) { std::vector<string> v = find_srt_files(d); Show srts; for ( auto b : v ) { if ( !b.empty() ) { string n = b; if ( d != "." ) b = d + '/' + b; Lesson les(b, false, false); double flue1 = t2r(les.rate(0)); //double flue2 = t2r(les.rate(1)); les.updatestat(now()); *wc += les.wordcount(); if ( lev > 0 ) { output_les_stat(les.st, flue1); cout << ' ' << b << '\n'; } srts.add(les.st, flue1); if (sum) sum->push_back(Summary(d, n, b, les.st)); } } os::Dir dir = os::FileSys::readDir(d); for ( auto i : dir.dirs ) { Show sd; string dd = i; if ( d != "." ) dd = d + "/" + i; showr(dd, sd, lev - 1, sum, wc); if ( lev == 1 && sd.size() ) { output_les_stat(sd.st, sd.flue); cout << ' ' << dd << '\n'; } data += sd; } data += srts; }
Show* Show::create() { Show* ret = new (std::nothrow) Show(); if (ret) { ret->autorelease(); } return ret; }
Show* Show::create() { Show* pRet = new Show(); if (pRet) { pRet->autorelease(); } return pRet; }
int show_to(var self, var out, int pos) { if (not type_implements(type_of(self), Show)) { return print_to(out, 0, "<'%s' At 0x%p>", type_of(self), self); } else { Show* ishow = type_class(type_of(self), Show); return ishow->show(self, out, pos); } }
Show* Show::create() { Show* ret = new Show(); if (ret) { ret->autorelease(); } return ret; }
AnimateCommands AnimateCompile::Compile( const Show& show, AnimationVariables& variablesStates, AnimationErrors& errors, Show::const_Sheet_iterator_t c_sheet, unsigned pt_num, SYMBOL_TYPE cont_symbol, std::list<std::unique_ptr<ContProcedure>> const& procs) { AnimateState state{ c_sheet->GetPosition(pt_num), c_sheet->GetBeats(), variablesStates, errors, }; AnimateCompile ac(show, cont_symbol, pt_num, c_sheet, state); if (procs.empty()) { // no continuity was specified auto s = c_sheet + 1; for (; s != show.GetSheetEnd(); ++s) { if (s->IsInAnimation()) { // use EVEN REM NP ContProcEven defcont(new ContValueFloat(state.beats_rem), new ContNextPoint()); defcont.Compile(ac); break; } } if (s == show.GetSheetEnd()) { // use MTRM E ContProcMTRM defcont(new ContValueDefined(CC_E)); defcont.Compile(ac); } } for (auto& proc : procs) { proc->Compile(ac); } if ((c_sheet + 1) != show.GetSheetEnd()) { auto next_point = (c_sheet + 1)->GetPosition(pt_num); if (state.pt != next_point) { auto c = next_point - state.pt; ac.RegisterError(ANIMERR_WRONGPLACE, NULL); ac.Append(std::make_shared<AnimateCommandMove>(state.beats_rem, c), NULL); } } if (state.beats_rem) { ac.RegisterError(ANIMERR_EXTRATIME, NULL); ac.Append(std::make_shared<AnimateCommandMT>(state.beats_rem, ANIMDIR_E), NULL); } return state.cmds; }
void ManageShowWidget::buttonRemoveShowClicked() { QModelIndex currentIndex = d->ui.listShows->currentIndex(); Show *show = static_cast<Show*>( currentIndex.internalPointer() ); if( show ) { if( QMessageBox::question(this, tr("Remove a show"), tr("Are you sure you want to remove the show at '%1' ?").arg( show->venue() ), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes ) { // Delete the show DeleteShowQuery deleteShowQuery; deleteShowQuery.setShow( show ); deleteShowQuery.execute(); // Update the UI and select the previous item d->showModel->update(); int newRow = 0; if( currentIndex.row()-1 >= 0 ) { newRow = currentIndex.row()-1; } QModelIndex newIndex = d->showModel->index(newRow,0); if( newIndex.isValid() ) { d->ui.listShows->setCurrentIndex( newIndex ); } } } }
void ConsoleUI::runShowMenu(Show& show) { bool inShowMenu = true; while (inShowMenu) { int result = 3; system("cls"); cout << "ShowLog " << show.getName() << " Menu" << endl; cout << "-----------------" << endl; cout << "1. Add episode" << endl; cout << "2. View episodes" << endl; cout << "3. Return to Main Menu" << endl << endl; cout << "--> "; cin >> result; switch (result) { case 1: //TODO: ADD EPISODE MENU break; case 2: //TODO: VIEW EPISODE AND LINK TO MORE MENUS FOR CHANGING EPISODE INFORMATION break; case 3: inShowMenu = false; break; } } }
bool ShowTree::addEpisode(QString title, QString link) { QString showTitle; QString language; int season; int episode; if (!EpisodeParser::parseTitle(title, &showTitle, &language, &season, &episode)) { return false; } Show *show = this->findOrInsert(showTitle, -1); show->addEpisode(season, episode, language, link); return true; }
int main() { FactoryShow fs; Show* sa = fs.createShow(FT_A); if (NULL != sa) { sa->show(); delete sa; } Show* sb = fs.createShow(FT_B); if (NULL != sb) { sb->show(); delete sb; } return 0; }
//Méthode globale permettant la récupération des resultats d'une recherche Show ParserIMDB::parseShow(string xml) { Show show; //Liste des séries correspondant à la recherche tinyxml2::XMLDocument doc; doc.Parse((const char*)xml.c_str()); //BALISE <xml> tinyxml2::XMLNode * pRootXml = doc.FirstChild(); if (pRootXml == nullptr) return show; //BALISE <root> tinyxml2::XMLNode * pRoot = pRootXml->NextSibling(); //Suivant la réponse positive ou négative, IMDB ne répond pas le <xml> tinyxml2::XMLElement* rootResponseElement; if(pRootXml->ToElement() != nullptr) rootResponseElement = pRootXml->ToElement(); else rootResponseElement = pRoot->ToElement(); string response = rootResponseElement->Attribute("response"); if (pRoot == nullptr || response == "False") return show; //BALISE <movie> tinyxml2::XMLElement * eMovie = pRoot->FirstChild()->ToElement(); if(eMovie == nullptr) return show; string title = eMovie->Attribute("title"); show.setTitle(title); string plot = eMovie->Attribute("plot"); show.setPlot(plot); string genre = eMovie->Attribute("genre"); show.setGenre(genre); string year = eMovie->Attribute("year"); //Comportement étrange, quand '2010-', length devient 7 //Et quand 2010-2012, length devient 11 if(year.length() == 7) year.resize(4); show.setYear(year); string urlPicture = eMovie->Attribute("poster"); show.setUrlPicture(urlPicture); vector<Personne> casting; string writerString = eMovie->Attribute("actors"); if(writerString != "N/A"){ vector<Personne> acteurs = getPersonnes(writerString, Role::EnumRole::Actor); casting.insert(casting.begin(), acteurs.begin(), acteurs.end()); } string writersString = eMovie->Attribute("writer"); if(writersString != "N/A"){ vector<Personne> writers = getPersonnes(writersString, Role::EnumRole::Writer); casting.insert(casting.begin(), writers.begin(), writers.end()); } string directorsString = eMovie->Attribute("director"); if(directorsString != "N/A"){ vector<Personne> directors = getPersonnes(directorsString, Role::EnumRole::Director); casting.insert(casting.begin(), directors.begin(), directors.end()); } show.setCasting(casting); string rating = eMovie->Attribute("imdbRating"); if(rating != "N/A"){ show.setRating(atoi(rating.c_str())); } string runtime = eMovie->Attribute("runtime"); if(runtime != "N/A"){ show.setRunTime(runtime); } return show; }
Show::Show(const Show& c) : RPC2Request(Marshaller::METHOD_NSRPC2COMMUNICATION_UI__SHOW,c.getId()) { *this=c; }
Show Show::mergeShows(Show show1, Show show2){ //On part du principe que le show 1 est la référence if(show1.getTitle().empty()) show1.setTitle( show2.getTitle() ); if(show1.getPlot().empty()) show1.setPlot( show2.getPlot() ); if(show1.getChannel().empty()) show1.setChannel( show2.getChannel() ); if(show1.getGenre().empty()) show1.setGenre( show2.getGenre() ); if(show1.getRating() == 0) show1.setRating( show2.getRating() ); if(show1.getRunTime().empty()) show1.setRunTime( show2.getRunTime() ); if(show1.getUrlPicture().empty()) show1.setUrlPicture( show2.getUrlPicture() ); if(show1.getYear().empty()) show1.setYear( show2.getYear() ); if(show1.getCasting().empty()) show1.setCasting( show2.getCasting() ); else if(!show2.getCasting().empty()){ vector<Personne> vCasting1 = show1.getCasting(); vector<Personne> vCasting2 = show2.getCasting(); vCasting1.insert(vCasting1.end(), vCasting2.begin(), vCasting2.end()); vector<Personne> vCastingMerged; vector<string> vCastingMergedComparaison; for(Personne &personneFusion : vCasting1){ string comparaisonPersonne = personneFusion.getFirstName()+":" + personneFusion.getLastName()+":" + Role::RolesString[personneFusion.getRole()]; if(std::find(vCastingMergedComparaison.begin(), vCastingMergedComparaison.end(), comparaisonPersonne) == vCastingMergedComparaison.end()){ vCastingMerged.push_back(personneFusion); vCastingMergedComparaison.push_back(comparaisonPersonne); } } show1.setCasting(vCastingMerged); } return show1; }
int look_from(var self, var input, int pos) { Show* ishow = type_class(type_of(self), Show); assert(ishow->look); return ishow->look(self, input, pos); }