2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
25 #include "PlayerListCtrl.h"
26 #include "..\..\subtitles\RTS.h"
27 #include "..\..\subtitles\VobSubFile.h"
29 // CPlayerSubresyncBar
31 class CPlayerSubresyncBar
: public CSizingControlBarG
33 DECLARE_DYNAMIC(CPlayerSubresyncBar
)
36 CPlayerListCtrl m_list
;
41 CComPtr
<ISubStream
> m_pSubStream
;
49 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
,
51 /* ........... same as TEXTSUB ............. */ COL_VOBID
=COL_TEXT
, COL_CELLID
, COL_FORCED
,
54 enum {NONE
= 0, VOBSUB
, TEXTSUB
};
59 typedef struct {int orgstart
, newstart
, orgend
, newend
;} SubTime
;
60 CAtlArray
<SubTime
> m_subtimes
;
62 // CRenderedTextSubtitle m_sts;
63 CSimpleTextSubtitle m_sts
;
65 int GetStartTime(int iItem
), GetEndTime(int iItem
);
66 void FormatTime(int iItem
, TCHAR
* buff
, int time
/* 0:start, 1:newstart, 2:preview */, bool fEnd
);
68 void UpdatePreview(), UpdateStrings();
70 enum {TSMOD
=1, TEMOD
=2, TSADJ
=4, TEADJ
=8, TSEP
=0x80000000};
72 void GetCheck(int iItem
, bool& fStartMod
, bool& fEndMod
, bool& fStartAdj
, bool& fEndAdj
);
73 void SetCheck(int iItem
, bool fStart
, bool fEnd
);
75 bool ModStart(int iItem
, int t
, bool fReset
= false);
76 bool ModEnd(int iItem
, int t
, bool fReset
= false);
79 CPlayerSubresyncBar();
80 virtual ~CPlayerSubresyncBar();
82 BOOL
Create(CWnd
* pParentWnd
, CCritSec
* pSubLock
);
84 void SetTime(__int64 rt
);
86 void SetSubtitle(ISubStream
* pSubStream
, double fps
);
91 virtual BOOL
PreCreateWindow(CREATESTRUCT
& cs
);
92 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
94 bool IsShortCut(MSG
* pMsg
);
99 afx_msg
void OnSize(UINT nType
, int cx
, int cy
);
100 afx_msg
void OnBeginlabeleditList(NMHDR
* pNMHDR
, LRESULT
* pResult
);
101 afx_msg
void OnDolabeleditList(NMHDR
* pNMHDR
, LRESULT
* pResult
);
102 afx_msg
void OnEndlabeleditList(NMHDR
* pNMHDR
, LRESULT
* pResult
);
103 afx_msg
void OnRclickList(NMHDR
* pNMHDR
, LRESULT
* pResult
);
104 afx_msg
void OnNMDblclkList(NMHDR
* pNMHDR
, LRESULT
* pResult
);
105 afx_msg
void OnLvnKeydownList(NMHDR
* pNMHDR
, LRESULT
* pResult
);
106 afx_msg
void OnCustomdrawList(NMHDR
* pNMHDR
, LRESULT
* pResult
);