bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void *)
{
	if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT))
	{
		printf("[neutrino] shutdown counter changed to %d minutes\n", atoi(g_settings.shutdown_count));
	}
	else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_CACHE) ||
	         ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE) ||
	         ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS) ||
	         ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_MAX_EVENTS))
	{
		CNeutrinoApp::getInstance()->SendSectionsdConfig();
	}
#ifndef TUXTXT_CFG_STANDALONE
	else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_TUXTXT_CACHE))
	{
		int vtpid = g_RemoteControl->current_PIDs.PIDs.vtxtpid;

		if (g_settings.tuxtxt_cache)
		{
			tuxtxt_init();
			if (vtpid)
				tuxtxt_start(vtpid);
		}
		else
		{
			tuxtxt_stop();
			tuxtxt_close();
		}
	}
#endif
	return false;
}
Esempio n. 2
0
void eTuxtxtApp::stopCaching()
{
	pthread_mutex_lock( &cacheChangeLock );
	if ( !uiRunning )
		tuxtxt_stop();

	pthread_mutex_unlock( &cacheChangeLock );
}
Esempio n. 3
0
void tuxtxt_check_death()
{
	// dmx->Read() will hang if we allow zapit to switch channels while dmx is in use

	tuxtxt_stop();
	while (tuxtxt_cache.thread_id)
		usleep(50000);
}
Esempio n. 4
0
void tuxtxt_close()
{
	pthread_mutex_lock(&tuxtxt_control_lock);
#if DEBUG
	printf ("cleaning up\n");
#endif
	tuxtxt_stop();
	if (tuxtxt_cache.dmx != -1)
    	    close(tuxtxt_cache.dmx);
	tuxtxt_cache.dmx = -1;
	tuxtxt_clear_cache();
	tuxtxt_initialized=0;
	pthread_mutex_unlock(&tuxtxt_control_lock);
}
Esempio n. 5
0
void tuxtxt_close()
{
#if TUXTXT_DEBUG
    printf ("libtuxtxt: cleaning up\n");
#endif
    tuxtxt_stop();
#if 0
    if (tuxtxt_cache.dmx != -1)
        close(tuxtxt_cache.dmx);
#endif
    tuxtxt_cache.dmx = -1;
    tuxtxt_clear_cache();
    tuxtxt_initialized=0;
}
Esempio n. 6
0
void CVCRControl::CFileAndServerDevice::CutBackNeutrino(const t_channel_id channel_id, const int mode)
{
	if (channel_id != 0) // wenn ein channel angegeben ist
	{
		last_mode = CNeutrinoApp::getInstance()->getMode();
		if (mode != last_mode && (mode != CNeutrinoApp::getInstance()->getLastMode() ||
		    last_mode != NeutrinoMessages::mode_standby && last_mode != NeutrinoMessages::mode_scart))
		{
			CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , mode | NeutrinoMessages::norezap );
			// Wenn wir im Standby waren, dann brauchen wir f�rs streamen nicht aufwachen...
			if(last_mode == NeutrinoMessages::mode_standby)
				CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_standby);
			else if(last_mode == NeutrinoMessages::mode_scart) // possibly switch back to SCART mode
				CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::VCR_ON, 0 );
		}
		if(g_Zapit->getCurrentServiceID() != channel_id)	// und momentan noch nicht getuned ist
		{
			g_Zapit->zapTo_serviceID(channel_id);		// dann umschalten
		}
	}
#ifndef TUXTXT_CFG_STANDALONE
	if(g_settings.tuxtxt_cache)
	{
		tuxtxt_stop();
		tuxtxt_close();
	}
#endif
#if ENABLE_RADIOTEXT
	if (mode == NeutrinoMessages::mode_radio && g_settings.radiotext_enable && g_Radiotext != NULL)
	{
		delete g_Radiotext;
		g_Radiotext = NULL;
	}
#endif
	if(StopPlayBack && g_Zapit->isPlayBackActive())	// wenn playback gestoppt werden soll und noch l�uft
		g_Zapit->stopPlayBack();		// dann playback stoppen

	if (StopSectionsd == CNeutrinoApp::SECTIONSD_STOP)
	{
 		g_Sectionsd->setPauseScanning(true);	// sectionsd stoppen
	}
	else if (StopSectionsd == CNeutrinoApp::SECTIONSD_RESTART)
	{
		g_Sectionsd->Restart();			// sectionsd neu starten (pausiert automatisch)
		g_Sectionsd->RegisterNeutrino();
	}

	g_Zapit->setRecordMode( true );			// recordmode einschalten
}
Esempio n. 7
0
void eExpertSetup::tuxtxtCachingChanged(bool b)
{
	if ( b )
	{
		if (Decoder::current.tpid != -1)
			tuxtxt_stop();
		tuxtxt_close();
	}
	else
	{
		tuxtxt_init();
		if (Decoder::current.tpid != -1)
			tuxtxt_start(Decoder::current.tpid);
	}
}
Esempio n. 8
0
void tuxtxt_start(int tpid)
{
    if (tuxtxt_cache.vtxtpid != tpid)
    {
        tuxtxt_stop();
        tuxtxt_clear_cache();
        tuxtxt_cache.page = 0x100;
        tuxtxt_cache.vtxtpid = tpid;
        tuxtxt_start_thread();
    }
    else if (!tuxtxt_cache.thread_starting && !tuxtxt_cache.receiving)
    {
        tuxtxt_start_thread();
    }
}
Esempio n. 9
0
void CVCRControl::CFileAndServerDevice::CutBackNeutrino(const t_channel_id channel_id, const int mode)
{
	if (channel_id != 0) // wenn ein channel angegeben ist
	{
		last_mode = CNeutrinoApp::getInstance()->getMode();
		if (mode != last_mode && (last_mode != NeutrinoMessages::mode_standby || mode != CNeutrinoApp::getInstance()->getLastMode()))
		{
			CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , mode | NeutrinoMessages::norezap );
			// Wenn wir im Standby waren, dann brauchen wir f�rs streamen nicht aufwachen...
			if(last_mode == NeutrinoMessages::mode_standby)
				CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_standby);
		}
		// Wenn im SB dann m�ssen wir die zapit aufwecken
/*		if(last_mode == NeutrinoMessages::mode_standby)
		{
			g_Zapit->setStandby(false);
		}*/
		if(g_Zapit->getCurrentServiceID() != channel_id)	// und momentan noch nicht getuned ist
		{
			g_Zapit->zapTo_serviceID(channel_id);		// dann umschalten
		}
		if(last_mode == NeutrinoMessages::mode_standby)
		{
			sleep(1); // Wait for zapit to come alive
			g_Zapit->muteAudio(false); // god knows why this is neccessary, it wont work without
			g_Zapit->muteAudio(true);
		}
	}
#ifndef TUXTXT_CFG_STANDALONE
	if(g_settings.tuxtxt_cache)
	{
		tuxtxt_stop();
		tuxtxt_close();
	}
#endif
	if(StopPlayBack && g_Zapit->isPlayBackActive())	// wenn playback gestoppt werden soll und noch l�uft
		g_Zapit->stopPlayBack();		// dann playback stoppen

	if(StopSectionsd)				// wenn sectionsd gestoppt werden soll
#ifdef RESTART_SECTIONSD_INSTEAD_OF_STOP
		g_Sectionsd->Restart();			// sectionsd neu starten (pausiert automatisch)
#else
		g_Sectionsd->setPauseScanning(true);	// sectionsd stoppen
#endif

	g_Zapit->setRecordMode( true );					// recordmode einschalten
}
Esempio n. 10
0
bool CTuxtxtCacheNotifier::changeNotify(const neutrino_locale_t, void *)
{
	int vtpid=g_RemoteControl->current_PIDs.PIDs.vtxtpid;

	if (g_settings.tuxtxt_cache)
	{
		tuxtxt_init();
		if (vtpid)
			tuxtxt_start(vtpid);
	}
	else
	{
		tuxtxt_stop();
		tuxtxt_close();
	}

	return true;
}
Esempio n. 11
0
int tuxtxt_start(int tpid)
{
	int ret = 1;
	pthread_mutex_lock(&tuxtxt_control_lock);
	if (tuxtxt_cache.vtxtpid != tpid)
	{
		tuxtxt_stop();
		tuxtxt_clear_cache();
		tuxtxt_cache.page = 0x100;
		tuxtxt_cache.vtxtpid = tpid;
		ret = tuxtxt_start_thread();
	}
	else if (!tuxtxt_cache.thread_starting && !tuxtxt_cache.receiving)
	{
		ret = tuxtxt_start_thread();
	}
	pthread_mutex_unlock(&tuxtxt_control_lock);
	return ret;
}
Esempio n. 12
0
void tuxtxt_start(int tpid, int source)
{
	if (tpid < 0)
	{
		printf("tuxtxt: invalid PID!\n");
		return;
	}

	if (tuxtxt_cache.vtxtpid != tpid)
	{
		tuxtxt_stop();
		tuxtxt_clear_cache();
		//tuxtxt_cache.page = 0x100;
		tuxtxt_cache.page = 0; // avoid pre-loading 0x100 (conflicts with subtitles)
		tuxtxt_cache.vtxtpid = tpid;
		tuxtxt_start_thread(source);
	}
	else if (!tuxtxt_cache.thread_starting && !tuxtxt_cache.receiving)
	{
		tuxtxt_start_thread(source);
	}
}