Start splitting sub windows into different categories
This commit is contained in:
1 parent
2c71e84f09
commit
1af504d56f
10 files changed
+928
-712
No files matched your search
+8
-190
@@ -32,212 +32,30 @@
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
#include "ViewArea.h"
|
||||
#include "ModulesHandle.h"
|
||||
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
class SubWindowHandle;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
QString m_cFilename;
|
||||
UInt m_uiWidth;
|
||||
UInt m_uiHeight;
|
||||
Int m_iPelFormat;
|
||||
UInt m_uiFrameRate;
|
||||
}PlaYUVerStreamInfo;
|
||||
typedef QVector<PlaYUVerStreamInfo> PlaYUVerStreamInfoVector;
|
||||
|
||||
QDataStream& operator<<(QDataStream& out, const PlaYUVerStreamInfoVector& d);
|
||||
QDataStream& operator>>(QDataStream& in, PlaYUVerStreamInfoVector& d);
|
||||
Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename );
|
||||
|
||||
class SubWindowHandle: public QMdiSubWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
|
||||
QScrollArea* m_cScrollArea;
|
||||
ViewArea* m_cViewArea;
|
||||
|
||||
PlaYUVerStreamInfo m_sStreamInfo;
|
||||
|
||||
PlaYUVerStream* m_pCurrStream;
|
||||
PlaYUVerFrame* m_pcCurrFrame;
|
||||
QRect m_cSelectedArea;
|
||||
|
||||
QString m_cFilename;
|
||||
PlaYUVerAppModuleIf* m_pcCurrentModule;
|
||||
|
||||
SubWindowHandle* m_pcReferenceSubWindow;
|
||||
|
||||
QString m_cWindowName;
|
||||
|
||||
QString m_cWindowShortName;
|
||||
QString m_cCurrFileName;
|
||||
|
||||
Bool m_bIsPlaying;
|
||||
Bool m_bIsModule;
|
||||
|
||||
QPoint m_cLastScroll;
|
||||
UInt m_uiCategory;
|
||||
|
||||
public:
|
||||
SubWindowHandle( QWidget * parent = 0, Bool isModule = false );
|
||||
enum SubWindowCategories
|
||||
{
|
||||
VIDEO_SUBWINDOW = 0,
|
||||
MODULE_SUBWINDOW,
|
||||
PLOT_SUBWINDOW,
|
||||
}
|
||||
SubWindowHandle( QWidget * parent, UInt category );
|
||||
~SubWindowHandle();
|
||||
|
||||
Bool mayClose();
|
||||
Bool loadFile( QString cFilename, Bool bForceDialog = false );
|
||||
Bool loadFile( PlaYUVerStreamInfo* streamInfo );
|
||||
Void reloadFile();
|
||||
Bool save( QString filename );
|
||||
|
||||
Bool play();
|
||||
Void pause();
|
||||
Int playEvent();
|
||||
Void stop();
|
||||
|
||||
Bool isPlaying()
|
||||
{
|
||||
return m_bIsPlaying;
|
||||
}
|
||||
|
||||
Void seekAbsoluteEvent( UInt new_frame_num );
|
||||
Void seekRelativeEvent( Bool bIsFoward );
|
||||
|
||||
QImage* FrameToQImage( PlaYUVerFrame* curr_frame );
|
||||
|
||||
Void refreshFrame();
|
||||
Void setCurrFrame( PlaYUVerFrame* pcCurrFrame );
|
||||
|
||||
PlaYUVerStreamInfo getStreamInfo()
|
||||
{
|
||||
return m_sStreamInfo;
|
||||
}
|
||||
|
||||
PlaYUVerStream* getInputStream()
|
||||
{
|
||||
return m_pCurrStream;
|
||||
}
|
||||
|
||||
PlaYUVerFrame* getCurrFrame()
|
||||
{
|
||||
return m_pcCurrFrame;
|
||||
}
|
||||
|
||||
ViewArea* getViewArea()
|
||||
{
|
||||
return m_cViewArea;
|
||||
}
|
||||
|
||||
Double getZoomFactor()
|
||||
{
|
||||
return m_cViewArea->getZoomFactor();
|
||||
}
|
||||
|
||||
Void setModule( PlaYUVerAppModuleIf* pcCurrentModule )
|
||||
{
|
||||
m_pcCurrentModule = pcCurrentModule;
|
||||
}
|
||||
PlaYUVerAppModuleIf* getModule()
|
||||
{
|
||||
return m_pcCurrentModule;
|
||||
}
|
||||
|
||||
Void setRefSubWindow( SubWindowHandle* subWindow )
|
||||
{
|
||||
m_pcReferenceSubWindow = subWindow;
|
||||
}
|
||||
SubWindowHandle* getRefSubWindow()
|
||||
{
|
||||
return m_pcReferenceSubWindow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Functions to enable a module in the
|
||||
* current SubWindow
|
||||
*/
|
||||
Void enableModule( PlaYUVerAppModuleIf* select_module );
|
||||
Void disableModule();
|
||||
Void swapModuleFrames();
|
||||
Void applyModuleAllFrames();
|
||||
|
||||
/**
|
||||
* Show the image at its original size
|
||||
*/
|
||||
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 );
|
||||
Double getScaleFactor()
|
||||
{
|
||||
return m_cViewArea->getZoomFactor();
|
||||
}
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
Void setWindowName( QString name )
|
||||
{
|
||||
m_cWindowName = name;
|
||||
setWindowTitle( m_cWindowName );
|
||||
}
|
||||
QString getWindowName()
|
||||
{
|
||||
return m_cWindowName;
|
||||
}
|
||||
QString getWindowShortName()
|
||||
{
|
||||
return m_cWindowShortName;
|
||||
}
|
||||
QString getCurrentFileName()
|
||||
{
|
||||
return m_cFilename;
|
||||
}
|
||||
|
||||
Bool getIsModule()
|
||||
{
|
||||
return m_bIsModule;
|
||||
}
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent *event );
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateSelectedArea( QRect area );
|
||||
void adjustScrollBarByZoom( double factor, QPoint center );
|
||||
void adjustScrollBarByOffset( QPoint Offset );
|
||||
void updateLastScrollValue();
|
||||
};
|
||||
|
||||
} // NAMESPACE
|
||||
|
||||
Q_DECLARE_METATYPE(plaYUVer::PlaYUVerStreamInfo);
|
||||
Q_DECLARE_METATYPE(plaYUVer::PlaYUVerStreamInfoVector);
|
||||
|
||||
#endif // __SUBWINDOWHANDLE_H__
|
||||
|
||||
Reference in new issue
Block a user