Mixer.h 1.81 KB
/* 
 * File:   Mixer.h
 * Author: eduardo
 *
 * Created on 17 de Janeiro de 2012, 15:28
 */

#ifndef MIXER_H
#define	MIXER_H

#include "string.h"
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <string>
#include <fstream>
#include "logging.h"

//SL Video Position
#define TOP_LEFT 1
#define TOP_RIGHT 2
#define BOTTOM_RIGHT 3
#define BOTTOM_LEFT 4
//SL Video Size
#define SMALL 1
#define MEDIUM 2
#define LARGE 3
//SL Video Width
#define SMALL_HEIGHT 324		//0,3*1080 se fosse full hd
#define MEDIUM_HEIGHT 432		//0,4*1080
#define LARGE_HEIGHT 540		//0.5*1080

#define MAX_SIZE_PATH 256

using namespace std;
using namespace util;

class Mixer {
public:    

    Mixer(string,string);
    Mixer();
    virtual ~Mixer();

    void adjustVideosFps();

    void mixVideos();
    void setSize(int);

    /* Setters e getters...*/
    void setMainVideo(string);
    string getMainVideo();
    void setSecondaryVideo(string);
    string getSecondaryVideo();
    void setPositionSecondaryVideo(int);
    int getPositionSecondaryVideo();
    void setTransparency(int);
    int getTransparency();
    void setNumThreads(string);
    string getNumThreads();
    void initialize(string mainVideo, string slVideo, int, int, int, char*, char*, char*);
    void setPathFinal();

private:

    struct fpsAndLine {
      string line;
      double fps;
      string possibleProgramID;
    };

    void readFileFPS(fpsAndLine [], int *);
    void convertMainVideoFPS(fpsAndLine [], int *);
    void convertSecondaryVideoFPS(double);

    string mainVideo, secondaryVideo, temporaryTextFile, numThreads, pathFinal, user_id, nameOfMainVideo;
    char* contents;
    char* uploads;
    int positionSecondaryVideo;
    double widthSecondaryVideo, heightSecondaryVideo;
    int transparency;    
};

#endif	/* MIXER_H */