//-------------------------------------------------------------- bool JSONElement::open(string filename) { if(filename.find("http://")==0) { return openRemote(filename); } else { return openLocal(filename); } }
VideoPlayer::VideoPlayer(QWidget *parent) : QMainWindow(parent),ui(new Ui::VideoPlayer),_media(0) { ui->setupUi(this); _instance = new VlcInstance(VlcCommon::args(), this); _player = new VlcMediaPlayer(_instance); _player->setVideoWidget(ui->video); ui->video->setMediaPlayer(_player); ui->seek->setMediaPlayer(_player); connect(ui->actionOpenLocal, SIGNAL(triggered()), this, SLOT(openLocal())); connect(ui->actionOpenUrl, SIGNAL(triggered()), this, SLOT(openUrl())); connect(ui->openLocal, SIGNAL(clicked()), this, SLOT(openLocal())); connect(ui->openUrl, SIGNAL(clicked()), this, SLOT(openUrl())); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { //init flags cameraDownFlag = false; cameraUpFlag = false; cameraLeftFlag = false; cameraRightFlag = false; carForwardFlag = false; carBackFlag = false; carLeftFlag = false; carRightFlag = false; ui->setupUi(this); _instance = new VlcInstance(VlcCommon::args(), this); _player = new VlcMediaPlayer(_instance); _player->setVideoWidget(ui->video); ui->video->setMediaPlayer(_player); connect(ui->actionOpen_Local_File, SIGNAL(triggered()), this, SLOT(openLocal())); connect(ui->actionOpen_URL, SIGNAL(triggered()), this, SLOT(openUrl())); connect(ui->actionCar_Address, SIGNAL(triggered()), this, SLOT(setCarAddr())); connect(ui->cameraDown, SIGNAL(pressed()), this, SLOT(cameraDown())); connect(ui->cameraUp, SIGNAL(pressed()), this, SLOT(cameraUp())); connect(ui->cameraLeft, SIGNAL(pressed()), this, SLOT(cameraLeft())); connect(ui->cameraRight, SIGNAL(pressed()), this, SLOT(cameraRight())); connect(ui->carForward, SIGNAL(pressed()), this, SLOT(carForward())); connect(ui->carBack, SIGNAL(pressed()), this, SLOT(carBack())); connect(ui->carLeft, SIGNAL(pressed()), this, SLOT(carLeft())); connect(ui->carRight, SIGNAL(pressed()), this, SLOT(carRight())); connect(ui->cameraDown, SIGNAL(released()), this, SLOT(cameraDownRelease())); connect(ui->cameraUp, SIGNAL(released()), this, SLOT(cameraUpRelease())); connect(ui->cameraLeft, SIGNAL(released()), this, SLOT(cameraLeftRelease())); connect(ui->cameraRight, SIGNAL(released()), this, SLOT(cameraRightRelease())); connect(ui->carForward, SIGNAL(released()), this, SLOT(carForwardRelease())); connect(ui->carBack, SIGNAL(released()), this, SLOT(carBackRelease())); connect(ui->carLeft, SIGNAL(released()), this, SLOT(carLeftRelease())); connect(ui->carRight, SIGNAL(released()), this, SLOT(carRightRelease())); sender = new MsgSender(); }