Changeset 3111

Show
Ignore:
Timestamp:
02/02/00 18:14:33 (15 years ago)
Author:
ucaccsp
Message:

Update tcl/tk initialization sequence. The UI should now be ready before
we initialize our mbus interface, which should mean that rtp.ssrc cannot
fail.

Location:
rat/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • rat/trunk/tcltk.c

    r3078 r3111  
    275275{ 
    276276        char            *cmd_line_args, buffer[10]; 
     277        Tcl_Obj         *audiotool_obj; 
    277278 
    278279        Tcl_FindExecutable(argv[0]); 
     
    317318        Tk_DefineBitmap(interp, Tk_GetUid("left"),  left_bits,  left_width, left_height); 
    318319        Tk_DefineBitmap(interp, Tk_GetUid("right"), right_bits, right_width,  right_height); 
    319         Tcl_Eval(interp, "wm withdraw ."); 
    320         while (Tcl_DoOneEvent(TCL_DONT_WAIT | TCL_ALL_EVENTS)) { 
    321                 /* Process Tcl/Tk events */ 
    322         } 
    323         return TRUE; 
    324 } 
    325  
    326 int  
    327 tcl_init2(struct mbus *mbus_ui, char *mbus_engine_addr) 
    328 { 
    329         struct timeval   timeout; 
    330         Tcl_Obj         *audiotool_obj; 
    331         engine_addr   = xstrdup(mbus_engine_addr); 
    332  
    333         Tcl_CreateCommand(interp, "mbus_send",       mbus_send_cmd,   (ClientData) mbus_ui, NULL); 
    334         Tcl_CreateCommand(interp, "mbus_encode_str", mbus_encode_cmd, NULL, NULL); 
    335320 
    336321        audiotool_obj = Tcl_NewStringObj(ui_audiotool, strlen(ui_audiotool)); 
     
    338323                fprintf(stderr, "ui_audiotool error: %s\n", Tcl_GetStringResult(interp)); 
    339324        } 
     325        while (Tcl_DoOneEvent(TCL_DONT_WAIT | TCL_ALL_EVENTS)) { 
     326                /* Process Tcl/Tk events */ 
     327        } 
     328 
     329        return TRUE; 
     330} 
     331 
     332int  
     333tcl_init2(struct mbus *mbus_ui, char *mbus_engine_addr) 
     334{ 
     335        struct timeval   timeout; 
     336        engine_addr   = xstrdup(mbus_engine_addr); 
     337 
     338        Tcl_CreateCommand(interp, "mbus_send",       mbus_send_cmd,   (ClientData) mbus_ui, NULL); 
     339        Tcl_CreateCommand(interp, "mbus_encode_str", mbus_encode_cmd, NULL, NULL); 
     340        Tcl_Eval(interp, "wm deiconify ."); 
    340341 
    341342        /* Process Tcl/Tk events */ 
  • rat/trunk/ui.c

    r3108 r3111  
    10741074        /* One off setting transfers / initialization */ 
    10751075        uint32_t my_ssrc = rtp_my_ssrc(sp->rtp_session[0]); 
    1076         int16_t i; 
    1077  
    1078         /* 
    1079          * This loop is the wrong fix for the engine sending commands to the 
    1080          * ui before the ui is ready.  When this happens the ui acks, but ignores 
    1081          * the messages (ugh!).  Since the ui depends on having got out ssrc in 
    1082          * lots of messages we have to make sure it gets through.   
    1083          * The ui and engine should wait until they've got 
    1084          * some kind of heartbeat or go message from the other before exchanging 
    1085          * data messages. 
    1086          */ 
    1087         for(i = 0; i < 10; i++) { 
    1088                 mbus_qmsgf(sp->mbus_engine, sp->mbus_ui_addr, TRUE, "rtp.ssrc", "%08lx", my_ssrc); 
    1089                 network_process_mbus(sp); 
    1090         } 
     1076 
     1077        mbus_qmsgf(sp->mbus_engine, sp->mbus_ui_addr, TRUE, "rtp.ssrc", "%08lx", my_ssrc); network_process_mbus(sp); 
    10911078        ui_sampling_modes(sp);                  network_process_mbus(sp); 
    10921079        ui_converters(sp);                      network_process_mbus(sp); 
  • rat/trunk/ui_audiotool.tcl

    r3110 r3111  
    99# 
    1010 
    11 #wm withdraw . 
     11wm withdraw . 
    1212 
    1313if {[string compare [info commands registry] "registry"] == 0} { 
     
    28932893} 
    28942894 
    2895 wm deiconify . 
    2896  
     2895