+ /* vlm */
+ case MVLC_VLM_NEW:
+ case MVLC_VLM_SETUP:
+ {
+ static const char *vlm_properties[11] =
+ {
+ "input", "output", "option", "enabled", "disabled",
+ "loop", "unloop", "append", "date", "period", "repeat",
+ };
+ vlm_message_t *vlm_answer;
+ char name[512];
+ char *psz = malloc( strlen( p_request ) + 1000 );
+ char *p = psz;
+ int i;
+
+ if( p_intf->p_sys->p_vlm == NULL )
+ p_intf->p_sys->p_vlm = vlm_New( p_intf );
+
+ uri_extract_value( p_request, "name", name, 512 );
+ if( StrToMacroType( control ) == MVLC_VLM_NEW )
+ {
+ char type[20];
+ uri_extract_value( p_request, "type", type, 20 );
+ p += sprintf( psz, "new %s %s", name, type );
+ }
+ else
+ {
+ p += sprintf( psz, "setup %s", name );
+ }
+ /* Parse the request */
+ for( i = 0; i < 11; i++ )
+ {
+ char val[512];
+ uri_extract_value( p_request, vlm_properties[i], val, 512 );
+ if( strlen( val ) > 0 )
+ {
+ p += sprintf( p, " %s %s", vlm_properties[i], val );
+ }
+ else if( uri_test_param( p_request, vlm_properties[i] ) )
+ {
+ p += sprintf( p, " %s", vlm_properties[i] );
+ }
+ }
+ vlm_ExecuteCommand( p_intf->p_sys->p_vlm, psz, &vlm_answer );
+ /* FIXME do a vlm_answer -> var stack conversion */
+ vlm_MessageDelete( vlm_answer );
+ free( psz );
+ break;
+ }
+
+ case MVLC_VLM_DEL:
+ {
+ vlm_message_t *vlm_answer;
+ char name[512];
+ char psz[512+10];
+ if( p_intf->p_sys->p_vlm == NULL )
+ p_intf->p_sys->p_vlm = vlm_New( p_intf );
+
+ uri_extract_value( p_request, "name", name, 512 );
+ sprintf( psz, "del %s", name );
+
+ vlm_ExecuteCommand( p_intf->p_sys->p_vlm, psz, &vlm_answer );
+ /* FIXME do a vlm_answer -> var stack conversion */
+ vlm_MessageDelete( vlm_answer );
+ break;
+ }
+
+ case MVLC_VLM_PLAY:
+ case MVLC_VLM_PAUSE:
+ case MVLC_VLM_STOP:
+ case MVLC_VLM_SEEK:
+ {
+ vlm_message_t *vlm_answer;
+ char name[512];
+ char psz[512+10];
+ if( p_intf->p_sys->p_vlm == NULL )
+ p_intf->p_sys->p_vlm = vlm_New( p_intf );
+
+ uri_extract_value( p_request, "name", name, 512 );
+ if( StrToMacroType( control ) == MVLC_VLM_PLAY )
+ sprintf( psz, "control %s play", name );
+ else if( StrToMacroType( control ) == MVLC_VLM_PAUSE )
+ sprintf( psz, "control %s pause", name );
+ else if( StrToMacroType( control ) == MVLC_VLM_STOP )
+ sprintf( psz, "control %s stop", name );
+ else if( StrToMacroType( control ) == MVLC_VLM_SEEK )
+ {
+ char percent[20];
+ uri_extract_value( p_request, "percent", percent, 512 );
+ sprintf( psz, "control %s seek %s", name, percent );
+ }
+
+ vlm_ExecuteCommand( p_intf->p_sys->p_vlm, psz, &vlm_answer );
+ /* FIXME do a vlm_answer -> var stack conversion */
+ vlm_MessageDelete( vlm_answer );
+ break;
+ }
+