<span style="FONT-SIZE: 150%; LINE-HEIGHT: 116%">Hi I am implementing a new button function. Thanks to the help of the forum's people I have been able to show the button beside the PLAY button. Now I was finding out how to run this funtion but I am not a so good programmer for this issues and I am not able to understand how is working. Looking around I saw some codes about the buttons and the change of variables.<br>
<br>Let me show what Iīve done and explain what I would like to do if anyone could help.<br><br>I have modified the file "ts.c" in /modules/mux/mpeg folder. In this file I have attached some funtions to stream a new PSI table and new boolean variables. Now I am trying to change the value of a boolean variable through the button before I have told:</span><br>
<br><span style="FONT-STYLE: italic">add_bool( SOUT_CFG_PREFIX "enable-HAT", 0, NULL, HAT_TEXT, HAT_LONGTEXT, VLC_TRUE);<br>[...]<br>static const char *ppsz_sout_options[] = {<br>"pid-video", "pid-audio", "pid-spu", "pid-pmt", "tsid", "netid",<br>
"es-id-pid", "shaping", "pcr", "bmin", "bmax", "use-key-frames",<br>"dts-delay", "csa-ck", "csa-pkt", "crypt-audio", "crypt-video",<br>
"muxpmt", "sdtdesc", "program-pmt", "alignment",<span style="FONT-WEIGHT: bold"> "enable-HAT"</span>,<br>"numpmt-f" , "pidpmt-f" , "numpmt-s" , "pidpmt-s",<br>
NULL<br>};</span><br><br><span style="FONT-SIZE: 150%; LINE-HEIGHT: 116%">The boolean "enable-Hat" appears in the MUX funtion in the file "ts.c". With the first two lines I want to receive the order from the button which I will explain afterwars his code:</span><br>
<br><span style="FONT-STYLE: italic">sout_instance_t *pa_mux = (sout_instance_t *)p_mux->parent;<br>[...]<br>p_sys->enhat = var_CreateGetBool( pa_mux, SOUT_CFG_PREFIX "enable-HAT" );<br>if(p_sys->enhat)<br>
{<br>GetHAT( p_mux, &chain_ts );<br>}</span><br><br><span style="FONT-SIZE: 150%; LINE-HEIGHT: 116%">In the "interface.cpp" file in /modules/gui/wxwidgets I have modified the code to show the button and itīs done properly. The problem is the code to change the boolean said backwards. The code is the next:</span><br>
<br><span style="FONT-STYLE: italic">void Interface::OnDecodeHAT( wxCommandEvent& WXUNUSED(event) )<br>{<br>DecodeHAT();<br>}<br><br>void Interface::DecodeHAT()<br>{<br>sout_instance_t *p_mux = (sout_instance_t *)vlc_object_find(p_intf, VLC_OBJECT_SOUT, FIND_ANYWHERE);<br>
if( p_mux = NULL )<br>{<br>msg_Warn(p_intf, "Object not found");<br>return;<br>}<br>var_SetBool(p_mux, "enable-HAT", VLC_TRUE);<br><br>vlc_object_release( p_mux );<br>}</span><br><br><span style="FONT-SIZE: 150%; LINE-HEIGHT: 116%">But the make give the error:interface.cpp:1095:error:invalid use of undefined type 'struct sout_instance_t', the line referred to varSetBool... And the same for the line 1097, the line vlc_object_release...</span><br>
<br><span style="FONT-SIZE: 150%; LINE-HEIGHT: 116%">Now I donīt know what to do as I feel little lost. I'm aware the message is a little large but there is none who can help me aside the forum people. If anyone could aid me to learn how doing it I would be very grateful.<br>
Thanks and regards </span>