%% 'enum' for Enumeration Class Parameter Mapping
% The following class definitions comprise a simple example of enumeration parameter mapping for properties defined by an enumeration class. You can specify the operating mode of the plugin created from this class by tuning the Mode parameter.
%
% Plugin Class Definition
% classdef pluginWithEnumMapping < audioPlugin
%     properties
%         Mode = OperatingMode.boost;
%     end
%     properties (Constant)
%         PluginInterface = audioPluginInterface(...
%             audioPluginParameter('Mode',...
%                 'Mapping',{'enum','+6 dB','-6 dB','silence','white noise'}));
%     end
%     methods
%         function out = process(plugin,in)
%             switch (plugin.Mode)
%                 case OperatingMode.boost
%                     out = in * 2;
%                 case OperatingMode.cut
%                     out = in / 2;
%                 case OperatingMode.mute
%                     out = zeros(size(in));
%                 case OperatingMode.noise
%                     out = rand(size(in)) - 0.5;
%                 otherwise
%                     out = in;
%             end
%         end
%     end
% end
%
% Enumeration Class Definition
% classdef OperatingMode < int8
%     enumeration
%         boost (0)
%         cut   (1)
%         mute  (2)
%         noise (3)
%     end
% end
%
% To run the plugin, save the plugin and enumeration class definition files to a local folder. Then call the Audio Test Bench on the plugin class.

audioTestBench(pluginWithEnumMapping)

%
% Copyright 2012 The MathWorks, Inc.