Continuing spliting subwindow into different categories

This commit is contained in:
jfmcarreira committed 2014-12-09 20:15:37 +00:00
1 parent 1af504d56f
commit 007f3ed67f
9 files changed
+71 -58

No files matched your search

+2 -1
View File
@@ -29,6 +29,7 @@
#include "ModulesListMacro.h"
#include "DialogSubWindowSelector.h"
#include "SubWindowHandle.h"
#include "VideoSubWindow.h"
namespace plaYUVer
{
@@ -80,7 +81,7 @@ SubWindowHandle* ModulesHandle::processModuleHandlingOpt()
}
else
{
SubWindowHandle* pcSubWindow = qobject_cast<SubWindowHandle *>( m_pcMdiArea->activeSubWindow() );
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow *>( m_pcMdiArea->activeSubWindow() );
switch( m_iOptionSelected )
{
case INVALID_OPT:
+2 -15
View File
@@ -40,6 +40,7 @@ namespace plaYUVer
{
class SubWindowHandle;
class VideoSubWindow;
class PlaYUVerAppModuleIf
#ifdef PLAYUVER_THREADED_MODULES
@@ -56,7 +57,7 @@ private:
PlaYUVerModuleIf* m_pcModule;
QAction* m_pcAction;
SubWindowHandle* m_pcSubWindow[MAX_NUMBER_FRAMES];
VideoSubWindow* m_pcSubWindow[MAX_NUMBER_FRAMES];
SubWindowHandle* m_pcDisplaySubWindow;
@@ -85,20 +86,6 @@ public:
PlaYUVerAppModuleIf();
virtual ~PlaYUVerAppModuleIf() {}
// virtual Void create() {}
// virtual Void create( PlaYUVerFrame* ) {}
//
// virtual PlaYUVerFrame* process( PlaYUVerFrame* ) { return NULL; }
// virtual PlaYUVerFrame* process( PlaYUVerFrame*, PlaYUVerFrame* ) { return NULL; }
// virtual PlaYUVerFrame* process( PlaYUVerFrame*, PlaYUVerFrame*, PlaYUVerFrame* ) { return NULL; }
//
// virtual Double measure( PlaYUVerFrame* ) { return 0; }
// virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame* ) { return 0; }
// virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame*, PlaYUVerFrame* ) { return 0; }
//
// virtual Void destroy() { }
protected:
virtual void run();
};
+1 -1
View File
@@ -29,7 +29,7 @@
#include "lib/PlaYUVerDefs.h"
#include <QtCore>
#include "GridManager.h"
#include "SubWindowHandle.h"
#include "VideoSubWindow.h"
namespace plaYUVer
{
+12 -3
View File
@@ -28,14 +28,23 @@ namespace plaYUVer
{
SubWindowHandle::SubWindowHandle( QWidget * parent, UInt category ) :
QMdiSubWindow( parent ),
m_uiCategory( category )
QMdiSubWindow( parent )
{
m_uiCategory = category;
}
SubWindowHandle::~SubWindowHandle()
{
}
QString SubWindowHandle::getWindowName()
{
return QString();
}
Bool SubWindowHandle::mayClose()
{
return true;
}
} // NAMESPACE
+37 -1
View File
@@ -51,8 +51,44 @@ public:
MODULE_SUBWINDOW,
PLOT_SUBWINDOW,
}
SubWindowHandle( QWidget * parent, UInt category );
SubWindowHandle( QWidget *, UInt );
~SubWindowHandle();
/**
* Show the image at its original size
*/
virtual Void normalSize() {};
/**
* Scale the image (zoomed in or out) to fit on the window.
*/
virtual Void zoomToFit() {};
/**
* Scale the image by a given factor
* @param factor factor of scale. Ex: 1.2 scale the image up by 20% and
* 0.8 scale the image down by 25%
*/
virtual Void scaleView( Double scale ) {};
/**
* The current image size is scaled to a rectangle as large as possible
* inside (@p width, @p height ) preserving the aspect ratio.
*/
virtual Void scaleView( Int width, Int height ) {};
/**
* This is an overloaded member function, provided for convenience.
* Scales the image to a rectangle with the given size, preserving the
* aspect ratio.
*/
Void scaleView( const QSize & size ) {};
virtual QString getWindowName();
virtual Bool mayClose();
UInt getCategory()
{
return m_uiCategory;
}
};
} // NAMESPACE
-5
View File
@@ -516,11 +516,6 @@ QSize VideoSubWindow::sizeHint() const
return maxSize;
}
Bool VideoSubWindow::mayClose()
{
return true;
}
void VideoSubWindow::closeEvent( QCloseEvent *event )
{
Bool bAccept = mayClose();
+6 -26
View File
@@ -49,11 +49,11 @@ typedef struct
UInt m_uiHeight;
Int m_iPelFormat;
UInt m_uiFrameRate;
}PlaYUVerStreamInfo;
} PlaYUVerStreamInfo;
typedef QVector<PlaYUVerStreamInfo> PlaYUVerStreamInfoVector;
QDataStream& operator<<(QDataStream& out, const PlaYUVerStreamInfoVector& d);
QDataStream& operator>>(QDataStream& in, PlaYUVerStreamInfoVector& d);
QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& d );
QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& d );
Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename );
class VideoSubWindow: public SubWindowHandle
@@ -90,7 +90,6 @@ public:
VideoSubWindow( QWidget * parent = 0, Bool isModule = false );
~VideoSubWindow();
Bool mayClose();
Bool loadFile( QString cFilename, Bool bForceDialog = false );
Bool loadFile( PlaYUVerStreamInfo* streamInfo );
Void reloadFile();
@@ -167,31 +166,12 @@ public:
Void applyModuleAllFrames();
/**
* Show the image at its original size
* Reimplemented function from SubWindowHandle
*/
Void normalSize();
/**
* Scale the image (zoomed in or out) to fit on the window.
*/
Void zoomToFit();
/**
* Scale the image by a given factor
* @param factor factor of scale. Ex: 1.2 scale the image up by 20% and
* 0.8 scale the image down by 25%
*/
Void scaleView( Double scale );
/**
* The current image size is scaled to a rectangle as large as possible
* inside (@p width, @p height ) preserving the aspect ratio.
*/
Void scaleView( Int width, Int height );
/**
* This is an overloaded member function, provided for convenience.
* Scales the image to a rectangle with the given size, preserving the
* aspect ratio.
*/
Void scaleView( const QSize & size );
Void scaleViewByRatio( Double ratio );
@@ -237,8 +217,8 @@ public Q_SLOTS:
} // NAMESPACE
Q_DECLARE_METATYPE(plaYUVer::PlaYUVerStreamInfo);
Q_DECLARE_METATYPE(plaYUVer::PlaYUVerStreamInfoVector);
Q_DECLARE_METATYPE( plaYUVer::PlaYUVerStreamInfo );
Q_DECLARE_METATYPE( plaYUVer::PlaYUVerStreamInfoVector );
#endif // __VIDEOSUBWINDOW_H__
+10 -5
View File
@@ -309,15 +309,16 @@ Void plaYUVerApp::save()
Void plaYUVerApp::format()
{
if( m_pcCurrentSubWindow )
if( m_pcCurrentSubWindow->getCategory() == SubWindowHandle::VIDEO_SUBWINDOW )
{
VideoSubWindow* pcVideoSubWindow = qobject_cast<VideoSubWindow*>( m_pcCurrentSubWindow );
try
{
m_pcCurrentSubWindow->loadFile( m_pcCurrentSubWindow->getCurrentFileName(), true );
pcVideoSubWindow->loadFile( pcVideoSubWindow->getCurrentFileName(), true );
}
catch( const char *msg )
{
QString warningMsg = "Cannot change format of " + QFileInfo( m_pcCurrentSubWindow->getCurrentFileName() ).fileName() + " with the following error: \n"
QString warningMsg = "Cannot change format of " + QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() + " with the following error: \n"
+ msg;
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
statusBar()->showMessage( warningMsg, 2000 );
@@ -331,9 +332,10 @@ Void plaYUVerApp::format()
Void plaYUVerApp::reload()
{
if( m_pcCurrentSubWindow )
if( m_pcCurrentSubWindow->getCategory() == SubWindowHandle::VIDEO_SUBWINDOW )
{
m_pcCurrentSubWindow->reloadFile();
VideoSubWindow* pcVideoSubWindow = qobject_cast<VideoSubWindow*>( m_pcCurrentSubWindow );
pcVideoSubWindow->reloadFile();
m_pcCurrentSubWindow = NULL;
chageSubWindowSelection();
}
@@ -901,7 +903,10 @@ Void plaYUVerApp::chageSubWindowSelection()
if( activeSubWindow() )
{
m_pcCurrentSubWindow = new_window;
setWindowTitle( QApplication::applicationName() + " - " + m_pcCurrentSubWindow->getWindowName() );
if( )
if( !plaYUVerApp::findSubWindow( mdiArea, m_pcCurrentSubWindow->getRefSubWindow() ) )
{
m_pcCurrentSubWindow->setRefSubWindow( NULL );
+1 -1
View File
@@ -193,7 +193,7 @@ private:
static VideoSubWindow* findVideoSubWindow( const QMdiArea* mdiArea, const QString& fileName );
static SubWindowHandle* findSubWindow( const QMdiArea* mdiArea, const SubWindowHandle* subWindow );
QVector<SubWindowHandle*> m_acPlayingSubWindows;
QVector<VideoSubWindow*> m_acPlayingSubWindows;
QSlider *m_pcFrameSlider;
WidgetFrameNumber* m_pcFrameNumInfo;