Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • rubygem-release
  • otovar/update-dind-image-to-20.10
  • bwill-master-patch-09156
  • test-disable-dangerbot
  • v15_wip-fix-conflicts
  • add_length_validation_for_link_attributes
  • bwill/remove-cluster-image-scanning
  • gonzoyumo-master-patch-54421
  • sethgitlab-api-fuzzing
  • required-properties-bug
  • update_dast_discovered_at_format_339629
  • cs-image-name
  • 300198-remove-sha-secret-detection
  • fix-common-version
  • adds_generic_security_report_schema
  • add-scan-configuration
  • add-vulnerabilities-scanner-module
  • rdickenson-1
  • fix-readme-testing
  • v15.2.1 protected
  • v15.2.0 protected
  • v15.1.4 protected
  • v15.1.3 protected
  • v15.1.2 protected
  • v15.1.1 protected
  • v15.1.0 protected
  • v15.0.7 protected
  • v15.0.6 protected
  • v15.0.5 protected
  • v15.0.4 protected
  • v15.0.2 protected
  • v15.0.1 protected
  • v15.0.0 protected
  • v14.1.3 protected
  • v14.1.2 protected
  • v14.1.1 protected
  • v14.1.0 protected
  • v14.0.6 protected
  • v14.0.5 protected
40 results

dist

  • Clone with SSH
  • Clone with HTTPS
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Name Last commit Last update
    ..
    examples
    src
    .gitignore
    COPYING
    Cargo.toml
    README.md

    mpvipc

    A small library which provides bindings to control existing mpv instances through sockets.

    To make use of this library, please make sure mpv is started with the following option: $ mpv --input-ipc-server=/tmp/mpv --idle # Linux $ mpv --input-ipc-server=\\.\mpv --idle # Windows

    Dependencies

    • mpv
    • cargo (makedep)

    Install

    You can use this package with cargo.

    Example

    Make sure mpv is started with the following option: $ mpv --input-ipc-server=/tmp/mpv --idle # Linux $ mpv --input-ipc-server=\\.\mpv --idle # Windows

    Here is a small code example which connects to the socket /tmp/mpv.sock and toggles playback.

    extern crate mpvipc;
    
    use mpvipc::*;
    use std::sync::mpsc::channel;
    
    #[cfg(unix)]
    const SOCKET: &str = "/tmp/mpv";
    
    #[cfg(windows)]
    const SOCKET: &str = r"\\.\mpv";
    
    fn main() {
        let mpv = Mpv::connect(SOCKET).unwrap();
        let paused: bool = mpv.get_property("pause").unwrap();
        mpv.set_property("pause", !paused).expect("Error pausing");
    }

    For a more extensive example and proof of concept, see project mpvc.

    Bugs / Ideas

    Check out the Issue Tracker