00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2009-06-18 16:47:58 +0200 (Thu, 18 Jun 2009) $ 00006 Version: $Revision: 15412 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #include "QmitkVideoPlayer.h" 00019 #include <QVBoxLayout> 00020 #include <QmitkOpenCVVideoControls.h> 00021 #include <QmitkStdMultiWidget.h> 00022 #include <QmitkVideoBackground.h> 00023 00024 QmitkVideoPlayer::QmitkVideoPlayer() 00025 : m_VideoSource(0) 00026 , m_VideoBackground( new QmitkVideoBackground(m_VideoSource) ) 00027 { 00028 00029 } 00030 00031 QmitkVideoPlayer::~QmitkVideoPlayer() 00032 { 00033 // save video preferences 00034 } 00035 00036 bool QmitkVideoPlayer::IsExclusiveFunctionality() const 00037 { 00038 return false; 00039 } 00040 00041 void QmitkVideoPlayer::CreateQtPartControl( QWidget* parent ) 00042 { 00043 // retrieve old preferences 00044 m_VideoSource = mitk::OpenCVVideoSource::New(); 00045 m_VideoBackground = new QmitkVideoBackground(m_VideoSource); 00046 m_VideoBackground->setParent(parent); 00047 00048 QVBoxLayout* layout = new QVBoxLayout; 00049 m_OpenCVVideoControls = new QmitkOpenCVVideoControls(m_VideoBackground, 00050 this->GetActiveStdMultiWidget()); 00051 layout->addWidget( m_OpenCVVideoControls ); 00052 00053 parent->setLayout( layout ); 00054 } 00055 00056 void QmitkVideoPlayer::StdMultiWidgetAvailable( QmitkStdMultiWidget& stdMultiWidget ) 00057 { 00058 m_OpenCVVideoControls->SetStdMultiWidget( &stdMultiWidget ); 00059 }