Exemplo n.º 1
0
Arquivo: ir.c Projeto: sedwards/xmms3
/* Our main thread */
static void *xmms_irapp_routine(void *arg)
{
	unsigned char *code;
	char *text;
	gint playlist_time, playlist_pos, output_time, vl, vr, i;
	gint ir_numpress = -1;
	gint ir_hundreds = 0;
	gboolean ir_playlist_mode = FALSE;
	GList *ir_playlist;
	GTimer *timer1, *timer2;

#define S_PAUSE	0.2
#define L_PAUSE 0.4
#define PL_PAUSE 2.0

	timer1 = g_timer_new();
	timer2 = g_timer_new();
	g_timer_start(timer1);

	while (keepGoing)
	{
		if (!irconf_is_going)
		{
			code = ir_poll_code();
			if (code)
			{
				text = ir_code_to_text(code);
				if (!strcmp(text, ircfg.button_play) && g_timer_elapsed(timer1, NULL) > L_PAUSE)
				{
					xmms_remote_play(ir_gp.xmms_session);
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}

				else if (!strcmp(text, ircfg.button_stop) && g_timer_elapsed(timer1, NULL) > L_PAUSE)
				{
					xmms_remote_stop(ir_gp.xmms_session);
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}
				else if (!strcmp(text, ircfg.button_pause) && g_timer_elapsed(timer1, NULL) > L_PAUSE)
				{
					xmms_remote_pause(ir_gp.xmms_session);
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}
				else if (!strcmp(text, ircfg.button_shuffle) && g_timer_elapsed(timer1, NULL) > L_PAUSE)
				{
					xmms_remote_toggle_shuffle(ir_gp.xmms_session);
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}
				else if (!strcmp(text, ircfg.button_repeat) && g_timer_elapsed(timer1, NULL) > L_PAUSE)
				{
					xmms_remote_toggle_repeat(ir_gp.xmms_session);
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}
				else if (!strcmp(text, ircfg.button_playlist) && g_timer_elapsed(timer1, NULL) > L_PAUSE)
				{
					ir_playlist_mode = !ir_playlist_mode;
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}
				else if (!strcmp(text, ircfg.button_next) && g_timer_elapsed(timer1, NULL) > L_PAUSE)
				{
					xmms_remote_playlist_next(ir_gp.xmms_session);
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}
				else if (!strcmp(text, ircfg.button_prev) && g_timer_elapsed(timer1, NULL) > L_PAUSE)
				{
					xmms_remote_playlist_prev(ir_gp.xmms_session);
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}
				else if (!strcmp(text, ircfg.button_seekf) && g_timer_elapsed(timer1, NULL) > S_PAUSE / 2)
				{
					output_time = xmms_remote_get_output_time(ir_gp.xmms_session);
					playlist_pos = xmms_remote_get_playlist_pos(ir_gp.xmms_session);
					playlist_time = xmms_remote_get_playlist_time(ir_gp.xmms_session, playlist_pos);
					if (playlist_time - output_time < 5000)
						output_time = playlist_time - 5000;
					xmms_remote_jump_to_time(ir_gp.xmms_session, output_time + 5000);
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}
				else if (!strcmp(text, ircfg.button_seekb) && g_timer_elapsed(timer1, NULL) > S_PAUSE / 2)
				{
					output_time = xmms_remote_get_output_time(ir_gp.xmms_session);
					if (output_time < 5000)
						output_time = 5000;
					xmms_remote_jump_to_time(ir_gp.xmms_session, output_time - 5000);
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_stop(timer2);
					ir_hundreds = 0;
				}
				else if (!strcmp(text, ircfg.button_volup) && g_timer_elapsed(timer1, NULL) > S_PAUSE)
				{
					xmms_remote_get_volume(ir_gp.xmms_session, &vl, &vr);
					if (vl > 95)
						vl = 95;
					if (vr > 95)
						vr = 95;
					xmms_remote_set_volume(ir_gp.xmms_session, vl + 5, vr + 5);
					g_timer_reset(timer1);
				}
				else if (!strcmp(text, ircfg.button_voldown) && g_timer_elapsed(timer1, NULL) > S_PAUSE)
				{
					xmms_remote_get_volume(ir_gp.xmms_session, &vl, &vr);
					if (vl < 5)
						vl = 5;
					if (vr < 5)
						vr = 5;
					xmms_remote_set_volume(ir_gp.xmms_session, vl - 5, vr - 5);
					g_timer_reset(timer1);
				}
				else if (!strcmp(text, ircfg.button_plus100) && g_timer_elapsed(timer1, NULL) > S_PAUSE)
				{
					ir_hundreds += 1;
					g_timer_reset(timer1);
					g_timer_reset(timer2);
					g_timer_start(timer2);
				}
				else
				{
					for (i = 0; i < 10; i++)
					{
						if (!strcmp(text, ircfg.button[i]) && g_timer_elapsed(timer1, NULL) > S_PAUSE)
						{
							g_timer_reset(timer2);
							if (ir_numpress >= 0)
							{
								g_timer_stop(timer2);
								if (ir_playlist_mode)
								{
									if (strcmp(ircfg.playlist[(10 * ir_numpress) + i], ""))
									{
										ir_playlist = NULL;
										ir_playlist = g_list_append(ir_playlist, ircfg.playlist[(10 * ir_numpress) + i]);
										xmms_remote_play_files(ir_gp.xmms_session, ir_playlist);
										g_list_free(ir_playlist);
									}
									ir_playlist_mode = FALSE;
								}
								else
								{
									ir_numpress = (100 * ir_hundreds) + (10 * ir_numpress) + i;
									if (ir_numpress == 0)
										xmms_remote_set_playlist_pos(ir_gp.xmms_session,
													     xmms_remote_get_playlist_length(ir_gp.xmms_session) - 1);
									else
										xmms_remote_set_playlist_pos(ir_gp.xmms_session, ir_numpress - 1);
								}
								ir_numpress = -1;
								ir_hundreds = 0;
							}
							else
							{
								g_timer_start(timer2);
								ir_numpress = i;
							}
							g_timer_reset(timer1);
						}
					}
				}
			}
			if (g_timer_elapsed(timer2, NULL) > PL_PAUSE)
			{
				if (ir_numpress >= 0 || ir_hundreds > 0)
				{
					if (ir_playlist_mode)
					{
						if (strcmp(ircfg.playlist[ir_numpress], ""))
						{
							ir_playlist = NULL;
							ir_playlist = g_list_append(ir_playlist, ircfg.playlist[ir_numpress]);
							xmms_remote_play_files(ir_gp.xmms_session, ir_playlist);
							g_list_free(ir_playlist);
						}
					}
					else if (ir_numpress <= 0)
						if (ir_hundreds > 0)
							xmms_remote_set_playlist_pos(ir_gp.xmms_session, (100 * ir_hundreds) - 1);
						else
							xmms_remote_set_playlist_pos(ir_gp.xmms_session,
										     xmms_remote_get_playlist_length(ir_gp.xmms_session) - 1);
					else
						xmms_remote_set_playlist_pos(ir_gp.xmms_session, (100 * ir_hundreds) + ir_numpress - 1);
				}
				ir_numpress = -1;
				ir_hundreds = 0;
				ir_playlist_mode = FALSE;
				g_timer_reset(timer2);
				g_timer_stop(timer2);
			}
		}
		ir_usleep(20000L);
	}
	g_timer_destroy(timer1);
	ir_close_port();
	pthread_exit(NULL);
}
Exemplo n.º 2
0
Arquivo: joy.c Projeto: sedwards/xmms3
/* ---------------------------------------------------------------------- */
static void *xmms_joyapp_routine(void *arg)
{
	gint vl, vr, output_time, playlist_pos, playlist_time, playlist_length;
	struct js_event js;
	struct timeval tv;
	fd_set set;
	int max_fd, js_alt = 0;
	joy_cmd js_command;

	while (keep_going)
	{
		max_fd = joy_fd1 + 1;
		tv.tv_sec = 0;
		tv.tv_usec = 1000;
		FD_ZERO(&set);
		FD_SET(joy_fd1, &set);
		if (joy_fd2 > 0)
		{
			FD_SET(joy_fd2, &set);
			max_fd = joy_fd2 + 1;
		}
		js_command = JC_NONE;

		if (select(max_fd, &set, NULL, NULL, &tv))
		{
			if (FD_ISSET(joy_fd1, &set))
			{
				if (read(joy_fd1, &js, sizeof (struct js_event)) != sizeof (struct js_event))
					perror(_("\nJoystick Control: error reading"));

				switch (js.type & ~JS_EVENT_INIT)
				{
					case JS_EVENT_BUTTON:
						if (js.number <= joy_cfg.num_buttons) {js_command = joy_cfg.button_cmd[js.number];}
						break;
					case JS_EVENT_AXIS:
						if (js.number == 0)
						{
							if (js.value > joy_cfg.sens)
							{
								if (js_alt)
									js_command = joy_cfg.alt_right;
								else
									js_command = joy_cfg.right;
							}
							else if (js.value < -joy_cfg.sens)
							{
								if (js_alt)
									js_command = joy_cfg.alt_left;
								else
									js_command = joy_cfg.left;
							}
						}
						else if (js.number == 1)
						{
							if (js.value > joy_cfg.sens)
							{
								if (js_alt)
									js_command = joy_cfg.alt_down;
								else
									js_command = joy_cfg.down;
							}
							else if (js.value < -joy_cfg.sens)
							{
								if (js_alt)
									js_command = joy_cfg.alt_up;
								else
									js_command = joy_cfg.up;
							}
						}
						break;
				}
			}
			if (joy_fd2 > 0)
			{
				if (FD_ISSET(joy_fd2, &set))
				{
					if (read(joy_fd2, &js, sizeof (struct js_event)) != sizeof (struct js_event))
					        	 perror(_("\nJoystick Control: error reading"));

					switch (js.type & ~JS_EVENT_INIT)
					{
						case JS_EVENT_BUTTON:
							if (js.number == 0)
								js_command = joy_cfg.button_cmd[2];
							else if (js.number == 1)
								js_command = joy_cfg.button_cmd[3];
							break;
						case JS_EVENT_AXIS:
							if (js.number == 0)
							{
								if (js.value > joy_cfg.sens)
									js_command = joy_cfg.alt_right;
								else if (js.value < -joy_cfg.sens)
									js_command = joy_cfg.alt_left;
							}
							else if (js.number == 1)
							{
								if (js.value > joy_cfg.sens)
									js_command = joy_cfg.alt_down;
								else if (js.value < -joy_cfg.sens)
									js_command = joy_cfg.alt_up;
							}
							break;
					}
				}
			}
			if (js_command != JC_ALT && js.value == 0)
				js_command = JC_NONE;

			switch (js_command)
			{
				case JC_PLAYPAUSE:
					if (xmms_remote_is_playing(joy_gp.xmms_session))
						xmms_remote_pause(joy_gp.xmms_session);
					else
						xmms_remote_play(joy_gp.xmms_session);
					break;
				case JC_STOP:
					xmms_remote_stop(joy_gp.xmms_session);
					break;
				case JC_NEXT:
					xmms_remote_playlist_next(joy_gp.xmms_session);
					break;
				case JC_PREV:
					xmms_remote_playlist_prev(joy_gp.xmms_session);
					break;
				case JC_FWD5:
					playlist_pos = xmms_remote_get_playlist_pos(joy_gp.xmms_session);
					playlist_length = xmms_remote_get_playlist_length(joy_gp.xmms_session);
					if (playlist_length - playlist_pos < 5)
						playlist_pos = playlist_length - 5;
					xmms_remote_set_playlist_pos(joy_gp.xmms_session, playlist_pos + 5);
					break;
				case JC_BWD5:
					playlist_pos = xmms_remote_get_playlist_pos(joy_gp.xmms_session);
					if (playlist_pos < 5)
						playlist_pos = 5;
					xmms_remote_set_playlist_pos(joy_gp.xmms_session, playlist_pos - 5);
					break;
				case JC_VOLUP:
					xmms_remote_get_volume(joy_gp.xmms_session, &vl, &vr);
					if (vl > 95)
						vl = 95;
					if (vr > 95)
						vr = 95;
					xmms_remote_set_volume(joy_gp.xmms_session, vl + 5, vr + 5);
					break;
				case JC_VOLDWN:
					xmms_remote_get_volume(joy_gp.xmms_session, &vl, &vr);
					if (vl < 5)
						vl = 5;
					if (vr < 5)
						vr = 5;
					xmms_remote_set_volume(joy_gp.xmms_session, vl - 5, vr - 5);
					break;
				case JC_FWD:
					output_time = xmms_remote_get_output_time(joy_gp.xmms_session);
					playlist_pos = xmms_remote_get_playlist_pos(joy_gp.xmms_session);
					playlist_time = xmms_remote_get_playlist_time(joy_gp.xmms_session, playlist_pos);
					if (playlist_time - output_time < 5000)
						output_time = playlist_time - 5000;
					xmms_remote_jump_to_time(joy_gp.xmms_session, output_time + 5000);
					break;
				case JC_RWD:
					output_time = xmms_remote_get_output_time(joy_gp.xmms_session);
					if (output_time < 5000)
						output_time = 5000;
					xmms_remote_jump_to_time(joy_gp.xmms_session, output_time - 5000);
					break;
				case JC_SHUFFLE:
					xmms_remote_toggle_shuffle(joy_gp.xmms_session);
					break;
				case JC_REPEAT:
					xmms_remote_toggle_repeat(joy_gp.xmms_session);
					break;
				case JC_ALT:
					js_alt = js.value;
					break;
			        case JC_NONE:
				        break;
			}
		}
	}

	pthread_exit(NULL);
}
Exemplo n.º 3
0
ssize_t cb_cmd_next(int csock, struct sockaddr_in *client_addr)
{
    xmms_remote_playlist_next(0);
    return 1;
}
Exemplo n.º 4
0
void *draw_thread_func(void *arg)
{
	Bool configured = FALSE;

	if ((window = create_window(640, 480)) == 0)
	{
		g_log(NULL, G_LOG_LEVEL_CRITICAL, __FILE__ ": unable to create window");
		pthread_exit(NULL);
	}
	
	XMapWindow(dpy, window);

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glFrustum(-1, 1, -1, 1, 1.5, 10);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LESS);

#ifdef HAVE_SCHED_SETSCHEDULER
	if(xmms_check_realtime_priority())
	{
		struct sched_param sparam;
		sparam.sched_priority = sched_get_priority_max(SCHED_OTHER);
		pthread_setschedparam(pthread_self(), SCHED_OTHER, &sparam);		
	}
#endif
	
	while(going)
	{
		while(XPending(dpy))
		{
			XEvent event;
			KeySym keysym;
			char buf[16];
			
			XNextEvent(dpy, &event);
			switch(event.type)
			{
			case ConfigureNotify:
				glViewport(0,0,event.xconfigure.width, event.xconfigure.height);
				if(oglspectrum_cfg.tdfx_mode && !grabbed_pointer)
				{
					
					XGrabPointer(dpy, window,
						     True, ButtonPressMask,
						     GrabModeAsync,
						     GrabModeAsync,
						     window, None, CurrentTime);
					grabbed_pointer = TRUE;
				}
				configured = TRUE;
				break;
			case KeyPress:

				
				XLookupString (&event.xkey, buf, 16, &keysym, NULL);
				switch(keysym)
				{
				case XK_Escape:
					
					/* Ugly hack to get the disable_plugin call in the main thread. */
					GDK_THREADS_ENTER();
					gtk_idle_add(disable_func, NULL);
					GDK_THREADS_LEAVE();
					break;
				case XK_z:
					xmms_remote_playlist_prev(oglspectrum_vp.xmms_session);
					break;
				case XK_x:
					xmms_remote_play(oglspectrum_vp.xmms_session);
					break;
				case XK_c:
					xmms_remote_pause(oglspectrum_vp.xmms_session);
					break;
				case XK_v:
					xmms_remote_stop(oglspectrum_vp.xmms_session);
					break;
				case XK_b:
					xmms_remote_playlist_next(oglspectrum_vp.xmms_session);
					break;
				case XK_Up:					
					x_speed -= 0.1;
					if(x_speed < -3.0)
						x_speed = -3.0;
					break;
				case XK_Down:					
					x_speed += 0.1;
					if(x_speed > 3.0)
						x_speed = 3.0;
					break;
				case XK_Left:
					y_speed -= 0.1;
					if(y_speed < -3.0)
						y_speed = -3.0;
					
					break;
				case XK_Right:
					y_speed += 0.1;
					if(y_speed > 3.0)
						y_speed = 3.0;
					break;
				case XK_w:
					z_speed -= 0.1;
					if(z_speed < -3.0)
						z_speed = -3.0;
					break;
				case XK_q:
					z_speed += 0.1;
					if(z_speed > 3.0)
						z_speed = 3.0;
					break;
				case XK_Return:
					x_speed = 0.0;
					y_speed = 0.5;
					z_speed = 0.0;
					x_angle = 20.0;
					y_angle = 45.0;
					z_angle = 0.0;
					break;					
				}
				
				break;
			case ClientMessage:
				if ((Atom)event.xclient.data.l[0] == wm_delete_window_atom)
				{
					GDK_THREADS_ENTER();
					gtk_idle_add(disable_func, NULL);
					GDK_THREADS_LEAVE();
				}
				break;
			}
		}
		if(configured)
		{
			x_angle += x_speed;
			if(x_angle >= 360.0)
				x_angle -= 360.0;
			
			y_angle += y_speed;
			if(y_angle >= 360.0)
				y_angle -= 360.0;

			z_angle += z_speed;
			if(z_angle >= 360.0)
				z_angle -= 360.0;

			draw_bars();
		}
	}

	if (glxcontext)
	{
		glXMakeCurrent(dpy, 0, NULL);
		glXDestroyContext(dpy, glxcontext);
		glxcontext = NULL;
	}
	if (window)
	{
		if (grabbed_pointer)
		{
			XUngrabPointer(dpy, CurrentTime);
			grabbed_pointer = FALSE;
		}

		XDestroyWindow(dpy, window);
		window = 0;
	}

	pthread_exit(NULL);
}
Exemplo n.º 5
0
Arquivo: misc.c Projeto: kunaldeo/JESS
void keyboard(void)
{
  SDL_Event event;

  while(SDL_PollEvent(&event)); /* on prend le dernier event */
    
  switch(event.type)
    {  
    case SDL_KEYDOWN:         
      switch(event.key.keysym.sym) 
	{

/* 	case SDLK_q: */
/* 	  disable_plugin(get_vplugin_info()); */
/* 	  break; */
/* 	case SDLK_k: */
/* 	  printf("Killed (use XMMS plug-in option to quit instead)\n"); */
/* 	  exit (1); */
/* 	  break; */
/* 	case SDLK_RETURN: */
/* 	  printf("Fading palette mode toggled\n"); */
/* 	  conteur.fade_on_off=1-conteur.fade_on_off; */
/* 	  for(i=0;i<256;i++){ */
/* 	    colors_used[i].r=i; */
/* 	    colors_used[i].g=(gint) ( (float) (i*i*i)/(256*256) ); */
/* 	    colors_used[i].b=0; */
/* 	  } */
/* 	  SDL_SetColors(screen, colors_used, 0, 256);       */
/* 	  break; */
	case SDLK_ESCAPE:
	case SDLK_SPACE:
	  printf("Full Screen mode toggled\n");
	  conteur.fullscreen = 1-conteur.fullscreen ;
	  SDL_WM_ToggleFullScreen(screen);     
	  break;
	case SDLK_c:
	  printf("Resolution key 320*180\n");
	  quit_renderer = 1;
	  resolution_change = 1;
	  resx = 320;
	  resy = 180;
	  break;
	case SDLK_v:
	  printf("Resolution key 512*200\n");
	  quit_renderer = 1;
	  resolution_change = 1;
	  resx = 512;
	  resy = 200;
	  break;
	case SDLK_b:
	  printf("Resolution key 640*480\n");
	  quit_renderer = 1;
	  resolution_change = 1;
	  resx = 640;
	  resy = 480;
	  break; 
	case SDLK_n:
	  printf("Resolution key 800*400\n");
	  quit_renderer = 1;
	  resolution_change = 1;
	  resx = 800;
	  resy = 400;
	  break; 
        case SDLK_COMMA:
	  printf("Resolution key 1024x768\n");
	  quit_renderer = 1;
	  resolution_change = 1;
	  resx = 1024;
	  resy = 768;
	  break;
	case SDLK_o:
	  printf("Toggle 32/8bits mode\n");
	  quit_renderer = 1;
	  resolution_change = 1;
	  if (video == 8)
	    video = 32;
	  else
	    video = 8;
	  break; 
	  
	      
	case SDLK_d: 
	  printf("Freeze Image\n"); 
	  conteur.freeze = 1-conteur.freeze; 
	  break; 


	case SDLK_f:
	  printf("Freeze mode\n");
	  conteur.freeze_mode = 1-conteur.freeze_mode;
	  break;
	case SDLK_p:
	  printf("Random palette\n");
	  random_palette();
	  break;
	case SDLK_e:
	  printf("Enable/disable new colors\n");
	  conteur.psy = 1-conteur.psy;
	  break;
	case SDLK_a:
	  printf("Enable/disable Energie analyser\n");
	  conteur.analyser = 1-conteur.analyser;
	  break;

	  /************ Blur mode *************/
	case SDLK_F1:
	  printf("Blur mode 0\n");
	  conteur.blur_mode = 0;
	  break;
	case SDLK_F2:
	  printf("Blur mode 1\n");
	  conteur.blur_mode = 1;
	  break;
	case SDLK_F3:
	  printf("Blur mode 2\n");
	  conteur.blur_mode = 2;
	  break;
	case SDLK_F4:
	  printf("Blur mode 3\n");
	  conteur.blur_mode = 3;
	  break;
	case SDLK_F5:
	  printf("Blur mode 4\n");
	  conteur.blur_mode = 4;
	  break;

	  /************ Draw mode *************/
	case SDLK_F6: /* lignes */
	  printf("Draw mode 5\n");
	  conteur.draw_mode = 6;
	  break;
	case SDLK_F7: /* lignes */
	  printf("Draw mode 5\n");
	  conteur.draw_mode = 5;
	  break;
	case SDLK_F8: /* lignes */
	  printf("Draw mode 4\n");
	  conteur.draw_mode = 4;
	  break;
	case SDLK_F9:
	  printf("Draw mode 0\n");
	  conteur.draw_mode = 0;
	  break;
	case SDLK_F10:
	  printf("Draw mode 1\n");
	  conteur.draw_mode = 1;
	  break;
	case SDLK_F11:
	  printf("Draw mode 2\n");
	  conteur.draw_mode = 2;
	  break;
	case SDLK_F12:
	  printf("Draw mode 3\n");
	  conteur.draw_mode = 3;
	  break;

	  /************* Key binding ************/
	case SDLK_UP:
	  printf("Prev\n");
	  xmms_remote_playlist_prev(0);
	  break;
	case SDLK_DOWN:
	  printf("Next\n");
	  xmms_remote_playlist_next(0);
	  break;
	case SDLK_LEFT:
	  printf("Jump to time -\n");
	  xmms_remote_jump_to_time(0, xmms_remote_get_output_time(0) - 10000);
	  break;
	case SDLK_RIGHT:
	  printf("Jump to time +\n");
	  xmms_remote_jump_to_time(0, xmms_remote_get_output_time(0) + 10000);
	  break;
	  
	case SDLK_u:
	  printf("Color mode : %i\n",conteur.triplet);
	  break;

	//default:
	}   
      break;
   // default:
    }

}