Exemple #1
0
        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.");
            }
        }
Exemple #2
0
 public Decompress(IMediaFormatProvider mediaFormat)
 {
     _mediaFormat = mediaFormat ?? throw new ArgumentNullException("Media Format cannot be NULL.");
 }
Exemple #3
0
 public Play(IMediaFormatProvider mediaFormat, List <IMediaFilterProvider> filters)
 {
     _mediaFormat = mediaFormat ?? throw new ArgumentNullException("Media Format cannot be NULL.");
     _filters     = filters;
 }