public void Run() { IMediaFormatProvider mediaFormat = DetermineMediaFormat(RequestModel); List <IMediaFilterProvider> filters = GetFilters(RequestModel); switch (RequestModel.ActionToPerform) { case ActionToPerform.Play: ICommand playCommand = new Play(mediaFormat, filters); _commands.Add(playCommand); playCommand.Execute(RequestModel); break; case ActionToPerform.Decompress: ICommand deCompressCommand = new Decompress(mediaFormat); _commands.Add(deCompressCommand); deCompressCommand.Execute(RequestModel); break; default: throw new ArgumentException("This function is not yet supported by MyMediaPlayer."); } }
public Decompress(IMediaFormatProvider mediaFormat) { _mediaFormat = mediaFormat ?? throw new ArgumentNullException("Media Format cannot be NULL."); }
public Play(IMediaFormatProvider mediaFormat, List <IMediaFilterProvider> filters) { _mediaFormat = mediaFormat ?? throw new ArgumentNullException("Media Format cannot be NULL."); _filters = filters; }