[vlc-devel] [PATCH] Allow on-the-fly multi-line marquee
Johann Ransay
johann.ransay at planar.com
Thu Jul 1 15:50:44 CEST 2010
I must have messed up with the git send-mail command. Sorry about that.
Anyway, Here it is again (hopefully) cleanly formatted.
Regards,
Johann
Turn a '\\' 'n' sequence into '\n' in on-the-fly marquee to enable
multi-line text. To be tried with --intf oldrc --sub-filter marq at title
then from the command line interface:
@title marq-marquee multi\nline\ntest
---
modules/control/rc.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/modules/control/rc.c b/modules/control/rc.c
index 2fbc628..021a38d 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -587,6 +587,8 @@ static void Run( intf_thread_t *p_intf )
char *psz_alias = psz_cmd + 1;
char *psz_mycmd = strdup( psz_arg );
char *psz_myarg = strchr( psz_mycmd, ' ' );
+ char *psz_subst = 0;
+ char *psz_start = 0;
char *psz_msg;
if( !psz_myarg )
@@ -598,6 +600,37 @@ static void Run( intf_thread_t *p_intf )
*psz_myarg = '\0';
psz_myarg ++;
+ psz_start = psz_myarg;
+ /* perform special character substitutions */
+ while( *psz_start )
+ {
+ psz_subst = psz_start;
+ if( *psz_subst == '\\' )
+ {
+ switch( *(psz_subst+1) )
+ {
+ case 'n':
+ /* replace '\\' 'n' with '\n' */
+ *psz_subst = '\n';
+ break;
+
+ default:
+ /* not a special character, remove backslash */
+ *psz_subst = *(psz_subst+1);
+ break;
+ }
+ *psz_subst++;
+ /* move remaining characters one index backward */
+ while( *(psz_subst+1) )
+ {
+ *psz_subst = *(psz_subst+1);
+ *psz_subst++;
+ }
+ *psz_subst = 0;
+ }
+ psz_start++;
+ }
+
var_Command( p_intf, psz_alias, psz_mycmd, psz_myarg,
&psz_msg );
--
1.6.2.5
On Thursday 01 July 2010, Jean-Baptiste Kempf wrote:
> On Thu, Jul 01, 2010 at 02:48:55PM +0200, Johann Ransay wrote :
> > Did that go below the radar of the dev team ?
>
> As far as I am concerned, I haven't seen it in my mailbox
>
> Best Regards,
____________________________________________________________________
This e-mail, and any attachments, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information belonging to Planar Systems, Inc. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, any attachments thereto, and use of the information contained, is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the original and any copy thereof.
______________________________________________________________________
More information about the vlc-devel
mailing list