当前位置: 首页>>代码示例>>C#>>正文


C# MediaState类代码示例

本文整理汇总了C#中MediaState的典型用法代码示例。如果您正苦于以下问题:C# MediaState类的具体用法?C# MediaState怎么用?C# MediaState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MediaState类属于命名空间,在下文中一共展示了MediaState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MediaEngine_MediaStateChanged

        private void MediaEngine_MediaStateChanged(MediaState state)
        {
            switch (state)
            {
                case MediaState.Loading:
                    this.PlaybackState = PlaybackState.Loading;

                    break;

                case MediaState.Stopped:
                    this.PlaybackState = PlaybackState.Paused;

                    break;

                case MediaState.Playing:
                    this.PlaybackState = PlaybackState.Playing;
                    break;

                case MediaState.Error:
                    this.PlaybackState = PlaybackState.Error_MediaInvalid;
                    break;

                case MediaState.Ended:
                    this.PlaybackState = PlaybackState.Ended;
                    break;
            }
        }
开发者ID:codekaizen,项目名称:internetradio,代码行数:27,代码来源:MediaEnginePlaybackManager.cs

示例2: Sound

        public Sound(Game game)
        {
            this.game = game;

            music = new Music();
            soundEffect = new SoundEffect();
            state = new MediaState();
        }
开发者ID:pedert,项目名称:XNA_4_GameOfThreetards,代码行数:8,代码来源:Sound.cs

示例3: pauseSoundButton_Click

 private void pauseSoundButton_Click(object sender, RoutedEventArgs e)
 {
     if (state == MediaState.Playing)
     {
         state = MediaState.Paused;
         myMediaElement.Pause();
     }
 }
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:8,代码来源:MainPage.xaml.cs

示例4: playSoundButton_Click

 private void playSoundButton_Click(object sender, RoutedEventArgs e)
 {
     if ((state == MediaState.Stopped) || (state == MediaState.Paused))
     {
         state = MediaState.Playing;
         myMediaElement.Play();
     }
 }
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:8,代码来源:MainPage.xaml.cs

示例5: Pause

        public static void Pause()
        {
			if (_song != null)
			{
				_song.Pause();
				_mediaState = MediaState.Paused;
			}			
        }
开发者ID:adison,项目名称:Tank-Wars,代码行数:8,代码来源:MediaPlayer.cs

示例6: Resume

        public static void Resume()
        {
			if (_song != null)
			{
				_song.Resume();
				_mediaState = MediaState.Playing;
			}					
        }
开发者ID:adison,项目名称:Tank-Wars,代码行数:8,代码来源:MediaPlayer.cs

示例7: VideoPlayer

        public VideoPlayer()
        {
			_state = MediaState.Stopped;
			_game = Game.Instance;
            _platform = (iOSGamePlatform)_game.Services.GetService(typeof(iOSGamePlatform));
            if (_platform == null)
                throw new InvalidOperationException("No iOSGamePlatform instance was available");
        }
开发者ID:patrickdenglerhobbisoft,项目名称:PimpIOs,代码行数:8,代码来源:VideoPlayer.cs

示例8: stopSoundButton_Click

 private void stopSoundButton_Click(object sender, RoutedEventArgs e)
 {
     if (state == MediaState.Playing)
     {
         state = MediaState.Stopped;
         myMediaElement.Stop();
     }
 }
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:8,代码来源:MainPage.xaml.cs

示例9: OnStateChanged

 protected override void OnStateChanged(MediaState state)
 {
     if (state == MediaState.End) return;
     if (Album != null)
         Album.State = State;
     foreach (var artist in Artists)
         artist.State = state;
 }
开发者ID:Colliotv,项目名称:WMediaPlayer,代码行数:8,代码来源:Track.cs

示例10: GetTexture

        /*
        public Texture2D GetTexture()
        {
			// Coming Soon
			throw new NotImplementedException();
			// TODO when Xamarin implement the relevant functions return currentFrame;
        }
        */

        public void Pause()
        {
			if (_video != null )
			{
				_video.MovieView.Pause(new NSObject());
				_state = MediaState.Paused;
			}
        }
开发者ID:Breadmouth,项目名称:Gravitas,代码行数:17,代码来源:VideoPlayer.cs

示例11: playVideoButton_Click

 private void playVideoButton_Click(object sender, RoutedEventArgs e)
 {
     if ((state == MediaState.Stopped) || (state == MediaState.Paused))
     {
         myMediaElement.Source = new Uri("ms-appx:///Assets/video.mp4", UriKind.RelativeOrAbsolute);
         state = MediaState.Playing;
         myMediaElement.Play();
     }
 }
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:9,代码来源:MainPage.xaml.cs

示例12: Play

        public static void Play(Song song)
        {
			if ( song != null )
			{
				_song = song;
				_song.Volume = _volume;
				_song.Loop = _looping;
				_song.Play();
				_mediaState = MediaState.Playing;
			}
        }
开发者ID:ValXp,项目名称:MonoGame,代码行数:11,代码来源:MediaPlayer.cs

示例13: UmdDevice

        public UmdDevice( IEmulationInstance emulator, ComponentParameters parameters )
        {
            //Debug.Assert( emulator != null );
            Debug.Assert( parameters != null );

            _emulator = emulator;
            _parameters = parameters;

            _state = MediaState.Ejected;

            _lbnLookup = new Dictionary<long, MediaFile>( 1024 );
        }
开发者ID:BradFuller,项目名称:pspplayer,代码行数:12,代码来源:UmdDevice.cs

示例14: initValue

 public async void initValue()
 {
     musicList.Clear();
     await getFiles(musicList, folder);
     STT = 0;
     musicProperties = null;
     stream = null;
     state = MediaState.STOP;
     pb = Playback.ORDER;
     rp = Repeat.ALL;
     nof = NumOfLoad.FIRST;
 }
开发者ID:sikyurabmt,项目名称:HQL,代码行数:12,代码来源:MusicManager.cs

示例15: SetVideoPlayerState

        public void SetVideoPlayerState(MediaState state)
        {
            switch(state)
            {
                case MediaState.Paused:
                    {
                        this._VideoPlayer.Pause();
                        break;
                    }

                case MediaState.Stopped:
                    {
                        this._VideoPlayer.Stop();
                        break;
                    }

                default:
                    break;
            }
        }
开发者ID:vu159951,项目名称:d-r-a-g-o-n-b-a-l-l-c-h-a-o-s,代码行数:20,代码来源:MyVideoPlayer.cs


注:本文中的MediaState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。