コード例 #1
0
ファイル: sdl.cpp プロジェクト: havlenapetr/Scummvm
void OSystem_SDL::quit() {
	if (_cdrom) {
		//SDL_CDStop(_cdrom);
		//SDL_CDClose(_cdrom);
	}
	unloadGFXMode();
	deleteMutex(_graphicsMutex);

	if (_joystick)
		SDL_JoystickClose(_joystick);
	SDL_ShowCursor(SDL_ENABLE);

	SDL_RemoveTimer(_timerID);
	closeMixer();

	free(_dirtyChecksums);
	free(_currentPalette);
	free(_cursorPalette);
	free(_mouseData);

	delete _timer;

	SDL_Quit();

	// Even Manager requires save manager for storing
	// recorded events
	delete getEventManager();
	delete _savefile;

	exit(0);
}
コード例 #2
0
ファイル: volume.cpp プロジェクト: BananaSamurai/Enigma2
void eDVBVolumecontrol::volumeUnMute()
{
#ifdef HAVE_ALSA
	if (mainVolume) snd_mixer_selem_set_playback_volume_all(mainVolume, leftVol);
	muted = false;
#else
	int fd = openMixer();
#ifdef HAVE_DVB_API_VERSION
	ioctl(fd, AUDIO_SET_MUTE, false);
#endif
	closeMixer(fd);
	muted = false;

	//HACK?
	FILE *f;
	if((f = fopen("/proc/stb/audio/j1_mute", "wb")) == NULL) {
		eDebug("cannot open /proc/stb/audio/j1_mute(%m)");
		return;
	}
	
	fprintf(f, "%d", 0);

	fclose(f);
#endif
}
コード例 #3
0
ファイル: volume.cpp プロジェクト: BananaSamurai/Enigma2
void eDVBVolumecontrol::setVolume(int left, int right)
{
		/* left, right is 0..100 */
	leftVol = checkVolume(left);
	rightVol = checkVolume(right);

#ifdef HAVE_ALSA
	if (mainVolume) snd_mixer_selem_set_playback_volume_all(mainVolume, muted ? 0 : leftVol);
#else
		/* convert to -1dB steps */
	left = 63 - leftVol * 63 / 100;
	right = 63 - rightVol * 63 / 100;
		/* now range is 63..0, where 0 is loudest */

#if HAVE_DVB_API_VERSION < 3
	audioMixer_t mixer;
#else
	audio_mixer_t mixer;
#endif

#if HAVE_DVB_API_VERSION < 3
		/* convert to linear scale. 0 = loudest, ..63 */
	mixer.volume_left = 63.0-pow(1.068241, 63-left);
	mixer.volume_right = 63.0-pow(1.068241, 63-right);
#else
	mixer.volume_left = left;
	mixer.volume_right = right;
#endif

	eDebug("Setvolume: %d %d (raw)", leftVol, rightVol);
	eDebug("Setvolume: %d %d (-1db)", left, right);
#if HAVE_DVB_API_VERSION < 3
	eDebug("Setvolume: %d %d (lin)", mixer.volume_left, mixer.volume_right);
#endif

	int fd = openMixer();
	if (fd >= 0)
	{
#ifdef HAVE_DVB_API_VERSION
		ioctl(fd, AUDIO_SET_MIXER, &mixer);
#endif
		closeMixer(fd);
		return;
	}

	//HACK?
	FILE *f;
	if((f = fopen("/proc/stb/avs/0/volume", "wb")) == NULL) {
		eDebug("cannot open /proc/stb/avs/0/volume(%m)");
		return;
	}

	fprintf(f, "%d", left); /* in -1dB */

	fclose(f);
#endif
}
コード例 #4
0
ファイル: sdl.cpp プロジェクト: havlenapetr/Scummvm
OSystem_SDL::~OSystem_SDL() {
	SDL_RemoveTimer(_timerID);
	closeMixer();

	free(_dirtyChecksums);
	free(_currentPalette);
	free(_cursorPalette);
	free(_mouseData);

	delete _savefile;
	delete _timer;
}
コード例 #5
0
void eDVBVolumecontrol::openMixerOnMute()
{
	int fd = openMixer();
	if (fd >= 0)
	{
#ifdef DVB_API_VERSION
		ioctl(fd, AUDIO_SET_MUTE, false);
#endif
		closeMixer(fd);
	}
	else {
		eDebug("[eDVBVolumecontrol] openMixerOnMute failed to open mixer: %m");
	}
}
コード例 #6
0
void eDVBVolumecontrol::setVolume(int left, int right)
{
		/* left, right is 0..100 */
	leftVol = checkVolume(left);
	rightVol = checkVolume(right);

#ifdef HAVE_ALSA
	eDebug("[eDVBVolumecontrol] Setvolume: ALSA leftVol=%d", leftVol);
	if (mainVolume)
		snd_mixer_selem_set_playback_volume_all(mainVolume, muted ? 0 : leftVol);
#else
		/* convert to -1dB steps */
	left = 63 - leftVol * 63 / 100;
	right = 63 - rightVol * 63 / 100;
		/* now range is 63..0, where 0 is loudest */

#if 0
	audio_mixer_t mixer;

	mixer.volume_left = left;
	mixer.volume_right = right;

	eDebug("[eDVBVolumecontrol] Setvolume: raw: %d %d, -1db: %d %d", leftVol, rightVol, left, right);

	int fd = openMixer();
	if (fd >= 0)
	{
#ifdef DVB_API_VERSION
		if (ioctl(fd, AUDIO_SET_MIXER, &mixer) < 0) {
			eDebug("[eDVBVolumecontrol] Setvolume failed: %m");
		}
#endif
		closeMixer(fd);
		return;
	}
	else {
		eDebug("[eDVBVolumecontrol] SetVolume failed to open mixer: %m");
	}
#endif

	//HACK?
	CFile::writeInt("/proc/stb/avs/0/volume", left); /* in -1dB */
#endif
}
コード例 #7
0
ファイル: volume.cpp プロジェクト: OpenESI/Wetek-ESI
void eDVBVolumecontrol::volumeUnMute()
{
#ifdef HAVE_ALSA
	if (mainVolume) snd_mixer_selem_set_playback_volume_all(mainVolume, leftVol);
	muted = false;
#else
	int fd = openMixer();
	if (fd >= 0)
	{
#ifdef HAVE_DVB_API_VERSION
		ioctl(fd, AUDIO_SET_MUTE, false);
#endif
		closeMixer(fd);
	}
	muted = false;

	//HACK?
	CFile::writeInt("/proc/stb/audio/j1_mute", 0);
#endif
}
コード例 #8
0
ファイル: volume.cpp プロジェクト: OpenLD/enigma2-wetek
void eDVBVolumecontrol::volumeMute()
{
#ifdef HAVE_ALSA
	eDebug("[eDVBVolumecontrol] Setvolume: ALSA Mute");
	if (mainVolume)
		snd_mixer_selem_set_playback_volume_all(mainVolume, 0);
	muted = true;
#else
	int fd = openMixer();
	if (fd >= 0)
	{
#ifdef DVB_API_VERSION
		ioctl(fd, AUDIO_SET_MUTE, true);
#endif
		closeMixer(fd);
	}
	muted = true;

	//HACK?
	CFile::writeInt("/proc/stb/audio/j1_mute", 1);
#endif
}
コード例 #9
0
void MicMute::SetMicrophone()
{

	log.Open("micmute.txt",CFile::modeCreate | CFile::modeWrite);

	if(openMixer())
	{
		if(getMicControl())
		{
			log.WriteString("\n Got the micmute control");
			selectMic(1);
		
		}
		else
		log.WriteString("\nGet mic control failed");

		closeMixer();
	}
	else
	log.WriteString("\nOpen mixer failed");

log.Close();
}