annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirdata/set.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function a = set(a,varargin)
Daniel@0 2 % SET Set properties for the MIRdata object
Daniel@0 3 % and return the updated object
Daniel@0 4
Daniel@0 5 propertyArgIn = varargin;
Daniel@0 6 while length(propertyArgIn) >= 2,
Daniel@0 7 prop = propertyArgIn{1};
Daniel@0 8 val = propertyArgIn{2};
Daniel@0 9 propertyArgIn = propertyArgIn(3:end);
Daniel@0 10 switch prop
Daniel@0 11 case 'Pos'
Daniel@0 12 a.pos = val;
Daniel@0 13 case {'Data','ChunkData'}
Daniel@0 14 if strcmp(prop,'ChunkData')
Daniel@0 15 val = {{val}};
Daniel@0 16 end
Daniel@0 17 a.data = val;
Daniel@0 18 case 'Unit'
Daniel@0 19 a.unit = val;
Daniel@0 20 case 'FramePos'
Daniel@0 21 a.framepos = val;
Daniel@0 22 case 'Sampling'
Daniel@0 23 a.sr = val;
Daniel@0 24 case 'NBits'
Daniel@0 25 a.nbits = val;
Daniel@0 26 case 'Name'
Daniel@0 27 a.name = val;
Daniel@0 28 case 'Name2'
Daniel@0 29 a.name2 = val;
Daniel@0 30 case 'Label'
Daniel@0 31 a.label = val;
Daniel@0 32 case 'Channels'
Daniel@0 33 a.channels = val;
Daniel@0 34 case 'Clusters'
Daniel@0 35 a.clusters = val;
Daniel@0 36 case 'MultiData'
Daniel@0 37 a.multidata = val;
Daniel@0 38 case 'Title'
Daniel@0 39 a.title = val;
Daniel@0 40 case 'Abs'
Daniel@0 41 a.abs = val;
Daniel@0 42 case 'Ord'
Daniel@0 43 a.ord = val;
Daniel@0 44 case 'PeakPos'
Daniel@0 45 a.peak.pos = val;
Daniel@0 46 case 'PeakVal'
Daniel@0 47 a.peak.val = val;
Daniel@0 48 case 'PeakPrecisePos'
Daniel@0 49 a.peak.precisepos = val;
Daniel@0 50 case 'PeakPreciseVal'
Daniel@0 51 a.peak.preciseval = val;
Daniel@0 52 case 'PeakMode'
Daniel@0 53 a.peak.mode = val;
Daniel@0 54 case 'AttackPos'
Daniel@0 55 a.attack.pos = val;
Daniel@0 56 case 'ReleasePos'
Daniel@0 57 a.release.pos = val;
Daniel@0 58 case 'TrackPos'
Daniel@0 59 a.track.pos = val;
Daniel@0 60 case 'TrackVal'
Daniel@0 61 a.track.val = val;
Daniel@0 62 case 'TrackPrecisePos'
Daniel@0 63 a.track.precisepos = val;
Daniel@0 64 case 'TrackPreciseVal'
Daniel@0 65 a.track.preciseval = val;
Daniel@0 66 case 'InterChunk'
Daniel@0 67 a.interchunk = val;
Daniel@0 68 case 'TmpIdx'
Daniel@0 69 a.tmpidx = val;
Daniel@0 70 case 'AcrossChunks'
Daniel@0 71 a.acrosschunks = val;
Daniel@0 72 case 'Interpolable'
Daniel@0 73 a.interpolable = val;
Daniel@0 74 case 'TmpFile'
Daniel@0 75 a.tmpfile = val;
Daniel@0 76 case 'Index'
Daniel@0 77 a.index = val;
Daniel@0 78 otherwise
Daniel@0 79 error(['Unknown MIRdata property: ' prop])
Daniel@0 80 end
Daniel@0 81 end