Changeset e5127326704fa04d68ae39c807e1d5e738a854dc

Show
Ignore:
Timestamp:
18/06/08 11:39:22 (6 months ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1213781962 +0200
git-parent:

[3b8c56cc792ccb1ce15b615ab2dfeeafab07048a]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1213555607 +0200
Message:

Add some video-filter2 effects to wxwidget extrapanel

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/wxwidgets/extrapanel.cpp

    r3561b9b re512732  
    5252                                 char *, bool ); 
    5353static void ChangeVFiltersString( intf_thread_t *, char *, bool ); 
    54  
     54static void ChangeVFilters2String( intf_thread_t *, char *, bool ); 
    5555 
    5656/* IDs for the controls and the menu commands */ 
     
    145145    char *psz_name; 
    146146    char *psz_help; 
     147    bool  b_vfilter2; 
    147148}; 
    148149 
    149150static const struct filter vfilters[] = 
    150151{ 
    151     { "clone", N_("Image clone"), N_("Creates several clones of the image") }, 
    152     { "distort", N_("Distortion"), N_("Adds distortion effects") }, 
    153     { "invert", N_("Image inversion") , N_("Inverts the colors of the image") }, 
    154     { "motionblur", N_("Blurring"), N_("Adds motion blurring to the image") }, 
    155     { "transform",  N_("Transformation"), N_("Rotates or flips the image") }, 
    156     { "magnify",  N_("Magnify"), N_("Magnifies part of the image") }, 
    157     { "puzzle",  N_("Puzzle"), N_("Turns the image into a puzzle") }, 
     152    { "clone", N_("Image clone"), N_("Creates several clones of the image"), false }, 
     153    { "gradient", N_("Cartoon effect"), N_("Gradient effects (cartoon) on the image"), true }, 
     154    { "invert", N_("Image inversion") , N_("Inverts the colors of the image"), true }, 
     155    { "motionblur", N_("Blurring"), N_("Adds motion blurring to the image"), true }, 
     156    { "ripple", N_("Water effect"), N_("Adds water effect to the image"), true }, 
     157    { "wave", N_("Wave effect"), N_("Adds wave effect to the image"), true }, 
     158    { "transform",  N_("Transformation"), N_("Rotates or flips the image"), false }, 
     159    { "magnify",  N_("Magnify"), N_("Magnifies part of the image"), false }, 
     160    { "puzzle",  N_("Puzzle"), N_("Turns the image into a puzzle"), false }, 
    158161    { NULL, NULL, NULL } /* Do not remove this line */ 
    159162}; 
     
    994997    if( vfilters[i_filter].psz_filter  ) 
    995998    { 
    996         ChangeVFiltersString( p_intf, vfilters[i_filter].psz_filter , 
    997                               event.IsChecked() ? true : false ); 
     999        if( vfilters[i_filter].b_vfilter2 ) 
     1000            ChangeVFilters2String( p_intf, vfilters[i_filter].psz_filter , 
     1001                                event.IsChecked() ? true : false ); 
     1002        else 
     1003            ChangeVFiltersString( p_intf, vfilters[i_filter].psz_filter , 
     1004                                  event.IsChecked() ? true : false ); 
    9981005    } 
    9991006} 
     
    10501057} 
    10511058 
    1052  
    10531059static void ChangeVFiltersString( intf_thread_t *p_intf, 
    1054                                  char *psz_name, bool b_add ) 
     1060                                  char *psz_name, bool b_add ) 
    10551061{ 
    10561062    vout_thread_t *p_vout; 
     
    11121118} 
    11131119 
    1114  
    1115 static void ChangeFiltersString( intf_thread_t *p_intf, 
    1116                                  aout_instance_t * p_aout, 
    1117                                  char *psz_name, bool b_add ) 
    1118 
     1120static void ChangeVFilters2String( intf_thread_t *p_intf, 
     1121                                  char *psz_name, bool b_add ) 
     1122
     1123    vout_thread_t *p_vout; 
    11191124    char *psz_parser, *psz_string; 
    11201125 
    1121     if( p_aout ) 
    1122     { 
    1123         psz_string = var_GetNonEmptyString( p_aout, "audio-filter" ); 
    1124     } 
    1125     else 
    1126     { 
    1127         psz_string = config_GetPsz( p_intf, "audio-filter" ); 
    1128     } 
     1126    psz_string = config_GetPsz( p_intf, "video-filter" ); 
    11291127 
    11301128    if( !psz_string ) psz_string = strdup(""); 
     
    11541152                            strlen(psz_parser + strlen(psz_name)) + 1 ); 
    11551153 
     1154            /* Remove trailing : : */ 
    11561155            if( *(psz_string+strlen(psz_string ) -1 ) == ':' ) 
    11571156            { 
     
    11651164         } 
    11661165    } 
     1166    /* Vout is not kept, so put that in the config */ 
     1167    config_PutPsz( p_intf, "video-filter", psz_string ); 
     1168 
     1169    /* Try to set on the fly */ 
     1170    p_vout = (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, 
     1171                                              FIND_ANYWHERE ); 
     1172    if( p_vout ) 
     1173    { 
     1174        var_SetString( p_vout, "video-filter", psz_string ); 
     1175        vlc_object_release( p_vout ); 
     1176    } 
     1177    free( psz_string ); 
     1178} 
     1179 
     1180 
     1181static void ChangeFiltersString( intf_thread_t *p_intf, 
     1182                                 aout_instance_t * p_aout, 
     1183                                 char *psz_name, bool b_add ) 
     1184{ 
     1185    char *psz_parser, *psz_string; 
     1186 
     1187    if( p_aout ) 
     1188    { 
     1189        psz_string = var_GetNonEmptyString( p_aout, "audio-filter" ); 
     1190    } 
     1191    else 
     1192    { 
     1193        psz_string = config_GetPsz( p_intf, "audio-filter" ); 
     1194    } 
     1195 
     1196    if( !psz_string ) psz_string = strdup(""); 
     1197 
     1198    psz_parser = strstr( psz_string, psz_name ); 
     1199 
     1200    if( b_add ) 
     1201    { 
     1202        if( !psz_parser ) 
     1203        { 
     1204            psz_parser = psz_string; 
     1205            asprintf( &psz_string, (*psz_string) ? "%s:%s" : "%s%s", 
     1206                            psz_string, psz_name ); 
     1207            free( psz_parser ); 
     1208        } 
     1209        else 
     1210        { 
     1211            return; 
     1212        } 
     1213    } 
     1214    else 
     1215    { 
     1216        if( psz_parser ) 
     1217        { 
     1218            memmove( psz_parser, psz_parser + strlen(psz_name) + 
     1219                            (*(psz_parser + strlen(psz_name)) == ':' ? 1 : 0 ), 
     1220                            strlen(psz_parser + strlen(psz_name)) + 1 ); 
     1221 
     1222            if( *(psz_string+strlen(psz_string ) -1 ) == ':' ) 
     1223            { 
     1224                *(psz_string+strlen(psz_string ) -1 ) = '\0'; 
     1225            } 
     1226         } 
     1227         else 
     1228         { 
     1229             free( psz_string ); 
     1230             return; 
     1231         } 
     1232    } 
    11671233 
    11681234    if( p_aout == NULL )