00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <afxcview.h>
00025 #include "PlayerListCtrl.h"
00026 #include "..\..\subtitles\RTS.h"
00027 #include "..\..\subtitles\VobSubFile.h"
00028
00029
00030
00031 class CPlayerSubresyncBar : public CSizingControlBarG
00032 {
00033 DECLARE_DYNAMIC(CPlayerSubresyncBar)
00034
00035 private:
00036 CPlayerListCtrl m_list;
00037
00038 CFont m_font;
00039
00040 CCritSec* m_pSubLock;
00041 CComPtr<ISubStream> m_pSubStream;
00042
00043 int m_lastSegment;
00044 __int64 m_rt;
00045
00046 enum
00047 {
00048
00049 COL_START=0, COL_END, COL_PREVSTART, COL_PREVEND, COL_TEXT, COL_STYLE, COL_FONT, COL_CHARSET, COL_UNICODE, COL_LAYER, COL_ACTOR, COL_EFFECT,
00050
00051 COL_VOBID=COL_TEXT, COL_CELLID, COL_FORCED,
00052 };
00053
00054 enum {NONE = 0, VOBSUB, TEXTSUB};
00055 int m_mode;
00056
00057 bool m_fUnlink;
00058
00059 typedef struct {int orgstart, newstart, orgend, newend;} SubTime;
00060 CArray<SubTime> m_subtimes;
00061
00062
00063 CSimpleTextSubtitle m_sts;
00064
00065 int GetStartTime(int iItem), GetEndTime(int iItem);
00066 void FormatTime(int iItem, TCHAR* buff, int time , bool fEnd);
00067
00068 void UpdatePreview(), UpdateStrings();
00069
00070 enum {TSMOD=1, TEMOD=2, TSADJ=4, TEADJ=8, TSEP=0x80000000};
00071
00072 void GetCheck(int iItem, bool& fStartMod, bool& fEndMod, bool& fStartAdj, bool& fEndAdj);
00073 void SetCheck(int iItem, bool fStart, bool fEnd);
00074
00075 bool ModStart(int iItem, int t, bool fReset = false);
00076 bool ModEnd(int iItem, int t, bool fReset = false);
00077
00078 public:
00079 CPlayerSubresyncBar();
00080 virtual ~CPlayerSubresyncBar();
00081
00082 BOOL Create(CWnd* pParentWnd, CCritSec* pSubLock);
00083
00084 void SetTime(__int64 rt);
00085
00086 void SetSubtitle(ISubStream* pSubStream, double fps);
00087 void ResetSubtitle();
00088 void SaveSubtitle();
00089
00090 protected:
00091 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00092 virtual BOOL PreTranslateMessage(MSG* pMsg);
00093
00094 DECLARE_MESSAGE_MAP()
00095
00096 public:
00097 afx_msg void OnSize(UINT nType, int cx, int cy);
00098 afx_msg void OnBeginlabeleditList(NMHDR* pNMHDR, LRESULT* pResult);
00099 afx_msg void OnDolabeleditList(NMHDR* pNMHDR, LRESULT* pResult);
00100 afx_msg void OnEndlabeleditList(NMHDR* pNMHDR, LRESULT* pResult);
00101 afx_msg void OnRclickList(NMHDR* pNMHDR, LRESULT* pResult);
00102 afx_msg void OnNMDblclkList(NMHDR* pNMHDR, LRESULT* pResult);
00103 afx_msg void OnLvnKeydownList(NMHDR* pNMHDR, LRESULT* pResult);
00104 afx_msg void OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult);
00105 };