Пример #1
0
void remote_button_action(gint button_num)
{
   switch(button_num)
   {
      case RC_0:
      case RC_1:
      case RC_2:
      case RC_3:
      case RC_4:
      case RC_5:
      case RC_6:
      case RC_7:
      case RC_8:
      case RC_9:
         set_timeout_goto_channel(button_num - RC_0);
         break;
      case RC_MUTE:
         toggle_audio();
         break;
      case RC_CHAN_UP:
         increase_channel(1);
         break;
      case RC_CHAN_DOWN:
         increase_channel(-1);
         break;
      case RC_FULLSCREEN:
         toggle_fullscreen();
         break;
      case RC_SCREENSHOT:
         create_screenshot();
         break;
      case RC_QUIT:
         if (!delete_event(NULL, NULL, NULL)) destroy(NULL, NULL);
         break;
#ifdef OSS
      case RC_VOLUME_UP:
         set_volume(volume + 2);
         break;
      case RC_VOLUME_DOWN:
         set_volume(volume - 2);
         break;
#endif
      case RC_PREVIOUS_CHAN:
         goto_previous_channel();
         break;
   }
}
Пример #2
0
static void tv_clicked(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
   if (verbose) g_print("Mouse button press event (button %d)\n", event->button);
   switch (event->button)
   {
      case 2:
         toggle_fullscreen();
         break;
      case 3:
         show_options_window();
         break;
      case 4:
         increase_channel(-1);
         break;
      case 5:
         increase_channel(1);
         break;
   }
}
static void userbutton_callback(button_id_t button_id)
{
	stop();
    switch(button_id)
    {
        case 0:
            switch(current_state)
            {
                case STATE_CONFIG_DIRECTION:
                    current_state = STATE_CONFIG_DATARATE;
                    break;
                case STATE_CONFIG_DATARATE:
                    current_state = STATE_RUNNING;
                    break;
                case STATE_RUNNING:
                    current_state = STATE_CONFIG_DIRECTION;
                    break;
            }
            break;
        case 1:
            switch(current_state)
            {
                case STATE_CONFIG_DIRECTION:
                    is_mode_rx = !is_mode_rx;
                    break;
                case STATE_CONFIG_DATARATE:
                    if(current_channel_id.channel_header.ch_class == PHY_CLASS_NORMAL_RATE)
                        current_channel_id.channel_header.ch_class = PHY_CLASS_LO_RATE;
                    else
                        current_channel_id.channel_header.ch_class = PHY_CLASS_NORMAL_RATE;

                    break;

                case STATE_RUNNING:
                	increase_channel();
                    break;
            }
            break;
    }

    sched_post_task(&start);
}
Пример #4
0
static void tv_typed(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
   int i=0;
   if (verbose)
   {
      g_print("Keyboard key press event (key ");
      if (event->keyval<0x100) g_print("\'%c\'", event->keyval);
      else g_print("0x%x", event->keyval);
      g_print(")\n");
   }
   switch (event->keyval)
   {
      case GDK_Right:
         set_volume(volume + 2);
         break;
      case GDK_Down:
         increase_channel(1);
         break;
      case GDK_Left:
         set_volume(volume - 2);
         break;
      case GDK_Up:
         increase_channel(-1);
         break;
      case GDK_Home:
         goto_channel(0);
         break;
      case GDK_End:
         if (channels) for(i=0;channels[i];i++)
         goto_channel(i-1);
         break;
      case GDK_Escape:
      case GDK_KP_Enter:
      case GDK_Return:
         toggle_fullscreen();
         break;
      case GDK_q:
         if (!delete_event(NULL, NULL, NULL)) destroy(NULL, NULL);
         break;
      case GDK_a:
         toggle_audio();
         break;
      case GDK_s:
         create_screenshot();
         break;
      case GDK_p:
         goto_previous_channel();
	 break;
      case GDK_KP_0:
      case GDK_KP_1:
      case GDK_KP_2:
      case GDK_KP_3:
      case GDK_KP_4:
      case GDK_KP_5:
      case GDK_KP_6:
      case GDK_KP_7:
      case GDK_KP_8:
      case GDK_KP_9:
         set_timeout_goto_channel(event->keyval - GDK_KP_0);
         break;
      case GDK_0:
      case GDK_1:
      case GDK_2:
      case GDK_3:
      case GDK_4:
      case GDK_5:
      case GDK_6:
      case GDK_7:
      case GDK_8:
      case GDK_9:
         set_timeout_goto_channel(event->keyval - GDK_0);
         break;
   }
}