diff --git a/data/locale/english.locale b/data/locale/english.locale index fe7584a9a..bdb0032f3 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -964,13 +964,15 @@ menu.hint_scan_cable Select cable network to scan menu.hint_scan_cable_simple Cable scan with optional\nprovider channel numbering menu.hint_scan_commited Select commited input for\nthis satellite menu.hint_scan_diseqc Select diseqc switch input for\nthis satellite +menu.hint_scan_diseqcorder Diseqc command order for cascaded switches menu.hint_scan_diseqcrepeat Diseqc repeat for cascaded switches menu.hint_scan_diseqctype Select your diseqc switch protocol\nwith 'advanced' you can use uncommited switches menu.hint_scan_fast CanalDigitaal/TéléSAT/TV Vlaanderen provider scan\nWARNING: diseqc config will be overwritten menu.hint_scan_fastprov Select provider to scan menu.hint_scan_fasttype Select fast scan type menu.hint_scan_fec Select transponder FEC -menu.hint_scan_femode Select second tuner connection type +menu.hint_scan_femode Select tuner connection type +menu.hint_scan_felink Select tuner to link tuner to menu.hint_scan_fesetup Configure tuner(s) menu.hint_scan_fetimeout Time to wait for signal, in 1/10 of second menu.hint_scan_freq Enter transponder frequency @@ -1534,6 +1536,7 @@ satsetup.diseqc12 DiSEqC 1.2 satsetup.diseqc_advanced Advanced satsetup.diseqc_com_uncom Commited/Uncommited satsetup.diseqc_input DiSEqC input +satsetup.diseqc_order DiSEqC command order satsetup.diseqc_uncom_com Uncommited/Commited satsetup.diseqcrepeat DiSEqC-repeats satsetup.extended DiSEqC-Settings @@ -1590,7 +1593,7 @@ scants.actcable Cable: scants.actsatellite Satellite: scants.bouquet Bouquet scants.bouquet_create create new -scants.bouquet_erase erase all +scants.bouquet_erase erase old scants.bouquet_leave leave current scants.bouquet_satellite Satellite-Bouquet scants.bouquet_update update diff --git a/lib/libcoolstream2/control.h b/lib/libcoolstream2/control.h index 56d38f696..20309deab 100644 --- a/lib/libcoolstream2/control.h +++ b/lib/libcoolstream2/control.h @@ -33,28 +33,12 @@ typedef struct _scart_status { bool fastblank; } scart_status_t; -typedef struct _pwm_status { - u16 pwm_pulse_first; - u16 pwm_pulse_second; - u32 pwm_clock; -} pwm_status_t; - -typedef struct cs_control_data { - scart_status_t scart_status; - pwm_status_t pwm_status; - bool hdd_power; - u32 readers; - u32 sys_serial_high, sys_serial_low; - u32 sys_revision; -} cs_control_data_t; - /* ioctls */ #define CS_CONTROL_MAGIC 0xDE #define IOC_CONTROL_WIDESCREEN _IOW(CS_CONTROL_MAGIC, 20, unsigned int) #define IOC_CONTROL_TVAV _IOW(CS_CONTROL_MAGIC, 21, unsigned int) #define IOC_CONTROL_RGB _IOW(CS_CONTROL_MAGIC, 22, unsigned int) #define IOC_CONTROL_SCART_STATUS _IOR(CS_CONTROL_MAGIC, 23, scart_status_t *) -#define IOC_CONTROL_PWM_SPEED _IOW(CS_CONTROL_MAGIC, 24, unsigned int) #define IOC_CONTROL_HDDPOWER _IOW(CS_CONTROL_MAGIC, 25, unsigned int) /* ioctl for getting board serial and revision */ diff --git a/lib/libcoolstream2/tsrouter.h b/lib/libcoolstream2/tsrouter.h index 672d6721d..613b0ffb1 100644 --- a/lib/libcoolstream2/tsrouter.h +++ b/lib/libcoolstream2/tsrouter.h @@ -29,4 +29,9 @@ extern void cs_tsx_tsp_get_port_config(tsrouter_tsp_config_t *conf); extern void cs_tsx_hsdp_set_port_config(const tsrouter_hsdp_config_t *conf); extern void cs_tsx_tsp_set_port_config(const tsrouter_tsp_config_t *conf); +extern void cs_tsx_hsdp_get_port_pll(unsigned int port, unsigned int *pll_index); +extern void cs_tsx_hsdp_set_port_pll(unsigned int port, unsigned int pll_index); + +extern void cs_tsx_hsdp_get_port_speed(unsigned int port, unsigned int *speed); +extern void cs_tsx_hsdp_set_port_speed(unsigned int port, unsigned int speed); #endif /* __TSROUTER_H */ diff --git a/src/driver/fade.cpp b/src/driver/fade.cpp index caefff571..fa6c9a5d9 100644 --- a/src/driver/fade.cpp +++ b/src/driver/fade.cpp @@ -88,10 +88,11 @@ void COSDFader::Stop() { if ( fadeIn || fadeOut ) { g_RCInput->killTimer(fadeTimer); + usleep(40000); #ifdef BOXMODEL_APOLLO - frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha + frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha #else - frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha + frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha #endif fadeIn = fadeOut = false; } diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index f989516be..f2796977e 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -543,7 +543,7 @@ void CFrameBuffer::setBlendLevel(int level) if (ioctl(fd, FBIO_SETOPACITY, value)) printf("FBIO_SETOPACITY failed.\n"); -#ifndef ISAPOLLO +#if 0 if(level == 100) // TODO: sucks. usleep(20000); #endif diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 5367c2111..9cfc0ede6 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -694,11 +694,12 @@ int CScanSetup::showFrontendSetup(int number) if (fe->getInfo()->type == FE_QPSK) { /* disable all but mode option for linked frontends */ - bool allow_moptions = !CFrontend::linked(femode); + bool allow_moptions = !CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED; if (fecount > 1) { /* link to master select */ linkfe = new CMenuOptionChooser(LOCALE_SATSETUP_FE_MODE_MASTER, &femaster, feselect, select_count, !allow_moptions, this, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN, true); + linkfe->setHint("", LOCALE_MENU_HINT_SCAN_FELINK); setupMenu->addItem(linkfe); } /* diseqc type select */ @@ -713,6 +714,13 @@ int CScanSetup::showFrontendSetup(int number) ojDiseqcRepeats->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCREPEAT); setupMenu->addItem(ojDiseqcRepeats); + /* diseqc cmd order select */ + dorder = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC_ORDER, (int *)&fe_config.diseqc_order, DISEQC_ORDER_OPTIONS, DISEQC_ORDER_OPTION_COUNT, + allow_moptions && (dmode == DISEQC_ADVANCED), + this, CRCInput::convertDigitToKey(shortcut++), "", true); + dorder->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCORDER); + setupMenu->addItem(dorder); + CMenuWidget * satToSelect = new CMenuWidget(LOCALE_SATSETUP_SELECT_SAT, NEUTRINO_ICON_SETTINGS, width); satToSelect->addIntroItems(); @@ -1378,7 +1386,8 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* #endif uniSetup->setActive(dmode == DISEQC_UNICABLE); bool enable = (dmode < DISEQC_ADVANCED) && (dmode != NO_DISEQC); - ojDiseqcRepeats->setActive(enable); + ojDiseqcRepeats->setActive(enable && !CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED); + dorder->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED && dmode == DISEQC_ADVANCED); } else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_FE_MODE)) { @@ -1404,12 +1413,14 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* if (fe && fe->getType() == FE_QPSK) { if (linkfe) linkfe->setActive(CFrontend::linked(femode)); + /* leave diseqc type enabled for TWIN in case user need different unicable setup */ dtype->setActive(femode != CFrontend::FE_MODE_UNUSED && femode != CFrontend::FE_MODE_LINK_LOOP); uniSetup->setActive(dmode == DISEQC_UNICABLE && femode != CFrontend::FE_MODE_UNUSED && femode != CFrontend::FE_MODE_LINK_LOOP); + dorder->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED && dmode == DISEQC_ADVANCED); fsatSelect->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED); fsatSetup->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED); bool enable = (dmode < DISEQC_ADVANCED) && (dmode != NO_DISEQC); - ojDiseqcRepeats->setActive(!CFrontend::linked(femode) && enable); + ojDiseqcRepeats->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED && enable); /* if mode changed, set current master too */ if (femaster >= 0) diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index 3d477eb04..7ef59fe33 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -60,6 +60,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver CMenuForwarder *fsatSetup; CMenuForwarder *fsatSelect; CMenuOptionChooser * dtype; + CMenuOptionChooser * dorder; CMenuForwarder *uniSetup; CMenuOptionNumberChooser * ojDiseqcRepeats; CIntInput * nid; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 76e48e7ab..760c46546 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1156,7 +1156,6 @@ extern CBouquetManager *g_bouquetManager; void CNeutrinoApp::channelsInit(bool bOnly) { - int bnum; CBouquet* tmp; printf("[neutrino] Creating channels lists...\n"); @@ -1173,7 +1172,6 @@ void CNeutrinoApp::channelsInit(bool bOnly) if(g_bouquetManager->existsUBouquet(fav_bouquetname, true) == -1) g_bouquetManager->addBouquet(fav_bouquetname, true, true); - if(TVbouquetList) delete TVbouquetList; if(RADIObouquetList) delete RADIObouquetList; @@ -1222,15 +1220,11 @@ void CNeutrinoApp::channelsInit(bool bOnly) tmp = TVallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); delete tmp->channelList; tmp->channelList = new CChannelList(*TVchannelList); - //tmp->channelList->SortAlpha(); RADIOallList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); tmp = RADIOallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); delete tmp->channelList; tmp->channelList = new CChannelList(*RADIOchannelList); - //tmp->channelList->SortAlpha(); - - TIMER_STOP("[neutrino] sort took"); if(TVsatList) delete TVsatList; TVsatList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_SATS)); @@ -1241,8 +1235,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) sat_iterator_t sit; satellite_map_t satlist = CServiceManager::getInstance()->SatelliteList(); for(sit = satlist.begin(); sit != satlist.end(); sit++) { - CServiceManager::getInstance()->GetAllSatelliteChannels(zapitList, sit->first); - if( zapitList.empty() ) + if (!CServiceManager::getInstance()->GetAllSatelliteChannels(zapitList, sit->first)) continue; tvi = 0, ri = 0; @@ -1264,36 +1257,42 @@ void CNeutrinoApp::channelsInit(bool bOnly) TVsatList->deleteBouquet(tmp1); if(!ri) RADIOsatList->deleteBouquet(tmp2); - + TIMER_STOP("[neutrino] sat took"); } + /* all HD channels */ + if (g_settings.make_hd_list) { + if (CServiceManager::getInstance()->GetAllHDChannels(zapitList)) { + CBouquet* hdBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_HDTV), false, true); + hdBouquet->channelList->SetChannelList(&zapitList); + TVallList->Bouquets.push_back(hdBouquet); + printf("[neutrino] got %d HD channels\n", zapitList.size()); fflush(stdout); + } + } /* new channels */ if (g_settings.make_new_list) { - CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::NEW); - if (!zapitList.empty()) { + if (CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::NEW)) { CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); newBouquet->channelList->SetChannelList(&zapitList); TVallList->Bouquets.push_back(newBouquet); printf("[neutrino] got %d new TV channels\n", zapitList.size()); fflush(stdout); } - CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::NEW); - if (!zapitList.empty()) { + if (CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::NEW)) { CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_NEW), false, true); newBouquet->channelList->SetChannelList(&zapitList); RADIOallList->Bouquets.push_back(newBouquet); printf("[neutrino] got %d new RADIO channels\n", zapitList.size()); fflush(stdout); } } + /* removed channels */ if (g_settings.make_removed_list) { - CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::REMOVED); - if (!zapitList.empty()) { + if (CServiceManager::getInstance()->GetAllTvChannels(zapitList, CZapitChannel::REMOVED)) { CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); newBouquet->channelList->SetChannelList(&zapitList); TVallList->Bouquets.push_back(newBouquet); printf("[neutrino] got %d removed TV channels\n", zapitList.size()); fflush(stdout); } - CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::REMOVED); - if (!zapitList.empty()) { + if (CServiceManager::getInstance()->GetAllRadioChannels(zapitList, CZapitChannel::REMOVED)) { CBouquet* newBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_REMOVED), false, true); newBouquet->channelList->SetChannelList(&zapitList); RADIOallList->Bouquets.push_back(newBouquet); @@ -1303,63 +1302,36 @@ void CNeutrinoApp::channelsInit(bool bOnly) TIMER_STOP("[neutrino] sats took"); } - /* Favorites and providers TV bouquets */ - bnum = 0; + /* Favorites and providers bouquets */ + tvi = ri = 0; for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { - if (!g_bouquetManager->Bouquets[i]->bHidden && !g_bouquetManager->Bouquets[i]->tvChannels.empty()) - { - if(g_bouquetManager->Bouquets[i]->bUser) - tmp = TVfavList->addBouquet(g_bouquetManager->Bouquets[i]); - else - tmp = TVbouquetList->addBouquet(g_bouquetManager->Bouquets[i]); + if (!g_bouquetManager->Bouquets[i]->bHidden) { + if (g_bouquetManager->Bouquets[i]->getTvChannels(zapitList)) { + if(g_bouquetManager->Bouquets[i]->bUser) + tmp = TVfavList->addBouquet(g_bouquetManager->Bouquets[i]); + else + tmp = TVbouquetList->addBouquet(g_bouquetManager->Bouquets[i]); - ZapitChannelList* channels = &(g_bouquetManager->Bouquets[i]->tvChannels); - tmp->channelList->SetChannelList(channels); - bnum++; + tmp->channelList->SetChannelList(&zapitList); + tvi++; + } + if (g_bouquetManager->Bouquets[i]->getRadioChannels(zapitList)) { + if(g_bouquetManager->Bouquets[i]->bUser) + tmp = RADIOfavList->addBouquet(g_bouquetManager->Bouquets[i]); + else + tmp = RADIObouquetList->addBouquet(g_bouquetManager->Bouquets[i]); + + tmp->channelList->SetChannelList(&zapitList); + ri++; + } } } - printf("[neutrino] got %d TV bouquets\n", bnum); fflush(stdout); - - /* all HD channels */ - if (g_settings.make_hd_list) { - CServiceManager::getInstance()->GetAllHDChannels(zapitList); - if (!zapitList.empty()) { - CBouquet* hdBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_HDTV), false, true); - hdBouquet->channelList->SetChannelList(&zapitList); - hdBouquet->channelList->SortSat(); - TVfavList->Bouquets.push_back(hdBouquet); - printf("[neutrino] got %d HD channels\n", zapitList.size()); fflush(stdout); - } - } - TIMER_STOP("[neutrino] tv took"); - - /* Favorites and provides RADIO bouquets */ - bnum = 0; - for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { - if (!g_bouquetManager->Bouquets[i]->bHidden && !g_bouquetManager->Bouquets[i]->radioChannels.empty() ) - { - if(g_bouquetManager->Bouquets[i]->bUser) - tmp = RADIOfavList->addBouquet(g_bouquetManager->Bouquets[i]); - else - tmp = RADIObouquetList->addBouquet(g_bouquetManager->Bouquets[i]); - - ZapitChannelList* channels = &(g_bouquetManager->Bouquets[i]->radioChannels); - tmp->channelList->SetChannelList(channels); - bnum++; - } - } - printf("[neutrino] got %d RADIO bouquets\n", bnum); fflush(stdout); + printf("[neutrino] got %d TV and %d RADIO bouquets\n", tvi, ri); fflush(stdout); TIMER_STOP("[neutrino] took"); SetChannelMode(lastChannelMode); dprintf(DEBUG_DEBUG, "\nAll bouquets-channels received\n"); -#ifdef DEBUG - struct mallinfo myinfo = mallinfo(); - printf("[neutrino] total memory allocated by malloc, in bytes: %d (%dkb), chunks %d\n", - myinfo.arena, myinfo.arena / 1024, myinfo.uordblks); -#endif - reloadhintBox->hide(); } diff --git a/src/system/locals.h b/src/system/locals.h index 5c96fe010..e79056e96 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -991,6 +991,7 @@ typedef enum LOCALE_MENU_HINT_SCAN_CABLE_SIMPLE, LOCALE_MENU_HINT_SCAN_COMMITED, LOCALE_MENU_HINT_SCAN_DISEQC, + LOCALE_MENU_HINT_SCAN_DISEQCORDER, LOCALE_MENU_HINT_SCAN_DISEQCREPEAT, LOCALE_MENU_HINT_SCAN_DISEQCTYPE, LOCALE_MENU_HINT_SCAN_FAST, @@ -998,6 +999,7 @@ typedef enum LOCALE_MENU_HINT_SCAN_FASTTYPE, LOCALE_MENU_HINT_SCAN_FEC, LOCALE_MENU_HINT_SCAN_FEMODE, + LOCALE_MENU_HINT_SCAN_FELINK, LOCALE_MENU_HINT_SCAN_FESETUP, LOCALE_MENU_HINT_SCAN_FETIMEOUT, LOCALE_MENU_HINT_SCAN_FREQ, @@ -1561,6 +1563,7 @@ typedef enum LOCALE_SATSETUP_DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_COM_UNCOM, LOCALE_SATSETUP_DISEQC_INPUT, + LOCALE_SATSETUP_DISEQC_ORDER, LOCALE_SATSETUP_DISEQC_UNCOM_COM, LOCALE_SATSETUP_DISEQCREPEAT, LOCALE_SATSETUP_EXTENDED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index bb507003b..5bfdfd3ed 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -991,6 +991,7 @@ const char * locale_real_names[] = "menu.hint_scan_cable_simple", "menu.hint_scan_commited", "menu.hint_scan_diseqc", + "menu.hint_scan_diseqcorder", "menu.hint_scan_diseqcrepeat", "menu.hint_scan_diseqctype", "menu.hint_scan_fast", @@ -998,6 +999,7 @@ const char * locale_real_names[] = "menu.hint_scan_fasttype", "menu.hint_scan_fec", "menu.hint_scan_femode", + "menu.hint_scan_felink", "menu.hint_scan_fesetup", "menu.hint_scan_fetimeout", "menu.hint_scan_freq", @@ -1561,6 +1563,7 @@ const char * locale_real_names[] = "satsetup.diseqc_advanced", "satsetup.diseqc_com_uncom", "satsetup.diseqc_input", + "satsetup.diseqc_order", "satsetup.diseqc_uncom_com", "satsetup.diseqcrepeat", "satsetup.extended", diff --git a/src/zapit/include/zapit/bouquets.h b/src/zapit/include/zapit/bouquets.h index 5b8e7f971..c9eeb272e 100644 --- a/src/zapit/include/zapit/bouquets.h +++ b/src/zapit/include/zapit/bouquets.h @@ -57,6 +57,8 @@ class CZapitBouquet CZapitChannel* getChannelByChannelID(const t_channel_id channel_id, const unsigned char serviceType = ST_RESERVED); void sortBouquet(void); void sortBouquetByNumber(void); + bool getTvChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); + bool getRadioChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); }; typedef vector BouquetList; @@ -115,7 +117,7 @@ class CBouquetManager void moveBouquet(const unsigned int oldId, const unsigned int newId); bool existsChannelInBouquet(unsigned int bq_id, const t_channel_id channel_id); - void clearAll(); + void clearAll(bool user = true); void sortBouquets(void); }; diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index 60d37f965..fd7a70b01 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -168,7 +168,10 @@ class CZapitChannel typedef enum channel_flags { NEW = 0x01, REMOVED = 0x02, - UPDATED = 0x04 + UPDATED = 0x04, + NOT_FOUND = 0x08, + PRESENT = 0x05, // NEW + UPDATED + ANY = 0xFF } channel_flags_t; casys_map_t camap; diff --git a/src/zapit/include/zapit/frontend_types.h b/src/zapit/include/zapit/frontend_types.h index 1e8fa6a88..590b383f3 100644 --- a/src/zapit/include/zapit/frontend_types.h +++ b/src/zapit/include/zapit/frontend_types.h @@ -37,6 +37,7 @@ typedef struct frontend_config { int uni_lnb; int motorRotationSpeed; int highVoltage; + int diseqc_order; } frontend_config_t; #endif // __FRONTEND_TYPES_H__ diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index c8bce6951..975da4388 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -135,12 +135,12 @@ class CServiceManager std::string GetServiceName(t_channel_id channel_id); tallchans* GetAllChannels(){ return &allchans; }; - bool GetAllRadioChannels(ZapitChannelList &list, int flags = 0); - bool GetAllTvChannels(ZapitChannelList &list, int flags = 0); - bool GetAllHDChannels(ZapitChannelList &list); - bool GetAllSatelliteChannels(ZapitChannelList &list, t_satellite_position position); - bool GetAllTransponderChannels(ZapitChannelList &list, transponder_id_t tpid); - bool GetAllUnusedChannels(ZapitChannelList &list); + bool GetAllRadioChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); + bool GetAllTvChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); + bool GetAllHDChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); + bool GetAllSatelliteChannels(ZapitChannelList &list, t_satellite_position position, int flags = CZapitChannel::PRESENT); + bool GetAllTransponderChannels(ZapitChannelList &list, transponder_id_t tpid, int flags = CZapitChannel::PRESENT); + bool GetAllUnusedChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); bool IsChannelTVChannel(const t_channel_id channel_id); diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 8a74c0a8f..9f46b7858 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -157,6 +157,26 @@ void CZapitBouquet::moveService(const unsigned int oldPosition, const unsigned i } } +bool CZapitBouquet::getTvChannels(ZapitChannelList &list, int flags) +{ + list.clear(); + for (ZapitChannelList::iterator it = tvChannels.begin(); it != tvChannels.end(); ++it) { + if ((*it)->flags & flags) + list.push_back(*it); + } + return (!list.empty()); +} + +bool CZapitBouquet::getRadioChannels(ZapitChannelList &list, int flags) +{ + list.clear(); + for (ZapitChannelList::iterator it = tvChannels.begin(); it != tvChannels.end(); ++it) { + if ((*it)->flags & flags) + list.push_back(*it); + } + return (!list.empty()); +} + #if 0 size_t CZapitBouquet::recModeRadioSize(const transponder_id_t transponder_id) { @@ -262,7 +282,7 @@ void CBouquetManager::saveBouquets(const CZapitClient::bouquetMode bouquetMode, if (bouquetMode == CZapitClient::BM_DELETEBOUQUETS) { INFO("removing existing bouquets"); //unlink(BOUQUETS_XML); - g_bouquetManager->clearAll(); + g_bouquetManager->clearAll(false); } if (bouquetMode == CZapitClient::BM_DONTTOUCHBOUQUETS) return; @@ -279,7 +299,7 @@ void CBouquetManager::saveBouquets(const CZapitClient::bouquetMode bouquetMode, Bouquets[0]->Name = providerName; } - if ((bouquetMode == CZapitClient::BM_UPDATEBOUQUETS) || (bouquetMode == CZapitClient::BM_CREATESATELLITEBOUQUET)) { + if ((bouquetMode == CZapitClient::BM_UPDATEBOUQUETS) || (bouquetMode == CZapitClient::BM_DELETEBOUQUETS)) { while (!(Bouquets.empty())) { CZapitBouquet* bouquet; int dest = g_bouquetManager->existsBouquet(Bouquets[0]->Name.c_str()); @@ -378,6 +398,13 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) chan->bAlwaysLocked = newBouquet->bLocked; newBouquet->addService(chan); + } else if (bUser) { + chan = new CZapitChannel(name2, CREATE_CHANNEL_ID64, 1 /*service_type*/, + satellitePosition, freq); + CServiceManager::getInstance()->AddChannel(chan); + chan->flags = CZapitChannel::NOT_FOUND; + chan->bAlwaysLocked = newBouquet->bLocked; + newBouquet->addService(chan); } channel_node = channel_node->xmlNextNode; @@ -616,12 +643,19 @@ void CBouquetManager::moveBouquet(const unsigned int oldId, const unsigned int n } } -void CBouquetManager::clearAll() +void CBouquetManager::clearAll(bool user) { - for (unsigned int i =0; i < Bouquets.size(); i++) - delete Bouquets[i]; + BouquetList tmplist; + for (unsigned int i =0; i < Bouquets.size(); i++) { + if (!user || !Bouquets[i]->bFav) + delete Bouquets[i]; + else + tmplist.push_back(Bouquets[i]); + } Bouquets.clear(); + if (!user) + Bouquets = tmplist; remainChannels = NULL; } diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index 81247df2f..83a8f33a6 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -321,6 +321,8 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op) newchannel->deltype = FE_QPSK; CServiceManager::getInstance()->AddChannel(newchannel); } + // FIXME detect new/removed + newchannel->flags = CZapitChannel::UPDATED; newchannel->setName(serviceName); newchannel->setServiceType(service_type); newchannel->setVideoPid(video_pid); diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index 1b0379f1e..2aecd509c 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -223,6 +223,7 @@ bool CFEManager::loadSettings() fe_config.highVoltage = getConfigValue(fe, "highVoltage", 0); fe_config.uni_scr = getConfigValue(fe, "uni_scr", -1); fe_config.uni_qrg = getConfigValue(fe, "uni_qrg", 0); + fe_config.diseqc_order = getConfigValue(fe, "diseqc_order", UNCOMMITED_FIRST); fe->setRotorSatellitePosition(getConfigValue(fe, "lastSatellitePosition", 0)); @@ -303,6 +304,7 @@ void CFEManager::saveSettings(bool write) setConfigValue(fe, "highVoltage", fe_config.highVoltage); setConfigValue(fe, "uni_scr", fe_config.uni_scr); setConfigValue(fe, "uni_qrg", fe_config.uni_qrg); + setConfigValue(fe, "diseqc_order", fe_config.diseqc_order); setConfigValue(fe, "lastSatellitePosition", fe->getRotorSatellitePosition()); setConfigValue(fe, "mode", fe->getMode()); setConfigValue(fe, "master", fe->getMaster()); diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index ed19f16dd..aa2ad64cf 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -1008,7 +1008,7 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque setDiseqc(sit->second.diseqc, polarization, frequency); return; } - if (sit->second.diseqc_order == COMMITED_FIRST) { + if (config.diseqc_order /*sit->second.diseqc_order*/ == COMMITED_FIRST) { if (setDiseqcSimple(sit->second.commited, polarization, frequency)) uncommitedInput = 255; sendUncommittedSwitchesCommand(sit->second.uncommited); diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index d58852c58..2bde7fd7c 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -225,7 +225,7 @@ bool CServiceManager::GetAllRadioChannels(ZapitChannelList &list, int flags) list.clear(); for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) { if (it->second.getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE && - ((flags == 0) || (it->second.flags & flags))) + (it->second.flags & flags)) list.push_back(&(it->second)); } return (!list.empty()); @@ -236,47 +236,47 @@ bool CServiceManager::GetAllTvChannels(ZapitChannelList &list, int flags) list.clear(); for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) { if (it->second.getServiceType() != ST_DIGITAL_RADIO_SOUND_SERVICE && - ((flags == 0) || (it->second.flags & flags))) + (it->second.flags & flags)) list.push_back(&(it->second)); } return (!list.empty()); } -bool CServiceManager::GetAllHDChannels(ZapitChannelList &list) +bool CServiceManager::GetAllHDChannels(ZapitChannelList &list, int flags) { list.clear(); for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) { - if (it->second.isHD()) + if ((it->second.flags & flags) && it->second.isHD()) list.push_back(&(it->second)); } return (!list.empty()); } -bool CServiceManager::GetAllUnusedChannels(ZapitChannelList &list) +bool CServiceManager::GetAllUnusedChannels(ZapitChannelList &list, int flags) { list.clear(); for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) { - if (it->second.has_bouquet == false) + if ((it->second.flags & flags) && it->second.has_bouquet == false) list.push_back(&(it->second)); } return (!list.empty()); } -bool CServiceManager::GetAllSatelliteChannels(ZapitChannelList &list, t_satellite_position position) +bool CServiceManager::GetAllSatelliteChannels(ZapitChannelList &list, t_satellite_position position, int flags) { list.clear(); for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) { - if(it->second.getSatellitePosition() == position) + if((it->second.flags & flags) && it->second.getSatellitePosition() == position) list.push_back(&(it->second)); } return (!list.empty()); } -bool CServiceManager::GetAllTransponderChannels(ZapitChannelList &list, transponder_id_t tpid) +bool CServiceManager::GetAllTransponderChannels(ZapitChannelList &list, transponder_id_t tpid, int flags) { list.clear(); for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) { - if(it->second.getTransponderId() == tpid) + if((it->second.flags & flags) && it->second.getTransponderId() == tpid) list.push_back(&(it->second)); } return (!list.empty()); @@ -368,6 +368,9 @@ void CServiceManager::ParseChannels(xmlNodePtr node, const t_transport_stream_id uint16_t scrambled = xmlGetNumericAttribute(node, "s", 16); int number = xmlGetNumericAttribute(node, "num", 10); int flags = xmlGetNumericAttribute(node, "f", 10); + /* default if no flags present */ + if (flags == 0) + flags = CZapitChannel::UPDATED; t_channel_id chid = CREATE_CHANNEL_ID64; char *ptr = xmlGetAttribute(node, "action"); @@ -789,6 +792,8 @@ void CServiceManager::SaveServices(bool tocopy, bool if_changed) continue; } for (channel_map_iterator_t ccI = allchans.begin(); ccI != allchans.end(); ++ccI) { + if(ccI->second.flags & CZapitChannel::NOT_FOUND) + continue; if(ccI->second.getTransponderId() == tI->first) { if(!satdone) { WriteSatHeader(fd, spos_it->second); @@ -848,16 +853,16 @@ bool CServiceManager::CopyCurrentServices(transponder_id_t tpid) aI = allchans.find(cI->second.getChannelID()); if(aI == allchans.end()) { channel_insert_res_t ret = allchans.insert(channel_pair_t (cI->second.getChannelID(), cI->second)); - ret.first->second.flags |= CZapitChannel::NEW; + ret.first->second.flags = CZapitChannel::NEW; updated = true; -printf("CServiceManager::CopyCurrentServices: [%s] add\n", cI->second.getName().c_str()); + printf("CServiceManager::CopyCurrentServices: [%s] add\n", cI->second.getName().c_str()); } else { if(cI->second.scrambled != aI->second.scrambled || cI->second.getName() != aI->second.getName()) { aI->second.setName(cI->second.getName()); aI->second.scrambled = cI->second.scrambled; - aI->second.flags |= CZapitChannel::UPDATED; + aI->second.flags = CZapitChannel::UPDATED; updated = true; -printf("CServiceManager::CopyCurrentServices: [%s] replace\n", cI->second.getName().c_str()); + printf("CServiceManager::CopyCurrentServices: [%s] replace\n", cI->second.getName().c_str()); } } } @@ -865,12 +870,12 @@ printf("CServiceManager::CopyCurrentServices: [%s] replace\n", cI->second.getNam if(aI->second.getTransponderId() == tpid) { channel_map_iterator_t dI = curchans.find(aI->second.getChannelID()); if(dI == curchans.end()) { - aI->second.flags |= CZapitChannel::REMOVED; + aI->second.flags = CZapitChannel::REMOVED; updated = true; -printf("CServiceManager::CopyCurrentServices: [%s] remove\n", aI->second.getName().c_str()); + printf("CServiceManager::CopyCurrentServices: [%s] remove\n", aI->second.getName().c_str()); } else if(aI->second.flags & CZapitChannel::REMOVED) { -printf("CServiceManager::CopyCurrentServices: [%s] restore\n", aI->second.getName().c_str()); - aI->second.flags = 0; + printf("CServiceManager::CopyCurrentServices: [%s] restore\n", aI->second.getName().c_str()); + aI->second.flags = CZapitChannel::UPDATED; updated = true; } } diff --git a/src/zapit/src/scansdt.cpp b/src/zapit/src/scansdt.cpp index 27d73f293..cfd7939f0 100644 --- a/src/zapit/src/scansdt.cpp +++ b/src/zapit/src/scansdt.cpp @@ -321,14 +321,13 @@ bool CSdt::ParseServiceDescriptor(ServiceDescription * service, ServiceDescripto if (channel) { channel->setName(serviceName); channel->setServiceType(real_type); - channel->flags &= ~CZapitChannel::REMOVED; - channel->flags |= CZapitChannel::UPDATED; + channel->flags = CZapitChannel::UPDATED; } else { channel = new CZapitChannel(serviceName, channel_id, real_type, satellitePosition, freq_id); - channel->deltype = cable ? FE_QAM : FE_QPSK; - CServiceManager::getInstance()->AddChannel(channel); + channel->deltype = cable ? FE_QAM : FE_QPSK; + channel->flags = CZapitChannel::UPDATED; /* mark channel as new, if this satellite already have channels */ if (CServiceScan::getInstance()->SatHaveChannels()) channel->flags = CZapitChannel::NEW;