]> git.sesse.net Git - vlc/blobdiff - src/interface/interface.c
Desactivation du changement de chaine en --novlan
[vlc] / src / interface / interface.c
index 5243f65c665b2faaa4d98b1f03d1dd217597ee27..6397511546c953ce5b740a56b1d1d86f73168847 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "intf_sys.h"
 
-
 /*******************************************************************************
  * intf_Create: prepare interface before main loop
  *******************************************************************************
@@ -106,7 +105,7 @@ void intf_Run( intf_thread_t *p_intf )
         }    
         if( (p_intf->p_input != NULL) && p_intf->p_input->b_error )
         {
-            input_DestroyThread( p_intf->p_input /*, NULL */ );            
+            input_DestroyThread( p_intf->p_input, NULL );            
             p_intf->p_input = NULL;            
             intf_DbgMsg("Input thread destroyed\n");            
         }
@@ -135,27 +134,31 @@ void intf_Destroy( intf_thread_t *p_intf )
 /*******************************************************************************
  * intf_SelectInput: change input stream
  *******************************************************************************
- * Kill existing input, if any, and try to open a new one. If p_cfg is NULL,
- * no new input will be openned.
+ * Kill existing input, if any, and try to open a new one, using an input
+ * configuration table.
  *******************************************************************************/
-int intf_SelectInput( intf_thread_t * p_intf, input_cfg_t *p_cfg )
+int intf_SelectInput( intf_thread_t * p_intf, int i_index )
 {
-    intf_DbgMsg("0x%x\n", p_intf );
+    intf_DbgMsg("\n");
+
+    /* If VLANs are not active, return with an error */
+    if( !p_main->b_vlans )
+    {
+        intf_ErrMsg("error: VLANs are not activated\n");
+        return( 1 );        
+    }    
     
     /* Kill existing input, if any */
     if( p_intf->p_input != NULL )
     {        
-        input_DestroyThread( p_intf->p_input /*??, NULL*/ );
-        p_intf->p_input = NULL;        
+        input_DestroyThread( p_intf->p_input, NULL );
     }
-    
-    /* Open new one */
-    if( p_cfg != NULL )
-    {        
-        p_intf->p_input = input_CreateThread( p_cfg /*??, NULL*/ );    
-    }
-    
-    return( (p_cfg != NULL) && (p_intf->p_input == NULL) );    
+
+    /* Open a new input */
+    intf_Msg("Switching to channel %d\n", i_index );    
+    p_intf->p_input = input_CreateThread( INPUT_METHOD_TS_VLAN_BCAST, NULL, 0, i_index, 
+                                          p_intf->p_vout, p_main->p_aout, NULL );        
+    return( p_intf->p_input == NULL );    
 }
 
 /*******************************************************************************
@@ -170,7 +173,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
     {
     case 'Q':                                                    /* quit order */
     case 'q':
-    case 27:
+    case 27: /* escape key */
         p_intf->b_die = 1;
         break;  
     case '0':                                                 /* source change */
@@ -183,7 +186,10 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
     case '7':
     case '8':
     case '9':                    
-        // ??
+        if( intf_SelectInput( p_intf, i_key - '0' ) )
+        {
+            intf_ErrMsg("error: can not open channel %d\n", i_key - '0');            
+        }        
         break;
     case '+':                                                      /* volume + */
         // ??
@@ -222,45 +228,6 @@ int intf_ProcessKey( intf_thread_t *p_intf, int i_key )
             vlc_mutex_unlock( &p_intf->p_vout->change_lock );      
         }
         break;  
-    case 'x':                                     /* horizontal aspect ratio - */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->i_horizontal_scale > -INTF_SCALE_LIMIT) )
-        {
-            vlc_mutex_lock( &p_intf->p_vout->change_lock );
-            p_intf->p_vout->i_horizontal_scale--;                        
-            p_intf->p_vout->i_changes |= VOUT_RATIO_CHANGE;
-            vlc_mutex_unlock( &p_intf->p_vout->change_lock );
-        }                    
-        break;                                        
-    case 'X':                                     /* horizontal aspect ratio + */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->i_horizontal_scale < INTF_SCALE_LIMIT) )
-        {       
-            vlc_mutex_lock( &p_intf->p_vout->change_lock );
-            p_intf->p_vout->i_horizontal_scale++;
-            p_intf->p_vout->i_changes |= VOUT_RATIO_CHANGE;
-            vlc_mutex_unlock( &p_intf->p_vout->change_lock );
-        }                    
-        break;  
-    case 'y':                                       /* vertical aspect ratio - */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->i_vertical_scale > -INTF_SCALE_LIMIT) )
-        {
-            vlc_mutex_lock( &p_intf->p_vout->change_lock );
-            p_intf->p_vout->i_vertical_scale--;
-            p_intf->p_vout->i_changes |= VOUT_RATIO_CHANGE;
-            vlc_mutex_unlock( &p_intf->p_vout->change_lock );
-        }                    
-        break;                                        
-    case 'Y':                                     /* horizontal aspect ratio + */
-        if( (p_intf->p_vout != NULL) && (p_intf->p_vout->i_vertical_scale < INTF_SCALE_LIMIT) )
-        {       
-            vlc_mutex_lock( &p_intf->p_vout->change_lock );
-            p_intf->p_vout->i_vertical_scale++;
-            p_intf->p_vout->i_changes |= VOUT_RATIO_CHANGE;
-            vlc_mutex_unlock( &p_intf->p_vout->change_lock );
-        }
-        break;        
-    case 'f':                                             /* toggle fullscreen */
-        //??
-        break;                                        
     case ' ':                                                   /* toggle info */
         if( p_intf->p_vout != NULL )
         {