Home > database > set_stim_col_const.m

set_stim_col_const

PURPOSE ^

Figures out which data columns correspond to different database fields in the stimulus table

SYNOPSIS ^

function SD = set_stim_col_const(var_list);

DESCRIPTION ^

 Figures out which data columns correspond to different database fields in the stimulus table

 var_list is a cell string containing field names
 SD is a structure with constants (column ids) assigned for the following
 fields:

 STIM_ID -- stimulus ID
 NAME -- stimulus name
 DESC -- stimulus description
 ARTIST -- artist
 ALBUM -- album
 GENRE -- genre
 FORMAT -- file format
 SIZE -- file size
 DURATION -- duration of file HH:MM:SS
 YEAR -- year of recording
 BIT_RATE -- compression bit rate
 SAMPRATE -- sampling rate
 SAMPSIZE -- number of bits per sample?
 CHANS -- number of channels
 FNAME -- path to file

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function SD = set_stim_col_const(var_list);
0002 % Figures out which data columns correspond to different database fields in the stimulus table
0003 %
0004 % var_list is a cell string containing field names
0005 % SD is a structure with constants (column ids) assigned for the following
0006 % fields:
0007 %
0008 % STIM_ID -- stimulus ID
0009 % NAME -- stimulus name
0010 % DESC -- stimulus description
0011 % ARTIST -- artist
0012 % ALBUM -- album
0013 % GENRE -- genre
0014 % FORMAT -- file format
0015 % SIZE -- file size
0016 % DURATION -- duration of file HH:MM:SS
0017 % YEAR -- year of recording
0018 % BIT_RATE -- compression bit rate
0019 % SAMPRATE -- sampling rate
0020 % SAMPSIZE -- number of bits per sample?
0021 % CHANS -- number of channels
0022 % FNAME -- path to file
0023 
0024 nvars = length(var_list);
0025 
0026 FD = struct(...
0027     'STIM_ID',[], ...
0028     'NAME',[], ...
0029     'DESC',[], ...
0030     'ARTIST',[], ...
0031     'ALBUM',[], ...
0032     'GENRE',[], ...
0033     'FORMAT',[], ...
0034     'SIZE',[], ...
0035     'DURATION',[], ...
0036     'YEAR',[], ...
0037     'BIT_RATE',[], ...
0038     'SAMPRATE',[], ...
0039     'SAMPSIZE', [], ...
0040     'CHANS', [], ...
0041     'FNAME', [] ...
0042     );
0043 
0044 for ivar = 1:nvars
0045   switch var_list{ivar}
0046     case 'stimulus_id'
0047       SD.STIM_ID = ivar;
0048     
0049     case 'name'
0050       SD.NAME = ivar;
0051       
0052     case 'description'
0053       SD.DESC = ivar;
0054       
0055     case 'artist'
0056       SD.ARTIST = ivar;
0057       
0058     case 'album'
0059       SD.ALBUM = ivar;
0060 
0061     case 'genre'
0062       SD.GENRE = ivar;
0063     
0064     case 'file_format'
0065       SD.FORMAT = ivar;
0066     
0067     case 'size'
0068       SD.SIZE = ivar;
0069     
0070     case 'duration'
0071       SD.DURATION = ivar;
0072     
0073     case 'year'
0074       SD.YEAR = ivar;
0075     
0076     case 'compression_bit_rate'
0077       SD.BIT_RATE = ivar;
0078     
0079     case 'sample_rate'
0080       SD.SAMPRATE = ivar;
0081     
0082     case 'sample_size'
0083       SD.SAMPSIZE = ivar;
0084     
0085     case 'channels'
0086       SD.CHANS = ivar;
0087     
0088     case 'location'
0089       SD.FNAME = ivar;
0090   
0091   end % switch
0092 end % for ivar
0093 
0094 return

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003