muzak 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/COMMANDS.md +1058 -0
  3. data/lib/muzak/const.rb +1 -1
  4. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93f5e7527bc45c8f3b5628549b12646a93894870
4
- data.tar.gz: 1d52aef051910cde7c7a54ba69afcf3bde166c14
3
+ metadata.gz: 3bbc4c6526a315ebd1d0c6cb7dd3edf77809d7ae
4
+ data.tar.gz: 21ac18f09286fd7ba229081247d17ef7311fd881
5
5
  SHA512:
6
- metadata.gz: 5b5b66564e82631adb267b68585627300509fb30468d4f41c66e1a9925fa94e16e02788a070397d976e4bac0f46a01cfde160081ae9b1640e541d983f335827d
7
- data.tar.gz: f1338f09ff440a08d77eb2ece1b713fe90eea8ff35d9f8379b77ec8dbe9463c3120f2bdac91c1ae0ab3c7d3194625608c406a37ffe255664126d1cb2a1f6b49e
6
+ metadata.gz: e12366f7b35680c4c46dbcb2067bc1a65e4bf7472b160cc693114d0be26e9e68a4c874d1b1c6ae29ec920d2df6549c7650841bf04e33a8ce37ff1355c8f03a2d
7
+ data.tar.gz: 28b3ab33bd145f695c2c433e3120da0903237fe8c76607cf543eebb2570f88cac1e325d7e146d3437a17c8d17fc55754c38da58b7bdda841d5c16a63072cd55d
@@ -0,0 +1,1058 @@
1
+ Muzak commands
2
+ ==============
3
+
4
+ This is the user-facing documentation for muzak's commands.
5
+
6
+ For the developer documentation, see {Muzak::Cmd the Muzak::Cmd module}.
7
+
8
+ ## General behavior
9
+
10
+ In general, muzak commands take 0 or more *arguments* and return a single
11
+ JSON *response* (sent to `stdout` when run through `muzak-cmd`).
12
+
13
+ Arguments are denoted with `<angle brackets>` when mandatory
14
+ and with `[square brackets]` when optional.
15
+
16
+ This response will *always* look something like this:
17
+
18
+ ```json
19
+ {
20
+ "response" : {
21
+ "data" : "some response string (or hash)",
22
+ "error" : null,
23
+ "method" : "the corresponding muzak method"
24
+ }
25
+ }
26
+ ```
27
+
28
+ **Important:** Programs that interact with `muzak` through commands should
29
+ **always** check the `error` field. If `error` is non-`null`, then the rest of
30
+ the response should be discarded (or at least not treated as a success).
31
+
32
+ The `data` field may be either null, a string, array, or a sub-hash, depending
33
+ on the command issued. The documentation below will clarify whichever is the
34
+ case for each command.
35
+
36
+ The `method` field corresponds to the {Muzak::Cmd} method that was invoked.
37
+ In general this will be the "resolved" equivalent
38
+ (e.g. {Muzak::Cmd#albums_by_artist} for `albums-by-artist`). If muzak
39
+ doesn't recognize a command or can't match the given arguments to the
40
+ ones that the command expects, this field will be `command` instead
41
+ (as the processing is terminated in {Muzak::Instance#command}).
42
+
43
+ ## Writing commands
44
+
45
+ Since muzak commands are just ruby methods under {Muzak::Cmd}, users
46
+ can write their own commands. These are loaded during muzak's initialization
47
+ from `~/.config/muzak/commands/*.rb`.
48
+
49
+ Commands are essentially first-class members of muzak, and as such can access
50
+ just about everything available to a {Muzak::Instance}:
51
+
52
+ * The current {Muzak::Index}.
53
+ * The user's {Muzak::Player::StubPlayer player}.
54
+ * All loaded {Muzak::Plugin::StubPlugin plugins}.
55
+ * All loaded {Muzak::Playlist}s.
56
+
57
+ This makes commands flexible, but also very dangerous - it's easy
58
+ to monkeypatch over an existing command and subtly break muzak's behavior.
59
+
60
+ Here's an example command:
61
+
62
+ ```ruby
63
+ module Muzak
64
+ module Cmd
65
+ def dump_state
66
+ debug "dumping muzak's state"
67
+
68
+ build_response data: {
69
+ index: index.to_s
70
+ player: player.to_s
71
+ plugins: plugins.to_s
72
+ playlists: playlists.to_s
73
+ }
74
+ end
75
+ end
76
+ end
77
+ ```
78
+
79
+ In the above example, `dump_state` will be exposed as `dump-state` via
80
+ {Muzak::Cmd.commands}, which is used by clients to enumerate and display
81
+ available commands.
82
+
83
+ It can also be invoked either directly (`Muzak::Instance#dump_state`) or
84
+ through {Muzak::Instance#command} (`instance.command "dump-state"`).
85
+
86
+ ## `albums-by-artist`
87
+
88
+ Provides a list of albums by the given artist.
89
+
90
+ ### Syntax
91
+
92
+ `albums-by-artist <artist name>`
93
+
94
+ ### Example
95
+
96
+ ```bash
97
+ $ muzak-cmd albums-by-artist Blink-182
98
+ ```
99
+
100
+ ### Example Response
101
+
102
+ ```json
103
+ {
104
+ "response" : {
105
+ "error" : null,
106
+ "method" : "albums_by_artist",
107
+ "data" : {
108
+ "albums" : [
109
+ "Buddha",
110
+ "Cheshire Cat",
111
+ "Cheshire Cat (Japanese Edition)",
112
+ "Greatest Hits (UK Bonus)",
113
+ "Take Off Your Pants And Jacket",
114
+ "Neighborhoods (Deluxe Edition)",
115
+ "The Mark, Tom And Travis Show",
116
+ "Enema Of The State",
117
+ "Blink-182",
118
+ "Greatest Hits (Japanese Retail + Bonus Tracks)",
119
+ "Blink-182 (Australian Exclusive Tour Edition)",
120
+ "Dude Ranch"
121
+ ]
122
+ }
123
+ }
124
+ }
125
+
126
+ ```
127
+
128
+ ## `clear-queue`
129
+
130
+ Clears the current playback queue.
131
+
132
+ ### Syntax
133
+
134
+ `clear-queue`
135
+
136
+ ### Example
137
+
138
+ ```bash
139
+ $ muzak-cmd clear-queue
140
+ ```
141
+
142
+ ### Example Response
143
+
144
+ ```json
145
+ {
146
+ "response" : {
147
+ "error" : null,
148
+ "method" : "clear_queue",
149
+ "data" : "null"
150
+ }
151
+ }
152
+ ```
153
+
154
+ ## `config-get`
155
+
156
+ Gets the value corresponding to the given config key.
157
+
158
+ ### Syntax
159
+
160
+ `config-get <key>`
161
+
162
+ ### Example
163
+
164
+ ```bash
165
+ $ muzak-cmd config-get jukebox-size
166
+ ```
167
+
168
+ ### Example Response
169
+
170
+ ```json
171
+ {
172
+ "response" : {
173
+ "error" : null,
174
+ "method" : "config_get",
175
+ "data" : {
176
+ "jukebox-size" : 100
177
+ }
178
+ }
179
+ }
180
+ ```
181
+
182
+ ## `enqueue-album`
183
+
184
+ Adds the given album to the player's queue.
185
+
186
+ ### Syntax
187
+
188
+ `enqueue-album <album name>`
189
+
190
+ ### Example
191
+
192
+ ```bash
193
+ $ muzak-cmd enqueue-album Energy
194
+ ```
195
+
196
+ ### Example Response
197
+
198
+ ```json
199
+ {
200
+ "response" : {
201
+ "error" : null,
202
+ "method" : "enqueue_album",
203
+ "data" : "null"
204
+ }
205
+ }
206
+ ```
207
+
208
+ ## `enqueue-artist`
209
+
210
+ Adds the given artist (i.e., all of their songs) to the player's queue.
211
+
212
+ ### Syntax
213
+
214
+ `muzak-cmd enqueue-artist <artist name>`
215
+
216
+ ### Example
217
+
218
+ ```bash
219
+ $ muzak-cmd enqueue-artist Operation Ivy
220
+ ```
221
+
222
+ ### Example Response
223
+
224
+ ```json
225
+ {
226
+ "response" : {
227
+ "error" : null,
228
+ "method" : "enqueue_artist",
229
+ "data" : "null"
230
+ }
231
+ }
232
+ ```
233
+
234
+ ## `enqueue-playlist`
235
+
236
+ Adds the given playlist to the player's queue.
237
+
238
+ **Note:** This triggers the `playlist_enqueued` event.
239
+
240
+ ### Syntax
241
+
242
+ `muzak-cmd enqueue-playlist <playlist name>`
243
+
244
+ ### Example
245
+
246
+ ```bash
247
+ $ muzak-cmd enqueue-playlist worst-of-2016
248
+ ```
249
+
250
+ ### Example Response
251
+
252
+ ```json
253
+ {
254
+ "response" : {
255
+ "error" : null,
256
+ "method" : "enqueue_playlist",
257
+ "data" : "null"
258
+ }
259
+ }
260
+ ```
261
+
262
+ ## `help`
263
+
264
+ Returns a list of available commands.
265
+
266
+ ### Syntax
267
+
268
+ `help`
269
+
270
+ ### Example
271
+
272
+ ```bash
273
+ $ muzak-cmd help
274
+ ```
275
+
276
+ ### Example Response
277
+
278
+ ```json
279
+ {
280
+ "response" : {
281
+ "data" : {
282
+ "commands" : [
283
+ "next",
284
+ "jukebox",
285
+ "player-activate",
286
+ "player-deactivate",
287
+ "play",
288
+ "pause",
289
+ "toggle",
290
+ "previous",
291
+ "enqueue-artist",
292
+ "enqueue-album",
293
+ "list-queue",
294
+ "shuffle-queue",
295
+ "clear-queue",
296
+ "now-playing",
297
+ "index-build",
298
+ "list-artists",
299
+ "list-albums",
300
+ "albums-by-artist",
301
+ "songs-by-artist",
302
+ "config-get",
303
+ "list-playlists",
304
+ "playlist-delete",
305
+ "enqueue-playlist",
306
+ "playlist-add-album",
307
+ "playlist-add-artist",
308
+ "playlist-add-current",
309
+ "playlist-del-current",
310
+ "playlist-shuffle",
311
+ "ping",
312
+ "help",
313
+ "list-plugins",
314
+ "quit",
315
+ "more-by-artist",
316
+ "more-from-album",
317
+ "favorite",
318
+ "unfavorite"
319
+ ]
320
+ },
321
+ "error" : null,
322
+ "method" : "help"
323
+ }
324
+ }
325
+ ```
326
+
327
+ ## `index-build`
328
+
329
+ (Re-)builds the index.
330
+
331
+ **Note:** This command can take quite some time to run. It's generally a good
332
+ idea to either set `index-autobuild` in the configuration to do automatic
333
+ rebuilds or schedule this command via `cron` or a similar tool.
334
+
335
+ ### Syntax
336
+
337
+ `index-build`
338
+
339
+ ### Example
340
+
341
+ ```bash
342
+ $ muzak-cmd index-build
343
+ ```
344
+
345
+ ### Example Response
346
+
347
+ ```json
348
+ {
349
+ "response" : {
350
+ "error" : null,
351
+ "method" : "index_build",
352
+ "data" : {
353
+ "artists" : 10,
354
+ "albums": 100
355
+ }
356
+ }
357
+ }
358
+ ```
359
+
360
+ ## `jukebox`
361
+
362
+ Adds *N* random songs to the player's queue, where *N* is either the optional
363
+ argument or `jukebox-size` in the configuration.
364
+
365
+ ### Syntax
366
+
367
+ `jukebox [size]`
368
+
369
+ ### Example
370
+
371
+ ```bash
372
+ $ muzak-cmd jukebox 20
373
+ ```
374
+
375
+ ### Example Response
376
+
377
+ ```json
378
+ {
379
+ "response" : {
380
+ "data" : {
381
+ "jukebox" : [
382
+ "Outro by Madvillain on Koushik Remixes",
383
+ "intro by jizue on journal",
384
+ "Familiar Patterns by PUP on The Dream Is Over",
385
+ "I Want Cancer For Christmas by Johnny Hobo And The Freight Trains on Love Songs For The Apocalypse",
386
+ "At The Movies by Bad Brains on Soul Brains - A Bad Brains Reunion Live From Maritime Hall",
387
+ "Abnormality by The Arrogant Sons Of Bitches on Built To Fail (Remastered)",
388
+ "Going to Pasalaqua (Live) by Green Day on Longview",
389
+ "Carnival Of Souls (feat. Demoz by Jedi Mind Tricks on Violence Begets Violence",
390
+ "Cowboy Coffee by The Mighty Mighty Bosstones on More Noise And Other Disturbances",
391
+ "Let Us Get Murdered by Andrew Jackson Jihad on Andrew Jackson Jihad/Ghost Mice Split"
392
+ ]
393
+ },
394
+ "error" : null,
395
+ "method" : "jukebox"
396
+ }
397
+ }
398
+ ```
399
+
400
+ ## `list-albums`
401
+
402
+ Returns all albums in the index.
403
+
404
+ ### Syntax
405
+
406
+ `list-albums`
407
+
408
+ ### Example
409
+
410
+ ```bash
411
+ $ muzak-cmd list-albums
412
+ ```
413
+
414
+ ### Example Response
415
+
416
+ ```json
417
+ {
418
+ "response" : {
419
+ "error" : null,
420
+ "method" : "list_albums",
421
+ "data" : {
422
+ "artists" : [
423
+ "Album 1",
424
+ "Album 2",
425
+ "Album 3"
426
+ ]
427
+ }
428
+ }
429
+ }
430
+ ```
431
+
432
+ ## `list-artists`
433
+
434
+ Returns all artists in the index.
435
+
436
+ ### Syntax
437
+
438
+ `list-artists`
439
+
440
+ ### Example
441
+
442
+ ```bash
443
+ $ muzak-cmd list-artists
444
+ ```
445
+
446
+ ### Example Response
447
+
448
+ ```json
449
+ {
450
+ "response" : {
451
+ "error" : null,
452
+ "method" : "list_artists",
453
+ "data" : {
454
+ "artists" : [
455
+ "Artist 1",
456
+ "Artist 2",
457
+ "Artist 3"
458
+ ]
459
+ }
460
+ }
461
+ }
462
+ ```
463
+
464
+ ## `list-playlists`
465
+
466
+ Returns all available playlists.
467
+
468
+ ### Syntax
469
+
470
+ `list-playlists`
471
+
472
+ ### Example
473
+
474
+ ```bash
475
+ $ muzak-cmd list-playlists
476
+ ```
477
+
478
+ ### Example Response
479
+
480
+ ```json
481
+ {
482
+ "response" : {
483
+ "method" : "list_playlists",
484
+ "error" : null,
485
+ "data" : {
486
+ "playlists" : [
487
+ "favorites",
488
+ "dad-rock",
489
+ "best-of-2016"
490
+ ]
491
+ }
492
+ }
493
+ }
494
+ ```
495
+
496
+ ## `list-plugins`
497
+
498
+ Returns all available plugins.
499
+
500
+ **Note:** This list will differ from the list of loaded plugins unless all
501
+ available plugins have been configured.
502
+
503
+ ### Syntax
504
+
505
+ `list-plugins`
506
+
507
+ ### Example
508
+
509
+ ```bash
510
+ $ muzak-cmd list-plugins
511
+ ```
512
+
513
+ ### Example Response
514
+
515
+ ```json
516
+ {
517
+ "response" : {
518
+ "data" : {
519
+ "plugins" : [
520
+ "stubplugin",
521
+ "notify",
522
+ "scrobble"
523
+ ]
524
+ },
525
+ "error" : null,
526
+ "method" : "list_plugins"
527
+ }
528
+ }
529
+ ```
530
+
531
+ ## `list-queue`
532
+
533
+ Returns the player's playback queue.
534
+
535
+ **Note:** This may include already-played songs.
536
+
537
+ ### Syntax
538
+
539
+ `list-queue`
540
+
541
+ ### Example
542
+
543
+ ```bash
544
+ $ muzak-cmd list-queue
545
+ ```
546
+
547
+ ### Example Response
548
+
549
+ ```json
550
+ {
551
+ "response" : {
552
+ "error" : null,
553
+ "method" : "list_queue",
554
+ "data" : {
555
+ "queue" : [
556
+ "Song 1",
557
+ "Song 2",
558
+ "Song 3"
559
+ ]
560
+ }
561
+ }
562
+ }
563
+ ```
564
+
565
+ ## `next`
566
+
567
+ Starts the next song in the player's queue.
568
+
569
+ ### Syntax
570
+
571
+ `next`
572
+
573
+ ### Example
574
+
575
+ ```bash
576
+ $ muzak-cmd next
577
+ ```
578
+
579
+ ### Example Response
580
+
581
+ ```json
582
+ {
583
+ "response" : {
584
+ "error" : null,
585
+ "method" : "next",
586
+ "data" : "null"
587
+ }
588
+ }
589
+ ```
590
+
591
+ ## `now-playing`
592
+
593
+ Returns the currently playing song.
594
+
595
+ ### Syntax
596
+
597
+ `now-playing`
598
+
599
+ ### Example
600
+
601
+ ```bash
602
+ $ muzak-cmd now-playing
603
+ ```
604
+
605
+ ### Example Response
606
+
607
+ ```json
608
+ {
609
+ "response" : {
610
+ "error" : null,
611
+ "data" : {
612
+ "playing" : "22 Offs by Chance The Rapper on 10 Day"
613
+ },
614
+ "method" : "now_playing"
615
+ }
616
+ }
617
+ ```
618
+
619
+ ## `pause`
620
+
621
+ Pauses the player.
622
+
623
+ ### Syntax
624
+
625
+ `pause`
626
+
627
+ ### Example
628
+
629
+ ```bash
630
+ $ muzak-cmd pause
631
+ ```
632
+
633
+ ### Example Response
634
+
635
+ ```json
636
+ {
637
+ "response" : {
638
+ "data" : null,
639
+ "method" : "pause",
640
+ "error" : null
641
+ }
642
+ }
643
+ ```
644
+
645
+ ## `ping`
646
+
647
+ Pings muzak to confirm that the instance is running as expected.
648
+
649
+ **Note**: This is mostly useful for debugging purposes.
650
+
651
+ ### Syntax
652
+
653
+ `ping`
654
+
655
+ ### Example
656
+
657
+ ```bash
658
+ $ muzak-cmd ping
659
+ ```
660
+
661
+ ### Example Response
662
+
663
+ ```json
664
+ {
665
+ "response" : {
666
+ "method" : "ping",
667
+ "error" : null,
668
+ "data" : {
669
+ "pong" : 1483395120
670
+ }
671
+ }
672
+ }
673
+ ```
674
+
675
+ ## `play`
676
+
677
+ Tells the play to play.
678
+
679
+ ### Syntax
680
+
681
+ `play`
682
+
683
+ ### Example
684
+
685
+ ```bash
686
+ $ muzak-cmd play
687
+ ```
688
+
689
+ ### Example Response
690
+
691
+ ```json
692
+ {
693
+ "response" : {
694
+ "error" : null,
695
+ "data" : null,
696
+ "method" : "play"
697
+ }
698
+ }
699
+ ```
700
+
701
+ ## `player-activate`
702
+
703
+ Activates the player.
704
+
705
+ **Note:** This will usually be done automatically when the user issues a command
706
+ that affects the playback state for the first time. Calling it manually may
707
+ be useful for debugging purposes.
708
+
709
+ ### Syntax
710
+
711
+ ### Example
712
+
713
+ ```bash
714
+ $ muzak-cmd player-activate
715
+ ```
716
+
717
+ ### Example Response
718
+
719
+ ```json
720
+ {
721
+ "response" : {
722
+ "error" : null,
723
+ "data" : {
724
+ "player": "Muzak::Player::MPV"
725
+ },
726
+ "method" : "player_activate"
727
+ }
728
+ }
729
+ ```
730
+
731
+ ## `player-deactivate`
732
+
733
+ Deactivates the player.
734
+
735
+ **Note:** This will usually be done automatically when muzak is quitting.
736
+ Calling it manually may be useful for debugging purposes.
737
+
738
+ ### Syntax
739
+
740
+ ### Example
741
+
742
+ ```bash
743
+ $ muzak-cmd
744
+ ```
745
+
746
+ ### Example Response
747
+
748
+ ```json
749
+ {
750
+ "response" : {
751
+ "error" : null,
752
+ "data" : {
753
+ "player": "Muzak::Player::MPV"
754
+ },
755
+ "method" : "player_deactivate"
756
+ }
757
+ }
758
+ ```
759
+
760
+ ## `playlist-add-album`
761
+
762
+ Adds the given album to the given playlist.
763
+
764
+ ### Syntax
765
+
766
+ `playlist-add-album <playlist name> <album name>`
767
+
768
+ ### Example
769
+
770
+ ```bash
771
+ $ muzak-cmd playlist-add-album best-of-2016 Coloring Book
772
+ ```
773
+
774
+ ### Example Response
775
+
776
+ ```json
777
+ {
778
+ "response" : {
779
+ "error" : null,
780
+ "data" : null,
781
+ "method" : "playlist_add_album"
782
+ }
783
+ }
784
+ ```
785
+
786
+ ## `playlist-add-artist`
787
+
788
+ Adds the given artist (i.e., their songs) to the given playlist.
789
+
790
+ ### Syntax
791
+
792
+ `playlist-add-artist <playlist name> <artist name>`
793
+
794
+ ### Example
795
+
796
+ ```bash
797
+ $ muzak-cmd playlist-add-artist dad-rock The Beatles
798
+ ```
799
+
800
+ ### Example Response
801
+
802
+ ```json
803
+ {
804
+ "response" : {
805
+ "error" : null,
806
+ "data" : null,
807
+ "method" : "playlist_add_artist"
808
+ }
809
+ }
810
+ ```
811
+
812
+ ## `playlist-add-current`
813
+
814
+ Adds the currently playing song to the given playlist.
815
+
816
+ ### Syntax
817
+
818
+ `playlist-add-current <playlist name>`
819
+
820
+ ### Example
821
+
822
+ ```bash
823
+ $ muzak-cmd playlist-add-current favorites
824
+ ```
825
+
826
+ ### Example Response
827
+
828
+ ```json
829
+ {
830
+ "response" : {
831
+ "error" : null,
832
+ "data" : null,
833
+ "method" : "playlist_add_current"
834
+ }
835
+ }
836
+ ```
837
+
838
+ ## `playlist-del-current`
839
+
840
+ Removes the currently playing song from the given playlist.
841
+
842
+ ### Syntax
843
+
844
+ `playlist-del-current <playlist name>`
845
+
846
+ ### Example
847
+
848
+ ```bash
849
+ $ muzak-cmd playlist-del-current favorites
850
+ ```
851
+
852
+ ### Example Response
853
+
854
+ ```json
855
+ {
856
+ "response" : {
857
+ "error" : null,
858
+ "data" : null,
859
+ "method" : "playlist_del_current"
860
+ }
861
+ }
862
+ ```
863
+
864
+ ## `playlist-delete`
865
+
866
+ Deletes the given playlist.
867
+
868
+ ### Syntax
869
+
870
+ `playlist-delete <playlist name>`
871
+
872
+ ### Example
873
+
874
+ ```bash
875
+ $ muzak-cmd playlist-delete worst-of-2016
876
+ ```
877
+
878
+ ### Example Response
879
+
880
+ ```json
881
+ {
882
+ "response" : {
883
+ "error" : null,
884
+ "data" : null,
885
+ "method" : "playlist_delete"
886
+ }
887
+ }
888
+ ```
889
+
890
+ ## `playlist-shuffle`
891
+
892
+ Shuffles the given playlist.
893
+
894
+ **Note:** If the playlist has already been enqueued, the playback order
895
+ is not affected.
896
+
897
+ ### Syntax
898
+
899
+ `playlist-shuffle <playlist name>`
900
+
901
+ ### Example
902
+
903
+ ```bash
904
+ $ muzak-cmd playlist-shuffle favorites
905
+ ```
906
+
907
+ ### Example Response
908
+
909
+ ```json
910
+ {
911
+ "response" : {
912
+ "error" : null,
913
+ "data" : null,
914
+ "method" : "playlist_shuffle"
915
+ }
916
+ }
917
+ ```
918
+
919
+ ## `previous`
920
+
921
+ Play the previous song in the player's queue.
922
+
923
+ ### Syntax
924
+
925
+ `previous`
926
+
927
+ ### Example
928
+
929
+ ```bash
930
+ $ muzak-cmd previous
931
+ ```
932
+
933
+ ### Example Response
934
+
935
+ ```json
936
+ {
937
+ "response" : {
938
+ "error" : null,
939
+ "data" : null,
940
+ "method" : "previous"
941
+ }
942
+ }
943
+ ```
944
+
945
+ ## `quit`
946
+
947
+ Terminates muzak.
948
+
949
+ **Note:** This terminates the {Muzak::Instance}, meaning that clients/interfaces
950
+ are expected to terminate as well.
951
+
952
+ ### Syntax
953
+
954
+ `quit`
955
+
956
+ ### Example
957
+
958
+ ```bash
959
+ $ muzak-cmd quit
960
+ ```
961
+
962
+ ### Example Response
963
+
964
+ ```json
965
+ {
966
+ "response" : {
967
+ "error" : null,
968
+ "data" : "quitting",
969
+ "method" : "quit"
970
+ }
971
+ }
972
+ ```
973
+
974
+ ## `shuffle-queue`
975
+
976
+ Shuffles the player's playback queue.
977
+
978
+ ### Syntax
979
+
980
+ `shuffle-queue`
981
+
982
+ ### Example
983
+
984
+ ```bash
985
+ $ muzak-cmd shuffle-queue
986
+ ```
987
+
988
+ ### Example Response
989
+
990
+ ```json
991
+ {
992
+ "response" : {
993
+ "error" : null,
994
+ "data" : null,
995
+ "method" : "shuffle_queue"
996
+ }
997
+ }
998
+ ```
999
+
1000
+ ## `songs-by-artist`
1001
+
1002
+ Returns all songs by the given artist.
1003
+
1004
+ ### Syntax
1005
+
1006
+ `songs-by-artist <artist name>`
1007
+
1008
+ ### Example
1009
+
1010
+ ```bash
1011
+ $ muzak-cmd songs-by-artist "Bob Dylan"
1012
+ ```
1013
+
1014
+ ### Example Response
1015
+
1016
+ ```json
1017
+ {
1018
+ "response" : {
1019
+ "error" : null,
1020
+ "data" : {
1021
+ "songs" : [
1022
+ "The Times They Are A' Changing",
1023
+ "Hurricane",
1024
+ "All Along the Watchtower"
1025
+ ]
1026
+ },
1027
+ "method" : "songs_by_artist"
1028
+ }
1029
+ }
1030
+
1031
+ ```
1032
+
1033
+ ## `toggle`
1034
+
1035
+ Toggles the playback state of the player.
1036
+
1037
+ ### Syntax
1038
+
1039
+ `toggle`
1040
+
1041
+ ### Example
1042
+
1043
+ ```bash
1044
+ $ muzak-cmd toggle
1045
+ ```
1046
+
1047
+ ### Example Response
1048
+
1049
+ ```json
1050
+ {
1051
+ "response" : {
1052
+ "error" : null,
1053
+ "data" : null,
1054
+ "method" : "toggle"
1055
+ }
1056
+ }
1057
+ ```
1058
+
@@ -1,6 +1,6 @@
1
1
  module Muzak
2
2
  # Muzak's current version
3
- VERSION = "0.1.3".freeze
3
+ VERSION = "0.1.4".freeze
4
4
 
5
5
  # The root directory for all user configuration, data, etc
6
6
  CONFIG_DIR = File.expand_path("~/.config/muzak").freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muzak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Woodruff
@@ -34,6 +34,7 @@ extensions: []
34
34
  extra_rdoc_files: []
35
35
  files:
36
36
  - ".yardopts"
37
+ - COMMANDS.md
37
38
  - LICENSE
38
39
  - README.md
39
40
  - bin/muzak-cmd