home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2004 March / PCWELT_3_2004.ISO / pcwsoft / flaskmpeg_078_39_src.z.exe / flaskmpeg / ProgressGraph.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-10-28  |  2.3 KB  |  88 lines

  1. /* 
  2.  *  ProgressGraph.h
  3.  *
  4.  *    Copyright (C) Alberto Vigata - July 2000 - ultraflask@yahoo.com
  5.  *
  6.  *  This file is part of FlasKMPEG, a free MPEG to MPEG/AVI converter
  7.  *    
  8.  *  FlasKMPEG is free software; you can redistribute it and/or modify
  9.  *  it under the terms of the GNU General Public License as published by
  10.  *  the Free Software Foundation; either version 2, or (at your option)
  11.  *  any later version.
  12.  *   
  13.  *  FlasKMPEG is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *  GNU General Public License for more details.
  17.  *   
  18.  *  You should have received a copy of the GNU General Public License
  19.  *  along with GNU Make; see the file COPYING.  If not, write to
  20.  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  21.  *
  22.  */
  23.  
  24. #if !defined(AFX_PROGRESSGRAPH_H__CE1DE857_B8E5_42E0_9B32_73FF8714CD66__INCLUDED_)
  25. #define AFX_PROGRESSGRAPH_H__CE1DE857_B8E5_42E0_9B32_73FF8714CD66__INCLUDED_
  26.  
  27. #if _MSC_VER > 1000
  28. #pragma once
  29. #endif // _MSC_VER > 1000
  30.  
  31. #include "..\include\flasktypes.h"
  32. #include "Canvas.h"
  33. #include <deque>
  34.  
  35. using namespace std;
  36.  
  37. #define PROGRESSBAR_WIDTH 2
  38.  
  39.  
  40. struct TProgressBar
  41. {
  42.   long nHeight;   //height in pixels of the bar
  43.   bool bKeyFrame; // The bar represents a keyframe
  44. };
  45.  
  46. struct TProgressFrame
  47. {
  48.   long nValue;    // size of the frame
  49.   bool bKeyFrame; // The bar represents a keyframe
  50. };
  51.  
  52. class CProgressGraph : public CCanvas  
  53. {
  54. public:
  55.     CProgressGraph();
  56.     virtual ~CProgressGraph();
  57.  
  58.   bool Initialize( HWND hWnd, long nWidth, long nHeight,  long nFrameDelay);
  59.  
  60.   void NewFrame( long size, bool bKeyframe );
  61.   void StreamInfo( ui64 size );
  62.   void Draw();
  63.  
  64. private:
  65.   deque<TProgressBar>    m_vBars;
  66.   deque<TProgressFrame> m_vFrames;
  67.  
  68.   long m_nBarCount;
  69.   long m_nBarSize;
  70.   long m_nFramedelay; // in 100ns units
  71.  
  72.   HWND m_hWnd;
  73.  
  74.   // Stats
  75.   long m_nMinFramesize;
  76.   long m_nMaxFramesize;
  77.   __int64 m_nTotalFramesize;
  78.   ui64 m_nTotalSize;
  79.   long m_nFramecount;
  80.  
  81.   // Calculated stats
  82.   long m_nAverageVideoBitrate; // in kilobits
  83.   long m_nAverageBitrate;
  84.  
  85. };
  86.  
  87. #endif // !defined(AFX_PROGRESSGRAPH_H__CE1DE857_B8E5_42E0_9B32_73FF8714CD66__INCLUDED_)
  88.