comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirdata/set.m @ 0:e9a9cd732c1e tip

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