Changeset 38b5689a8fb05f78d000fae61a7842a7be024796

Show
Ignore:
Timestamp:
13/08/03 03:45:13 (5 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1060739113 +0000
git-parent:

[e69c7de6cf315eaf7156dcec085eb31288f8b79d]

git-author:
Gildas Bazin <gbazin@videolan.org> 1060739113 +0000
Message:

* modules/access/dvdplay/*: support for dvd menus navigation ("dvd_menus" object variable).
* modules/gui/wxwindows/menus.cpp: support for dvd menus navigation.
* src/input/input_programs.c: programs object var was not reset correctly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • NEWS

    rae141f9 r38b5689  
    1 $Id: NEWS,v 1.63 2003/08/10 21:26:07 gbazin Exp $ 
     1$Id: NEWS,v 1.64 2003/08/13 01:45:13 gbazin Exp $ 
    22 
    33Changes between 0.6.1 and 0.6.2: 
     
    1414 * Support for DVB-S/C/T cards using v4l2 API for Linux 2.6.x kernels. 
    1515 * Few fixes to the VCD navigation. 
     16 
     17Interfaces: 
     18 * Support for DVD menus navigation added to the wxWindows interface. 
    1619 
    1720UNIX ports: 
  • modules/access/dvdplay/access.c

    r28f793d r38b5689  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: access.c,v 1.18 2003/05/08 19:06:44 titer Exp $ 
     5 * $Id: access.c,v 1.19 2003/08/13 01:45:13 gbazin Exp $ 
    66 * 
    77 * Author: St�ane Borel <stef@via.ecp.fr> 
     
    6666static int dvdNewPGC ( input_thread_t * ); 
    6767 
     68 
     69static int MenusCallback( vlc_object_t *, char const *, 
     70                          vlc_value_t, vlc_value_t, void * ); 
     71 
    6872/***************************************************************************** 
    6973 * OpenDVD: open libdvdplay 
     
    8084    unsigned int            i_angle; 
    8185    unsigned int            i; 
     86    vlc_value_t             val, text; 
    8287 
    8388    p_dvd = malloc( sizeof(dvd_data_t) ); 
     
    191196    var_Create( p_input, "highlight", VLC_VAR_BOOL ); 
    192197    var_Create( p_input, "highlight-mutex", VLC_VAR_MUTEX ); 
     198 
     199    /* Create a few object variables used for navigation in the interfaces */ 
     200    var_Create( p_input, "dvd_menus", 
     201                VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_ISCOMMAND ); 
     202    text.psz_string = _("DVD menus"); 
     203    var_Change( p_input, "dvd_menus", VLC_VAR_SETTEXT, &text, NULL ); 
     204    var_AddCallback( p_input, "dvd_menus", MenusCallback, NULL ); 
     205    val.i_int = ROOT_MENU; text.psz_string = _("Root"); 
     206    var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text ); 
     207    val.i_int = TITLE_MENU; text.psz_string = _("Title"); 
     208    var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text ); 
     209    val.i_int = PART_MENU; text.psz_string = _("Chapter"); 
     210    var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text ); 
     211    val.i_int = SUBPICTURE_MENU; text.psz_string = _("Subtitle"); 
     212    var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text ); 
     213    val.i_int = AUDIO_MENU; text.psz_string = _("Audio"); 
     214    var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text ); 
     215    val.i_int = ANGLE_MENU; text.psz_string = _("Angle"); 
     216    var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text ); 
     217    val.i_int = 99; text.psz_string = _("Resume"); 
     218    var_Change( p_input, "dvd_menus", VLC_VAR_ADDCHOICE, &val, &text ); 
    193219 
    194220    return 0; 
     
    287313        dvdNewArea( p_input, p_area ); 
    288314 
    289         /* Reinit ES */ 
    290315        dvdNewPGC( p_input ); 
    291316 
     
    412437 
    413438        /* new pgc in same title: reinit ES */ 
     439        dvdplay_ES( p_input ); 
    414440        dvdNewPGC( p_input ); 
    415441 
     
    417443 
    418444        break; 
     445    case JUMP: 
     446        dvdplay_ES( p_input ); 
     447        dvdNewPGC( p_input ); 
    419448    case NEW_PG: 
    420449        /* update current chapter */ 
     
    438467    case END_OF_CELL: 
    439468        p_dvd->b_end_of_cell = 1; 
    440         break; 
    441     case JUMP: 
    442         dvdplay_ES( p_input ); 
    443469        break; 
    444470    case STILL_TIME: 
     
    535561    p_input->stream.p_selected_program->b_is_ok = 1; 
    536562 
     563    /* Reinit ES */ 
     564    dvdplay_ES( p_input ); 
     565 
    537566    /* Update the navigation variables without triggering a callback */ 
    538567    val.i_int = p_area->i_id; 
     
    554583static int dvdNewPGC( input_thread_t * p_input ) 
    555584{ 
    556     dvd_data_t *    p_dvd; 
    557 //    int             i_audio_nr  = -1; 
    558 //    int             i_audio     = -1; 
    559 //    int             i_subp_nr   = -1; 
    560 //    int             i_subp      = -1; 
    561 //    int             i_sec; 
    562  
    563     p_dvd = (dvd_data_t*)p_input->p_access_data; 
    564  
    565 //    dvdplay_audio_info( p_dvd->vmg, &i_audio_nr, &i_audio ); 
    566 //    dvdplay_subp_info( p_dvd->vmg, &i_subp_nr, &i_subp ); 
    567  
    568     dvdplay_ES( p_input ); 
     585    dvd_data_t * p_dvd = (dvd_data_t*)p_input->p_access_data; 
     586 
    569587    p_input->stream.p_selected_area->i_start = 
    570588        LB2OFF( dvdplay_title_first( p_dvd->vmg ) ); 
     
    583601    } 
    584602 
    585 #if 0 
    586     i_sec = dvdplay_title_time( p_dvd->vmg ); 
    587     msg_Dbg( p_input, "title time: %d:%02d:%02d (%d)", 
    588                      i_sec/3600, (i_sec%3600)/60, i_sec%60, i_sec ); 
    589 #endif 
    590  
    591603    return 0; 
    592604} 
     605 
     606static int MenusCallback( vlc_object_t *p_this, char const *psz_name, 
     607                          vlc_value_t oldval, vlc_value_t newval, void *p_arg ) 
     608{ 
     609    input_thread_t *    p_input; 
     610    dvd_data_t *        p_dvd; 
     611 
     612    p_input = (input_thread_t*)p_this; 
     613    p_dvd   = (dvd_data_t*)p_input->p_access_data; 
     614 
     615    vlc_mutex_lock( &p_input->stream.stream_lock ); 
     616    if( newval.i_int < 99 ) 
     617        dvdplay_menu( p_dvd->vmg, newval.i_int, 0 ); 
     618    else 
     619        dvdplay_resume( p_dvd->vmg ); 
     620    vlc_mutex_unlock( &p_input->stream.stream_lock ); 
     621 
     622    if( p_dvd->p_intf ) dvdIntfResetStillTime( p_dvd->p_intf ); 
     623 
     624    return VLC_SUCCESS; 
     625} 
  • modules/access/dvdplay/intf.c

    raef7cfe r38b5689  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: intf.c,v 1.6 2003/01/29 15:55:44 sam Exp $ 
     5 * $Id: intf.c,v 1.7 2003/08/13 01:45:13 gbazin Exp $ 
    66 * 
    77 * Authors: St�ane Borel <stef@via.ecp.fr> 
     
    425425} 
    426426 
     427/***************************************************************************** 
     428 * dvdIntfStillTime: function provided to reset still image 
     429 *****************************************************************************/ 
     430int dvdIntfResetStillTime( intf_thread_t *p_intf ) 
     431{ 
     432    vlc_mutex_lock( &p_intf->change_lock ); 
     433    p_intf->p_sys->m_still_time = 0; 
     434    input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); 
     435    vlc_mutex_unlock( &p_intf->change_lock ); 
     436 
     437    return VLC_SUCCESS; 
     438} 
  • modules/access/dvdplay/intf.h

    r19ea8fe r38b5689  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: intf.h,v 1.1 2002/08/04 17:23:42 sam Exp $ 
     5 * $Id: intf.h,v 1.2 2003/08/13 01:45:13 gbazin Exp $ 
    66 * 
    77 * Author: St�ane Borel <stef@via.ecp.fr> 
     
    2323 
    2424int dvdIntfStillTime( struct intf_thread_t *, int ); 
     25int dvdIntfResetStillTime( intf_thread_t *p_intf ); 
  • modules/gui/wxwindows/menus.cpp

    rae65b15 r38b5689  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: menus.cpp,v 1.17 2003/07/20 10:38:49 gbazin Exp $ 
     5 * $Id: menus.cpp,v 1.18 2003/08/13 01:45:13 gbazin Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    170170        ppsz_varnames[i] = "chapter"; 
    171171        pi_objects[i++] = p_object->i_object_id; 
     172        ppsz_varnames[i] = "program"; 
     173        pi_objects[i++] = p_object->i_object_id; 
    172174        ppsz_varnames[i] = "navigation"; 
    173175        pi_objects[i++] = p_object->i_object_id; 
    174         ppsz_varnames[i] = "program"; 
     176        ppsz_varnames[i] = "dvd_menus"; 
    175177        pi_objects[i++] = p_object->i_object_id; 
    176178 
     
    295297        ppsz_varnames[i] = "chapter"; 
    296298        pi_objects[i++] = p_object->i_object_id; 
     299        ppsz_varnames[i] = "program"; 
     300        pi_objects[i++] = p_object->i_object_id; 
    297301        ppsz_varnames[i] = "navigation"; 
    298302        pi_objects[i++] = p_object->i_object_id; 
    299         ppsz_varnames[i] = "program"; 
     303        ppsz_varnames[i] = "dvd_menus"; 
    300304        pi_objects[i++] = p_object->i_object_id; 
    301305 
     
    519523                                 wxU(text_list.p_list->p_values[i].psz_string ? 
    520524                                 text_list.p_list->p_values[i].psz_string : 
    521                                  another_val.psz_string), 
    522                                  wxT(""), wxITEM_RADIO, strdup(psz_var), 
     525                                 another_val.psz_string), wxT(""), 
     526                                 i_type & VLC_VAR_ISCOMMAND ? 
     527                                   wxITEM_NORMAL : wxITEM_RADIO, 
     528                                 strdup(psz_var), 
    523529                                 p_object->i_object_id, another_val, i_type ); 
    524530 
     
    537543                                   text_list.p_list->p_values[i].psz_string) : 
    538544                                 wxString::Format(wxT("%d"), 
    539                                  val_list.p_list->p_values[i].i_int), 
    540                                  wxT(""), wxITEM_RADIO, strdup(psz_var), 
     545                                 val_list.p_list->p_values[i].i_int), wxT(""), 
     546                                 i_type & VLC_VAR_ISCOMMAND ? 
     547                                   wxITEM_NORMAL : wxITEM_RADIO, 
     548                                 strdup(psz_var), 
    541549                                 p_object->i_object_id, 
    542550                                 val_list.p_list->p_values[i], i_type ); 
  • src/input/input_programs.c

    rfa06cb3 r38b5689  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2002 VideoLAN 
    5  * $Id: input_programs.c,v 1.116 2003/07/30 21:09:06 gbazin Exp $ 
     5 * $Id: input_programs.c,v 1.117 2003/08/13 01:45:13 gbazin Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    272272    } 
    273273 
    274     val.i_int = i_pgrm_index
     274    val.i_int = p_input->stream.pp_programs[i_pgrm_index]->i_number
    275275    var_Change( p_input, "program", VLC_VAR_DELCHOICE, &val, NULL ); 
    276276