-
Notifications
You must be signed in to change notification settings - Fork 78
/
SendCtrlCmd.h
841 lines (731 loc) · 15.9 KB
/
SendCtrlCmd.h
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
#pragma once
#include "Util.h"
#include "StructDef.h"
#include "CtrlCmdDef.h"
class CSendCtrlCmd
{
public:
CSendCtrlCmd(void);
~CSendCtrlCmd(void);
//コマンド送信方法の設定
//引数:
// tcpFlag [IN] TRUE:TCP/IPモード、FALSE:名前付きパイプモード
void SetSendMode(
BOOL tcpFlag
);
//名前付きパイプモード時の接続先を設定
//EpgTimerSrv.exeに対するコマンドは設定しなくても可(デフォルト値になっている)
//引数:
// eventName [IN]排他制御用Eventの名前
// pipeName [IN]接続パイプの名前
void SetPipeSetting(
wstring eventName,
wstring pipeName
);
//TCP/IPモード時の接続先を設定
//引数:
// ip [IN]接続先IP
// port [IN]接続先ポート
void SetNWSetting(
wstring ip,
DWORD port
);
//接続処理時のタイムアウト設定
// timeOut [IN]タイムアウト値(単位:ms)
void SetConnectTimeOut(
DWORD timeOut
);
//Program.txtを追加で再読み込みする
//戻り値:
// エラーコード
DWORD SendAddloadReserve();
//EPGデータを再読み込みする
//戻り値:
// エラーコード
DWORD SendReloadEpg();
//設定情報を再読み込みする
//戻り値:
// エラーコード
DWORD SendReloadSetting();
//EpgTimerSrv.exeを終了する
//戻り値:
// エラーコード
DWORD SendClose();
//EpgTimerSrv.exeのパイプ接続GUIとしてプロセスを登録する
//戻り値:
// エラーコード
//引数:
// processID [IN]プロセスID
DWORD SendRegistGUI(DWORD processID);
//EpgTimerSrv.exeのパイプ接続GUI登録を解除する
//戻り値:
// エラーコード
//引数:
// processID [IN]プロセスID
DWORD SendUnRegistGUI(DWORD processID);
//EpgTimerSrv.exeのTCP接続GUIとしてプロセスを登録する
//戻り値:
// エラーコード
//引数:
// port [IN]ポート
DWORD SendRegistTCP(DWORD port);
//EpgTimerSrv.exeのTCP接続GUI登録を解除する
//戻り値:
// エラーコード
//引数:
// port [IN]ポート
DWORD SendUnRegistTCP(DWORD port);
//予約一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [OUT]予約一覧
DWORD SendEnumReserve(
vector<RESERVE_DATA>* val
);
//予約情報を取得する
//戻り値:
// エラーコード
//引数:
// reserveID [IN]取得する情報の予約ID
// val [OUT]予約情報
DWORD SendGetReserve(DWORD reserveID, RESERVE_DATA* val);
//予約を追加する
//戻り値:
// エラーコード
//引数:
// val [IN]追加する予約一覧
DWORD SendAddReserve(vector<RESERVE_DATA>* val);
//予約を削除する
//戻り値:
// エラーコード
//引数:
// val [IN]削除する予約ID一覧
DWORD SendDelReserve(vector<DWORD>* val);
//予約を変更する
//戻り値:
// エラーコード
//引数:
// val [IN]変更する予約一覧
DWORD SendChgReserve(vector<RESERVE_DATA>* val);
//チューナーごとの予約一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [IN]予約一覧
DWORD SendEnumTunerReserve(vector<TUNER_RESERVE_INFO>* val);
//録画済み情報一覧取得
//戻り値:
// エラーコード
//引数:
// val [OUT]録画済み情報一覧
DWORD SendEnumRecInfo(
vector<REC_FILE_INFO>* val
);
//録画済み情報を削除する
//戻り値:
// エラーコード
//引数:
// val [IN]削除するID一覧
DWORD SendDelRecInfo(vector<DWORD>* val);
//サービス一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [OUT]サービス一覧
DWORD SendEnumService(
vector<EPGDB_SERVICE_INFO>* val
);
//サービス指定で番組情報を一覧を取得する
//戻り値:
// エラーコード
//引数:
// service [IN]ONID<<32 | TSID<<16 | SIDとしたサービスID
// val [OUT]番組情報一覧
DWORD SendEnumPgInfo(
ULONGLONG service,
vector<EPGDB_EVENT_INFO*>* val
);
//指定イベントの番組情報を取得する
//戻り値:
// エラーコード
//引数:
// pgID [IN]ONID<<48 | TSID<<32 | SID<<16 | EventIDとしたID
// val [OUT]番組情報
DWORD SendGetPgInfo(
ULONGLONG pgID,
EPGDB_EVENT_INFO* val
);
//指定キーワードで番組情報を検索する
//戻り値:
// エラーコード
//引数:
// key [IN]検索キー(複数指定時はまとめて検索結果が返る)
// val [OUT]番組情報一覧
DWORD SendSearchPg(
vector<EPGDB_SEARCH_KEY_INFO>* key,
vector<EPGDB_EVENT_INFO*>* val
);
//番組情報一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [OUT]番組情報一覧
DWORD SendEnumPgAll(
vector<EPGDB_SERVICE_EVENT_INFO*>* val
);
//自動予約登録条件一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [OUT]条件一覧
DWORD SendEnumEpgAutoAdd(
vector<EPG_AUTO_ADD_DATA>* val
);
//自動予約登録条件を追加する
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendAddEpgAutoAdd(
vector<EPG_AUTO_ADD_DATA>* val
);
//自動予約登録条件を削除する
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendDelEpgAutoAdd(
vector<DWORD>* val
);
//自動予約登録条件を変更する
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendChgEpgAutoAdd(
vector<EPG_AUTO_ADD_DATA>* val
);
//自動予約登録条件一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [OUT]条件一覧
DWORD SendEnumManualAdd(
vector<MANUAL_AUTO_ADD_DATA>* val
);
//自動予約登録条件を追加する
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendAddManualAdd(
vector<MANUAL_AUTO_ADD_DATA>* val
);
//プログラム予約自動登録の条件削除
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendDelManualAdd(
vector<DWORD>* val
);
//プログラム予約自動登録の条件変更
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendChgManualAdd(
vector<MANUAL_AUTO_ADD_DATA>* val
);
DWORD SendChkSuspend();
DWORD SendSuspend(
WORD val
);
DWORD SendReboot();
DWORD SendEpgCapNow();
//指定ファイルを転送する
//戻り値:
// エラーコード
//引数:
// val [IN]ファイル名
// resVal [OUT]ファイルのバイナリデータ
// resValSize [OUT]resValのサイズ
DWORD SendFileCopy(
wstring val,
BYTE** resVal,
DWORD* resValSize
);
//PlugInファイルの一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [IN]1:ReName、2:Write
// resVal [OUT]ファイル名一覧
DWORD SendEnumPlugIn(
WORD val,
vector<wstring>* resVal
);
//TVTestのチャンネル切り替え用の情報を取得する
//戻り値:
// エラーコード
//引数:
// val [IN]ONID<<32 | TSID<<16 | SIDとしたサービスID
// resVal [OUT]チャンネル情報
DWORD SendGetChgChTVTest(
ULONGLONG val,
TVTEST_CH_CHG_INFO* resVal
);
//ネットワークモードのEpgDataCap_Bonのチャンネルを切り替え
//戻り値:
// エラーコード
//引数:
// chInfo [OUT]チャンネル情報
DWORD SendNwTVSetCh(
SET_CH_INFO* val
);
//ネットワークモードで起動中のEpgDataCap_Bonを終了
//戻り値:
// エラーコード
//引数:
// chInfo [OUT]チャンネル情報
DWORD SendNwTVClose(
);
//ネットワークモードで起動するときのモード
//戻り値:
// エラーコード
//引数:
// val [OUT]モード(1:UDP 2:TCP 3:UDP+TCP)
DWORD SendNwTVMode(
DWORD val
);
//ストリーム配信用ファイルを開く
//戻り値:
// エラーコード
//引数:
// val [IN]開くファイルのサーバー側ファイルパス
// resVal [OUT]制御用CtrlID
DWORD SendNwPlayOpen(
wstring val,
DWORD* resVal
);
//ストリーム配信用ファイルを閉じる
//戻り値:
// エラーコード
//引数:
// val [IN]制御用CtrlID
DWORD SendNwPlayClose(
DWORD val
);
//ストリーム配信開始
//戻り値:
// エラーコード
//引数:
// val [IN]制御用CtrlID
DWORD SendNwPlayStart(
DWORD val
);
//ストリーム配信停止
//戻り値:
// エラーコード
//引数:
// val [IN]制御用CtrlID
DWORD SendNwPlayStop(
DWORD val
);
//ストリーム配信で現在の送信位置と総ファイルサイズを取得する
//戻り値:
// エラーコード
//引数:
// val [IN/OUT]サイズ情報
DWORD SendNwPlayGetPos(
NWPLAY_POS_CMD* val
);
//ストリーム配信で送信位置をシークする
//戻り値:
// エラーコード
//引数:
// val [IN]サイズ情報
DWORD SendNwPlaySetPos(
NWPLAY_POS_CMD* val
);
//ストリーム配信で送信先を設定する
//戻り値:
// エラーコード
//引数:
// val [IN]サイズ情報
DWORD SendNwPlaySetIP(
NWPLAY_PLAY_INFO* val
);
//ストリーム配信用ファイルをタイムシフトモードで開く
//戻り値:
// エラーコード
//引数:
// val [IN]予約ID
// resVal [OUT]ファイルパスとCtrlID
DWORD SendNwTimeShiftOpen(
DWORD val,
NWPLAY_TIMESHIFT_INFO* resVal
);
//コマンドバージョン対応版
//予約一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [OUT]予約一覧
DWORD SendEnumReserve2(
vector<RESERVE_DATA>* val
);
//予約情報を取得する
//戻り値:
// エラーコード
//引数:
// reserveID [IN]取得する情報の予約ID
// val [OUT]予約情報
DWORD SendGetReserve2(DWORD reserveID, RESERVE_DATA* val);
//予約を追加する
//戻り値:
// エラーコード
//引数:
// val [IN]追加する予約一覧
DWORD SendAddReserve2(vector<RESERVE_DATA>* val);
//予約を変更する
//戻り値:
// エラーコード
//引数:
// val [IN]変更する予約一覧
DWORD SendChgReserve2(vector<RESERVE_DATA>* val);
//予約追加が可能か確認する
//戻り値:
// エラーコード
//引数:
// val [IN]予約情報
// resVal [OUT]追加可能かのステータス
DWORD SendAddChkReserve2(RESERVE_DATA* val, WORD* resVal);
//EPGデータファイルのタイムスタンプ取得
//戻り値:
// エラーコード
//引数:
// val [IN]取得ファイル名
// resVal [OUT]タイムスタンプ
DWORD SendGetEpgFileTime2(wstring val, LONGLONG* resVal);
//EPGデータファイル取得
//戻り値:
// エラーコード
//引数:
// val [IN]ファイル名
// resVal [OUT]ファイルのバイナリデータ
// resValSize [OUT]resValのサイズ
DWORD SendGetEpgFile2(
wstring val,
BYTE** resVal,
DWORD* resValSize
);
//自動予約登録条件一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [OUT]条件一覧
DWORD SendEnumEpgAutoAdd2(
vector<EPG_AUTO_ADD_DATA>* val
);
//自動予約登録条件を追加する
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendAddEpgAutoAdd2(
vector<EPG_AUTO_ADD_DATA>* val
);
//自動予約登録条件を変更する
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendChgEpgAutoAdd2(
vector<EPG_AUTO_ADD_DATA>* val
);
//自動予約登録条件一覧を取得する
//戻り値:
// エラーコード
//引数:
// val [OUT]条件一覧
DWORD SendEnumManualAdd2(
vector<MANUAL_AUTO_ADD_DATA>* val
);
//自動予約登録条件を追加する
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendAddManualAdd2(
vector<MANUAL_AUTO_ADD_DATA>* val
);
//プログラム予約自動登録の条件変更
//戻り値:
// エラーコード
//引数:
// val [IN]条件一覧
DWORD SendChgManualAdd2(
vector<MANUAL_AUTO_ADD_DATA>* val
);
//録画済み情報一覧取得
//戻り値:
// エラーコード
//引数:
// val [OUT]録画済み情報一覧
DWORD SendEnumRecInfo2(
vector<REC_FILE_INFO>* val
);
//録画済み情報一覧取得
//戻り値:
// エラーコード
//引数:
// val [OUT]録画済み情報一覧
DWORD SendChgProtectRecInfo2(
vector<REC_FILE_INFO>* val
);
//タイマーGUI(EpgTimer_Bon.exe)用
//ダイアログを前面に表示
//戻り値:
// エラーコード
DWORD SendGUIShowDlg(
);
//予約一覧の情報が更新された
//戻り値:
// エラーコード
DWORD SendGUIUpdateReserve(
);
//EPGデータの再読み込みが完了した
//戻り値:
// エラーコード
DWORD SendGUIUpdateEpgData(
);
//情報更新を通知する
//戻り値:
// エラーコード
//引数:
// val [IN]通知情報
DWORD SendGUINotifyInfo2(NOTIFY_SRV_INFO* val);
//Viewアプリ(EpgDataCap_Bon.exe)を起動
//戻り値:
// エラーコード
//引数:
// exeCmd [IN]コマンドライン
// PID [OUT]起動したexeのPID
DWORD SendGUIExecute(
wstring exeCmd,
DWORD* PID
);
//スタンバイ、休止、シャットダウンに入っていいかの確認をユーザーに行う
//戻り値:
// エラーコード
DWORD SendGUIQuerySuspend(
BYTE rebootFlag,
BYTE suspendMode
);
//PC再起動に入っていいかの確認をユーザーに行う
//戻り値:
// エラーコード
DWORD SendGUIQueryReboot(
BYTE rebootFlag
);
//サーバーのステータス変更通知
//戻り値:
// エラーコード
//引数:
// status [IN]ステータス
DWORD SendGUIStatusChg(
WORD status
);
//Viewアプリ(EpgDataCap_Bon.exe)用
//BonDriverの切り替え
//戻り値:
// エラーコード
//引数:
// bonDriver [IN]BonDriverファイル名
DWORD SendViewSetBonDrivere(
wstring bonDriver
);
//使用中のBonDriverのファイル名を取得
//戻り値:
// エラーコード
//引数:
// bonDriver [OUT]BonDriverファイル名
DWORD SendViewGetBonDrivere(
wstring* bonDriver
);
//チャンネル切り替え
//戻り値:
// エラーコード
//引数:
// chInfo [OUT]チャンネル情報
DWORD SendViewSetCh(
SET_CH_INFO* chInfo
);
//放送波の時間とPC時間の誤差取得
//戻り値:
// エラーコード
//引数:
// delaySec [OUT]誤差(秒)
DWORD SendViewGetDelay(
int* delaySec
);
//現在の状態を取得
//戻り値:
// エラーコード
//引数:
// status [OUT]状態
DWORD SendViewGetStatus(
DWORD* status
);
//現在の状態を取得
//戻り値:
// エラーコード
DWORD SendViewAppClose(
);
//識別用IDの設定
//戻り値:
// エラーコード
//引数:
// id [IN]ID
DWORD SendViewSetID(
int id
);
//識別用IDの取得
//戻り値:
// エラーコード
//引数:
// id [OUT]ID
DWORD SendViewGetID(
int* id
);
//予約録画用にGUIキープ
//戻り値:
// エラーコード
DWORD SendViewSetStandbyRec(
DWORD keepFlag
);
//ストリーム制御用コントロール作成
//戻り値:
// エラーコード
//引数:
// ctrlID [OUT]制御ID
DWORD SendViewCreateCtrl(
DWORD* ctrlID
);
//ストリーム制御用コントロール削除
//戻り値:
// エラーコード
//引数:
// ctrlID [IN]制御ID
DWORD SendViewDeleteCtrl(
DWORD ctrlID
);
//制御コントロールの設定
//戻り値:
// エラーコード
//引数:
// val [IN]設定値
DWORD SendViewSetCtrlMode(
SET_CTRL_MODE val
);
//録画処理開始
//戻り値:
// エラーコード
//引数:
// val [IN]設定値
DWORD SendViewStartRec(
SET_CTRL_REC_PARAM val
);
//録画処理開始
//戻り値:
// エラーコード
//引数:
// val [IN]設定値
// resVal [OUT]ドロップ数
DWORD SendViewStopRec(
SET_CTRL_REC_STOP_PARAM val,
SET_CTRL_REC_STOP_RES_PARAM* resVal
);
//録画中のファイルパスを取得
//戻り値:
// エラーコード
//引数:
// val [OUT]ファイルパス
DWORD SendViewGetRecFilePath(
DWORD ctrlID,
wstring* resVal
);
//録画処理開始
//戻り値:
// エラーコード
DWORD SendViewStopRecAll(
);
//ファイル出力したサイズを取得
//戻り値:
// エラーコード
//引数:
// resVal [OUT]ファイル出力したサイズ
DWORD SendViewGetWriteSize(
DWORD ctrlID,
__int64* resVal
);
//EPG取得開始
//戻り値:
// エラーコード
//引数:
// val [IN]取得チャンネルリスト
DWORD SendViewEpgCapStart(
vector<SET_CH_INFO>* val
);
//EPG取得キャンセル
//戻り値:
// エラーコード
DWORD SendViewEpgCapStop(
);
//EPGデータの検索
//戻り値:
// エラーコード
// val [IN]取得番組
// resVal [OUT]番組情報
DWORD SendViewSearchEvent(
SEARCH_EPG_INFO_PARAM* val,
EPGDB_EVENT_INFO* resVal
);
//現在or次の番組情報を取得する
//戻り値:
// エラーコード
// val [IN]取得番組
// resVal [OUT]番組情報
DWORD SendViewGetEventPF(
GET_EPG_PF_INFO_PARAM* val,
EPGDB_EVENT_INFO* resVal
);
//Viewボタン登録アプリ起動
//戻り値:
// エラーコード
DWORD SendViewExecViewApp(
);
//TVTest連携のストリーミング配信専用
//ストリーミング配信制御IDの設定
//戻り値:
// エラーコード
DWORD SendViewSetStreamingInfo(
TVTEST_STREAMING_INFO* val
);
protected:
HANDLE lockEvent;
BOOL tcpFlag;
DWORD connectTimeOut;
wstring eventName;
wstring pipeName;
wstring ip;
DWORD port;
protected:
//PublicAPI排他制御用
BOOL Lock(LPCWSTR log = NULL, DWORD timeOut = 60*1000);
void UnLock(LPCWSTR log = NULL);
DWORD SendPipe(LPCWSTR pipeName, LPCWSTR eventName, DWORD timeOut, CMD_STREAM* send, CMD_STREAM* res);
DWORD SendTCP(wstring ip, DWORD port, DWORD timeOut, CMD_STREAM* sendCmd, CMD_STREAM* resCmd);
};