annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirchromagram/set.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function cc = set(c,varargin)
wolffd@0 2 % SET Set properties for the MIRchromagram object
wolffd@0 3 % and return the updated object
wolffd@0 4
wolffd@0 5 propertyArgIn = varargin;
wolffd@0 6 pl = c.plabel;
wolffd@0 7 wr = c.wrap;
wolffd@0 8 cl = c.chromaclass;
wolffd@0 9 cf = c.chromafreq;
wolffd@0 10 or = c.register;
wolffd@0 11 d = mirdata(c);
wolffd@0 12 d = set(d,'Title',get(c,'Title'),'Abs',get(c,'Abs'),'Ord',get(c,'Ord'));
wolffd@0 13 while length(propertyArgIn) >= 2,
wolffd@0 14 prop = propertyArgIn{1};
wolffd@0 15 val = propertyArgIn{2};
wolffd@0 16 propertyArgIn = propertyArgIn(3:end);
wolffd@0 17 switch prop
wolffd@0 18 case 'Magnitude'
wolffd@0 19 d = set(d,'Data',val);
wolffd@0 20 case 'Chroma'
wolffd@0 21 d = set(d,'Pos',val);
wolffd@0 22 case 'ChromaClass'
wolffd@0 23 cl = val;
wolffd@0 24 case 'ChromaFreq'
wolffd@0 25 cf = val;
wolffd@0 26 case 'Register'
wolffd@0 27 or = val;
wolffd@0 28 case 'PitchLabel'
wolffd@0 29 pl = val;
wolffd@0 30 case 'Wrap'
wolffd@0 31 wr = val;
wolffd@0 32 otherwise
wolffd@0 33 d = set(d,prop,val);
wolffd@0 34 end
wolffd@0 35 end
wolffd@0 36 cc.plabel = pl;
wolffd@0 37 cc.wrap = wr;
wolffd@0 38 cc.chromaclass = cl;
wolffd@0 39 cc.chromafreq = cf;
wolffd@0 40 cc.register = or;
wolffd@0 41 cc = class(cc,'mirchromagram',d);