From aa39cb134808532f9a211c416ac234793c4ac36e Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 10 Apr 2012 18:10:34 +0400 Subject: [PATCH] zapit/include/zapit/getservices.h: cache satellitePosition in transponder struct --- src/zapit/include/zapit/getservices.h | 31 ++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index 9d7f95a2a..852e6f5f3 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -42,28 +42,35 @@ struct transponder t_transport_stream_id transport_stream_id; t_original_network_id original_network_id; transponder_id_t transponder_id; + t_satellite_position satellitePosition; + struct dvb_frontend_parameters feparams; unsigned char polarization; bool updated; #if 0 transponder(const t_transport_stream_id p_transport_stream_id, const t_original_network_id p_original_network_id, const struct dvb_frontend_parameters p_feparams, const uint8_t p_polarization = 0) - { - transport_stream_id = p_transport_stream_id; - original_network_id = p_original_network_id; - feparams = p_feparams; - polarization = p_polarization; + { + transport_stream_id = p_transport_stream_id; + original_network_id = p_original_network_id; + feparams = p_feparams; + polarization = p_polarization; updated = 0; - } + } #endif transponder(const transponder_id_t t_id, const struct dvb_frontend_parameters p_feparams, const uint8_t p_polarization = 0) - { + { transponder_id = t_id; - transport_stream_id = (t_id >> 16) & 0xFFFF; - original_network_id = t_id & 0xFFFF; - feparams = p_feparams; - polarization = p_polarization; + transport_stream_id = GET_TRANSPORT_STREAM_ID_FROM_TRANSPONDER_ID(t_id); + original_network_id = GET_ORIGINAL_NETWORK_ID_FROM_TRANSPONDER_ID(t_id); + feparams = p_feparams; + polarization = p_polarization; updated = 0; - } + satellitePosition = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(transponder_id); + if(satellitePosition & 0xF000) + satellitePosition = -(satellitePosition & 0xFFF); + else + satellitePosition = satellitePosition & 0xFFF; + } }; typedef std::map transponder_list_t;