# HG changeset patch # User benoitrigolleau # Date 1194532056 0 # Node ID b3df8b8185db06813d66cd18e62d00f94a69b764 # Parent 587ad94d6ac2ec6f1e9e647158215423ef520520 video in a widget, with a basic solution (not optimal) diff -r 587ad94d6ac2 -r b3df8b8185db data/fileio/VideoFileReader.cpp --- a/data/fileio/VideoFileReader.cpp Thu Nov 08 13:29:48 2007 +0000 +++ b/data/fileio/VideoFileReader.cpp Thu Nov 08 14:27:36 2007 +0000 @@ -190,10 +190,10 @@ // we get the size from our active video stream, if no active video stream // exists, width and height are set to default values (320x240) SDL_ffmpegGetVideoSize(file, &w, &h); - + SDL_Init(SDL_INIT_VIDEO); // Open the Video device screen = SDL_SetVideoMode(w, h, 0, SDL_DOUBLEBUF|SDL_HWSURFACE); - SDL_WM_SetCaption("EASAIER Video Player", "EASAIER Video Player"); + //SDL_WM_SetCaption("EASAIER Video Player", "EASAIER Video Player"); if(!screen) { printf("Couldn't open video: %s\n", SDL_GetError()); return false; diff -r 587ad94d6ac2 -r b3df8b8185db data/svdata.vcproj --- a/data/svdata.vcproj Thu Nov 08 13:29:48 2007 +0000 +++ b/data/svdata.vcproj Thu Nov 08 14:27:36 2007 +0000 @@ -1,7 +1,7 @@ @@ -306,6 +306,10 @@ > + + @@ -918,6 +922,21 @@ + + + + + + + diff -r 587ad94d6ac2 -r b3df8b8185db sv/filter/FilterStack.cpp --- a/sv/filter/FilterStack.cpp Thu Nov 08 13:29:48 2007 +0000 +++ b/sv/filter/FilterStack.cpp Thu Nov 08 14:27:36 2007 +0000 @@ -124,7 +124,7 @@ { Filter * filter = iter->second; size_t required = filter->getRequiredInputSamples(outputSamplesNeeded); - if (required > max) + if ( (required > max) && (filter->isFilterEnabled()) ) { max = required; } @@ -145,7 +145,9 @@ if (filter->objectName() == "Pitch-Time Stretching") { TimeStretchFilter * timefilter = (TimeStretchFilter *) filter; - skip = timefilter->getRequiredSkipSamples(); + if (filter->isFilterEnabled()) { + skip = timefilter->getRequiredSkipSamples(); + } } } return skip; diff -r 587ad94d6ac2 -r b3df8b8185db sv/main/MainWindow.cpp --- a/sv/main/MainWindow.cpp Thu Nov 08 13:29:48 2007 +0000 +++ b/sv/main/MainWindow.cpp Thu Nov 08 14:27:36 2007 +0000 @@ -108,6 +108,8 @@ #include #include +#include "data/model/SDLWidget.h" + using std::cerr; using std::endl; @@ -153,6 +155,8 @@ m_abandoning(false), m_preferencesDialog(0) { + + m_videoWidget = 0; m_instance = this; setWindowTitle(tr("Sound Access")); @@ -275,7 +279,7 @@ m_qtabwidget->addTab(new QWidget, tr("Related media")); QGridLayout *auxlayout = new QGridLayout; - auxlayout->addWidget(m_paneStack, 0, 0, 1, 5); + auxlayout->addWidget(m_paneStack, 0, 0, 1, 2); auxlayout->addWidget(m_overview, 1, 0); auxlayout->addWidget(m_fader, 1, 1); //auxlayout->addWidget(m_playSpeed, 1, 2); @@ -312,6 +316,27 @@ widgetAuxForLogo->setLayout(logoLayout); /****************************/ + /************video***********/ + SDLWidget* tt = new SDLWidget(); + QHBoxLayout *videoHLayout= new QHBoxLayout; + videoHLayout->addStretch(); + videoHLayout->addWidget(tt); + videoHLayout->addStretch(); + QVBoxLayout *videoVLayout= new QVBoxLayout; + videoVLayout->addStretch(); + videoVLayout->addLayout(videoHLayout); + videoVLayout->addStretch(); + + QWidget *ttaux = new QWidget; + ttaux->setLayout(videoVLayout); + QPalette palette; + palette.setColor(QPalette::Background,palette.color(QPalette::Dark)); + ttaux->setPalette(palette); + + m_qtabwidget->addTab(ttaux, tr("Video")); + + /****************************/ + m_rightExpandWidget = new ExpandWidget(); m_rightExpandWidget->setWidgetLocation(ExpandWidget::Location_Right); m_rightExpandWidget->setPanes(m_leftExpandWidget, widgetAuxForLogo); @@ -389,6 +414,10 @@ m_instance = 0; } +QWidget* MainWindow::getVideoWidget(){ + return m_videoWidget; +} + QString MainWindow::getOpenFileName(FileFinder::FileType type) { @@ -2307,11 +2336,14 @@ { QString path = getOpenFileName(FileFinder::VideoFile); + m_qtabwidget->setCurrentIndex(Video); + if (path != "") { - if (openVideoFile(path, ReplaceMainModel) == FileOpenFailed) { - QMessageBox::critical(this, tr("Failed to open file"), - tr("Video file \"%1\" could not be opened").arg(path)); - } + if (openVideoFile(path, ReplaceMainModel) == FileOpenFailed) { + QMessageBox::critical(this, tr("Failed to open file"), + tr("Video file \"%1\" could not be opened").arg(path)); + } + } } // diff -r 587ad94d6ac2 -r b3df8b8185db sv/main/MainWindow.h --- a/sv/main/MainWindow.h Thu Nov 08 13:29:48 2007 +0000 +++ b/sv/main/MainWindow.h Thu Nov 08 14:27:36 2007 +0000 @@ -96,7 +96,8 @@ Search, Result, Info, - RelatedMedia, + RelatedMedia, + Video }; FileOpenStatus openSomeFile(QString path, AudioFileOpenMode = AskUser); @@ -121,6 +122,10 @@ bool openEasaierSessionFile(QString path); bool saveEasaierSessionFile(QString path); + + QWidget* getVideoWidget(); + + signals: // Used to toggle the availability of menu actions void canAddPane(bool); @@ -300,7 +305,10 @@ void exit(); + + protected: + QWidget *m_videoWidget; QString m_sessionFile; QString m_audioFile; // Ivan Damnjanovic 09-10/2007 added video file import diff -r 587ad94d6ac2 -r b3df8b8185db sv/videoio/SDL_ffmpeg.cpp --- a/sv/videoio/SDL_ffmpeg.cpp Thu Nov 08 13:29:48 2007 +0000 +++ b/sv/videoio/SDL_ffmpeg.cpp Thu Nov 08 14:27:36 2007 +0000 @@ -37,6 +37,7 @@ #include #include #endif +#undef main #ifdef __cplusplus } #endif