StelVideoMgr.cpp   StelVideoMgr.cpp 
skipping to change at line 157 skipping to change at line 157
videoObjects[id]->player->play(); videoObjects[id]->player->play();
else else
videoObjects[id]->player->pause(); videoObjects[id]->player->pause();
} }
void StelVideoMgr::playVideo(const QString& id, const bool keepVisibleAtEnd ) void StelVideoMgr::playVideo(const QString& id, const bool keepVisibleAtEnd )
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
videoObjects[id]->keepVisible=keepVisibleAtEnd; videoObjects[id]->keepVisible=keepVisibleAtEnd;
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
// if already playing, stop and play from the start // if already playing, stop and play from the start
if (videoObjects[id]->player->state() == QMediaPlaye r::PlayingState) if (videoObjects[id]->player->state() == QMediaPlaye r::PlayingState)
{ {
videoObjects[id]->player->stop(); videoObjects[id]->player->stop();
} }
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
// On Linux, we may have made movie frame invisible during loadVideo(). // On Linux, we may have made movie frame invisible during loadVideo().
videoObjects[id]->videoItem->setVisible(true); videoObjects[id]->videoItem->setVisible(true);
#endif #endif
skipping to change at line 206 skipping to change at line 206
//! @param popdownDuration duration of shrinking end transition (seconds) //! @param popdownDuration duration of shrinking end transition (seconds)
//! @param frozenInTransition true if video should be paused during growing /shrinking transition. //! @param frozenInTransition true if video should be paused during growing /shrinking transition.
void StelVideoMgr::playVideoPopout(const QString& id, float fromX, float fr omY, float atCenterX, float atCenterY, void StelVideoMgr::playVideoPopout(const QString& id, float fromX, float fr omY, float atCenterX, float atCenterY,
float finalSizeX, float finalSizeY, float popupDuration , bool frozenInTransition) float finalSizeX, float finalSizeY, float popupDuration , bool frozenInTransition)
{ {
if (verbose) if (verbose)
qDebug() << "\n\n====Configuring playVideoPopout(): " << id; qDebug() << "\n\n====Configuring playVideoPopout(): " << id;
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
videoObjects[id]->keepVisible=frozenInTransition; videoObjects[id]->keepVisible=frozenInTransition;
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
// if already playing, stop and play from the start // if already playing, stop and play from the start
if (videoObjects[id]->player->state() == QMediaPlaye r::PlayingState) if (videoObjects[id]->player->state() == QMediaPlaye r::PlayingState)
{ {
qDebug() << "playVideoPopout(): stop the pla ying video"; qDebug() << "playVideoPopout(): stop the pla ying video";
videoObjects[id]->player->stop(); videoObjects[id]->player->stop();
} }
// prepare (1) target frame size, (2) XY start posit ion, and (3) end position: // prepare (1) target frame size, (2) XY start posit ion, and (3) end position:
// (1) Target frame size. // (1) Target frame size.
skipping to change at line 306 skipping to change at line 306
} }
} }
else qDebug() << "StelVideoMgr::playVideoPopout(" << id << "): no su ch video"; else qDebug() << "StelVideoMgr::playVideoPopout(" << id << "): no su ch video";
} }
void StelVideoMgr::pauseVideo(const QString& id) void StelVideoMgr::pauseVideo(const QString& id)
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
// Maybe we can only pause while already playing? // Maybe we can only pause while already playing?
if (videoObjects[id]->player->state()==QMediaPlayer: :StoppedState) if (videoObjects[id]->player->state()==QMediaPlayer: :StoppedState)
videoObjects[id]->player->play(); videoObjects[id]->player->play();
if (verbose) if (verbose)
qDebug() << "StelVideoMgr::pauseVideo() ..." ; qDebug() << "StelVideoMgr::pauseVideo() ..." ;
videoObjects[id]->player->pause(); videoObjects[id]->player->pause();
} }
} }
else qDebug() << "StelVideoMgr::pauseVideo()" << id << ": no such vi deo"; else qDebug() << "StelVideoMgr::pauseVideo()" << id << ": no such vi deo";
} }
void StelVideoMgr::stopVideo(const QString& id) void StelVideoMgr::stopVideo(const QString& id)
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
videoObjects[id]->player->stop(); videoObjects[id]->player->stop();
} }
} }
else qDebug() << "StelVideoMgr::stopVideo()" << id << ": no such vid eo"; else qDebug() << "StelVideoMgr::stopVideo()" << id << ": no such vid eo";
} }
void StelVideoMgr::seekVideo(const QString& id, const qint64 ms, bool pause ) void StelVideoMgr::seekVideo(const QString& id, const qint64 ms, bool pause )
{ {
if (verbose) if (verbose)
qDebug() << "StelVideoMgr::seekVideo: " << id << " to:" << m s << (pause ? " (pausing)" : " (playing)"); qDebug() << "StelVideoMgr::seekVideo: " << id << " to:" << m s << (pause ? " (pausing)" : " (playing)");
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
if (videoObjects[id]->player->isSeekable()) if (videoObjects[id]->player->isSeekable())
{ {
videoObjects[id]->player->setPosition(ms); videoObjects[id]->player->setPosition(ms);
// Seek capability depends on the backend us ed and likely media codec. // Seek capability depends on the backend us ed and likely media codec.
} }
else else
{ {
qDebug() << "[StelVideoMgr] Cannot seek medi a source" << id; qDebug() << "[StelVideoMgr] Cannot seek medi a source" << id;
} }
skipping to change at line 362 skipping to change at line 362
videoObjects[id]->player->pause(); videoObjects[id]->player->pause();
} }
} }
else qDebug() << "StelVideoMgr::seekVideo()" << id << ": no such vid eo"; else qDebug() << "StelVideoMgr::seekVideo()" << id << ": no such vid eo";
} }
void StelVideoMgr::dropVideo(const QString& id) void StelVideoMgr::dropVideo(const QString& id)
{ {
if (!videoObjects.contains(id)) if (!videoObjects.contains(id))
return; return;
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
if (verbose) if (verbose)
qDebug() << "About to drop (unload) video " << id << "(" << videoObjects[id]->player->mediaStatus() << ")"; qDebug() << "About to drop (unload) video " << id << "(" << videoObjects[id]->player->mediaStatus() << ")";
videoObjects[id]->player->stop(); videoObjects[id]->player->stop();
StelMainView::getInstance().scene()->removeItem(videoObjects [id]->videoItem); StelMainView::getInstance().scene()->removeItem(videoObjects [id]->videoItem);
delete videoObjects[id]->player; delete videoObjects[id]->player;
delete videoObjects[id]->videoItem; delete videoObjects[id]->videoItem;
delete videoObjects[id]; delete videoObjects[id];
videoObjects.remove(id); videoObjects.remove(id);
} }
skipping to change at line 385 skipping to change at line 385
// setVideoXY(100, 200, false): absolute, as before // setVideoXY(100, 200, false): absolute, as before
// setVideoXY(100, 200, true): shift 100 right, 200 down // setVideoXY(100, 200, true): shift 100 right, 200 down
// setVideoXY(0.5, 0.25, false): (on fullHD), set to (960/270) // setVideoXY(0.5, 0.25, false): (on fullHD), set to (960/270)
// setVideoXY(0.5, 0.25, true): (on fullHD), shift by (960/270) // setVideoXY(0.5, 0.25, true): (on fullHD), shift by (960/270)
// setVideoXY(600, 0.25, false): (on fullHD), set to (600/270) // setVideoXY(600, 0.25, false): (on fullHD), set to (600/270)
// setVideoXY(600, 0.25, true): (on fullHD), shift by (600/270) // setVideoXY(600, 0.25, true): (on fullHD), shift by (600/270)
void StelVideoMgr::setVideoXY(const QString& id, const float x, const float y, const bool relative) void StelVideoMgr::setVideoXY(const QString& id, const float x, const float y, const bool relative)
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->videoItem!=NULL) if (videoObjects[id]->videoItem!=Q_NULLPTR)
{ {
// if w or h < 1 we scale proportional to mainview! // if w or h < 1 we scale proportional to mainview!
int viewportWidth=StelMainView::getInstance().size() .width(); int viewportWidth=StelMainView::getInstance().size() .width();
int viewportHeight=StelMainView::getInstance().size( ).height(); int viewportHeight=StelMainView::getInstance().size( ).height();
float newX=x; float newX=x;
float newY=y; float newY=y;
if (x>-1 && x<1) if (x>-1 && x<1)
newX *= viewportWidth; newX *= viewportWidth;
if (y>-1 && y<1) if (y>-1 && y<1)
newY *= viewportHeight; newY *= viewportHeight;
skipping to change at line 414 skipping to change at line 414
qDebug() << "Setting video XY= " << newX << "/" << newY << (relative? "(relative)":""); qDebug() << "Setting video XY= " << newX << "/" << newY << (relative? "(relative)":"");
} }
} }
else qDebug() << "StelVideoMgr::setVideoXY()" << id << ": no such vi deo"; else qDebug() << "StelVideoMgr::setVideoXY()" << id << ": no such vi deo";
} }
void StelVideoMgr::setVideoAlpha(const QString& id, const float alpha) void StelVideoMgr::setVideoAlpha(const QString& id, const float alpha)
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->videoItem!=NULL) if (videoObjects[id]->videoItem!=Q_NULLPTR)
{ {
videoObjects[id]->videoItem->setOpacity(alpha); videoObjects[id]->videoItem->setOpacity(alpha);
} }
} }
else qDebug() << "StelVideoMgr::setVideoAlpha()" << id << ": no such video"; else qDebug() << "StelVideoMgr::setVideoAlpha()" << id << ": no such video";
} }
void StelVideoMgr::resizeVideo(const QString& id, float w, float h) void StelVideoMgr::resizeVideo(const QString& id, float w, float h)
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->videoItem!=NULL) if (videoObjects[id]->videoItem!=Q_NULLPTR)
{ {
// if w or h <= 1 we scale proportional to mainview! // if w or h <= 1 we scale proportional to mainview!
// Note that w or h thus cannot be set to 1.0, i.e. single-pixel rows/columns! // Note that w or h thus cannot be set to 1.0, i.e. single-pixel rows/columns!
// This is likely not tragic, else set to 1.0001 // This is likely not tragic, else set to 1.0001
int viewportWidth=StelMainView::getInstance().size() .width(); int viewportWidth=StelMainView::getInstance().size() .width();
int viewportHeight=StelMainView::getInstance().size( ).height(); int viewportHeight=StelMainView::getInstance().size( ).height();
if (w>0 && w<=1) if (w>0 && w<=1)
w*=viewportWidth; w*=viewportWidth;
if (h>0 && h<=1) if (h>0 && h<=1)
skipping to change at line 484 skipping to change at line 484
videoObjects[id]->needResize=false; videoObjects[id]->needResize=false;
} }
} }
else qDebug() << "StelVideoMgr::resizeVideo()" << id << ": no such v ideo"; else qDebug() << "StelVideoMgr::resizeVideo()" << id << ": no such v ideo";
} }
void StelVideoMgr::showVideo(const QString& id, const bool show) void StelVideoMgr::showVideo(const QString& id, const bool show)
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->videoItem!=NULL) if (videoObjects[id]->videoItem!=Q_NULLPTR)
{ {
videoObjects[id]->videoItem->setVisible(show); videoObjects[id]->videoItem->setVisible(show);
} }
} }
else qDebug() << "StelVideoMgr::showVideo()" << id << ": no such vid eo"; else qDebug() << "StelVideoMgr::showVideo()" << id << ": no such vid eo";
} }
qint64 StelVideoMgr::getVideoDuration(const QString& id) qint64 StelVideoMgr::getVideoDuration(const QString& id)
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
skipping to change at line 553 skipping to change at line 553
return -1; return -1;
} }
else qDebug() << "StelVideoMgr::getHeight()" << id << ": no such vid eo"; else qDebug() << "StelVideoMgr::getHeight()" << id << ": no such vid eo";
return -1; return -1;
} }
void StelVideoMgr::muteVideo(const QString& id, bool mute) void StelVideoMgr::muteVideo(const QString& id, bool mute)
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
videoObjects[id]->player->setMuted(mute); videoObjects[id]->player->setMuted(mute);
} }
} }
else qDebug() << "StelVideoMgr::mute()" << id << ": no such video"; else qDebug() << "StelVideoMgr::mute()" << id << ": no such video";
} }
void StelVideoMgr::setVideoVolume(const QString& id, int newVolume) void StelVideoMgr::setVideoVolume(const QString& id, int newVolume)
{ {
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
videoObjects[id]->player->setVolume(newVolume); videoObjects[id]->player->setVolume(newVolume);
} }
} }
else qDebug() << "StelVideoMgr::setVolume()" << id << ": no such vid eo"; else qDebug() << "StelVideoMgr::setVolume()" << id << ": no such vid eo";
} }
int StelVideoMgr::getVideoVolume(const QString& id) int StelVideoMgr::getVideoVolume(const QString& id)
{ {
int volume=-1; int volume=-1;
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
volume=videoObjects[id]->player->volume(); volume=videoObjects[id]->player->volume();
} }
} }
else qDebug() << "StelVideoMgr::getVolume()" << id << ": no such vid eo"; else qDebug() << "StelVideoMgr::getVolume()" << id << ": no such vid eo";
return volume; return volume;
} }
bool StelVideoMgr::isVideoPlaying(const QString& id) bool StelVideoMgr::isVideoPlaying(const QString& id)
{ {
bool playing=false; bool playing=false;
if (videoObjects.contains(id)) if (videoObjects.contains(id))
{ {
if (videoObjects[id]->player!=NULL) if (videoObjects[id]->player!=Q_NULLPTR)
{ {
playing= (videoObjects[id]->player->state() == QMedi aPlayer::PlayingState ); playing= (videoObjects[id]->player->state() == QMedi aPlayer::PlayingState );
} }
} }
else qDebug() << "StelVideoMgr::isPlaying()" << id << ": no such vid eo"; else qDebug() << "StelVideoMgr::isPlaying()" << id << ": no such vid eo";
return playing; return playing;
} }
/* ************************************************* /* *************************************************
* Signal handlers for all signals of QMediaPlayer. Usually for now this on ly writes a message to logfile. * Signal handlers for all signals of QMediaPlayer. Usually for now this on ly writes a message to logfile.
 End of changes. 14 change blocks. 
14 lines changed or deleted 14 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/