DVBCore  1.0
Open source DVB engine
dvb/src/ap_dbdef.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
00003  * Copyright © 2004 Ocean Blue Software Ltd
00004  *
00005  * This file is part of a DTVKit Software Component
00006  * You are permitted to copy, modify or distribute this file subject to the terms
00007  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
00008  * 
00009  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00010  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00011  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00012  * 
00013  * If you or your organisation is not a member of DTVKit then you have access
00014  * to this source code outside of the terms of the licence agreement
00015  * and you are expected to delete this and any associated files immediately.
00016  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
00017  *******************************************************************************/
00024 #ifndef _AP_DBDEF_H
00025 #define _AP_DBDEF_H
00026 
00027 #include "stbsiflt.h"
00028 #include "stbsitab.h"
00029 #include "stbllist.h"
00030 
00031 //---Constant and macro definitions for public use-----------------------------
00032 
00033 #define ADB_LANG_CODE_UNDEF               0x756e64
00034 #define ADB_LANG_CODE_QAA                 0x716161
00035 #define ADB_LANG_CODE_NAR                 0x6e6172
00036 
00037 #define LINK_TYPE_EVENT                   0x0d
00038 #define LINK_TYPE_EXT_EVENT               0x0e
00039 
00040 #define INVALID_FREESAT_SERV_ID           0x8000
00041 
00042 //---Enumerations for public use-----------------------------------------------
00043 typedef enum
00044 {
00045    STREAM_MATCH_EXACT,
00046    STREAM_MATCH_ASPECT,
00047    STREAM_MATCH_LANG,
00048    STREAM_MATCH_TYPE,
00049    STREAM_MATCH_NOT_ZERO,
00050    STREAM_MATCH_NONE
00051 } E_STREAM_MATCH_TYPE;
00052 
00053 //---Global type defs for public use-------------------------------------------
00054 
00055 
00056 //--------------------------------------------------
00057 
00058 // Database structures - strings
00059 typedef struct adb_string
00060 {
00061    U32BIT lang_code;
00062    U16BIT nbytes;
00063    U8BIT *str_ptr;
00064 } ADB_STRING;
00065 
00066 
00067 //--------------------------------------------------
00068 // Database structures - satellite records
00069 typedef struct adb_lnb_rec
00070 {
00071    LINK_LIST_PTR_BLK ptrs;
00072    void *dba_rec;
00073 
00074    E_STB_DP_LNB_TYPE type;
00075    U16BIT freq_low;
00076    U16BIT freq_high;
00077    E_STB_DP_LNB_POWER power;
00078    BOOLEAN is_22k;
00079    BOOLEAN is_12v;
00080    BOOLEAN is_pulse_posn;
00081    BOOLEAN is_diseqc_posn;
00082    E_STB_DP_DISEQC_TONE diseqc_tone;
00083    E_STB_DP_DISEQC_CSWITCH c_switch;
00084    U8BIT u_switch;            // 0 to 16 inclusive
00085    BOOLEAN is_smatv;
00086    U8BIT diseqc_repeats;      // 0 to 3 inclusive
00087    U32BIT unicable_if;
00088    U8BIT unicable_chan;
00089 } ADB_LNB_REC;
00090 
00091 typedef struct adb_bat_version_rec
00092 {
00093    struct adb_bat_version_rec *next;
00094    U16BIT bouquet_id;
00095    U8BIT version;
00096 } ADB_BAT_VERSION_REC;
00097 
00098 typedef struct adb_satellite_rec
00099 {
00100    LINK_LIST_PTR_BLK ptrs;
00101    void *dba_rec;
00102 
00103    ADB_LNB_REC *lnb;
00104    ADB_STRING *name;
00105    U16BIT dish_pos;
00106    U16BIT long_pos;           // 0 to 1800 inclusive
00107    BOOLEAN east_west;         // 0=West,1=East
00108 
00109    BOOLEAN has_fta_desc;
00110    BOOLEAN do_not_scramble;
00111    ADB_STRING *def_authority;
00112 
00113    ADB_BAT_VERSION_REC *bat_version_list;
00114 } ADB_SATELLITE_REC;
00115 
00116 
00117 //--------------------------------------------------
00118 // Database structures - network records
00119 typedef struct adb_network_rec
00120 {
00121    LINK_LIST_PTR_BLK ptrs;
00122    void *dba_rec;
00123 
00124    U16BIT net_id;
00125    U8BIT nit_version;
00126    BOOLEAN nit_version_changed;
00127 
00128    ADB_STRING *name_str;
00129    ADB_STRING *name_array[ACFG_NUM_DB_LANGUAGES];
00130    BOOLEAN has_fta_desc;
00131    BOOLEAN do_not_scramble;
00132    SI_NIT_TARGET_REGION_NAME_DESC *target_region_name_list;
00133    SI_TARGET_REGION_DESC *target_region_list;
00134    SI_LINKAGE_DESC_ENTRY *last_linkage_entry;
00135    SI_LINKAGE_DESC_ENTRY *linkage_desc_list;
00136    U16BIT num_linkage_entries;
00137    ADB_STRING *def_authority;
00138    ADB_SATELLITE_REC *satellite;
00139    ADB_PROFILE_TYPE profile_type;
00140 
00141 #ifdef COMMON_INTERFACE
00142    BOOLEAN module_present;
00143    U32BIT module;
00144    U16BIT cicam_onet_id;
00145    U32BIT cicam_identifier;
00146    BOOLEAN op_search_required;
00147    U16BIT op_search_date;
00148    U16BIT op_search_time;
00149    U32BIT op_search_timer;
00150    ADB_STRING *profile_name;
00151 #endif
00152 } ADB_NETWORK_REC;
00153 
00154 
00155 //--------------------------------------------------
00156 // Database structures - transport records
00157 typedef struct adb_pmt_version_rec
00158 {
00159    struct adb_pmt_version_rec *next;
00160    U16BIT serv_id;
00161    U8BIT version;
00162 } ADB_PMT_VERSION_REC;
00163 
00164 typedef struct adb_transport_rec
00165 {
00166    LINK_LIST_PTR_BLK ptrs;
00167    void *dba_rec;
00168 
00169    U16BIT tran_id;
00170    U16BIT orig_net_id;
00171    ADB_STRING *name_str;
00172    U32BIT frequency;
00173    ADB_NETWORK_REC *network;
00174    E_STB_DP_SIGNAL_TYPE sig_type;
00175    U8BIT signal_level_at_search;
00176 
00177    /* The following union is accessed based on sig_type */
00178    union
00179    {
00180       struct _analog_trans_rec
00181       {
00182          S8BIT freq_offset;
00183          E_STB_DP_ANALOG_VIDEO_TYPE vtype;
00184       } anal;
00185       struct _terr_trans_rec
00186       {
00187          E_STB_DP_TBWIDTH bwidth;
00188          E_STB_DP_TMODE tmode;
00189          E_STB_DP_TTYPE terr_type;
00190          U8BIT plp_id;
00191          S8BIT freq_offset;
00192          E_STB_TUNE_TCONST constellation;
00193          E_STB_TUNE_THIERARCHY hierarchy;
00194          E_STB_TUNE_TCODERATE lp_code_rate;
00195          E_STB_TUNE_TCODERATE hp_code_rate;
00196          E_STB_TUNE_TGUARDINT guard_int;
00197          SI_TARGET_REGION_DESC *target_region_list;
00198       } terr;
00199       struct _cable_trans_rec
00200       {
00201          E_STB_DP_CMODE cmode;
00202          U16BIT symbol_rate;
00203       } cab;
00204       struct _sat_trans_rec
00205       {
00206          U16BIT symbol_rate;
00207          E_STB_DP_POLARITY polarity;
00208          E_STB_DP_FEC fec_code;
00209          E_STB_DP_FEC_TYPE fec_type;
00210          BOOLEAN dvb_s2;
00211          E_STB_DP_MODULATION modulation;
00212       } sat;
00213    } u;
00214 
00215    U8BIT pat_version;
00216    BOOLEAN sdt_received;
00217    BOOLEAN sdt_version_changed;
00218    U8BIT sdt_version;
00219    ADB_PMT_VERSION_REC *pmt_version_list;
00220    BOOLEAN has_fta_desc;
00221    BOOLEAN do_not_scramble;
00222    ADB_STRING *def_authority;
00223    BOOLEAN searched;
00224    BOOLEAN available;
00225 } ADB_TRANSPORT_REC;
00226 
00227 //--------------------------------------------------------
00228 // Database structures - service, event and stream records
00229 
00230 typedef struct adb_audio_stream_data
00231 {
00232    U32BIT lang_code;
00233    ADB_AUDIO_TYPE type;
00234    E_STB_DP_AUDIO_MODE mode;
00235 } ADB_AUDIO_STREAM_DATA;
00236 
00237 typedef struct adb_subtitle_stream_data
00238 {
00239    U32BIT lang_code;
00240    ADB_SUBTITLE_TYPE type;
00241    U16BIT composition_page;
00242    U16BIT ancillary_page;
00243 } ADB_SUBTITLE_STREAM_DATA;
00244 
00245 typedef struct adb_ttext_stream_data
00246 {
00247    U32BIT lang_code;
00248    U8BIT type;
00249    U8BIT magazine;
00250    U8BIT page;
00251 } ADB_TTEXT_STREAM_DATA;
00252 
00253 typedef union adb_stream_data
00254 {
00255    ADB_AUDIO_STREAM_DATA audio;
00256    ADB_SUBTITLE_STREAM_DATA subtitle;
00257    ADB_TTEXT_STREAM_DATA ttext;
00258 } ADB_STREAM_DATA;
00259 
00260 typedef struct adb_stream_rec
00261 {
00262    struct adb_stream_rec *next;
00263    ADB_STREAM_TYPE type;
00264    U8BIT *tag_array;
00265    U8BIT num_tags;
00266    U16BIT pid;
00267    BOOLEAN in_use;
00268    ADB_STREAM_DATA data;
00269    BOOLEAN has_ca_descriptor;
00270    U8BIT component_type;
00271 } ADB_STREAM_REC;
00272 
00273 typedef struct adb_crid_info
00274 {
00275    U8BIT type;
00276    ADB_STRING *crid_str;
00277 } ADB_CRID_INFO;
00278 
00279 typedef struct
00280 {
00281    U16BIT target_event_id;
00282    BOOLEAN target_listed;
00283    BOOLEAN event_simulcast;
00284 } ADB_EVENT_LINKAGE_DESC;
00285 
00286 typedef struct
00287 {
00288    U16BIT target_event_id;
00289    BOOLEAN target_listed;
00290    BOOLEAN event_simulcast;
00291    U8BIT link_type;
00292    U8BIT target_id_type;
00293    BOOLEAN orig_net_id_flag;
00294    BOOLEAN service_id_flag;
00295    U16BIT id_value;
00296 } ADB_EXT_EVENT_LINKAGE_INFO;
00297 
00298 typedef struct
00299 {
00300    U8BIT num_links;
00301    ADB_EXT_EVENT_LINKAGE_INFO *links;
00302 } ADB_EXT_EVENT_LINKAGE_DESC;
00303 
00304 typedef struct adb_linkage_desc
00305 {
00306    struct adb_linkage_desc *next;
00307    U16BIT tran_id;
00308    U16BIT orig_net_id;
00309    U16BIT serv_id;
00310    U8BIT linkage_type;
00311    union
00312    {
00313       ADB_EVENT_LINKAGE_DESC event;
00314       ADB_EXT_EVENT_LINKAGE_DESC ext_event;
00315    } u;
00316 } ADB_LINKAGE_DESC;
00317 
00318 typedef struct adb_extended_event_info
00319 {
00320    U8BIT next_desc;
00321    U16BIT num_items;
00322    ADB_STRING **item_desc;
00323    ADB_STRING **item_text;
00324    ADB_STRING *event_text;
00325 } ADB_EXTENDED_EVENT_INFO;
00326 
00327 typedef struct adb_event_rec
00328 {
00329    struct adb_event_rec *next;
00330    void *dba_rec;
00331 
00332    U32DHMS start;
00333    U32DHMS duration;
00334    U8BIT running_status;
00335    U8BIT version;
00336    BOOLEAN scrambled;
00337    U8BIT preferred_name_id;
00338    ADB_EVENT_CONTENT event_content;
00339    U8BIT parental_age_rating;
00340    BOOLEAN subtitles_avail;
00341    BOOLEAN audio_desc;
00342    BOOLEAN has_fta_desc;
00343    BOOLEAN do_not_scramble;
00344    BOOLEAN free_to_air;
00345    U8BIT content_len;
00346    U8BIT *content_data;
00347    ADB_STRING *name_array[ACFG_NUM_DB_LANGUAGES];
00348    ADB_STRING *desc_array[ACFG_NUM_DB_LANGUAGES];
00349    ADB_EXTENDED_EVENT_INFO extended_info[ACFG_NUM_DB_LANGUAGES];
00350    ADB_STRING *guidance[ACFG_NUM_DB_LANGUAGES];
00351    U16BIT event_id;
00352    U8BIT num_crids;
00353    ADB_CRID_INFO *crid_array;
00354    ADB_LINKAGE_DESC *linkage_list;
00355 
00356 #ifdef INTEGRATE_HBBTV
00357    U16BIT desc_loop_len;
00358    U8BIT *desc_data;
00359 #endif
00360 } ADB_EVENT_REC;
00361 
00362 typedef struct adb_alt_serv_rec
00363 {
00364    struct adb_alt_serv_rec *next;
00365    U16BIT onet_id;
00366    U16BIT tran_id;
00367    U16BIT serv_id;
00368    U8BIT link_type;
00369 } ADB_ALT_SERV_REC;
00370 
00371 typedef enum
00372 {
00373    ICON_TYPE_PNG,
00374    ICON_TYPE_JPEG
00375 } E_ICON_TYPE;
00376 
00377 typedef struct adb_icon_image
00378 {
00379    struct adb_icon_image *next;
00380    U8BIT icon_id;
00381    BOOLEAN position_defined;
00382    E_ICON_COORD_SYSTEM coord_system;
00383    U16BIT x_pos;
00384    U16BIT y_pos;
00385    U16BIT width;
00386    U16BIT height;
00387    E_ICON_TYPE icon_type;
00388    E_ICON_TRANSPORT_MODE transport_mode;
00389    U8BIT *icon_url;
00390    U32BIT data_len;
00391    U8BIT *icon_data;
00392    void (*destroy_func)(void *);
00393    void *dsm_handle;
00394 } ADB_IMAGE_ICON;
00395 
00396 typedef struct adb_rct_link_info
00397 {
00398    struct adb_rct_link_info *next;
00399    BOOLEAN is_group_trailer;
00400    U8BIT *uri_string;
00401    BOOLEAN can_use_default_icon;
00402    U8BIT icon_id;
00403    ADB_STRING *promo_text[ACFG_NUM_DB_LANGUAGES];
00404    ADB_STRING *event_name;
00405 } ADB_RCT_LINK_INFO;
00406 
00407 typedef struct adb_service_rec
00408 {
00409    LINK_LIST_PTR_BLK ptrs;
00410    void *dba_rec;
00411 
00412    ADB_TRANSPORT_REC *transport;
00413    ADB_SERVICE_TYPE serv_type;
00414    U16BIT serv_id;
00415    U16BIT serv_lcn;
00416    U16BIT allocated_lcn;
00417    U16BIT old_allocated_lcn;
00418    U8BIT current_name_id;
00419    ADB_STRING *name_str;
00420    ADB_STRING *provider_str;
00421    ADB_STRING *short_name_str;
00422    ADB_STRING *short_name_array[ACFG_NUM_DB_LANGUAGES];
00423    ADB_STRING *name_array[ACFG_NUM_DB_LANGUAGES][ADB_NUM_SERV_NAME_IDS];
00424    ADB_STRING *provider_array[ACFG_NUM_DB_LANGUAGES];
00425    ADB_STRING *guidance[ACFG_NUM_DB_LANGUAGES];
00426    ADB_STREAM_REC *stream_list;
00427    ADB_ALT_SERV_REC *alt_serv_list;
00428    U8BIT fav_groups;
00429 
00430    BOOLEAN sched_disabled;
00431    BOOLEAN now_next_disabled;
00432 
00433    BOOLEAN eit_now_next_avail;
00434    ADB_EVENT_REC *now_event;
00435    ADB_EVENT_REC *next_event;
00436 
00437    BOOLEAN eit_sched_avail;
00438    U16BIT num_events_in_schedule;
00439    ADB_EVENT_REC *event_schedule;
00440 
00441    BOOLEAN pmt_received;
00442 
00443    U16BIT pcr_pid;
00444    U16BIT video_pid;
00445    U16BIT audio_pid;
00446    U16BIT ad_pid;
00447    U16BIT ttext_pid;
00448    U8BIT ttext_mag;
00449    U8BIT ttext_page;
00450    U16BIT subtitle_pid;
00451    U16BIT subtitle_cpage;
00452    U16BIT subtitle_apage;
00453    ADB_STREAM_TYPE video_type;
00454    ADB_STREAM_TYPE audio_type;
00455 
00456    BOOLEAN reqd_audio_valid;
00457    U32BIT reqd_audio_lang_code;
00458    ADB_AUDIO_TYPE reqd_audio_type;
00459    ADB_STREAM_TYPE reqd_stream_type;
00460    BOOLEAN reqd_subtitle_valid;
00461    U32BIT reqd_subtitle_lang_code;
00462    ADB_SUBTITLE_TYPE reqd_subtitle_type;
00463    BOOLEAN reqd_ttext_valid;
00464    U32BIT reqd_ttext_lang_code;
00465    ADB_TELETEXT_TYPE reqd_ttext_type;
00466 
00467    BOOLEAN found;             /* Used during service search */
00468    U8BIT running_status;
00469    BOOLEAN not_running;
00470    BOOLEAN unavailable;
00471    BOOLEAN new_service;
00472    BOOLEAN locked;
00473    BOOLEAN hidden;
00474    BOOLEAN selectable;
00475    BOOLEAN lcn_editable;
00476    BOOLEAN scrambled;
00477 
00478    BOOLEAN has_fta_desc;
00479    BOOLEAN do_not_scramble;
00480 
00481    SI_TARGET_REGION_DESC *target_region_list;
00482 
00483    ADB_STRING *def_authority;
00484 
00485    U16BIT rct_pid;
00486    ADB_RCT_LINK_INFO *rct_link_list;
00487    ADB_IMAGE_ICON *icon_list;
00488 
00489 #ifdef COMMON_INTERFACE
00490    BOOLEAN sdt_received;
00491    U8BIT *ci_protection_desc;
00492    U32BIT ci_prot_last_update;
00493 #endif
00494    U8BIT *pmt_data;
00495    U16BIT pmt_data_len;
00496    U16BIT pmt_pid;
00497    SI_LINKAGE_DESC_ENTRY *last_linkage_entry;
00498    SI_LINKAGE_DESC_ENTRY *linkage_desc_list;
00499    U16BIT num_linkage_entries;
00500    SI_LCN_DESC *hd_lcn_desc;
00501 
00502    BOOLEAN has_ca_descriptor;
00503 
00504    /* Freesat specific values */
00505    U16BIT freesat_id;
00506    U16BIT region_id;
00507 
00508    U16BIT bat_pid;
00509    U16BIT eit_pf_pid;
00510    U16BIT eit_pf_plus_pid;
00511    U16BIT eit_sched_pid;
00512    U16BIT nit_pid;
00513    U16BIT sdt_pid;
00514    U16BIT tdt_pid;
00515    U16BIT tot_pid;
00516 #ifdef INTEGRATE_HBBTV
00517    U16BIT ait_pid;
00518 #endif
00519 } ADB_SERVICE_REC;
00520 
00521 typedef struct adb_crid_record
00522 {
00523    LINK_LIST_PTR_BLK ptrs;
00524    void *dba_rec;
00525 
00526    U16BIT eit_date;           /* The date the CRID was last seen in the EITs */
00527    BOOLEAN series_flag;       /* The CRID represents a series */
00528    BOOLEAN recommended_flag;  /* The CRID represents a recommended programme or series */
00529    BOOLEAN radio_service;     /* TRUE if this record represents a CRID from a radio service */
00530    U32DHMS date_time;         /* Date to be used when searching for a split event */
00531    U16BIT serv_id;            /* Service to be used when searching for a split event */
00532    ADB_STRING *name_str;      /* Programme name for series/recommendations */
00533    ADB_STRING *crid_str;      /* CRID string */
00534 } ADB_CRID_REC;
00535 
00536 typedef struct adb_favserv_rec
00537 {
00538    LINK_LIST_PTR_BLK ptrs;       /* prev/next service in favourite list */
00539    void *dba_rec;
00540 
00541    ADB_SERVICE_REC *serv_ptr;
00542    U8BIT list_id;                /* Id of the fav list this service is in */
00543    U16BIT index;                 /* Defines the position of this service in the list */
00544 } ADB_FAVSERV_REC;
00545 
00546 typedef struct adb_favlist_rec
00547 {
00548    LINK_LIST_PTR_BLK ptrs;       /* List of favourite lists */
00549    void *dba_rec;
00550 
00551    U8BIT list_id;                /* Unique id for a list */
00552    U8BIT index;                  /* Defines the position of this list in the favourite lists */
00553    U32BIT user_data;             /* User defined value stored with the list */
00554    ADB_STRING *name;
00555    LINK_LIST_HEADER serv_list;   /* List of service in this favourite list */
00556 } ADB_FAVLIST_REC;
00557 
00558 //typedef S_DB_TIMER ADB_TIMER_REC;
00559 
00560 
00561 //---Global Function prototypes for public use---------------------------------
00562 
00566 void DBDEF_Initialise(void);
00567 
00571 void DBDEF_RequestAccess(void);
00572 
00576 void DBDEF_ReleaseAccess(void);
00577 
00578 BOOLEAN DBDEF_LoadDatabase(U8BIT *db_pathname);
00579 void DBDEF_DeleteAllRecords(void);
00580 BOOLEAN DBDEF_SaveDatabase(void);
00581 
00582 void DBDEF_DeleteRecordsForTunerType(E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite);
00583 
00584 void DBDEF_DeleteServiceRec(ADB_SERVICE_REC *s_ptr);
00585 U16BIT DBDEF_NumStreamsInList(ADB_STREAM_REC *slist);
00586 ADB_STREAM_REC* DBDEF_CopyStreamList(ADB_STREAM_REC *slist);
00587 void DBDEF_DeleteStreamList(ADB_STREAM_REC *slist);
00588 void DBDEF_DeleteEvent(ADB_EVENT_REC *e_ptr);
00589 void DBDEF_DeleteAltServList(ADB_ALT_SERV_REC *aslist);
00590 
00591 void DBDEF_DeleteRCTLinks(ADB_RCT_LINK_INFO *links);
00592 void DBDEF_DeleteImageIcons(ADB_IMAGE_ICON *icon_list);
00593 
00597 void DBDEF_SortServicesByLcn(void);
00598 
00599 BOOLEAN DBDEF_AllocateLcns(E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN assign_lcns);
00600 BOOLEAN DBDEF_AllocateLcnsDefault(E_STB_DP_SIGNAL_TYPE tuner_type);
00601 #ifdef COUNTRY_UK
00602 BOOLEAN DBDEF_AllocateLcnsUK(E_STB_DP_SIGNAL_TYPE tuner_type);
00603 #endif
00604 #ifdef COUNTRY_FINLAND
00605 BOOLEAN DBDEF_AllocateLcnsFinland(E_STB_DP_SIGNAL_TYPE tuner_type);
00606 #endif
00607 
00608 
00613 U16BIT DBDEF_GetNumLNBs(void);
00614 
00622 ADB_LNB_REC* DBDEF_AddLNB(E_STB_DP_LNB_TYPE type, U16BIT min_freq, U16BIT max_freq);
00623 
00630 BOOLEAN DBDEF_SetLNBPower(ADB_LNB_REC *lnb, E_STB_DP_LNB_POWER power);
00631 
00638 BOOLEAN DBDEF_SetLNB22k(ADB_LNB_REC *lnb, BOOLEAN is_22k);
00639 
00646 BOOLEAN DBDEF_SetLNB12V(ADB_LNB_REC *lnb, BOOLEAN is_12v);
00647 
00654 BOOLEAN DBDEF_SetLNBPulsePosition(ADB_LNB_REC *lnb, BOOLEAN is_pulse_posn);
00655 
00662 BOOLEAN DBDEF_SetLNBDiSEqCPosition(ADB_LNB_REC *lnb, BOOLEAN is_diseqc_posn);
00663 
00670 BOOLEAN DBDEF_SetLNBDiSEqCTone(ADB_LNB_REC *lnb, E_STB_DP_DISEQC_TONE diseqc_tone);
00671 
00678 BOOLEAN DBDEF_SetLNBCSwitch(ADB_LNB_REC *lnb, E_STB_DP_DISEQC_CSWITCH cswitch);
00679 
00686 BOOLEAN DBDEF_SetLNBUSwitch(ADB_LNB_REC *lnb, U8BIT uswitch);
00687 
00694 BOOLEAN DBDEF_SetLNBSmatv(ADB_LNB_REC *lnb, BOOLEAN is_smatv);
00695 
00702 BOOLEAN DBDEF_SetLNBRepeats(ADB_LNB_REC *lnb, U8BIT repeats);
00703 
00711 BOOLEAN DBDEF_SetLNBUnicable(ADB_LNB_REC *lnb, U32BIT inter_freq, U8BIT chan);
00712 
00719 ADB_LNB_REC* DBDEF_GetNextLNBRec(ADB_LNB_REC *lnb_ptr);
00720 
00725 U16BIT DBDEF_GetNumSatellites(void);
00726 
00736 ADB_SATELLITE_REC* DBDEF_AddSatelliteRec(ADB_STRING *name_str, U16BIT dish_pos, U16BIT long_pos,
00737    BOOLEAN east_west, ADB_LNB_REC *associated_lnb);
00738 
00745 ADB_SATELLITE_REC* DBDEF_GetNextSatelliteRec(ADB_SATELLITE_REC *sat_ptr);
00746 
00751 U16BIT DBDEF_GetNumNetworks(void);
00752 
00759 ADB_NETWORK_REC* DBDEF_AddNetworkRec(U16BIT net_id, ADB_SATELLITE_REC *satellite);
00760 
00766 void DBDEF_SetNetworkName(ADB_NETWORK_REC *n_ptr, U8BIT *name);
00767 
00774 ADB_NETWORK_REC* DBDEF_FindNetworkRec(U16BIT net_id, ADB_SATELLITE_REC *satellite);
00775 
00782 ADB_NETWORK_REC* DBDEF_GetNextNetworkRec(ADB_NETWORK_REC *n_ptr);
00783 
00788 U16BIT DBDEF_GetNumTransports(void);
00789 
00796 ADB_TRANSPORT_REC* DBDEF_GetNextTransportRec(ADB_TRANSPORT_REC *t_ptr);
00797 
00805 ADB_TRANSPORT_REC* DBDEF_AddTerrestrialTransportRec(U32BIT freq_hz, U8BIT plp_id,
00806    ADB_NETWORK_REC *network);
00807 ADB_TRANSPORT_REC* DBDEF_FindTerrestrialTransportRec(U32BIT freq_hz, U8BIT plp_id);
00808 
00816 ADB_TRANSPORT_REC* DBDEF_AddCableTransportRec(U32BIT freq_hz, U32BIT symbol_rate,
00817    ADB_NETWORK_REC *network);
00818 ADB_TRANSPORT_REC* DBDEF_FindCableTransportRec(U32BIT freq_hz, U32BIT symbol_rate);
00819 
00820 void DBDEF_SetCableTransportSymbolRate(ADB_TRANSPORT_REC *t_ptr, U16BIT symbol_rate);
00821 void DBDEF_SetCableTransportMode(ADB_TRANSPORT_REC *t_ptr, E_STB_DP_CMODE cmode);
00822 
00833 ADB_TRANSPORT_REC* DBDEF_AddSatTransportRec(U32BIT freq_hz, U16BIT symbol_rate,
00834    E_STB_DP_POLARITY polarity, BOOLEAN dvb_s2, E_STB_DP_MODULATION modulation,
00835    ADB_NETWORK_REC *network);
00836 ADB_TRANSPORT_REC* DBDEF_FindSatTransportRec(U32BIT freq_hz, U16BIT symbol_rate,
00837    E_STB_DP_POLARITY polarity, BOOLEAN dvb_s2, E_STB_DP_MODULATION modulation, void *satellite);
00838 
00847 ADB_TRANSPORT_REC* DBDEF_FindTransportRecByIds(ADB_TRANSPORT_REC *transp, U32BIT net_id,
00848    U32BIT onet_id, U32BIT tran_id);
00849 
00855 void DBDEF_SetTransportTransportId(ADB_TRANSPORT_REC *t_ptr, U16BIT tran_id);
00856 
00862 void DBDEF_SetTransportOrigNetworkId(ADB_TRANSPORT_REC *t_ptr, U16BIT orig_net_id);
00863 
00868 void DBDEF_DeleteTransportRec(ADB_TRANSPORT_REC *t_ptr);
00869 
00870 void DBDEF_ClearTableVersionHistory(ADB_TRANSPORT_REC *t_ptr);
00871 
00876 U16BIT DBDEF_GetNumServices(void);
00877 
00884 ADB_SERVICE_REC* DBDEF_GetNextServiceRec(ADB_SERVICE_REC *s_ptr);
00885 
00892 ADB_SERVICE_REC* DBDEF_GetPrevServiceRec(ADB_SERVICE_REC *s_ptr);
00893 
00901 ADB_SERVICE_REC* DBDEF_AddServiceRec(U16BIT serv_id, ADB_TRANSPORT_REC *t_ptr);
00902 
00910 ADB_SERVICE_REC* DBDEF_CopyServiceRec(ADB_SERVICE_REC *orig_serv);
00911 
00918 void DBDEF_SetServiceName(ADB_SERVICE_REC *s_ptr, U8BIT *name);
00919 
00925 void DBDEF_SetServiceType(ADB_SERVICE_REC *s_ptr, ADB_SERVICE_TYPE serv_type);
00926 
00931 void DBDEF_SaveServiceEventSchedule(ADB_SERVICE_REC *s_ptr);
00932 
00939 ADB_SERVICE_REC* DBDEF_GetNextServiceOnTransport(ADB_SERVICE_REC *s_ptr, ADB_TRANSPORT_REC *t_ptr);
00940 
00950 ADB_SERVICE_REC* DBDEF_FindServiceRecByIds(ADB_SERVICE_REC *servp, U32BIT net_id, U32BIT onet_id,
00951    U32BIT tran_id, U32BIT serv_id);
00952 
00961 ADB_SERVICE_REC* DBDEF_FindServiceRecByLcn(U16BIT lcn, ADB_TRANSPORT_REC *t_ptr, BOOLEAN allocated_lcn);
00962 
00969 ADB_SERVICE_REC* DBDEF_FindServiceRecByFreesatId(ADB_SERVICE_REC *servp, U16BIT freesat_id);
00970 
00971 U16BIT DBDEF_GetReqdAudioPid(ADB_SERVICE_REC *s_ptr, E_STB_DP_AUDIO_MODE *audio_mode, ADB_STREAM_TYPE *audio_type);
00972 U16BIT DBDEF_GetReqdADPid(ADB_SERVICE_REC *s_ptr, E_STB_DP_AUDIO_MODE *ad_mode);
00973 E_STREAM_MATCH_TYPE DBDEF_GetReqdTtextPid(ADB_SERVICE_REC *s_ptr, BOOLEAN for_subtitles, U16BIT *pid_ptr,
00974    U8BIT *magazine, U8BIT *page);
00975 E_STREAM_MATCH_TYPE DBDEF_GetReqdSubtitleParams(ADB_SERVICE_REC *s_ptr, U16BIT *pid_ptr,
00976    U16BIT *cpage_ptr, U16BIT *apage_ptr);
00977 U16BIT DBDEF_GetReqdVideoPid(ADB_SERVICE_REC *s_ptr, ADB_STREAM_TYPE *video_type);
00978 
00979 ADB_STRING* DBDEF_GetServiceName(ADB_SERVICE_REC *s_ptr, BOOLEAN short_name, BOOLEAN pref_name);
00980 ADB_STRING* DBDEF_GetServiceProviderName(ADB_SERVICE_REC *s_ptr);
00981 
00982 BOOLEAN DBDEF_AddAnalogService(void);
00983 void DBDEF_SetAnalogServiceName(ADB_SERVICE_REC *s_ptr, U8BIT *new_name, U8BIT new_len);
00984 void DBDEF_SetServicePmtPid(ADB_SERVICE_REC *s_ptr, U16BIT pmt_pid);
00985 U16BIT DBDEF_GetServicePmtPid(ADB_SERVICE_REC *s_ptr);
00986 
00992 void DBDEF_SetServiceFavGroups(ADB_SERVICE_REC *s_ptr, U8BIT groups);
00993 
00999 ADB_EVENT_REC* DBDEF_CopyEventRec(ADB_EVENT_REC *e_ptr);
01000 
01005 void DBDEF_DeleteEventList(ADB_EVENT_REC *elist);
01006 
01007 void DBDEF_SetTunedNetwork(U8BIT path, ADB_NETWORK_REC *n_ptr);
01008 ADB_NETWORK_REC* DBDEF_GetTunedNetwork(U8BIT path);
01009 
01010 void DBDEF_SetTunedTransport(U8BIT path, ADB_TRANSPORT_REC *t_ptr);
01011 ADB_TRANSPORT_REC* DBDEF_GetTunedTransport(U8BIT path);
01012 void DBDEF_SetTunedService(U8BIT path, ADB_SERVICE_REC *s_ptr);
01013 ADB_SERVICE_REC* DBDEF_GetTunedService(U8BIT path);
01014 
01015 void DBDEF_SetTextLang(U8BIT *lang_ids);
01016 U8BIT* DBDEF_GetTextLang(void);
01017 void DBDEF_SetSecondaryTextLang(U8BIT *lang_ids);
01018 U8BIT* DBDEF_GetSecondaryTextLang(void);
01019 void DBDEF_SetAudioLang(U8BIT *lang_ids);
01020 U8BIT* DBDEF_GetAudioLang(void);
01021 U8BIT* DBDEF_GetSecondaryAudioLang(void);
01022 void DBDEF_SetSecondaryAudioLang(U8BIT *lang_ids);
01023 
01032 void DBDEF_TidyDatabaseAfterSearch(E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite,
01033    BOOLEAN search_completed, BOOLEAN manual);
01034 
01035 void DBDEF_TidyDatabaseNordig(E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN search_completed, BOOLEAN manual);
01036 void DBDEF_TidyDatabaseUK(E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN search_completed, BOOLEAN manual);
01037 void DBDEF_TidyDatabaseSatUK(E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN search_completed, BOOLEAN manual);
01038 void DBDEF_TidyDatabaseDefault(E_STB_DP_SIGNAL_TYPE tuner_type, BOOLEAN search_completed, BOOLEAN manual);
01039 
01047 void DBDEF_RemoveEmptyTransports(E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite);
01048 
01049 void DBDEF_DeleteLinkageDescripterArray(SI_LINKAGE_DESC_ENTRY *list_ptr);
01050 
01059 ADB_CRID_REC* DBDEF_AddCridRecord(U8BIT *crid, BOOLEAN series, BOOLEAN recommended,
01060    BOOLEAN radio_service);
01061 
01067 void DBDEF_SetCridDateTime(ADB_CRID_REC *c_ptr, U32DHMS date_time);
01068 
01074 void DBDEF_SetCridService(ADB_CRID_REC *c_ptr, U16BIT serv_id);
01075 
01081 void DBDEF_SetCridProgrammeName(ADB_CRID_REC *c_ptr, U8BIT *prog_name);
01082 
01087 void DBDEF_UpdateCridEitDate(ADB_CRID_REC *c_ptr);
01088 
01093 void DBDEF_DeleteCridRecord(ADB_CRID_REC *c_ptr);
01094 
01099 U16BIT DBDEF_GetNumCridRecords(void);
01100 
01107 ADB_CRID_REC* DBDEF_GetNextCridRecord(ADB_CRID_REC *c_ptr);
01108 
01114 BOOLEAN DBDEF_IsValidCridRecord(ADB_CRID_REC *c_ptr);
01115 
01120 U16BIT DBDEF_GetNumFavouriteLists(void);
01121 
01135 ADB_FAVLIST_REC* DBDEF_AddFavouriteList(U8BIT list_id, U8BIT *name, U32BIT user_data, S16BIT index);
01136 
01142 ADB_FAVLIST_REC* DBDEF_GetNextFavouriteList(ADB_FAVLIST_REC *fav_list);
01143 
01149 ADB_FAVLIST_REC* DBDEF_FindFavouriteList(U8BIT list_id);
01150 
01156 void DBDEF_SetFavouriteListUserData(ADB_FAVLIST_REC *fav_list, U32BIT user_data);
01157 
01165 void DBDEF_MoveFavouriteListTo(ADB_FAVLIST_REC *fav_list, S16BIT index);
01166 
01171 void DBDEF_DeleteFavouriteList(ADB_FAVLIST_REC *fav_list);
01172 
01178 U16BIT DBDEF_GetNumServicesInFavouriteList(ADB_FAVLIST_REC *fav_list);
01179 
01188 ADB_FAVSERV_REC* DBDEF_AddServiceToFavouriteList(ADB_FAVLIST_REC *fav_list,
01189    ADB_SERVICE_REC *serv_ptr, S16BIT index);
01190 
01197 ADB_FAVSERV_REC* DBDEF_FindServiceInFavouriteList(ADB_FAVLIST_REC *fav_list, void *serv_ptr);
01198 
01205 ADB_FAVSERV_REC* DBDEF_GetNextServiceFromFavouriteList(ADB_FAVLIST_REC *fav_list,
01206    ADB_FAVSERV_REC *fav_serv);
01207 
01214 ADB_FAVSERV_REC* DBDEF_GetPrevServiceFromFavouriteList(ADB_FAVLIST_REC *fav_list,
01215    ADB_FAVSERV_REC *fav_serv);
01216 
01225 void DBDEF_MoveFavouriteListServiceTo(ADB_FAVLIST_REC *fav_list, ADB_FAVSERV_REC *fav_serv,
01226    S16BIT index);
01227 
01233 void DBDEF_DeleteServiceFromFavouriteList(ADB_FAVLIST_REC *fav_list, ADB_FAVSERV_REC *fav_serv);
01234 
01239 void DBDEF_DeleteAllServicesFromFavouriteList(ADB_FAVLIST_REC *fav_list);
01240 
01251 BOOLEAN DBDEF_ServiceForTunerType(ADB_SERVICE_REC *s_ptr, E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite);
01252 
01263 BOOLEAN DBDEF_TransportForTunerType(ADB_TRANSPORT_REC *t_ptr, E_STB_DP_SIGNAL_TYPE tuner_type, void *satellite);
01264 
01268 U16BIT DBDEF_GetNumProfiles(void);
01269 
01277 U16BIT DBDEF_GetProfileList(void ***profile_list, U16BIT *active_profile);
01278 
01284 void DBDEF_ReleaseProfileList(void **profile_list, U16BIT num_profiles);
01285 
01291 BOOLEAN DBDEF_IsActiveProfile(ADB_NETWORK_REC *profile);
01292 
01297 ADB_PROFILE_TYPE DBDEF_GetCurrentProfileType(void);
01298 
01303 void DBDEF_SelectBroadcastProfile(void);
01304 
01310 void DBDEF_PushBroadcastProfile(void);
01311 
01312 #ifdef COMMON_INTERFACE
01313 
01320 void DBDEF_SelectCIPlusProfile(U16BIT onet_id, U32BIT cicam_id);
01321 
01328 void DBDEF_PushCIPlusProfile(U16BIT onet_id, U32BIT cicam_id);
01329 #endif
01330 
01334 void DBDEF_PopProfile(void);
01335 
01342 BOOLEAN DBDEF_ServiceInProfile(ADB_SERVICE_REC *s_ptr);
01343 
01350 BOOLEAN DBDEF_TransportInProfile(ADB_TRANSPORT_REC *t_ptr);
01351 
01358 BOOLEAN DBDEF_NetworkInProfile(ADB_NETWORK_REC *n_ptr);
01359 
01360 #ifdef COMMON_INTERFACE
01361 ADB_NETWORK_REC* DBDEF_FindNetworkForCIPlusProfile(U16BIT cicam_onet_id, U32BIT cicam_identifier);
01362 ADB_NETWORK_REC* DBDEF_FindNetworkForCIPlusModule(U32BIT module);
01363 #endif
01364 
01370 ADB_NETWORK_REC* DBDEF_FindOrAddPrivateNetwork(void *satellite);
01371 
01372 #ifdef DEBUG_PRINT_DATABASE
01373 void DBDEF_PrintAllRecords(void);
01374 #endif
01375 
01384 ADB_STRING* DBDEF_MakeString(U32BIT lang_code, U8BIT *str_ptr, U16BIT nbytes);
01385 
01391 ADB_STRING* DBDEF_CopyString(ADB_STRING *src_str);
01392 
01401 ADB_STRING* DBDEF_ConcatSIString(ADB_STRING *str1, SI_STRING_DESC *str2);
01402 
01407 void DBDEF_ReleaseString(ADB_STRING *string);
01408 
01409 #endif //  _AP_DBDEF_H
01410 
01411 //*****************************************************************************
01412 // End of file
01413 //*****************************************************************************
01414 
 All Data Structures Files Functions Typedefs Defines