/*
 * DELETE ME!! TESTING ONLY!
 */
void controller::ApplicationController::run() {
	bool added = addMovie("Fargo", "20th Century Fox", 120, "R");
	added = addMovie("Batman", "20th Century Fox", 120, "R");
	added = addMovie("Aladdin", "Doesn't Matter", 110, "G");
	added = addMovie("Zelda", "Paramount", 130, "PG");
//	added = addMovie("Mama Mia", "20th Century Fox", 99, "PG-13");

}
Пример #2
0
void caddMovie(int length, char * title, char * desc) {
	printf(ANSI_COLOR_CYAN"---- AGREGANDO PELICULA ----\n");
	char* answer = addMovie(length, title, desc);
	if (answer[0] == 0) {
		printf(ANSI_COLOR_RED"Server not found\n"ANSI_COLOR_RESET);
		return;
	}
	printf(ANSI_COLOR_MAGENTA" %s ", answer);
}
Пример #3
0
//new movie clicked
void MainWindow::on_pushButton_clicked()
{
    int maxNr = 0;
    QSqlQuery query;
    query.exec("SELECT nr FROM movie order BY nr DESC LIMIT 1");
    query.next();
    maxNr = query.value(0).toInt()+1;

    addmovie = new newmovie(this,maxNr);
    connect(addmovie,SIGNAL(addMovie(QString,QString)),this,SLOT(movieAdded(QString,QString)));
    addmovie->show();
}
Пример #4
0
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
    //////////////////////////////
    // 1. super init first
    if ( !Scene::init() )
    {
        return false;
    }
	
	//
	// pre-load shaders
	//
	auto p1 = GLProgram::createWithFilenames("Shaders/AEM/AEM_Normal.vsh", "Shaders/AEM/AEM_Normal.fsh");
	auto p2 = GLProgram::createWithFilenames("Shaders/AEM/AEM_TrackMatte.vsh", "Shaders/AEM/AEM_TrackMatte.fsh");
	auto pc = GLProgramCache::getInstance();
	pc->addGLProgram(p1, "AEM_Normal");
	pc->addGLProgram(p2, "AEM_TrackMatte");
	
	extension::AEMovieCache::getInstance()->initialize(ex_example_license_hash);

	Size designSize = Director::getInstance()->getOpenGLView()->getDesignResolutionSize();

	const bool usePlist = true;
	
	if(usePlist)
	{
		addMovie(extension::AEMovie::createWithPlist("AEM/Knight/Knight.aem", "knight.plist"),
				 Point(designSize.width / 4, designSize.height / 2), "Knight");
	}
	else
	{
		addMovie(extension::AEMovie::create("AEM/Knight/Knight.aem"),
				 Point(designSize.width / 4, designSize.height / 2), "Knight");
	}
	
    return true;
}
Пример #5
0
void MainWindow::emitAddMovie()
{
    QStringList test;
    test << "1"<<"2"<<"23"<<"32";
    connect(this,SIGNAL(addMovie(int,QString,QDate,QString,QTime,int)),db,
            SLOT(addMovie(int,QString,QDate,QString,QTime,int)));
    emit addMovie(ui->movieDirectorSelector->currentIndex()+1,ui->movieNameLineEdit->text(),
                  ui->movieDateEdit->date(),
                  ui->movieAddedActors->text().remove(ui->movieAddedActors->text().length()-1,1),
                  ui->movieTimeEdit->time(),ui->movieGenerSelector->currentIndex()+1);
    disconnect(this,SIGNAL(addMovie(int,QString,QDate,QString,QTime,int)),db,
               SLOT(addMovie(int,QString,QDate,QString,QTime,int)));
    ui->statusBar->showMessage("Movie added",3000);
    refreshUi();
}
Пример #6
0
void MainWindow::on_actionAdd_Movie_triggered() {
    QFileDialog fileDlg;
    fileDlg.setFileMode(QFileDialog::ExistingFiles);
    fileDlg.setNameFilter(tr("Movies (*.mov *.avi *.mpg *.mp4 *.mpeg *.mkv)"));
    fileDlg.setDirectory(AppSettings::defaultInputFolder());
    if (fileDlg.exec()) {
        QFileInfo fileInfo(fileDlg.selectedFiles()[0]);
        QString folderPath = QFileInfo(fileInfo).absoluteDir().absolutePath();
        AppSettings::setDefaultInputFolder(folderPath);
        for (int i = 0; i < fileDlg.selectedFiles().length(); i++) {
            QListWidgetItem item;
            item.setText(fileDlg.selectedFiles()[i]);
            addMovie(fileDlg.selectedFiles()[i]);
        }
    }

    if (hasMovieToConvert())
        ui->actionConvert_Movies->setEnabled(true);
}
Пример #7
0
void menuF(sMovies movies[],int length)
{
    int option;
    int flag;
    initIsEmpty(movies, length);

    do
    {
        system("cls");
        printf("Ingrese una opcion\n\n");
        printf(" 1. Alta Pelicula \n 2. Modificar Datos de Pelicula \n 3. Dar de Baja Pelicula \n 4. Generar archivo con peliculas \n 5. Salir \n");
        fflush(stdin);
        scanf("%d", &option);
            switch(option)
        {
        case 1:
            if(addMovie(movies, length) == 0)
                printf("Agregado exitoso\n");
            else
                printf("Alguno de los parametros ingresados es erroneo o el espacio esta lleno. Borre una pelicula o intente reingresar\n");
            break;

        case 2:
            modifyMovie(movies, length);
            break;

        case 3:
            removeMovie(movies, length);
            break;
        case 4: fileGen(movies, "archivo.html", length);
            break;
        case 5:

        default:
            printf("Ingrese una opcion valida \n\n");
            break;
        }
        system("pause");
    }while(option != 5);

}
Пример #8
0
int main()
{
	int value;
	FILE * input= fopen("movies.dat","r+w");
	int x=getc(input),count=0;
    	while(x!=EOF)
    	{
        	x=getc(input);
        	if(x==10)
            	{
			count=count+1;
		}
    	}
    	fclose(input);
	do
	{	
    		printf("Welcome to the C Movie Database!\nMain menu:\n1: display all movies\n2: display shortest movie\n3: display longest movie\n4: display older movies\n5: display newer movies\n6: display movies in the region specified\n7: display all movies of same actor\n8: display all movies released in same year\n9: display all movies of same length\n10: add movie\n0: quit the program\nEnter option number:");
		scanf("%d",&value);
		if(value==1)
		{
			DisplayAll("movies.dat",count);
		}
		else if(value==2)
		{
			DisplayShortest("movies.dat",count);
   		}
		else if(value==3)
		{
			DisplayLongest("movies.dat",count);
   		}
		else if(value==4)
		{	
			int oldyear;
			printf("Display movies older than what year?");
			scanf("%d",&oldyear);
			DisplayOlder("movies.dat",oldyear);
   		}
		else if(value==5)
		{
			int newyear;
			printf("Display movies newer than what year?");
			scanf("%d",&newyear);
			DisplayNewer("movies.dat",newyear,count);
   		}
		else if(value==6)
		{
			int newyear,oldyear;
			printf("Display movies in between what year?");
			scanf("%d %d",&oldyear,&newyear);
			DisplayInBetween("movies.dat",oldyear,newyear,count);
   		}
		else if(value==7)
		{
			char check[120];
			printf("Display movies of which actor?");
			scanf("%s",check);
			DisplaySameActor("movies.dat",check,count);
   		}
		else if(value==8)
		{
			int sameyear;
			printf("Display movies of what year?");
			scanf("%d",&sameyear);
			DisplaySameYear("movies.dat",sameyear,count);
   		}
		else if(value==9)
		{
			int samelength;
			printf("Display movies of what length?");
			scanf("%d",&samelength);
			DisplaySameLength("movies.dat",samelength,count);
   		}
		else if(value==10)
		{
			addMovie("movies.dat");
   		}
		else if(value==11)
		{
			delete("movies.dat",count);
   		}
	}while(value!=0);
}