Exemplo n.º 1
0
        public void Open(IPlayerUserControl _owner, string _file, bool _autoPlay = true)
        {
            if (_ExclusiveLock)
            {
                return;
            }

            Close();
            _ExclusiveOwner = _owner;
            _ExclusiveFile  = _file;

            _ExclusiveAudioPlayer.Open(_file);
            if (_ExclusiveOwner != null)
            {
                _ExclusiveOwner.OnOpen();
            }
            if (_autoPlay && _ExclusiveAudioPlayer.bFileIsOpen)
            {
                _ExclusiveAudioPlayer.Play();
                if (_ExclusiveOwner != null)
                {
                    _ExclusiveOwner.OnPlay();
                }
            }
        }
Exemplo n.º 2
0
 public void Play()
 {
     if (_ExclusiveAudioPlayer.bFileIsOpen)
     {
         if (_ExclusiveAudioPlayer.Pause)
         {
             _ExclusiveAudioPlayer.Pause = false;
             if (_ExclusiveOwner != null)
             {
                 _ExclusiveOwner.OnPlay();
             }
         }
         else
         {
             _ExclusiveAudioPlayer.Play();
             if (_ExclusiveOwner != null)
             {
                 _ExclusiveOwner.OnPause();
             }
         }
         //_ExclusiveAudioPlayer.Pause = false;
     }
 }