Changeset 2b6826a13d9179d4d30e05efc75692b9ffa29516

Show
Ignore:
Timestamp:
25/08/05 21:57:12 (3 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1124999832 +0000
git-parent:

[246584f554dbd84ef00a88ddb4bc6a824cb20f95]

git-author:
Clément Stenac <zorglub@videolan.org> 1124999832 +0000
Message:

Add new spectrum analyzer effect, patch from zcot.
Remove the "random" effect

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/visualization/visual/effects.c

    rfe087a3 r2b6826a  
    322322 
    323323/***************************************************************************** 
     324 * spectrometer_Run: derivative spectrum analysis 
     325 *****************************************************************************/ 
     326int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout, 
     327                 aout_buffer_t * p_buffer , picture_t * p_picture) 
     328{ 
     329#define Y(R,G,B) ((uint8_t)( (R * .299) + (G * .587) + (B * .114) )) 
     330#define U(R,G,B) ((uint8_t)( (R * -.169) + (G * -.332) + (B * .500) + 128 )) 
     331#define V(R,G,B) ((uint8_t)( (R * .500) + (G * -.419) + (B * -.0813) + 128 )) 
     332    float p_output[FFT_BUFFER_SIZE];  /* Raw FFT Result  */ 
     333    int *height;                      /* Bar heights */ 
     334    int *peaks;                       /* Peaks */ 
     335    int i_nb_bands;                   /* number of bands */ 
     336    int i_band_width;                 /* width of bands */ 
     337    int i_separ;                      /* Should we let blanks ? */ 
     338    int i_amp;                        /* Vertical amplification */ 
     339    int i_peak;                       /* Should we draw peaks ? */ 
     340 
     341    int i_original;          /* original spectrum graphic routine */ 
     342    int i_rad;               /* radius of circle of base of bands */ 
     343    int i_sections;          /* sections of spectranalysis */ 
     344    int i_extra_width;       /* extra width on peak */ 
     345    int i_peak_height;       /* height of peak */ 
     346    int c;                   /* sentinel container of total spectral sections */ 
     347    double band_sep_angle;   /* angled separation between beginning of each band */ 
     348    double section_sep_angle;/* "   "    '     "    '    "     "    spectrum section */ 
     349    int max_band_length;     /* try not to go out of screen */ 
     350    int i_show_base;         /* Should we draw base of circle ? */ 
     351    int i_show_bands;        /* Should we draw bands ? */ 
     352    //int i_invert_bands;      /* do the bands point inward ? */ 
     353    double a;                /* for various misc angle situations in radians */ 
     354    int x,y,xx,yy;           /* various misc x/y */ 
     355    char color1;             /* V slide on a YUV color cube */ 
     356    //char color2;             /* U slide.. ?  color2 fade color ? */ 
     357 
     358    char *psz_parse = NULL;           /* Args line */ 
     359 
     360    /* Horizontal scale for 20-band equalizer */ 
     361    const int xscale1[]={0,1,2,3,4,5,6,7,8,11,15,20,27, 
     362                        36,47,62,82,107,141,184,255}; 
     363 
     364    /* Horizontal scale for 80-band equalizer */ 
     365    const int xscale2[] = 
     366    {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 
     367     19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34, 
     368     35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51, 
     369     52,53,54,55,56,57,58,59,61,63,67,72,77,82,87,93,99,105, 
     370     110,115,121,130,141,152,163,174,185,200,255}; 
     371    const int *xscale; 
     372    const double y_scale =  3.60673760222;  /* (log 256) */ 
     373 
     374    fft_state *p_state;                 /* internal FFT data */ 
     375 
     376    int i , j , k; 
     377    int i_line; 
     378    int16_t p_dest[FFT_BUFFER_SIZE];      /* Adapted FFT result */ 
     379    int16_t p_buffer1[FFT_BUFFER_SIZE];   /* Buffer on which we perform 
     380                                             the FFT (first channel) */ 
     381    i_line = 0; 
     382 
     383    float *p_buffl =                     /* Original buffer */ 
     384            (float*)p_buffer->p_buffer; 
     385 
     386    int16_t  *p_buffs;                    /* int16_t converted buffer */ 
     387    int16_t  *p_s16_buff = NULL;                /* int16_t converted buffer */ 
     388 
     389    p_s16_buff = (int16_t*)malloc( 
     390              p_buffer->i_nb_samples * p_effect->i_nb_chans * sizeof(int16_t)); 
     391 
     392    if( !p_s16_buff ) 
     393    { 
     394        msg_Err(p_aout,"Out of memory"); 
     395        return -1; 
     396    } 
     397 
     398    p_buffs = p_s16_buff; 
     399    //i_nb_bands = config_GetInt ( p_aout, "visual-nbbands" ); 
     400    //i_separ    = config_GetInt( p_aout, "visual-separ" ); 
     401    //i_amp     = config_GetInt ( p_aout, "visual-amp" ); 
     402    //i_peak     = config_GetInt ( p_aout, "visual-peaks" ); 
     403    /* previous 4 vars changed.. using them as `spect' variables */ 
     404    i_original     = config_GetInt ( p_aout, "spect-show-original" ); 
     405    i_nb_bands     = config_GetInt ( p_aout, "spect-nbbands" ); 
     406    i_separ        = config_GetInt ( p_aout, "spect-separ" ); 
     407    i_amp          = config_GetInt ( p_aout, "spect-amp" ); 
     408    i_peak         = config_GetInt ( p_aout, "spect-show-peaks" ); 
     409    i_show_base    = config_GetInt ( p_aout, "spect-show-base" ); 
     410    i_show_bands   = config_GetInt ( p_aout, "spect-show-bands" ); 
     411    i_rad          = config_GetInt ( p_aout, "spect-radius" ); 
     412    i_sections     = config_GetInt ( p_aout, "spect-sections" ); 
     413    i_extra_width  = config_GetInt ( p_aout, "spect-peak-width" ); 
     414    i_peak_height  = config_GetInt ( p_aout, "spect-peak-height" ); 
     415    color1         = config_GetInt ( p_aout, "spect-color" ); 
     416 
     417    if( i_nb_bands == 20) 
     418    { 
     419        xscale = xscale1; 
     420    } 
     421    else 
     422    { 
     423        i_nb_bands = 80; 
     424        xscale = xscale2; 
     425    } 
     426    i_nb_bands *= i_sections; 
     427    /* whoops, dont malloc the following memory for all the duplicated bands.. 
     428        -only the original 20 or 80 will be fine */ 
     429 
     430    if( !p_effect->p_data ) 
     431    { 
     432        p_effect->p_data=(void *)malloc(i_nb_bands * sizeof(int) ); 
     433        if( !p_effect->p_data) 
     434        { 
     435            msg_Err(p_aout,"Out of memory"); 
     436            return -1; 
     437        } 
     438        peaks = (int *)p_effect->p_data; 
     439        for( i = 0 ; i < i_nb_bands ; i++) 
     440        { 
     441           peaks[i] = 0; 
     442        } 
     443    } 
     444    else 
     445    { 
     446        peaks =(int *)p_effect->p_data; 
     447    } 
     448 
     449 
     450    height = (int *)malloc( i_nb_bands * sizeof(int) ); 
     451    if( !height) 
     452    { 
     453        msg_Err(p_aout,"Out of memory"); 
     454        return -1; 
     455    } 
     456    /* Convert the buffer to int16_t  */ 
     457    /* Pasted from float32tos16.c */ 
     458    for (i = p_buffer->i_nb_samples * p_effect->i_nb_chans; i--; ) 
     459    { 
     460        union { float f; int32_t i; } u; 
     461        u.f = *p_buffl + 384.0; 
     462        if(u.i >  0x43c07fff ) * p_buffs = 32767; 
     463        else if ( u.i < 0x43bf8000 ) *p_buffs = -32768; 
     464        else *p_buffs = u.i - 0x43c00000; 
     465 
     466        p_buffl++ ; p_buffs++ ; 
     467    } 
     468    p_state  = visual_fft_init(); 
     469    if( !p_state) 
     470    { 
     471        msg_Err(p_aout,"Unable to initialize FFT transform"); 
     472        return -1; 
     473    } 
     474    p_buffs = p_s16_buff; 
     475    for ( i = 0 ; i < FFT_BUFFER_SIZE ; i++) 
     476    { 
     477        p_output[i]    = 0; 
     478        p_buffer1[i] = *p_buffs; 
     479        p_buffs      = p_buffs + p_effect->i_nb_chans; 
     480    } 
     481    fft_perform( p_buffer1, p_output, p_state); 
     482    for(i= 0; i< FFT_BUFFER_SIZE ; i++ ) 
     483        p_dest[i] = ( (int) sqrt( p_output [ i + 1 ] ) ) >> 8; 
     484 
     485    for ( i = 0 ; i< i_nb_bands/i_sections ;i++) 
     486    { 
     487        /* We search the maximum on one scale */ 
     488        for( j = xscale[i] , y=0 ; j< xscale[ i + 1 ] ; j++ ) 
     489        { 
     490            if ( p_dest[j] > y ) 
     491                 y = p_dest[j]; 
     492        } 
     493        /* Calculate the height of the bar */ 
     494        y >>=7;/* remove some noise */ 
     495        if( y != 0) 
     496        { 
     497            height[i] = (int)log(y)* y_scale; 
     498               if(height[i] > 150) 
     499                  height[i] = 150; 
     500        } 
     501        else 
     502        { 
     503            height[i] = 0 ; 
     504        } 
     505 
     506        /* Draw the bar now */ 
     507        i_band_width = floor( p_effect->i_width / (i_nb_bands/i_sections)) ; 
     508 
     509        if( i_amp * height[i] > peaks[i]) 
     510        { 
     511            peaks[i] = i_amp * height[i]; 
     512        } 
     513        else if (peaks[i] > 0 ) 
     514        { 
     515            peaks[i] -= PEAK_SPEED; 
     516            if( peaks[i] < i_amp * height[i] ) 
     517            { 
     518                peaks[i] = i_amp * height[i]; 
     519            } 
     520            if( peaks[i] < 0 ) 
     521            { 
     522                peaks[i] = 0; 
     523            } 
     524        } 
     525 
     526        if( i_original != 0 ) 
     527        { 
     528        if( peaks[i] > 0 && i_peak ) 
     529        { 
     530            if( peaks[i] >= p_effect->i_height ) 
     531                peaks[i] = p_effect->i_height - 2; 
     532            i_line = peaks[i]; 
     533 
     534            for( j = 0 ; j< i_band_width - i_separ; j++) 
     535            { 
     536               for( k = 0 ; k< 3 ; k ++) 
     537               { 
     538                   //* Draw the peak  
     539                     *(p_picture->p[0].p_pixels + 
     540                    (p_picture->p[0].i_lines - i_line -1 -k ) * 
     541                     p_picture->p[0].i_pitch + (i_band_width*i +j) ) 
     542                                    = 0xff; 
     543 
     544                    *(p_picture->p[1].p_pixels + 
     545                     (p_picture->p[1].i_lines - i_line /2 -1 -k/2 ) * 
     546                     p_picture->p[1].i_pitch + 
     547                    ( ( i_band_width * i + j ) /2  ) ) 
     548                                    = 0x00; 
     549 
     550                   if( 0x04 * (i_line + k ) - 0x0f > 0 ) 
     551                   { 
     552                       if ( 0x04 * (i_line + k ) -0x0f < 0xff) 
     553                           *(p_picture->p[2].p_pixels  + 
     554                            (p_picture->p[2].i_lines - i_line /2 - 1 -k/2 ) * 
     555                             p_picture->p[2].i_pitch + 
     556                             ( ( i_band_width * i + j ) /2  ) ) 
     557                                    = ( 0x04 * ( i_line + k ) ) -0x0f ; 
     558                       else 
     559                           *(p_picture->p[2].p_pixels  + 
     560                            (p_picture->p[2].i_lines - i_line /2 - 1 -k/2 ) * 
     561                             p_picture->p[2].i_pitch + 
     562                             ( ( i_band_width * i + j ) /2  ) ) 
     563                                    = 0xff; 
     564                   } 
     565                   else 
     566                   { 
     567                        *(p_picture->p[2].p_pixels  + 
     568                         (p_picture->p[2].i_lines - i_line /2 - 1 -k/2 ) * 
     569                         p_picture->p[2].i_pitch + 
     570                         ( ( i_band_width * i + j ) /2  ) ) 
     571                               = 0x10 ; 
     572                   } 
     573               } 
     574            } 
     575        } 
     576        if(height[i] * i_amp > p_effect->i_height) 
     577            height[i] = floor(p_effect->i_height / i_amp ); 
     578 
     579        for(i_line = 0 ; i_line < i_amp * height[i]; i_line ++ ) 
     580        { 
     581            for( j = 0 ; j< i_band_width - i_separ ; j++) 
     582            { 
     583               *(p_picture->p[0].p_pixels + 
     584                 (p_picture->p[0].i_lines - i_line -1) * 
     585                  p_picture->p[0].i_pitch + (i_band_width*i +j) ) = 0xff; 
     586 
     587                *(p_picture->p[1].p_pixels + 
     588                 (p_picture->p[1].i_lines - i_line /2 -1) * 
     589                 p_picture->p[1].i_pitch + 
     590                 ( ( i_band_width * i + j ) /2  ) ) = 0x00; 
     591 
     592               if( 0x04 * i_line - 0x0f > 0 ) 
     593               { 
     594                    if( 0x04 * i_line - 0x0f < 0xff ) 
     595                         *(p_picture->p[2].p_pixels  + 
     596                          (p_picture->p[2].i_lines - i_line /2 - 1) * 
     597                           p_picture->p[2].i_pitch + 
     598                           ( ( i_band_width * i + j ) /2  ) ) = 
     599                               ( 0x04 * i_line) -0x0f ; 
     600                    else 
     601                         *(p_picture->p[2].p_pixels  + 
     602                          (p_picture->p[2].i_lines - i_line /2 - 1) * 
     603                           p_picture->p[2].i_pitch + 
     604                           ( ( i_band_width * i + j ) /2  ) ) = 
     605                                       0xff; 
     606               } 
     607               else 
     608               { 
     609                    *(p_picture->p[2].p_pixels  + 
     610                     (p_picture->p[2].i_lines - i_line /2 - 1) * 
     611                     p_picture->p[2].i_pitch + 
     612                     ( ( i_band_width * i + j ) /2  ) ) = 
     613                            0x10 ; 
     614               } 
     615            } 
     616        } 
     617        } 
     618    } 
     619 
     620    band_sep_angle = 360.0 / i_nb_bands; 
     621    section_sep_angle = 360.0 / i_sections; 
     622    if( i_peak_height < 1 ) 
     623        i_peak_height = 1; 
     624    max_band_length = p_picture->p[0].i_lines / 2 - ( i_rad + i_peak_height + 1 ); 
     625 
     626    i_band_width = floor( 360 / i_nb_bands - i_separ ); 
     627    if( i_band_width < 1 ) 
     628        i_band_width = 1; 
     629 
     630    for( c = 0 ; c < i_sections ; c++ ) 
     631    for( i = 0 ; i < (i_nb_bands / i_sections) ; i++ ) 
     632    { 
     633        /* DO A PEAK */ 
     634        if( peaks[i] > 0 && i_peak ) 
     635        { 
     636            if( peaks[i] >= p_effect->i_height ) 
     637                peaks[i] = p_effect->i_height - 2; 
     638            i_line = peaks[i]; 
     639 
     640            /* circular line pattern(so color blend is more visible) */ 
     641            for( j = 0 ; j < i_peak_height ; j++ ) 
     642            { 
     643                x = p_picture->p[0].i_pitch / 2; 
     644                y = p_picture->p[0].i_lines / 2; 
     645                xx = x; 
     646                yy = y; 
     647                for( k = 0 ; k < (i_band_width + i_extra_width) ; k++ ) 
     648                { 
     649                    x = xx; 
     650                    y = yy; 
     651                    a = ( (i+1) * band_sep_angle + section_sep_angle * (c+1) + k ) 
     652                        * 3.141592 / 180.0; 
     653                    x += (double)( cos(a) * (double)( i_line + j + i_rad ) ); 
     654                    y += (double)( -sin(a) * (double)( i_line + j + i_rad ) ); 
     655 
     656                    *(p_picture->p[0].p_pixels + x + y * p_picture->p[0].i_pitch 
     657                    ) = 255;/* Y(R,G,B); */ 
     658 
     659                    x /= 2; 
     660                    y /= 2; 
     661 
     662                    *(p_picture->p[1].p_pixels + x + y * p_picture->p[1].i_pitch 
     663                    - p_picture->p[1].i_pitch 
     664                    ) = 0;/* U(R,G,B); */ 
     665 
     666                    if( 0x04 * (i_line + k ) - 0x0f > 0 ) 
     667                    { 
     668                        if ( 0x04 * (i_line + k ) -0x0f < 0xff) 
     669                            *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
     670                            - p_picture->p[2].i_pitch 
     671                            ) = ( 0x04 * ( i_line + k ) ) -(color1-1);/* -V(R,G,B); */ 
     672                        else 
     673                            *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
     674                            - p_picture->p[2].i_pitch 
     675                            ) = 255;/* V(R,G,B); */ 
     676                    } 
     677                    else 
     678                    { 
     679                        *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
     680                        - p_picture->p[2].i_pitch 
     681                        ) = color1;/* V(R,G,B); */ 
     682                    } 
     683                } 
     684            } 
     685        } 
     686 
     687        if( (height[i] * i_amp) > p_effect->i_height ) 
     688            height[i] = floor( p_effect->i_height / i_amp ); 
     689 
     690        /* DO BASE OF BAND (mostly makes a circle) */ 
     691        if( i_show_base != 0 ) 
     692        { 
     693            x = p_picture->p[0].i_pitch / 2; 
     694            y = p_picture->p[0].i_lines / 2; 
     695 
     696            a =  ( (i+1) * band_sep_angle + section_sep_angle * (c+1) ) 
     697                * 3.141592 / 180.0; 
     698            x += (double)( cos(a) * (double)i_rad );/* newb-forceful casting */ 
     699            y += (double)( -sin(a) * (double)i_rad ); 
     700 
     701            *(p_picture->p[0].p_pixels + x + y * p_picture->p[0].i_pitch 
     702            ) = 255;/* Y(R,G,B); */ 
     703 
     704            x /= 2; 
     705            y /= 2; 
     706 
     707            *(p_picture->p[1].p_pixels + x + y * p_picture->p[1].i_pitch 
     708            - p_picture->p[1].i_pitch 
     709            ) = 0;/* U(R,G,B); */ 
     710 
     711            if( 0x04 * i_line - 0x0f > 0 ) 
     712            { 
     713                if( 0x04 * i_line -0x0f < 0xff) 
     714                    *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
     715                    - p_picture->p[2].i_pitch 
     716                    ) = ( 0x04 * i_line) -(color1-1);/* -V(R,G,B); */ 
     717                else 
     718                    *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
     719                    - p_picture->p[2].i_pitch 
     720                    ) = 255;/* V(R,G,B); */ 
     721            } 
     722            else 
     723            { 
     724                *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
     725                - p_picture->p[2].i_pitch 
     726                ) = color1;/* V(R,G,B); */ 
     727            } 
     728        } 
     729 
     730        /* DO A BAND */ 
     731        if( i_show_bands != 0 ) 
     732        for( j = 0 ; j < i_band_width ; j++ ) 
     733        { 
     734            x = p_picture->p[0].i_pitch / 2; 
     735            y = p_picture->p[0].i_lines / 2; 
     736            xx = x; 
     737            yy = y; 
     738            a = ( (i+1) * band_sep_angle + section_sep_angle * (c+1) + j ) 
     739                * 3.141592/180.0; 
     740 
     741            for( k = (i_rad+1) ; k < max_band_length ; k++ ) 
     742            { 
     743                if( (k-i_rad) > height[i] ) 
     744                    break;/* uhh.. */ 
     745 
     746                x = xx; 
     747                y = yy; 
     748                x += (double)( cos(a) * (double)k );/* newbed! */ 
     749                y += (double)( -sin(a) * (double)k ); 
     750 
     751                *(p_picture->p[0].p_pixels + x + y * p_picture->p[0].i_pitch 
     752                ) = 255; 
     753 
     754                x /= 2; 
     755                y /= 2; 
     756 
     757                *(p_picture->p[1].p_pixels + x + y * p_picture->p[1].i_pitch 
     758                - p_picture->p[1].i_pitch 
     759                ) = 0; 
     760 
     761                if( 0x04 * i_line - 0x0f > 0 ) 
     762                { 
     763                    if ( 0x04 * i_line -0x0f < 0xff) 
     764                        *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
     765                        - p_picture->p[2].i_pitch 
     766                        ) = ( 0x04 * i_line) -(color1-1); 
     767                    else 
     768                        *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
     769                        - p_picture->p[2].i_pitch 
     770                        ) = 255; 
     771                } 
     772                else 
     773                { 
     774                    *(p_picture->p[2].p_pixels + x + y * p_picture->p[2].i_pitch 
     775                    - p_picture->p[2].i_pitch 
     776                    ) = color1; 
     777                } 
     778            } 
     779        } 
     780    } 
     781 
     782    fft_close( p_state ); 
     783 
     784    if( p_s16_buff != NULL ) 
     785    { 
     786        free( p_s16_buff ); 
     787        p_s16_buff = NULL; 
     788    } 
     789 
     790    if(height) free(height); 
     791 
     792    if(psz_parse) free(psz_parse); 
     793 
     794    return 0; 
     795} 
     796 
     797 
     798/***************************************************************************** 
    324799 * scope_Run: scope effect 
    325800 *****************************************************************************/ 
     
    373848        } 
    374849        return 0; 
    375 } 
    376  
    377  
    378 /***************************************************************************** 
    379  * random_Run:  random plots display effect 
    380  *****************************************************************************/ 
    381 int random_Run(visual_effect_t * p_effect, aout_instance_t *p_aout, 
    382               aout_buffer_t * p_buffer , picture_t * p_picture) 
    383 { 
    384     int i_nb_plots; 
    385     char *psz_parse= NULL; 
    386     int i , i_y , i_u , i_v; 
    387     int i_position; 
    388     srand((unsigned int)mdate()); 
    389  
    390     if( p_effect->psz_args ) 
    391     { 
    392         psz_parse = strdup( p_effect->psz_args ); 
    393         i_nb_plots = config_GetInt ( p_aout, "visual-stars" ); 
    394     } 
    395     else 
    396     { 
    397         i_nb_plots = 200; 
    398     } 
    399  
    400     for( i = 0 ; i < i_nb_plots ; i++ ) 
    401     { 
    402         i_position = rand() % (p_effect->i_width * p_effect->i_height ); 
    403         i_y = rand() % 256; 
    404         i_u = rand() % 256; 
    405         i_v = rand() % 256; 
    406         *(p_picture->p[0].p_pixels + i_position )= i_u; 
    407         *(p_picture->p[1].p_pixels + i_position/4) = i_v; 
    408         *(p_picture->p[2].p_pixels + i_position/4) = i_y; 
    409     } 
    410     return 0; 
    411850} 
    412851 
  • modules/visualization/visual/visual.c

    rfe087a3 r2b6826a  
    3939#define ELIST_LONGTEXT N_( \ 
    4040      "A list of visual effect, separated by commas.\n"  \ 
    41       "Current effects include: dummy, random, scope, spectrum" ) 
     41      "Current effects include: dummy, scope, spectrum" ) 
    4242 
    4343#define WIDTH_TEXT N_( "Video width" ) 
     
    6464#define PEAKS_LONGTEXT N_( \ 
    6565        "Defines whether to draw peaks." ) 
     66 
     67#define ORIG_TEXT N_( "Enable original graphic spectrum" ) 
     68#define ORIG_LONGTEXT N_( \ 
     69        "Defines whether to draw the original spectrum graphic routine." ) 
     70 
     71#define BANDS_TEXT N_( "Enable bands" ) 
     72#define BANDS_LONGTEXT N_( \ 
     73        "Defines whether to draw the bands." ) 
     74 
     75#define BASE_TEXT N_( "Enable base" ) 
     76#define BASE_LONGTEXT N_( \ 
     77        "Defines whether to draw the base of the bands." ) 
     78 
     79#define RADIUS_TEXT N_( "Base pixel radius" ) 
     80#define RADIUS_LONGTEXT N_( \ 
     81        "Defines radius size in pixels, of base of bands(beginning)." ) 
     82 
     83#define SECT_TEXT N_( "Spectral sections" ) 
     84#define SECT_LONGTEXT N_( \ 
     85        "Determines how many sections of spectrum will exist." ) 
     86 
     87#define PEAK_HEIGHT_TEXT N_( "Peak height" ) 
     88#define PEAK_HEIGHT_LONGTEXT N_( \ 
     89        "This is the total pixel height of the peak items." ) 
     90 
     91#define PEAK_WIDTH_TEXT N_( "Peak extra width" ) 
     92#define PEAK_WIDTH_LONGTEXT N_( \ 
     93        "Additions or subtractions of pixels on the peak width." ) 
     94 
     95#define COLOR1_TEXT N_( "V-plane color" ) 
     96#define COLOR1_LONGTEXT N_( \ 
     97        "YUV-Color cube shifting across the V-plane ( 0 - 127 )." ) 
    6698 
    6799#define STARS_TEXT N_( "Number of stars" ) 
     
    93125    add_bool("visual-peaks", VLC_TRUE, NULL, 
    94126             PEAKS_TEXT, PEAKS_LONGTEXT, VLC_TRUE ); 
    95     set_section( N_( "Random effect") , NULL ); 
    96     add_integer("visual-stars", 200, NULL, 
    97              STARS_TEXT, STARS_LONGTEXT, VLC_TRUE ); 
     127    set_section( N_("Spectrometer") , NULL ); 
     128    add_bool("spect-show-original", VLC_TRUE, NULL, 
     129             ORIG_TEXT, ORIG_LONGTEXT, VLC_TRUE ); 
     130    add_bool("spect-show-base", VLC_TRUE, NULL, 
     131             BASE_TEXT, BASE_LONGTEXT, VLC_TRUE ); 
     132    add_integer("spect-radius", 22, NULL, 
     133             RADIUS_TEXT, RADIUS_LONGTEXT, VLC_TRUE ); 
     134    add_integer("spect-sections", 2, NULL, 
     135             SECT_TEXT, SECT_LONGTEXT, VLC_TRUE ); 
     136    add_integer("spect-color", 16, NULL, 
     137             COLOR1_TEXT, COLOR1_LONGTEXT, VLC_TRUE ); 
     138    add_bool("spect-show-bands", VLC_TRUE, NULL, 
     139             BANDS_TEXT, BANDS_LONGTEXT, VLC_TRUE ); 
     140    add_integer("spect-nbbands", 80, NULL, 
     141             NBBANDS_TEXT, NBBANDS_LONGTEXT, VLC_TRUE ); 
     142    add_integer("spect-separ", 1, NULL, 
     143             SEPAR_TEXT, SEPAR_LONGTEXT, VLC_TRUE ); 
     144    add_integer("spect-amp", 3, NULL, 
     145             AMP_TEXT, AMP_LONGTEXT, VLC_TRUE ); 
     146    add_bool("spect-show-peaks", VLC_TRUE, NULL, 
     147             PEAKS_TEXT, PEAKS_LONGTEXT, VLC_TRUE ); 
     148    add_integer("spect-peak-width", 1, NULL, 
     149             PEAK_WIDTH_TEXT, PEAK_WIDTH_LONGTEXT, VLC_TRUE ); 
     150    add_integer("spect-peak-height", 1, NULL, 
     151             PEAK_HEIGHT_TEXT, PEAK_HEIGHT_LONGTEXT, VLC_TRUE ); 
    98152    set_capability( "visualization", 0 ); 
    99153    set_callbacks( Open, Close ); 
     
    118172    { "scope",      scope_Run }, 
    119173    { "spectrum",   spectrum_Run }, 
    120     { "random",     random_Run}, 
     174    { "spectrometer",   spectrometer_Run }, 
    121175    { "dummy",      dummy_Run}, 
    122176    { NULL,         dummy_Run} 
     
    164218    psz_parser = psz_effects = strdup( val.psz_string ); 
    165219    free( val.psz_string ); 
    166     msg_Dbg( p_filter , "Building list of effects" ); 
    167      
     220 
    168221    var_AddCallback( p_filter, "effect-list", FilterCallback, NULL ); 
    169222 
  • modules/visualization/visual/visual.h

    rfe087a3 r2b6826a  
    6262int spectrum_Run 
    6363        (visual_effect_t * , aout_instance_t *, aout_buffer_t *, picture_t *); 
     64int spectrometer_Run 
     65        (visual_effect_t * , aout_instance_t *, aout_buffer_t *, picture_t *); 
    6466#if 0 
    6567int blur_Run 
     
    6870 
    6971/* Default vout size */ 
    70 #define VOUT_WIDTH 320 
    71 #define VOUT_HEIGHT 12
     72#define VOUT_WIDTH 533 
     73#define VOUT_HEIGHT 40
  • src/audio_output/input.c

    rfe087a3 r2b6826a  
    108108        val.psz_string = ""; text.psz_string = _("Disable"); 
    109109        var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text ); 
    110         val.psz_string = "random"; text.psz_string = _("Random"); 
     110        val.psz_string = "spectrometer"; text.psz_string = _("Spectrometer"); 
    111111        var_Change( p_aout, "visual", VLC_VAR_ADDCHOICE, &val, &text ); 
    112112        val.psz_string = "scope"; text.psz_string = _("Scope");