• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MediaEngine.PlayerEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ProcessEvent

 public void ProcessEvent(PlayerEventArgs args, TrackInfo track, uint pos, uint len)
 {
     switch(args.Event) {
     case PlayerEvent.StateChange:
         StateChange((PlayerEventStateChangeArgs)args, track, pos, len);
         break;
     case PlayerEvent.TrackInfoUpdated:
         UpdateTrack(track, pos, len);
         break;
     case PlayerEvent.Iterate:
         UpdatePosition(pos, len);
         break;
     }
 }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:14,代码来源:LCDParser.cs


示例2: OnPlayerEvent

 private void OnPlayerEvent (PlayerEventArgs args)
 {
     switch (args.Event) {
         case PlayerEvent.StartOfStream:
         case PlayerEvent.TrackInfoUpdated:
             player.AddPropertyChange (PlayerProperties.Metadata);
             break;
         case PlayerEvent.StateChange:
             player.AddPropertyChange (PlayerProperties.PlaybackStatus);
             break;
         case PlayerEvent.Seek:
             player.HandleSeek ();
             break;
         case PlayerEvent.Volume:
             player.AddPropertyChange (PlayerProperties.Volume);
             break;
     }
 }
开发者ID:petejohanson,项目名称:banshee,代码行数:18,代码来源:MprisService.cs


示例3: OnPlayerEvent

        /// <summary>
        /// Callback for when player events occur
        /// </summary>
        /// <param name='args'>Event arguments</param>
        public void OnPlayerEvent(PlayerEventArgs args)
        {
            // Check what type of event it was - We need to know if playback
            // was stopped or started.
            switch (args.Event)
            {
                case PlayerEvent.StartOfStream:
                case PlayerEvent.TrackInfoUpdated:
                    UpdateStatus();
                    break;

                case PlayerEvent.EndOfStream:
                    OnStop();
                    break;

                case PlayerEvent.StateChange:
                    OnPlayerStateChange((PlayerEventStateChangeArgs)args);
                    break;
            }
        }
开发者ID:Daniel15,项目名称:Banshee-StatusUpdater,代码行数:24,代码来源:StatusUpdaterService.cs


示例4: OnPlayerEvent

        private void OnPlayerEvent (PlayerEventArgs args)
        {
            if (args.Event == PlayerEvent.EndOfStream) {
                // If EoS is for the last track in the play queue
                if (this == ServiceManager.PlaybackController.Source &&
                    TrackModel.IndexOf (current_track) == Count - 1) {
                    SetCurrentTrack (null);
                    UpdatePlayQueue ();
                    if (was_playing) {
                        ServiceManager.PlaybackController.PriorTrack = prior_playback_track;
                    } else {
                        // Stop playback; nothing was playing before the play queue, so it doesn't
                        // make sense to continue playback.
                        ServiceManager.PlaybackController.StopWhenFinished = true;
                    }
                }

                if (ServiceManager.PlaybackController.StopWhenFinished) {
                    if (current_track != null && this == ServiceManager.PlaybackController.Source) {
                        int index = TrackModel.IndexOf (current_track) + 1;
                        SetCurrentTrack (index < Count ? TrackModel[index] as DatabaseTrackInfo : null);
                    }
                }
            } else if (args.Event == PlayerEvent.StartOfStream) {
                if (TrackModel.IndexOf (ServiceManager.PlayerEngine.CurrentTrack) != -1) {
                    SetCurrentTrack (ServiceManager.PlayerEngine.CurrentTrack as DatabaseTrackInfo);
                    SetAsPlaybackSourceUnlessPlaying ();
                    UpdatePlayQueue ();
                } else {
                    prior_playback_track = ServiceManager.PlayerEngine.CurrentTrack;
                }
            }
        }
开发者ID:petejohanson,项目名称:banshee,代码行数:33,代码来源:PlayQueueSource.cs


示例5: OnEngineEventChanged

        private void OnEngineEventChanged(PlayerEventArgs args)
        {
            if (CurrentTrack != null) {
                if (args.Event == PlayerEvent.Error
                    && CurrentTrack.PlaybackError == StreamPlaybackError.None) {
                    CurrentTrack.SavePlaybackError (StreamPlaybackError.Unknown);
                } else if (args.Event == PlayerEvent.Iterate
                    && CurrentTrack.PlaybackError != StreamPlaybackError.None) {
                    CurrentTrack.SavePlaybackError (StreamPlaybackError.None);
                }
            }

            if (args.Event == PlayerEvent.StartOfStream) {
                incremented_last_played = false;
            } else if (args.Event == PlayerEvent.EndOfStream) {
                IncrementLastPlayed ();
            }

            RaiseEvent (args);

            // Do not raise iterate across DBus to avoid so many calls;
            // DBus clients should do their own iterating and
            // event/state checking locally
            if (args.Event == PlayerEvent.Iterate) {
                return;
            }

            DBusPlayerEventHandler dbus_handler = dbus_event_changed;
            if (dbus_handler != null) {
                dbus_handler (args.Event.ToString ().ToLower (),
                    args is PlayerEventErrorArgs ? ((PlayerEventErrorArgs)args).Message : String.Empty,
                    args is PlayerEventBufferingArgs ? ((PlayerEventBufferingArgs)args).Progress : 0
                );
            }
        }
开发者ID:dufoli,项目名称:banshee,代码行数:35,代码来源:PlayerEngineService.cs


示例6: OnPlayerEvent

        private void OnPlayerEvent(PlayerEventArgs args)
        {
            switch (args.Event) {
                case PlayerEvent.StartOfStream:
                case PlayerEvent.TrackInfoUpdated:
                    current_track = ServiceManager.PlayerEngine.CurrentTrack;
                    ToggleRatingMenuSensitive ();
                    ShowTrackNotification ();
                    break;
                case PlayerEvent.StateChange:
                    UpdateActions ();
                    break;
                case PlayerEvent.EndOfStream:
                    current_track = null;
                    ToggleRatingMenuSensitive ();
                    break;
            }

            if (notif_area != null) {
                notif_area.OnPlayerEvent (args);
            }
        }
开发者ID:knocte,项目名称:banshee,代码行数:22,代码来源:NotificationAreaService.cs


示例7: OnEndOfStream

 /// <summary>
 /// Handles EndOfStream events and stops recording
 /// </summary>
 /// <param name="args">
 /// A <see cref="PlayerEventArgs"/>
 /// </param>
 private void OnEndOfStream(PlayerEventArgs args)
 {
     if (recording) {
         StopRecording ();
     }
 }
开发者ID:dgupta,项目名称:banshee-community-extension-fakefork-,代码行数:12,代码来源:StreamrecorderService.cs


示例8: OnStateChange

 /// <summary>
 /// Handles Player state changes and Stops recording if appropriate
 /// </summary>
 /// <param name="args">
 /// A <see cref="PlayerEventArgs"/>
 /// </param>
 private void OnStateChange(PlayerEventArgs args)
 {
     if (ServiceManager.PlayerEngine.CurrentState == PlayerState.Idle && recording) {
         StopRecording ();
     }
 }
开发者ID:dgupta,项目名称:banshee-community-extension-fakefork-,代码行数:12,代码来源:StreamrecorderService.cs


示例9: OnPlayerEvent

        private void OnPlayerEvent(PlayerEventArgs args)
        {
            parser.ProcessEvent(args,
                ServiceManager.PlayerEngine.CurrentTrack,
                ServiceManager.PlayerEngine.Position,
                ServiceManager.PlayerEngine.Length);

            if (args.Event == PlayerEvent.StateChange)
            {
                switch(((PlayerEventStateChangeArgs)args).Current)
                {
                case PlayerState.NotReady:
                case PlayerState.Ready:
                case PlayerState.Idle:
                case PlayerState.Contacting:
                case PlayerState.Loading:
                case PlayerState.Loaded:
                    idlescreen.prio = LCDScreen.Prio.Foreground;
                    lcdclient.UpdScreen(idlescreen);
                    foreach(LCDScreen screen in userscreens.Keys)
                    {
                        screen.prio = LCDScreen.Prio.Hidden;
                        lcdclient.UpdScreen(screen);
                    }
                    break;
                case PlayerState.Playing:
                case PlayerState.Paused:
                    idlescreen.prio = LCDScreen.Prio.Hidden;
                    lcdclient.UpdScreen(idlescreen);
                    foreach(LCDScreen screen in userscreens.Keys)
                    {
                        screen.prio = LCDScreen.Prio.Foreground;
                        lcdclient.UpdScreen(screen);
                    }
                    break;
                }
            }
            lcdclient.UpdWidgetsAll(parser);
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:39,代码来源:LCDService.cs


示例10: RaiseEventChanged

 private void RaiseEventChanged (PlayerEventArgs args)
 {
     PlayerEventHandler handler = EventChanged;
     if (handler != null) {
         handler (args);
     }
 }
开发者ID:allquixotic,项目名称:banshee-gst-sharp-work,代码行数:7,代码来源:PlayerEngine.cs


示例11: OnPlayerEvent

        private void OnPlayerEvent (PlayerEventArgs args)
        {
            switch (args.Event) {
                case PlayerEvent.StartOfStream:
                    CurrentTrack = player_engine.CurrentTrack;
                    consecutive_errors = 0;
                    break;
                case PlayerEvent.EndOfStream:
                    EosTransition ();
                    break;
                case PlayerEvent.Error:
                    if (++consecutive_errors >= 5) {
                        consecutive_errors = 0;
                        player_engine.Close (false);
                        OnStopped ();
                        break;
                    }

                    CancelErrorTransition ();
                    // TODO why is this so long? any reason not to be instantaneous?
                    error_transition_id = Application.RunTimeout (250, delegate {
                        EosTransition ();
                        RequestTrackHandler ();
                        return true;
                    });
                    break;
                case PlayerEvent.StateChange:
                    if (((PlayerEventStateChangeArgs)args).Current != PlayerState.Loading) {
                        break;
                    }

                    TrackInfo track = player_engine.CurrentTrack;
                    if (changing_to_track != track && track != null) {
                        CurrentTrack = track;
                    }

                    changing_to_track = null;

                    if (!raise_started_after_transition) {
                        transition_track_started = false;
                        OnTrackStarted ();
                    } else {
                        transition_track_started = true;
                    }
                    break;
                case PlayerEvent.RequestNextTrack:
                    RequestTrackHandler ();
                    break;
            }
        }
开发者ID:gclark916,项目名称:banshee,代码行数:50,代码来源:PlaybackControllerService.cs


示例12: OnEventChanged

        protected virtual void OnEventChanged(PlayerEventArgs args)
        {
            if (args.Event == PlayerEvent.StartOfStream && pending_track != null) {
                Log.DebugFormat ("OnEventChanged called with StartOfStream.  Replacing current_track with pending_track: \"{0}\"",
                                 pending_track.DisplayTrackTitle);
                CurrentTrackTimeStamp = DateTime.Now;
                current_track = pending_track;
                pending_track = null;
            }

            ThreadAssist.ProxyToMain (() => RaiseEventChanged (args));
        }
开发者ID:ptrimble,项目名称:banshee,代码行数:12,代码来源:PlayerEngine.cs


示例13: OnEventChanged

        protected virtual void OnEventChanged (PlayerEventArgs args)
        {
            if (args.Event == PlayerEvent.StartOfStream && pending_track != null) {
                Log.DebugFormat ("OnEventChanged called with StartOfStream.  Replacing current_track with pending_track: \"{0}\"",
                                 pending_track.DisplayTrackTitle);
                current_track = pending_track;
                current_uri = pending_uri;
                pending_track = null;
                pending_uri = null;
            }

            if (ThreadAssist.InMainThread) {
                RaiseEventChanged (args);
            } else {
                ThreadAssist.ProxyToMain (delegate {
                    RaiseEventChanged (args);
                });
            }
        }
开发者ID:allquixotic,项目名称:banshee-gst-sharp-work,代码行数:19,代码来源:PlayerEngine.cs


示例14: playerEvent_Handler

        void playerEvent_Handler(PlayerEventArgs e)
        {
            if(e.Event == PlayerEvent.StartOfStream && current_track != ServiceManager.PlaybackController.CurrentTrack)
            {
                try {
                    if (current_track != null) {
                        StopTrack (current_track);
                    }

                    Log.Debug("TrackStarted: "+ServiceManager.PlaybackController.CurrentTrack.TrackTitle);
                    Event ev = CreateZgEvent (ServiceManager.PlaybackController.CurrentTrack, Interpretation.Instance.EventInterpretation.AccessEvent);
                    client.InsertEvents (new List<Event> () {ev});

                    current_track = ServiceManager.PlaybackController.CurrentTrack;
                } catch (Exception ex) {
                    Log.Exception (ex);
                }
            }
        }
开发者ID:dgupta,项目名称:banshee-community-extension-fakefork-,代码行数:19,代码来源:ZeitgeistDataprovider.cs


示例15: OnPlayerEvent

 private void OnPlayerEvent(PlayerEventArgs args)
 {
     ToggleVideoVisibility ();
 }
开发者ID:abock,项目名称:cubano,代码行数:4,代码来源:NowPlayingStage.cs


示例16: OnTrackInfoUpdated

 private void OnTrackInfoUpdated(PlayerEventArgs args)
 {
     CheckForSwitch ();
 }
开发者ID:stsundermann,项目名称:cubano,代码行数:4,代码来源:NowPlayingSource.cs


示例17: RaiseEvent

        private void RaiseEvent(PlayerEventArgs args)
        {
            lock (event_handlers) {
                if (args.Event == PlayerEvent.StateChange && args is PlayerEventStateChangeArgs) {
                    HandleStateChange ((PlayerEventStateChangeArgs)args);
                }

                LinkedListNode<PlayerEventHandlerSlot> node = event_handlers.First;
                while (node != null) {
                    if ((node.Value.EventMask & args.Event) == args.Event) {
                        try {
                            node.Value.Handler (args);
                        } catch (Exception e) {
                            Log.Exception (String.Format ("Error running PlayerEngine handler for {0}", args.Event), e);
                        }
                    }
                    node = node.Next;
                }
            }
        }
开发者ID:dufoli,项目名称:banshee,代码行数:20,代码来源:PlayerEngineService.cs


示例18: OnPlayerEvent

        private void OnPlayerEvent(PlayerEventArgs args)
        {
            if (((PlayerEventStateChangeArgs)args).Current == PlayerState.Loaded &&
                track_model.Contains (ServiceManager.PlayerEngine.CurrentTrack)) {
                CurrentTrack = ServiceManager.PlayerEngine.CurrentTrack;

                lock (track_model) {
                    // Remove all but 5 played or skipped tracks
                    if (current_track > 5) {
                        for (int i = 0; i < (current_track - 5); i++) {
                            track_model.Remove (track_model[0]);
                        }
                        current_track = 5;
                    }

                    // Set all previous tracks as CanPlay = false
                    foreach (TrackInfo track in track_model) {
                        if (track == CurrentTrack)
                            break;
                        if (track.CanPlay) {
                            track.CanPlay = false;
                        }
                    }
                    OnUpdated ();
                }

                if (TracksLeft <= 2) {
                    Refresh ();
                }
            }
        }
开发者ID:knocte,项目名称:banshee,代码行数:31,代码来源:StationSource.cs


示例19: OnPlayerEvent

        private void OnPlayerEvent(PlayerEventArgs args)
        {
            book_track = ServiceManager.PlayerEngine.CurrentTrack as DatabaseTrackInfo;
            if (book_track == null || book_track.PrimarySourceId != this.DbId) {
                book_track = null;
            }

            switch (args.Event) {
                case PlayerEvent.StartOfStream:
                    if (book_track != null) {
                        StartTimeout ();

                        if (PlaybackSource.Book == null || PlaybackSource.Book.DbId != book_track.AlbumId) {
                            PlaybackSource.Book = DatabaseAlbumInfo.Provider.FetchSingle (book_track.AlbumId);
                        }

                        if (book_track.CacheModelId != PlaybackSource.DatabaseTrackModel.CacheId) {
                            var index = PlaybackSource.DatabaseTrackModel.IndexOfFirst (book_track);
                            if (index >= 0) {
                                ServiceManager.PlaybackController.PriorTrack = PlaybackSource.TrackModel [index];
                            } else {
                                Log.Error ("Audiobook track started, but couldn't find in the Audiobook.PlaybackSource");
                            }
                        }
                    }
                    break;
                case PlayerEvent.EndOfStream:
                    StopTimeout ();
                    break;
                case PlayerEvent.Seek:
                    UpdateLastPlayed ();
                    break;
            }
        }
开发者ID:knocte,项目名称:banshee,代码行数:34,代码来源:AudiobookLibrarySource.cs


示例20: OnPlayerEvent

 private void OnPlayerEvent(PlayerEventArgs args)
 {
     if (ContactContainerSource.ShareCurrentlyPlayingSchema.Get ()) {
         switch (args.Event) {
             case PlayerEvent.StartOfStream:
                 //AnnounceTrack (ServiceManager.PlayerEngine.CurrentTrack);
                 break;
             case PlayerEvent.StateChange:
                 PlayerEventStateChangeArgs state = args as PlayerEventStateChangeArgs;
                 if (state != null) {
                     switch (state.Current) {
                         case PlayerState.Paused:
                             announcer.Announce (String.Empty);
                             break;
                         case PlayerState.Playing:
                             AnnounceTrack (ServiceManager.PlayerEngine.CurrentTrack);
                             break;
                     }
                 }
                 break;
         }
     }
 }
开发者ID:nloko,项目名称:banshee-telepathy-extension,代码行数:23,代码来源:TelepathyActions.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BaseDatos.SentenciaSQL类代码示例发布时间:2022-05-24
下一篇:
C# Database.DatabaseTrackInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap