fixed video issue on linux

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 2fcf84315b
commit 95380fc881
  1. 3
      src/adaptors/UBImportDocument.cpp
  2. 1
      src/adaptors/UBImportImage.cpp
  3. 1
      src/adaptors/UBImportPDF.cpp
  4. 17
      src/customWidgets/UBMediaWidget.cpp
  5. 1
      src/customWidgets/UBMediaWidget.h
  6. 2
      src/document/UBDocumentController.cpp
  7. 4
      src/gui/UBTBPageEditWidget.cpp
  8. 56
      src/gui/UBTeacherBarPreviewWidget.cpp
  9. 2
      src/gui/UBTeacherBarPreviewWidget.h

@ -14,7 +14,6 @@
*/ */
#include "UBImportDocument.h" #include "UBImportDocument.h"
#include "UBMetadataDcSubsetAdaptor.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
@ -49,7 +48,7 @@ QStringList UBImportDocument::supportedExtentions()
QString UBImportDocument::importFileFilter() QString UBImportDocument::importFileFilter()
{ {
return tr("Sankore 3.1 (*.ubz)"); return tr("Open-Sankore (*.ubz)");
} }

@ -14,7 +14,6 @@
*/ */
#include "UBImportImage.h" #include "UBImportImage.h"
#include "UBMetadataDcSubsetAdaptor.h"
#include "UBSvgSubsetAdaptor.h" #include "UBSvgSubsetAdaptor.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"

@ -14,7 +14,6 @@
*/ */
#include "UBImportPDF.h" #include "UBImportPDF.h"
#include "UBMetadataDcSubsetAdaptor.h"
#include "UBSvgSubsetAdaptor.h" #include "UBSvgSubsetAdaptor.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"

@ -103,6 +103,21 @@ eMediaType UBMediaWidget::mediaType()
return mType; return mType;
} }
void UBMediaWidget::showEvent(QShowEvent* event)
{
if(!mpVideoWidget){
mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout.addStretch(1);
mMediaLayout.addWidget(mpVideoWidget, 0);
mMediaLayout.addStretch(1);
Phonon::createPath(mpMediaObject, mpVideoWidget);
adaptSizeToVideo();
mpMediaObject->play();
mpMediaObject->stop();
}
QWidget::showEvent(event);
}
/** /**
* \brief Create the media player * \brief Create the media player
*/ */
@ -114,12 +129,14 @@ void UBMediaWidget::createMediaPlayer()
if(eMediaType_Video == mType){ if(eMediaType_Video == mType){
mMediaLayout.setContentsMargins(10, 10, 25, 10); mMediaLayout.setContentsMargins(10, 10, 25, 10);
if(isVisible()){
mpVideoWidget = new Phonon::VideoWidget(this); mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout.addStretch(1); mMediaLayout.addStretch(1);
mMediaLayout.addWidget(mpVideoWidget, 0); mMediaLayout.addWidget(mpVideoWidget, 0);
mMediaLayout.addStretch(1); mMediaLayout.addStretch(1);
Phonon::createPath(mpMediaObject, mpVideoWidget); Phonon::createPath(mpMediaObject, mpVideoWidget);
adaptSizeToVideo(); adaptSizeToVideo();
}
mpAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this); mpAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
Phonon::createPath(mpMediaObject, mpAudioOutput); Phonon::createPath(mpMediaObject, mpAudioOutput);
}else if(eMediaType_Audio == mType){ }else if(eMediaType_Audio == mType){

@ -71,6 +71,7 @@ public:
protected: protected:
void resizeEvent(QResizeEvent* ev); void resizeEvent(QResizeEvent* ev);
void showEvent(QShowEvent* event);
private slots: private slots:
void onPlayStopClicked(); void onPlayStopClicked();

@ -37,7 +37,6 @@
#include "board/UBBoardPaletteManager.h" #include "board/UBBoardPaletteManager.h"
#include "board/UBDrawingController.h" #include "board/UBDrawingController.h"
//#include "gui/UBKeyboardPalette.h"
#include "gui/UBThumbnailView.h" #include "gui/UBThumbnailView.h"
#include "gui/UBDocumentTreeWidget.h" #include "gui/UBDocumentTreeWidget.h"
@ -69,7 +68,6 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
, mToolsPalette(0) , mToolsPalette(0)
, mToolsPalettePositionned(false) , mToolsPalettePositionned(false)
, mTrashTi(0) , mTrashTi(0)
// , mKeyboardPalette(0)
{ {
setupViews(); setupViews();
setupToolbar(); setupToolbar();

@ -200,10 +200,14 @@ void UBTBPageEditWidget::updateFields()
} }
// Medias // Medias
foreach(QString url, mpDataMgr->mediaUrls()){ foreach(QString url, mpDataMgr->mediaUrls()){
if(url.isEmpty())
continue;
QWidget* pWidget = mpMediaContainer->generateMediaWidget(url); QWidget* pWidget = mpMediaContainer->generateMediaWidget(url);
if(pWidget != NULL){
mpDataMgr->medias()->append(pWidget); mpDataMgr->medias()->append(pWidget);
mpMediaContainer->addWidget(pWidget); mpMediaContainer->addWidget(pWidget);
} }
}
// Links // Links
foreach(sLink link, *mpDataMgr->urls()){ foreach(sLink link, *mpDataMgr->urls()){
UBUrlWidget* urlWidget = new UBUrlWidget(this); UBUrlWidget* urlWidget = new UBUrlWidget(this);

@ -43,34 +43,34 @@ void UBTeacherBarPreviewMedia::loadWidgets(QList<QWidget*> pWidgetsList, bool is
} }
int UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias) //int UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias)
{ //{
int addedMedia = 0; // int addedMedia = 0;
// foreach(QString eachString, pMedias){ //// foreach(QString eachString, pMedias){
// if(!eachString.isEmpty()){ //// if(!eachString.isEmpty()){
// QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(eachString); //// QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(eachString);
// if(mimeType.contains("image")){ //// if(mimeType.contains("image")){
// UBDraggableLabel* label = new UBDraggableLabel(); //// UBDraggableLabel* label = new UBDraggableLabel();
// label->loadImage(eachString); //// label->loadImage(eachString);
// mWidget->addWidget(label); //// mWidget->addWidget(label);
// mWidgetList[label]=eachString; //// mWidgetList[label]=eachString;
// addedMedia += 1; //// addedMedia += 1;
// } //// }
// else if(mimeType.contains("video") || mimeType.contains("audio")){ //// else if(mimeType.contains("video") || mimeType.contains("audio")){
// UBDraggableMediaPlayer* mediaPlayer = new UBDraggableMediaPlayer(); //// UBDraggableMediaPlayer* mediaPlayer = new UBDraggableMediaPlayer();
// mediaPlayer->setFile(eachString); //// mediaPlayer->setFile(eachString);
// mWidget->addWidget(mediaPlayer); //// mWidget->addWidget(mediaPlayer);
// mWidgetList[mediaPlayer] = eachString; //// mWidgetList[mediaPlayer] = eachString;
// addedMedia += 1; //// addedMedia += 1;
// } //// }
// else{ //// else{
// qWarning() << "pMediaPath" << eachString; //// qWarning() << "pMediaPath" << eachString;
// qWarning() << "bad idea to come here"; //// qWarning() << "bad idea to come here";
// } //// }
// } //// }
// } //// }
return addedMedia; // return addedMedia;
} //}
// ----------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------
UBActionPreview::UBActionPreview(QWidget *parent, const char *name):QWidget(parent) UBActionPreview::UBActionPreview(QWidget *parent, const char *name):QWidget(parent)

@ -15,7 +15,7 @@ class UBTeacherBarPreviewMedia : public QWidget
public: public:
UBTeacherBarPreviewMedia(QWidget* parent=0, const char* name="UBTeacherBarPreviewMedia"); UBTeacherBarPreviewMedia(QWidget* parent=0, const char* name="UBTeacherBarPreviewMedia");
~UBTeacherBarPreviewMedia(); ~UBTeacherBarPreviewMedia();
int loadMedia(QStringList pMedias); // int loadMedia(QStringList pMedias);
void loadWidgets(QList<QWidget*> pWidgetList, bool isResizable = true); void loadWidgets(QList<QWidget*> pWidgetList, bool isResizable = true);
void cleanMedia(); void cleanMedia();

Loading…
Cancel
Save