Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. ////// dbus-service
  2. [DBus (name = "org.mpris.MediaPlayer2.Player")]
  3. public class MprisPlayer : GLib.Object {
  4. ....
  5. public int64 position {
  6. get {
  7. ///// запрашивает единожды и потом возвращает одно и тоже значение. Почему?
  8. return player.position / Constants.MILI_INV;
  9. }
  10. }
  11. ....
  12. }
  13. ///////
  14. public class Player : GLib.Object {
  15. public int64 position {
  16. set {
  17. playbin.seek_simple (fmt, Gst.SeekFlags.FLUSH, value);
  18. }
  19. get {
  20. int64 d = 0;
  21. playbin.query_position (fmt, out d);
  22. return d;
  23. }
  24. }
  25. }
  26. //////// dbus-client
  27. [DBus (name="org.mpris.MediaPlayer2.Player")]
  28. public interface PlayerIface : MprisIface {
  29. public abstract int64 position { get; }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement