FireBirdLib - Topfield TMS PVR TAP Programming Library
FlashServiceDel.c
Go to the documentation of this file.
1#include <string.h>
2#include "FBLib_flash.h"
3
4bool FlashServiceDel(int SvcType, int SvcIndex)
5{
7
8 word *nSvc;
9 bool ret;
10
11 //SvcType out of range
12 if((SvcType < 0) || (SvcType > SVC_TYPE_Radio))
13 {
14 TRACEEXIT();
15 return FALSE;
16 }
17
18 //SvcNum out of range
19 if((SvcIndex < 0) || (SvcIndex >= FlashServiceGetTotal(SvcType)))
20 {
21 TRACEEXIT();
22 return FALSE;
23 }
24
25 //Prepare the nSvc pointer
26 if(SvcType == SVC_TYPE_Tv)
27 nSvc = (word*)FIS_vnTvSvc();
28 else
29 nSvc = (word*)FIS_vnRadioSvc();
30 if(!nSvc)
31 {
32 TRACEEXIT();
33 return FALSE;
34 }
35
36 ret = FALSE;
37 switch(GetSystemType())
38 {
39 //Unknown and old 5k/6k systems are not supported
40 case ST_UNKNOWN:
41 case ST_S:
42 case ST_ST:
43 case ST_T:
44 case ST_C:
45 case ST_CT:
46 case ST_T5700:
47 case ST_T5800:
48 case ST_TF7k7HDPVR: break;
49
50 case ST_TMSS:
51 {
53
54 FlashServiceDelServiceName(SvcType, SvcIndex);
55
56 if(SvcType == SVC_TYPE_Tv)
58 else
60 if(p && FlashServiceDelete(p))
61 {
62 *nSvc = *nSvc - 1;
63
64 //TODO: Delete provider
65
66 FlashReindexFavorites(SvcType, SvcIndex, -1);
67 FlashReindexTimers(SvcType, SvcIndex, -1);
68
69 ret = TRUE;
70 }
71 break;
72 }
73
74 case ST_TMST:
75 {
77
78 FlashServiceDelServiceName(SvcType, SvcIndex);
79
80 if(SvcType == SVC_TYPE_Tv)
82 else
84 if(p && FlashServiceDelete(p))
85 {
86 *nSvc = *nSvc - 1;
87
88 //TODO: Delete provider
89
90 FlashReindexFavorites(SvcType, SvcIndex, -1);
91 FlashReindexTimers(SvcType, SvcIndex, -1);
92
93 ret = TRUE;
94 }
95 break;
96 }
97
98 case ST_TMSC:
99 {
101
102 FlashServiceDelServiceName(SvcType, SvcIndex);
103
104 if(SvcType == SVC_TYPE_Tv)
106 else
108 if(p && FlashServiceDelete(p))
109 {
110 *nSvc = *nSvc - 1;
111
112 //TODO: Delete provider
113
114 FlashReindexFavorites(SvcType, SvcIndex, -1);
115 FlashReindexTimers(SvcType, SvcIndex, -1);
116
117 ret = TRUE;
118 }
119 break;
120 }
121
122 case ST_NRTYPES: break;
123 }
124
125 TRACEEXIT();
126 return ret;
127}
#define TYPE_Service_TMST
Definition: FBLib_flash.h:42
void FlashReindexTimers(int SvcType, int FromSvcNum, int ToSvcNum)
bool FlashServiceDelete(void *Data)
void FlashReindexFavorites(int SvcType, int FromSvcNum, int ToSvcNum)
#define TYPE_Service_TMSC
Definition: FBLib_flash.h:43
bool FlashServiceDelServiceName(int SvcType, int SvcNum)
dword FIS_vFlashBlockRadioServices(void)
dword FIS_vFlashBlockTVServices(void)
dword FIS_vnRadioSvc(void)
Definition: FIS_vnRadioSvc.c:3
dword FIS_vnTvSvc(void)
Definition: FIS_vnTvSvc.c:3
bool FlashServiceDel(int SvcType, int SvcIndex)
int FlashServiceGetTotal(int SvcType)
SYSTEM_TYPE GetSystemType(void)
Definition: GetSystemType.c:3
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243
@ ST_CT
Definition: libFireBird.h:77
@ ST_T
Definition: libFireBird.h:69
@ ST_TMSC
Definition: libFireBird.h:74
@ ST_UNKNOWN
Definition: libFireBird.h:67
@ ST_T5700
Definition: libFireBird.h:71
@ ST_TMST
Definition: libFireBird.h:73
@ ST_T5800
Definition: libFireBird.h:75
@ ST_TMSS
Definition: libFireBird.h:72
@ ST_ST
Definition: libFireBird.h:76
@ ST_NRTYPES
Definition: libFireBird.h:79
@ ST_TF7k7HDPVR
Definition: libFireBird.h:78
@ ST_S
Definition: libFireBird.h:68
@ ST_C
Definition: libFireBird.h:70