├── .gitignore ├── .travis.yml ├── Cargo.toml ├── README.md ├── Cargo.lock └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | ### Rust template 2 | # Compiled files 3 | *.o 4 | *.so 5 | *.rlib 6 | *.dll 7 | 8 | # Executables 9 | *.exe 10 | 11 | # Generated by Cargo 12 | /target/ 13 | /out/ 14 | 15 | # Created by .ignore support plugin (hsz.mobi) 16 | 17 | *.iml 18 | .idea 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | rust: 3 | - stable 4 | - beta 5 | - nightly 6 | 7 | cache: 8 | directories: 9 | - $HOME/.cargo 10 | - $TRAVIS_BUILD_DIR/target 11 | 12 | script: 13 | - cargo build 14 | 15 | os: 16 | - linux 17 | - osx 18 | 19 | notifications: 20 | email: 21 | on_success: never 22 | 23 | branches: 24 | only: 25 | - master 26 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-caster" 3 | version = "0.16.0" 4 | authors = ["Aleh Zasypkin "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | ansi_term = "0.12.1" 9 | docopt = "1.1.0" 10 | env_logger = "0.8.2" 11 | log = "0.4.11" 12 | rust_cast = { version = "0.16.0", features = ["thread_safe"] } 13 | serde = "1.0.118" 14 | serde_derive = "1.0.118" 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | __IMPORTANT:__ This repository is no longer maintained since the tool has been merged to the [Rust Cast](https://github.com/azasypkin/rust-cast) repository as the example. 2 | 3 | -------------- 4 | 5 | # Rust Caster 6 | 7 | [![Build Status](https://travis-ci.org/azasypkin/rust-caster.svg?branch=master)](https://travis-ci.org/azasypkin/rust-caster) 8 | 9 | Just a helper tool for [Rust Cast](https://github.com/azasypkin/rust-cast) crate. 10 | 11 | ## Usage 12 | 13 | ### Generic features 14 | To get the address of the device you can use `avahi` with the following command: 15 | ```bash 16 | $ avahi-browse -a --resolve 17 | ``` 18 | 19 | ```bash 20 | // Get some info about the Google Cast enabled device (e.g. Chromecast). 21 | $ cargo run -- -a 192.168.0.100 -i 22 | 23 | Number of apps run: 1 24 | App#0: Default Media Receiver (CC1AD845) 25 | Volume level: 1 26 | Muted: false 27 | 28 | // Run specific app on the Chromecast. 29 | $ cargo run -- -a 192.168.0.100 -r youtube 30 | 31 | // Stop specific active app. 32 | $ cargo run -- -a 192.168.0.100 -s youtube 33 | 34 | // Stop currently active app. 35 | $ cargo run -- -a 192.168.0.100 --stop-current 36 | 37 | The following app has been stopped: Default Media Receiver (CC1AD845) 38 | ``` 39 | 40 | ### Media features 41 | ```bash 42 | // Stream a video. 43 | $ cargo run -- -a 192.168.0.100 -m http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 44 | 45 | // Stream a video of specific format with buffering. 46 | $ cargo run -- -a 192.168.0.100 -m http://xxx.webm --media-type video/webm --media-stream-type buffered 47 | 48 | // Stream video from YouTube. 49 | $ cargo run -- -a 192.168.0.100 -m 7LcUOEP7Brc --media-app youtube 50 | 51 | // Display an image. 52 | $ cargo run -- -a 192.168.0.100 -m https://azasypkin.github.io/style-my-image/images/mozilla.jpg 53 | 54 | // Change volume level. 55 | $ cargo run -- -a 192.168.0.100 --media-volume 0.5 56 | 57 | // Mute/unmute media. 58 | $ cargo run -- -a 192.168.0.100 --media-mute [--media-unmute] 59 | 60 | // Pause media. 61 | $ cargo run -- -a 192.168.0.100 --media-app youtube --media-pause 62 | 63 | // Resume/play media. 64 | $ cargo run -- -a 192.168.0.100 --media-app youtube --media-play 65 | 66 | // Seek media. 67 | $ cargo run -- -a 192.168.0.100 --media-app youtube --media-seek 100 68 | ``` 69 | 70 | For all possible values of `--media-type` see [Supported Media for Google Cast](https://developers.google.com/cast/docs/media). -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "aho-corasick" 5 | version = "0.7.15" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" 8 | dependencies = [ 9 | "memchr", 10 | ] 11 | 12 | [[package]] 13 | name = "ansi_term" 14 | version = "0.12.1" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 17 | dependencies = [ 18 | "winapi", 19 | ] 20 | 21 | [[package]] 22 | name = "atty" 23 | version = "0.2.14" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 26 | dependencies = [ 27 | "hermit-abi", 28 | "libc", 29 | "winapi", 30 | ] 31 | 32 | [[package]] 33 | name = "autocfg" 34 | version = "1.0.1" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 37 | 38 | [[package]] 39 | name = "bitflags" 40 | version = "1.2.1" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 43 | 44 | [[package]] 45 | name = "byteorder" 46 | version = "1.4.2" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" 49 | 50 | [[package]] 51 | name = "cc" 52 | version = "1.0.66" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" 55 | 56 | [[package]] 57 | name = "cfg-if" 58 | version = "0.1.10" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 61 | 62 | [[package]] 63 | name = "cfg-if" 64 | version = "1.0.0" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 67 | 68 | [[package]] 69 | name = "docopt" 70 | version = "1.1.0" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "7f525a586d310c87df72ebcd98009e57f1cc030c8c268305287a476beb653969" 73 | dependencies = [ 74 | "lazy_static", 75 | "regex", 76 | "serde", 77 | "strsim", 78 | ] 79 | 80 | [[package]] 81 | name = "env_logger" 82 | version = "0.8.2" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" 85 | dependencies = [ 86 | "atty", 87 | "humantime", 88 | "log", 89 | "regex", 90 | "termcolor", 91 | ] 92 | 93 | [[package]] 94 | name = "foreign-types" 95 | version = "0.3.2" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 98 | dependencies = [ 99 | "foreign-types-shared", 100 | ] 101 | 102 | [[package]] 103 | name = "foreign-types-shared" 104 | version = "0.1.1" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 107 | 108 | [[package]] 109 | name = "getrandom" 110 | version = "0.1.16" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 113 | dependencies = [ 114 | "cfg-if 1.0.0", 115 | "libc", 116 | "wasi", 117 | ] 118 | 119 | [[package]] 120 | name = "hermit-abi" 121 | version = "0.1.17" 122 | source = "registry+https://github.com/rust-lang/crates.io-index" 123 | checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" 124 | dependencies = [ 125 | "libc", 126 | ] 127 | 128 | [[package]] 129 | name = "humantime" 130 | version = "2.0.1" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a" 133 | 134 | [[package]] 135 | name = "itoa" 136 | version = "0.4.7" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" 139 | 140 | [[package]] 141 | name = "lazy_static" 142 | version = "1.4.0" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 145 | 146 | [[package]] 147 | name = "libc" 148 | version = "0.2.82" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" 151 | 152 | [[package]] 153 | name = "log" 154 | version = "0.4.11" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 157 | dependencies = [ 158 | "cfg-if 0.1.10", 159 | ] 160 | 161 | [[package]] 162 | name = "memchr" 163 | version = "2.3.4" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" 166 | 167 | [[package]] 168 | name = "openssl" 169 | version = "0.10.32" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "038d43985d1ddca7a9900630d8cd031b56e4794eecc2e9ea39dd17aa04399a70" 172 | dependencies = [ 173 | "bitflags", 174 | "cfg-if 1.0.0", 175 | "foreign-types", 176 | "lazy_static", 177 | "libc", 178 | "openssl-sys", 179 | ] 180 | 181 | [[package]] 182 | name = "openssl-sys" 183 | version = "0.9.60" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "921fc71883267538946025deffb622905ecad223c28efbfdef9bb59a0175f3e6" 186 | dependencies = [ 187 | "autocfg", 188 | "cc", 189 | "libc", 190 | "pkg-config", 191 | "vcpkg", 192 | ] 193 | 194 | [[package]] 195 | name = "pkg-config" 196 | version = "0.3.19" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" 199 | 200 | [[package]] 201 | name = "ppv-lite86" 202 | version = "0.2.10" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 205 | 206 | [[package]] 207 | name = "proc-macro2" 208 | version = "1.0.24" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" 211 | dependencies = [ 212 | "unicode-xid", 213 | ] 214 | 215 | [[package]] 216 | name = "protobuf" 217 | version = "2.20.0" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "86473d5f16580f10b131a0bf0afb68f8e029d1835d33a00f37281b05694e5312" 220 | 221 | [[package]] 222 | name = "protobuf-codegen" 223 | version = "2.20.0" 224 | source = "registry+https://github.com/rust-lang/crates.io-index" 225 | checksum = "c8b6ba4581fcd9c3ce3576f25e528467b0d3516e332884c0da6f2084fe59045f" 226 | dependencies = [ 227 | "protobuf", 228 | ] 229 | 230 | [[package]] 231 | name = "protoc" 232 | version = "2.20.0" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "13870c0b44e3de0aa1439da1661a284c2c8ec628f41a7bfe375b605fef1a6ebd" 235 | dependencies = [ 236 | "log", 237 | "which", 238 | ] 239 | 240 | [[package]] 241 | name = "protoc-rust" 242 | version = "2.20.0" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "cbb6fb4fd8a3aa76e96d16b460419b3c7441f42e52ebd7d93a9c42fa1715ac75" 245 | dependencies = [ 246 | "protobuf", 247 | "protobuf-codegen", 248 | "protoc", 249 | "tempfile", 250 | ] 251 | 252 | [[package]] 253 | name = "quote" 254 | version = "1.0.8" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" 257 | dependencies = [ 258 | "proc-macro2", 259 | ] 260 | 261 | [[package]] 262 | name = "rand" 263 | version = "0.7.3" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 266 | dependencies = [ 267 | "getrandom", 268 | "libc", 269 | "rand_chacha", 270 | "rand_core", 271 | "rand_hc", 272 | ] 273 | 274 | [[package]] 275 | name = "rand_chacha" 276 | version = "0.2.2" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 279 | dependencies = [ 280 | "ppv-lite86", 281 | "rand_core", 282 | ] 283 | 284 | [[package]] 285 | name = "rand_core" 286 | version = "0.5.1" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 289 | dependencies = [ 290 | "getrandom", 291 | ] 292 | 293 | [[package]] 294 | name = "rand_hc" 295 | version = "0.2.0" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 298 | dependencies = [ 299 | "rand_core", 300 | ] 301 | 302 | [[package]] 303 | name = "redox_syscall" 304 | version = "0.1.57" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 307 | 308 | [[package]] 309 | name = "regex" 310 | version = "1.4.3" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" 313 | dependencies = [ 314 | "aho-corasick", 315 | "memchr", 316 | "regex-syntax", 317 | "thread_local", 318 | ] 319 | 320 | [[package]] 321 | name = "regex-syntax" 322 | version = "0.6.22" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" 325 | 326 | [[package]] 327 | name = "remove_dir_all" 328 | version = "0.5.3" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 331 | dependencies = [ 332 | "winapi", 333 | ] 334 | 335 | [[package]] 336 | name = "rust-caster" 337 | version = "0.16.0" 338 | dependencies = [ 339 | "ansi_term", 340 | "docopt", 341 | "env_logger", 342 | "log", 343 | "rust_cast", 344 | "serde", 345 | "serde_derive", 346 | ] 347 | 348 | [[package]] 349 | name = "rust_cast" 350 | version = "0.16.0" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "1ef75a68487841879568da6cbf361c7439cc794b60959927c4ee1d91e2a11b19" 353 | dependencies = [ 354 | "byteorder", 355 | "log", 356 | "openssl", 357 | "protobuf", 358 | "protoc-rust", 359 | "serde", 360 | "serde_derive", 361 | "serde_json", 362 | ] 363 | 364 | [[package]] 365 | name = "ryu" 366 | version = "1.0.5" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 369 | 370 | [[package]] 371 | name = "serde" 372 | version = "1.0.118" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" 375 | dependencies = [ 376 | "serde_derive", 377 | ] 378 | 379 | [[package]] 380 | name = "serde_derive" 381 | version = "1.0.118" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" 384 | dependencies = [ 385 | "proc-macro2", 386 | "quote", 387 | "syn", 388 | ] 389 | 390 | [[package]] 391 | name = "serde_json" 392 | version = "1.0.61" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" 395 | dependencies = [ 396 | "itoa", 397 | "ryu", 398 | "serde", 399 | ] 400 | 401 | [[package]] 402 | name = "strsim" 403 | version = "0.9.3" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" 406 | 407 | [[package]] 408 | name = "syn" 409 | version = "1.0.58" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" 412 | dependencies = [ 413 | "proc-macro2", 414 | "quote", 415 | "unicode-xid", 416 | ] 417 | 418 | [[package]] 419 | name = "tempfile" 420 | version = "3.1.0" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 423 | dependencies = [ 424 | "cfg-if 0.1.10", 425 | "libc", 426 | "rand", 427 | "redox_syscall", 428 | "remove_dir_all", 429 | "winapi", 430 | ] 431 | 432 | [[package]] 433 | name = "termcolor" 434 | version = "1.1.2" 435 | source = "registry+https://github.com/rust-lang/crates.io-index" 436 | checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" 437 | dependencies = [ 438 | "winapi-util", 439 | ] 440 | 441 | [[package]] 442 | name = "thiserror" 443 | version = "1.0.23" 444 | source = "registry+https://github.com/rust-lang/crates.io-index" 445 | checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" 446 | dependencies = [ 447 | "thiserror-impl", 448 | ] 449 | 450 | [[package]] 451 | name = "thiserror-impl" 452 | version = "1.0.23" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" 455 | dependencies = [ 456 | "proc-macro2", 457 | "quote", 458 | "syn", 459 | ] 460 | 461 | [[package]] 462 | name = "thread_local" 463 | version = "1.1.0" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "bb9bc092d0d51e76b2b19d9d85534ffc9ec2db959a2523cdae0697e2972cd447" 466 | dependencies = [ 467 | "lazy_static", 468 | ] 469 | 470 | [[package]] 471 | name = "unicode-xid" 472 | version = "0.2.1" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 475 | 476 | [[package]] 477 | name = "vcpkg" 478 | version = "0.2.11" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" 481 | 482 | [[package]] 483 | name = "wasi" 484 | version = "0.9.0+wasi-snapshot-preview1" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 487 | 488 | [[package]] 489 | name = "which" 490 | version = "4.0.2" 491 | source = "registry+https://github.com/rust-lang/crates.io-index" 492 | checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" 493 | dependencies = [ 494 | "libc", 495 | "thiserror", 496 | ] 497 | 498 | [[package]] 499 | name = "winapi" 500 | version = "0.3.9" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 503 | dependencies = [ 504 | "winapi-i686-pc-windows-gnu", 505 | "winapi-x86_64-pc-windows-gnu", 506 | ] 507 | 508 | [[package]] 509 | name = "winapi-i686-pc-windows-gnu" 510 | version = "0.4.0" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 513 | 514 | [[package]] 515 | name = "winapi-util" 516 | version = "0.1.5" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 519 | dependencies = [ 520 | "winapi", 521 | ] 522 | 523 | [[package]] 524 | name = "winapi-x86_64-pc-windows-gnu" 525 | version = "0.4.0" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 528 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | extern crate ansi_term; 2 | extern crate docopt; 3 | extern crate env_logger; 4 | #[macro_use] 5 | extern crate log; 6 | extern crate rust_cast; 7 | extern crate serde; 8 | #[macro_use] 9 | extern crate serde_derive; 10 | 11 | use std::str::FromStr; 12 | 13 | use ansi_term::Colour::{Green, Red}; 14 | 15 | use docopt::Docopt; 16 | 17 | use rust_cast::channels::heartbeat::HeartbeatResponse; 18 | use rust_cast::channels::media::{Media, StatusEntry, StreamType}; 19 | use rust_cast::channels::receiver::CastDeviceApp; 20 | use rust_cast::{CastDevice, ChannelMessage}; 21 | 22 | const DEFAULT_DESTINATION_ID: &str = "receiver-0"; 23 | 24 | const USAGE: &str = " 25 | Usage: rust-caster [-v] [-h] [-a
] [-p ] [-i | -r | -s | --stop-current | [-m [--media-type ] [--media-stream-type ] [--media-app ]] | [--media-volume | --media-mute| --media-unmute | --media-pause | --media-play | --media-stop | --media-seek