forked from leixiaohua1020/VideoEye
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VideoEyeDlg.cpp
1324 lines (1049 loc) · 31.6 KB
/
VideoEyeDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
*
*
* VideoEye
*
* 雷霄骅 Lei Xiaohua
* leixiaohua1020@126.com
* 中国传媒大学/数字电视技术
* Communication University of China / Digital TV Technology
* http://blog.csdn.net/leixiaohua1020
*
*/
#include "stdafx.h"
#include "VideoEye.h"
#include "VideoEyeDlg.h"
#include "afxdialogex.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// 用于应用程序“关于”菜单项的 CAboutDlg 对话框
class CAboutDlg : public CDialogEx
{
public:
CAboutDlg();
// 对话框数据
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 实现
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnPaint();
CString m_intro;
};
CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD)
{
CString resloader;
resloader.LoadString(IDS_ABOUTBOX_INTRO);
m_intro.Format(_T("%s"),resloader);
//Version Info
#if 0
DWORD dwLen = 0;
char* lpData=NULL;
BOOL bSuccess = FALSE;
//配置文件路径
LPSTR exe_path=(LPSTR)malloc(MAX_URL_LENGTH);
//获得exe绝对路径
GetModuleFileNameA(NULL,(LPSTR)exe_path,MAX_URL_LENGTH);//
dwLen = GetFileVersionInfoSize((LPCTSTR)exe_path, 0);
if ( dwLen==0 ){
return ;
}
lpData =new char [dwLen+1];
bSuccess = GetFileVersionInfo((LPCTSTR)exe_path, 0, dwLen, lpData);
if (!bSuccess){
delete lpData;
return ;
}
free(exe_path);
LPVOID lpBuffer = NULL;
UINT uLen = 0;
bSuccess = VerQueryValue(lpData,
TEXT("\\StringFileInfo\\080404b0\\CompanyName"),
&lpBuffer,
&uLen);
//0804中文
//04b0即1252,ANSI
//可以从ResourceView中的Version中BlockHeader中看到
//可以测试的属性
//CompanyName
//FileDescription
//FileVersion
//InternalName
//LegalCopyright
//OriginalFilename
//ProductName
//ProductVersion
//Comments
//LegalTrademarks
//PrivateBuild
//SpecialBuild
if (!bSuccess)
{
delete lpData;
return ;
}
for (int i= 0; i<=uLen; i++)
{
char a = ((char *)lpBuffer)[i];
}
TRACE("%s",lpBuffer);
delete [] lpData;//此处不需要释放lpBuffer指向的空间,因为lpBuffer和lpData指向同一块内存空间
#endif
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_INTRO, m_intro);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
ON_WM_PAINT()
END_MESSAGE_MAP()
// CVideoEyeDlg 对话框
CVideoEyeDlg::CVideoEyeDlg(CWnd* pParent /*=NULL*/)
: CDialogEx(CVideoEyeDlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_edit_delay = 0;
}
void CVideoEyeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_DECODER_NAME, m_decoder_name);
// DDX_Control(pDX, IDC_DECODER_TYPE, m_decoder_type);
DDX_Control(pDX, IDC_PIX_FMT, m_pix_fmt);
DDX_Control(pDX, IDC_WxH, m_wxh);
DDX_Control(pDX, IDC_BITRATE, m_bitrate);
DDX_Control(pDX, IDC_EXTENTION, m_extention);
DDX_Control(pDX, IDC_METADATA, m_metadata);
DDX_Control(pDX, IDC_FRAMERATE, m_framerate);
DDX_Control(pDX, IDC_TIMELONG, m_timelong);
DDX_Control(pDX, IDC_INPUT_FORMAT, m_input_format);
DDX_Control(pDX, IDC_INPUT_PROTOCOL, m_input_protocol);
DDX_Control(pDX, IDC_DECODER_AUDIO_NAME, m_decoder_name_au);
DDX_Control(pDX, IDC_SAMPLE_RATE, m_sample_rate_au);
DDX_Control(pDX, IDC_INPUTURL, m_inputurl);
DDX_Control(pDX, IDC_CHANNELS, m_channels_au);
DDX_Control(pDX, IDC_PLAY_PROGRESS, m_playprogress);
DDX_Control(pDX, IDC_AQ_SIZE, m_aqsize);
DDX_Control(pDX, IDC_VQ_SIZE, m_vqsize);
DDX_Control(pDX, IDC_DURATION, m_duration);
DDX_Control(pDX, IDC_CURRENT_CLOCK, m_currentclock);
DDX_Control(pDX, IDC_AV_DIFF, m_avdiff);
}
BEGIN_MESSAGE_MAP(CVideoEyeDlg, CDialogEx)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDOK, &CVideoEyeDlg::OnBnClickedOk)
ON_BN_CLICKED(IDC_STOP, &CVideoEyeDlg::OnClickedStop)
ON_BN_CLICKED(IDC_ABOUT, &CVideoEyeDlg::OnBnClickedAbout)
ON_BN_CLICKED(IDC_PAUSE, &CVideoEyeDlg::OnBnClickedPause)
//ON_BN_CLICKED(IDCANCEL, &CVideoEyeDlg::OnBnClickedCancel)
ON_BN_CLICKED(IDC_INPUTURLBUTTON, &CVideoEyeDlg::OnBnClickedInputurlbutton)
ON_WM_DROPFILES()
ON_BN_CLICKED(IDC_OPEN_INPUTLIST, &CVideoEyeDlg::OnBnClickedOpenInputlist)
ON_BN_CLICKED(IDC_VIDEODECODE, &CVideoEyeDlg::OnBnClickedVideodecode)
ON_BN_CLICKED(IDC_AUDIODECODE, &CVideoEyeDlg::OnBnClickedAudiodecode)
ON_COMMAND(ID_HELP_DOC, &CVideoEyeDlg::OnHelpDoc)
ON_COMMAND(ID_HELP_HOMEPAGE, &CVideoEyeDlg::OnHelpHomepage)
ON_BN_CLICKED(IDC_FULLSCREEN, &CVideoEyeDlg::OnBnClickedFullscreen)
ON_BN_CLICKED(IDC_SEEK_F, &CVideoEyeDlg::OnBnClickedSeekF)
ON_BN_CLICKED(IDC_SEEK_B, &CVideoEyeDlg::OnBnClickedSeekB)
ON_BN_CLICKED(IDC_SEEK_STEP, &CVideoEyeDlg::OnBnClickedSeekStep)
ON_COMMAND(IDC_SEEK_F_10, &CVideoEyeDlg::OnSeekF10)
ON_COMMAND(IDC_SEEK_B_10, &CVideoEyeDlg::OnSeekB10)
ON_COMMAND(IDC_SEEK_F_600, &CVideoEyeDlg::OnSeekF600)
ON_COMMAND(IDC_SEEK_B_600, &CVideoEyeDlg::OnSeekB600)
ON_COMMAND(ID_RESIZE_50, &CVideoEyeDlg::OnResize50)
ON_COMMAND(ID_RESIZE_75, &CVideoEyeDlg::OnResize75)
ON_COMMAND(ID_RESIZE_100, &CVideoEyeDlg::OnResize100)
ON_COMMAND(ID_RESIZE_125, &CVideoEyeDlg::OnResize125)
ON_COMMAND(ID_RESIZE_150, &CVideoEyeDlg::OnResize150)
ON_COMMAND(ID_RESIZE_175, &CVideoEyeDlg::OnResize175)
ON_COMMAND(ID_RESIZE_200, &CVideoEyeDlg::OnResize200)
ON_COMMAND(ID_RESIZE_300, &CVideoEyeDlg::OnResize300)
ON_COMMAND(ID_RESIZE_400, &CVideoEyeDlg::OnResize400)
ON_COMMAND(ID_REASPECT_1_1, &CVideoEyeDlg::OnReaspect11)
ON_COMMAND(ID_REASPECT_3_2, &CVideoEyeDlg::OnReaspect32)
ON_COMMAND(ID_REASPECT_4_3, &CVideoEyeDlg::OnReaspect43)
ON_COMMAND(ID_REASPECT_5_4, &CVideoEyeDlg::OnReaspect54)
ON_COMMAND(ID_REASPECT_14_9, &CVideoEyeDlg::OnReaspect149)
ON_COMMAND(ID_REASPECT_14_10, &CVideoEyeDlg::OnReaspect1410)
ON_COMMAND(ID_REASPECT_16_9, &CVideoEyeDlg::OnReaspect169)
ON_COMMAND(ID_REASPECT_16_10, &CVideoEyeDlg::OnReaspect1610)
ON_COMMAND(ID_REASPECT_235_100, &CVideoEyeDlg::OnReaspect235100)
ON_COMMAND(ID_WINDOW_YUV, &CVideoEyeDlg::OnWindowYuv)
ON_COMMAND(ID_WINDOW_A_WAVE, &CVideoEyeDlg::OnWindowAWave)
ON_COMMAND(ID_WINDOW_A_RDFT, &CVideoEyeDlg::OnWindowARdft)
ON_COMMAND(ID_DATA_OUTPUT_M_A, &CVideoEyeDlg::OnDataOutputMA)
ON_COMMAND(ID_DATA_OUTPUT_M_V, &CVideoEyeDlg::OnDataOutputMV)
ON_COMMAND(ID_DATA_OUTPUT_M_O, &CVideoEyeDlg::OnDataOutputMO)
ON_COMMAND(ID_DATA_OUTPUT_R_YUV, &CVideoEyeDlg::OnDataOutputRYuv)
ON_COMMAND(ID_DATA_OUTPUT_R_Y, &CVideoEyeDlg::OnDataOutputRY)
ON_COMMAND(ID_DATA_OUTPUT_R_U, &CVideoEyeDlg::OnDataOutputRU)
ON_COMMAND(ID_DATA_OUTPUT_R_V, &CVideoEyeDlg::OnDataOutputRV)
ON_COMMAND(ID_DATA_OUTPUT, &CVideoEyeDlg::OnDataOutput)
ON_COMMAND(IDC_SPECIAL_P_RTMP, &CVideoEyeDlg::OnSpecialPRtmp)
ON_COMMAND(ID_ASSISTANT_MEDIAINFO, &CVideoEyeDlg::OnAssistantMediainfo)
ON_COMMAND(IDC_SPECIAL_V_I_JPG, &CVideoEyeDlg::OnSpecialVIJpg)
ON_COMMAND(IDC_RAWANALYSIS_HISTOGRAM, &CVideoEyeDlg::OnRawanalysisHistogram)
ON_COMMAND(IDC_RAWANALYSIS_CANNY, &CVideoEyeDlg::OnRawanalysisCanny)
ON_COMMAND(IDC_RAWANALYSIS_CONTOUR, &CVideoEyeDlg::OnRawanalysisContour)
ON_COMMAND(IDC_RAWANALYSIS_2DDFT, &CVideoEyeDlg::OnRawanalysis2ddft)
ON_COMMAND(IDC_RAWANALYSIS, &CVideoEyeDlg::OnRawanalysis)
ON_COMMAND(IDC_RAWANALYSIS_FACE_DETECT, &CVideoEyeDlg::OnRawanalysisFaceDetect)
ON_COMMAND(IDC_SPECIAL_F_FLV, &CVideoEyeDlg::OnSpecialFFlv)
ON_COMMAND(IDC_SPECIAL_A_AAC, &CVideoEyeDlg::OnSpecialAAac)
ON_COMMAND(IDC_SPECIAL_F_TS, &CVideoEyeDlg::OnSpecialFTs)
ON_COMMAND(IDC_SPECIAL_V_H264, &CVideoEyeDlg::OnSpecialVH264)
ON_COMMAND(ID_OPT_PLAYER, &CVideoEyeDlg::OnOptPlayer)
ON_WM_HSCROLL()
ON_COMMAND(ID_DFANALYSIS, &CVideoEyeDlg::OnDfanalysis)
ON_COMMAND(IDC_RAWANALYSIS_Y, &CVideoEyeDlg::OnRawanalysisY)
ON_COMMAND(IDC_RAWANALYSIS_U, &CVideoEyeDlg::OnRawanalysisU)
ON_COMMAND(IDC_RAWANALYSIS_V, &CVideoEyeDlg::OnRawanalysisV)
ON_COMMAND(IDC_RAWANALYSIS_R, &CVideoEyeDlg::OnRawanalysisR)
ON_COMMAND(IDC_RAWANALYSIS_G, &CVideoEyeDlg::OnRawanalysisG)
ON_COMMAND(IDC_RAWANALYSIS_B, &CVideoEyeDlg::OnRawanalysisB)
ON_COMMAND(ID_TOPMOST_ALWAYS, &CVideoEyeDlg::OnTopmostAlways)
ON_COMMAND(ID_TOPMOST_NEVER, &CVideoEyeDlg::OnTopmostNever)
//ON_COMMAND(IDC_SPECIAL_ABOUT, &CVideoEyeDlg::OnSpecialAbout)
ON_COMMAND(ID_LANG_CN, &CVideoEyeDlg::OnLangCn)
ON_COMMAND(ID_LANG_EN, &CVideoEyeDlg::OnLangEn)
ON_COMMAND(IDCANCEL, &CVideoEyeDlg::OnCancel)
ON_COMMAND(ID_SYSINFO, &CVideoEyeDlg::OnSysinfo)
ON_WM_CTLCOLOR()
ON_COMMAND(ID_WINDOWSTRETCH_KEEPRATIO, &CVideoEyeDlg::OnWindowstretchKeepratio)
ON_COMMAND(ID_WINDOWSTRETCH_RESIZE, &CVideoEyeDlg::OnWindowstretchResize)
END_MESSAGE_MAP()
UINT Thread_Play(LPVOID lpParam){
CVideoEyeDlg *dlg=(CVideoEyeDlg *)lpParam;
ve_play(lpParam);
//LPDWORD nExitCode=0;
return 0;
}
// CVideoEyeDlg 消息处理程序
BOOL CVideoEyeDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// 将“关于...”菜单项添加到系统菜单中。
// IDM_ABOUTBOX 必须在系统命令范围内。
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
BOOL bNameValid;
CString strAboutMenu;
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
ASSERT(bNameValid);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
// 执行此操作
SetIcon(m_hIcon, TRUE); // 设置大图标
SetIcon(m_hIcon, FALSE); // 设置小图标
///////////////显示Splash (欢迎界面)///////////////////////////////////
Welcome welcome; //创建启动窗口类的实例
welcome.Create(IDB_WELCOME);
welcome.CenterWindow();
welcome.UpdateWindow(); //send WM_PAINT
//显示时长
Sleep(2000);
welcome.DestroyWindow();//销毁初始画面窗口
/////////////////////////////////////////////////////////////////////////
//设置背景色
//SetBackgroundColor(RGB(255,255,255));
//检查内存泄露
//在程序开始启动的地方(足够前的地方,只要在泄漏的内存分配的前面)使用代码
//参数为内存块地址“{}”中的数字
//_CrtSetBreakAlloc(5253);
//初始化图片按钮
InitBitmapButton();
//初始化子窗口
InitSubWindow();
//Tooltip---------------
InitTooltip();
//SliderControl
m_playprogress.SetRange(0,1000);
m_playprogress.SetTicFreq(10);
//page=(CPage)lineSeries.
//重置按钮
ResetBtn();
is_playing=0;
//支持在系统中右键打开----------------------
//当传入参数的时候
TCHAR* argvPath = __targv[1];
if(argvPath != NULL){
//设置路径
m_inputurl.SetWindowText(argvPath);
OnBnClickedOk();
}
//----------------------------------------------------
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
}
void CVideoEyeDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialogEx::OnSysCommand(nID, lParam);
}
}
// 如果向对话框添加最小化按钮,则需要下面的代码
// 来绘制该图标。对于使用文档/视图模型的 MFC 应用程序,
// 这将由框架自动完成。
void CVideoEyeDlg::OnPaint()
{
//IsIconic的意思是:是否是最小化的?
if (IsIconic())
{
CPaintDC dc(this); // 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作区矩形中居中
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 绘制图标
dc.DrawIcon(x, y, m_hIcon);
}
else
{
//一般图标都不是最小化的
//都会触发这里
CDialogEx::OnPaint();
//CDC *pDC = this->GetDC();
//CRect rect;
//CBrush pBrush;
//
////客户区
//GetClientRect(&rect);
//pBrush.CreateSolidBrush(RGB(255,255,255));
//pDC->FillRect(rect,&pBrush);
//pBrush.DeleteObject();
}
}
//当用户拖动最小化窗口时系统调用此函数取得光标
//显示。
HCURSOR CVideoEyeDlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
void CVideoEyeDlg::OnBnClickedOk()
{
SystemClear();
if(GetURL()==-1){
return ;
}
pThreadPlay = AfxBeginThread(Thread_Play,this);//开启线程
ActiveBtn();
is_playing=1;
// TODO: 在此添加控件通知处理程序代码
//CDialogEx::OnOK();
}
int CVideoEyeDlg::GetURL()
{
LPTSTR urlstr=(LPTSTR)malloc(MAX_URL_LENGTH);
m_inputurl.GetWindowText((LPTSTR)urlstr,MAX_URL_LENGTH);
#ifdef _UNICODE
USES_CONVERSION;
strcpy(url,W2A(urlstr));
#else
strcpy(url,urlstr);
#endif
if(strcmp(url,"")==0){
CString resloader;
resloader.LoadString(IDS_MSGBOX_NOURL);
AfxMessageBox(resloader);
return -1;
}
return 0;
}
void CVideoEyeDlg::OnClickedStop()
{
ve_quit();
ResetBtn();
is_playing=0;
}
void CVideoEyeDlg::OnBnClickedAbout()
{
// TODO: 在此添加控件通知处理程序代码
CAboutDlg dlg;
dlg.DoModal();
}
void CVideoEyeDlg::OnBnClickedPause()
{
// TODO: 在此添加控件通知处理程序代码
ve_play_pause();
}
void CVideoEyeDlg::SystemClear()
{
videodecode->SystemClear();
audiodecode->SystemClear();
ve_reset_index();
}
void CVideoEyeDlg::OnTimer(UINT nIDEvent)
{
}
void CVideoEyeDlg::OnBnClickedInputurlbutton()
{
// TODO: 在此添加控件通知处理程序代码
CString FilePathName;
//文件过滤字符串。够长
CString strfilter;
strfilter.Append(_T("Common media formats|*.avi;*.wmv;*.wmp;*.wm;*.asf;*.rm;*.ram;*.rmvb;*.ra;*.mpg;*.mpeg;*.mpe;*.m1v;*.m2v;*.mpv2;"));
strfilter.Append(_T("*.mp2v;*.dat;*.mp4;*.m4v;*.m4p;*.vob;*.ac3;*.dts;*.mov;*.qt;*.mr;*.3gp;*.3gpp;*.3g2;*.3gp2;*.swf;*.ogg;*.wma;*.wav;"));
strfilter.Append(_T("*.mid;*.midi;*.mpa;*.mp2;*.mp3;*.m1a;*.m2a;*.m4a;*.aac;*.mkv;*.ogm;*.m4b;*.tp;*.ts;*.tpr;*.pva;*.pss;*.wv;*.m2ts;*.evo;"));
strfilter.Append(_T("*.rpm;*.realpix;*.rt;*.smi;*.smil;*.scm;*.aif;*.aiff;*.aifc;*.amr;*.amv;*.au;*.acc;*.dsa;*.dsm;*.dsv;*.dss;*.pmp;*.smk;*.flic|"));
strfilter.Append(_T("Windows Media Video(*.avi;*wmv;*wmp;*wm;*asf)|*.avi;*.wmv;*.wmp;*.wm;*.asf|"));
strfilter.Append(_T("Windows Media Audio(*.wma;*wav;*aif;*aifc;*aiff;*mid;*midi;*rmi)|*.wma;*.wav;*.aif;*.aifc;*.aiff;*.mid;*.midi;*.rmi|"));
strfilter.Append(_T("Real(*.rm;*ram;*rmvb;*rpm;*ra;*rt;*rp;*smi;*smil;*.scm)|*.rm;*.ram;*.rmvb;*.rpm;*.ra;*.rt;*.rp;*.smi;*.smil;*.scm|"));
strfilter.Append(_T("MPEG Video(*.mpg;*mpeg;*mpe;*m1v;*m2v;*mpv2;*mp2v;*dat;*mp4;*m4v;*m4p;*m4b;*ts;*tp;*tpr;*pva;*pss;*.wv;)|"));
strfilter.Append(_T("*.mpg;*.mpeg;*.mpe;*.m1v;*.m2v;*.mpv2;*.mp2v;*.dat;*.mp4;*.m4v;*.m4p;*.m4b;*.ts;*.tp;*.tpr;*.pva;*.pss;*.wv;|"));
strfilter.Append(_T("MPEG Audio(*.mpa;*mp2;*m1a;*m2a;*m4a;*aac;*.m2ts;*.evo)|*.mpa;*.mp2;*.m1a;*.m2a;*.m4a;*.aac;*.m2ts;*.evo|"));
strfilter.Append(_T("DVD(*.vob;*ifo;*ac3;*dts)|*.vob;*.ifo;*.ac3;*.dts|MP3(*.mp3)|*.mp3|CD Tracks(*.cda)|*.cda|"));
strfilter.Append(_T("Quicktime(*.mov;*qt;*mr;*3gp;*3gpp;*3g2;*3gp2)|*.mov;*.qt;*.mr;*.3gp;*.3gpp;*.3g2;*.3gp2|"));
strfilter.Append(_T("Flash Files(*.flv;*swf;*.f4v)|*.flv;*.swf;*.f4v|Playlist(*.smpl;*.asx;*m3u;*pls;*wvx;*wax;*wmx;*mpcpl)|*.smpl;*.asx;*.m3u;*.pls;*.wvx;*.wax;*.wmx;*.mpcpl|"));
strfilter.Append(_T("Others(*.ivf;*au;*snd;*ogm;*ogg;*fli;*flc;*flic;*d2v;*mkv;*pmp;*mka;*smk;*bik;*ratdvd;*roq;*drc;*dsm;*dsv;*dsa;*dss;*mpc;*divx;*vp6;*.ape;*.flac;*.tta;*.csf)"));
strfilter.Append(_T("|*.ivf;*.au;*.snd;*.ogm;*.ogg;*.fli;*.flc;*.flic;*.d2v;*.mkv;*.pmp;*.mka;*.smk;*.bik;*.ratdvd;*.roq;*.drc;*.dsm;*.dsv;*.dsa;*.dss;*.mpc;*.divx;*.vp6;*.ape;*.amr;*.flac;*.tta;*.csf|"));
strfilter.Append(_T("All Files(*.*)|*.*||"));
LPCTSTR lpszfilter=strfilter;
CFileDialog dlg(TRUE,NULL,NULL,NULL,lpszfilter);///TRUE为OPEN对话框,FALSE为SAVE AS对话框
if(dlg.DoModal()==IDOK) {
FilePathName=dlg.GetPathName();
m_inputurl.SetWindowText(FilePathName);
}
}
void CVideoEyeDlg::OnDropFiles(HDROP hDropInfo)
{
CDialogEx::OnDropFiles(hDropInfo);
LPTSTR pFilePathName =(LPTSTR)malloc(MAX_URL_LENGTH);
::DragQueryFile(hDropInfo, 0, pFilePathName,MAX_URL_LENGTH); // 获取拖放文件的完整文件名,最关键!
m_inputurl.SetWindowText(pFilePathName);
::DragFinish(hDropInfo); // 注意这个不能少,它用于释放Windows 为处理文件拖放而分配的内存
free(pFilePathName);
}
void CVideoEyeDlg::OnBnClickedOpenInputlist()
{
inputlist->ShowWindow(SW_SHOW);
}
void CVideoEyeDlg::OnBnClickedVideodecode()
{
videodecode->ShowWindow(SW_SHOW);
}
void CVideoEyeDlg::OnBnClickedAudiodecode()
{
audiodecode->ShowWindow(SW_SHOW);
}
void CAboutDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: 在此处添加消息处理程序代码
// 不为绘图消息调用 CDialogEx::OnPaint()
// 添加背景图片
CRect rect;
GetClientRect(&rect);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CBitmap bmpBackground;
bmpBackground.LoadBitmap(IDB_ABOUT);
//IDB_BITMAP是你自己的图对应的ID
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
CBitmap *pbmpOld=dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0,
bitmap.bmWidth,bitmap.bmHeight,SRCCOPY);
}
void CVideoEyeDlg::OnHelpDoc()
{
char realpath[400]={0};
//获得exe绝对路径
GetModuleFileNameA(NULL,(LPSTR)realpath,400);//
//获得exe文家夹路径
strrchr(realpath, '\\')[0]= '\0';//倒着查找对应的字符'\\',替换成'\0'
strcat(realpath,"\\helpdoc.pdf");
ShellExecuteA( NULL,"open",realpath,NULL,NULL,SW_SHOWNORMAL);
}
void CVideoEyeDlg::OnHelpHomepage()
{
ShellExecuteA(NULL, "open","http://blog.csdn.net/leixiaohua1020",NULL,NULL,SW_SHOWNORMAL);
}
void CVideoEyeDlg::OnBnClickedFullscreen()
{
ve_play_fullcreen();
}
void CVideoEyeDlg::OnBnClickedSeekF()
{
ve_seek(60);
}
void CVideoEyeDlg::OnBnClickedSeekB()
{
ve_seek(-60);
}
void CVideoEyeDlg::OnBnClickedSeekStep()
{
ve_seek_step();
}
void CVideoEyeDlg::OnSeekF10()
{
ve_seek(10);
}
void CVideoEyeDlg::OnSeekB10()
{
ve_seek(-10);
}
void CVideoEyeDlg::OnSeekF600()
{
ve_seek(600);
}
void CVideoEyeDlg::OnSeekB600()
{
ve_seek(-600);
}
void CVideoEyeDlg::OnResize50()
{
ve_size(50);
}
void CVideoEyeDlg::OnResize75()
{
ve_size(75);
}
void CVideoEyeDlg::OnResize100()
{
ve_size(100);
}
void CVideoEyeDlg::OnResize125()
{
ve_size(125);
}
void CVideoEyeDlg::OnResize150()
{
ve_size(150);
}
void CVideoEyeDlg::OnResize175()
{
ve_size(175);
}
void CVideoEyeDlg::OnResize200()
{
ve_size(200);
}
void CVideoEyeDlg::OnResize300()
{
ve_size(300);
}
void CVideoEyeDlg::OnResize400()
{
ve_size(400);
}
void CVideoEyeDlg::OnReaspect11()
{
ve_aspectratio(1,1);
}
void CVideoEyeDlg::OnReaspect32()
{
ve_aspectratio(3,2);
}
void CVideoEyeDlg::OnReaspect43()
{
ve_aspectratio(4,3);
}
void CVideoEyeDlg::OnReaspect54()
{
ve_aspectratio(5,4);
}
void CVideoEyeDlg::OnReaspect149()
{
ve_aspectratio(14,9);
}
void CVideoEyeDlg::OnReaspect1410()
{
ve_aspectratio(14,10);
}
void CVideoEyeDlg::OnReaspect169()
{
ve_aspectratio(16,9);
}
void CVideoEyeDlg::OnReaspect1610()
{
ve_aspectratio(16,10);
}
void CVideoEyeDlg::OnReaspect235100()
{
ve_aspectratio(235,100);
}
void CVideoEyeDlg::OnWindowYuv()
{
ve_audio_display(0);
}
void CVideoEyeDlg::OnWindowAWave()
{
ve_audio_display(1);
}
void CVideoEyeDlg::OnWindowARdft()
{
ve_audio_display(2);
}
void CVideoEyeDlg::OnDataOutputMA()
{
dataoutput->ShowWindow(SW_SHOW);
dataoutput->m_outcheckma.SetCheck(1);
}
void CVideoEyeDlg::OnDataOutputMV()
{
dataoutput->ShowWindow(SW_SHOW);
dataoutput->m_outcheckmv.SetCheck(1);
}
void CVideoEyeDlg::OnDataOutputMO()
{
dataoutput->ShowWindow(SW_SHOW);
dataoutput->m_outcheckmo.SetCheck(1);
}
void CVideoEyeDlg::OnDataOutputRYuv()
{
dataoutput->ShowWindow(SW_SHOW);
dataoutput->m_outcheckryuv.SetCheck(1);
}
void CVideoEyeDlg::OnDataOutputRY()
{
dataoutput->ShowWindow(SW_SHOW);
dataoutput->m_outcheckry.SetCheck(1);
}
void CVideoEyeDlg::OnDataOutputRU()
{
dataoutput->ShowWindow(SW_SHOW);
dataoutput->m_outcheckru.SetCheck(1);
}
void CVideoEyeDlg::OnDataOutputRV()
{
dataoutput->ShowWindow(SW_SHOW);
dataoutput->m_outcheckrv.SetCheck(1);
}
void CVideoEyeDlg::OnDataOutput()
{
dataoutput->ShowWindow(SW_SHOW);
}
void CVideoEyeDlg::OnSpecialPRtmp()
{
char realpath[400]={0};
//获得exe绝对路径
GetModuleFileNameA(NULL,(LPSTR)realpath,400);//
//获得exe文家夹路径
strrchr(realpath, '\\')[0]= '\0';//倒着查找对应的字符'\\',替换成'\0'
strcat(realpath,"\\SpecialPRTMP.exe");
//打开文件
ShellExecuteA( NULL,"open",realpath,NULL,NULL,SW_SHOWNORMAL);
}
void CVideoEyeDlg::OnAssistantMediainfo()
{
assistantmi=new Assistantmediainfo;
//主程序this指针
assistantmi->maindlg=this;
assistantmi->Create(IDD_ASSISTANTMEDIAINFO);
assistantmi->ShowWindow(TRUE);
}
void CVideoEyeDlg::OnSpecialVIJpg()
{
char realpath[400]={0};
//获得exe绝对路径
GetModuleFileNameA(NULL,(LPSTR)realpath,400);//
//获得exe文家夹路径
strrchr(realpath, '\\')[0]= '\0';//倒着查找对应的字符'\\',替换成'\0'
strcat(realpath,"\\SpecialVIJPG.exe");
//打开文件
ShellExecuteA( NULL,"open",realpath,NULL,NULL,SW_SHOWNORMAL);
}
void CVideoEyeDlg::OnRawanalysisHistogram()
{
rawanalysis->ShowWindow(SW_SHOW);
rawanalysis->m_rawanalysismethod=0;
rawanalysis->UpdateData(FALSE);
rawanalysis->maindlg=this;
}
void CVideoEyeDlg::OnRawanalysisCanny()
{
rawanalysis->ShowWindow(SW_SHOW);
rawanalysis->m_rawanalysismethod=1;
rawanalysis->UpdateData(FALSE);
rawanalysis->maindlg=this;
}
void CVideoEyeDlg::OnRawanalysisContour()
{
rawanalysis->ShowWindow(SW_SHOW);
rawanalysis->m_rawanalysismethod=2;
rawanalysis->UpdateData(FALSE);
rawanalysis->maindlg=this;
}
void CVideoEyeDlg::OnRawanalysis2ddft()
{
rawanalysis->ShowWindow(SW_SHOW);
rawanalysis->m_rawanalysismethod=3;
rawanalysis->UpdateData(FALSE);
rawanalysis->maindlg=this;
}
void CVideoEyeDlg::OnRawanalysisFaceDetect()
{
rawanalysis->ShowWindow(SW_SHOW);
rawanalysis->m_rawanalysismethod=4;
rawanalysis->UpdateData(FALSE);
rawanalysis->maindlg=this;
}
void CVideoEyeDlg::OnRawanalysis()
{
rawanalysis->ShowWindow(SW_SHOW);
rawanalysis->maindlg=this;
}
void CVideoEyeDlg::OnSpecialFFlv()
{
char realpath[400]={0};
//获得exe绝对路径
GetModuleFileNameA(NULL,(LPSTR)realpath,400);//
//获得exe文家夹路径
strrchr(realpath, '\\')[0]= '\0';//倒着查找对应的字符'\\',替换成'\0'
strcat(realpath,"\\SpecialFFLV.exe");
//打开文件
ShellExecuteA( NULL,"open",realpath,NULL,NULL,SW_SHOWNORMAL);
}
void CVideoEyeDlg::OnSpecialAAac()
{
char realpath[400]={0};
//获得exe绝对路径
GetModuleFileNameA(NULL,(LPSTR)realpath,400);//
//获得exe文家夹路径
strrchr(realpath, '\\')[0]= '\0';//倒着查找对应的字符'\\',替换成'\0'
strcat(realpath,"\\SpecialAAAC.exe");
//打开文件
ShellExecuteA( NULL,"open",realpath,NULL,NULL,SW_SHOWNORMAL);
}
void CVideoEyeDlg::OnSpecialFTs()
{
char realpath[400]={0};
//获得exe绝对路径
GetModuleFileNameA(NULL,(LPSTR)realpath,400);//
//获得exe文家夹路径
strrchr(realpath, '\\')[0]= '\0';//倒着查找对应的字符'\\',替换成'\0'
strcat(realpath,"\\SpecialFTS.exe");
//打开文件
ShellExecuteA( NULL,"open",realpath,NULL,NULL,SW_SHOWNORMAL);
}
void CVideoEyeDlg::OnSpecialVH264()
{
char realpath[400]={0};
//获得exe绝对路径
GetModuleFileNameA(NULL,(LPSTR)realpath,400);//
//获得exe文家夹路径
strrchr(realpath, '\\')[0]= '\0';//倒着查找对应的字符'\\',替换成'\0'
strcat(realpath,"\\SpecialVH264.exe");
//打开文件
ShellExecuteA( NULL,"open",realpath,NULL,NULL,SW_SHOWNORMAL);
}
void CVideoEyeDlg::OnOptPlayer()
{
optplayer->ShowWindow(SW_SHOW);
}
void CVideoEyeDlg::ResetBtn(){
GetDlgItem(IDOK)->EnableWindow(TRUE);
GetDlgItem(IDC_SEEK_B)->EnableWindow(FALSE);
GetDlgItem(IDC_SEEK_F)->EnableWindow(FALSE);
GetDlgItem(IDC_PAUSE)->EnableWindow(FALSE);
GetDlgItem(IDC_STOP)->EnableWindow(FALSE);
GetDlgItem(IDC_SEEK_STEP)->EnableWindow(FALSE);
GetDlgItem(IDC_FULLSCREEN)->EnableWindow(FALSE);
GetDlgItem(IDC_PLAY_PROGRESS)->EnableWindow(FALSE);
//FIX
GetDlgItem(IDC_RAWANALYSIS)->EnableWindow(FALSE);
GetDlgItem(ID_DFANALYSIS)->EnableWindow(FALSE);
GetDlgItem(IDC_VIDEODECODE)->EnableWindow(FALSE);
GetDlgItem(IDC_AUDIODECODE)->EnableWindow(FALSE);
}
void CVideoEyeDlg::ActiveBtn(){
GetDlgItem(IDOK)->EnableWindow(FALSE);
GetDlgItem(IDC_SEEK_B)->EnableWindow(TRUE);
GetDlgItem(IDC_SEEK_F)->EnableWindow(TRUE);
GetDlgItem(IDC_PAUSE)->EnableWindow(TRUE);
GetDlgItem(IDC_STOP)->EnableWindow(TRUE);
GetDlgItem(IDC_SEEK_STEP)->EnableWindow(TRUE);
GetDlgItem(IDC_FULLSCREEN)->EnableWindow(TRUE);
GetDlgItem(IDC_PLAY_PROGRESS)->EnableWindow(TRUE);
//FIX
GetDlgItem(IDC_RAWANALYSIS)->EnableWindow(TRUE);