Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

It still doesn't work, but the segfault's gone now

That arrow notation was the source of that problem. It was also concealing a
bunch of syntax errors, all fixed now.
  • Loading branch information...
commit 3ced637c3269c730eb13b09ec7feae36e5cf57bb 1 parent 1f2faa2
authored
2  bin/p6xmms2
@@ -13,7 +13,7 @@ multi sub MAIN(Str $command) {
13 13
         exit 1;
14 14
     }
15 15
 
16  
-    XMMS2::Client.new(:client-name<p6xmms2>).$command;
  16
+    XMMS2::Client.new(:client-name<p6xmms2>)."$command"();
17 17
 }
18 18
 
19 19
 sub USAGE {
10  lib/XMMS2/Client.pm6
@@ -16,23 +16,23 @@ method play returns Bool {
16 16
 }
17 17
 
18 18
 method pause returns Bool {
19  
-    ...
  19
+    ???
20 20
 }
21 21
 
22 22
 method toggle returns Bool {
23  
-    ...
  23
+    ???
24 24
 }
25 25
 
26 26
 method stop returns Bool {
27  
-    ...
  27
+    ???
28 28
 }
29 29
 
30 30
 method prev returns Bool {
31  
-    ...
  31
+    ???
32 32
 }
33 33
 
34 34
 method next returns Bool {
35  
-    ...
  35
+    ???
36 36
 }
37 37
 
38 38
 submethod BUILD(Str $client-name, Str $path) {
14  lib/XMMS2/Connection.pm6
@@ -6,19 +6,23 @@ use XMMS2::Result;
6 6
 class xmmsc_connection_t is OpaquePointer { };
7 7
 
8 8
 # Native functions
9  
-sub xmmsc_playback_start(xmmsc_connection_t --> xmmsc_result_t)
  9
+sub xmmsc_playback_start(xmmsc_connection_t)
  10
+    returns xmmsc_result_t
10 11
     is native('libxmmsclient') { ... }
11 12
 
12  
-sub xmmsc_init(Str $clientname --> xmmsc_connection_t)
  13
+sub xmmsc_init(Str $clientname)
  14
+    returns xmmsc_connection_t
13 15
     is native('libxmmsclient') { ... }
14 16
 
15  
-sub xmmsc_connect(xmmsc_connection_t, Str $path --> Int)
  17
+sub xmmsc_connect(xmmsc_connection_t, Str $path)
  18
+    returns Int
16 19
     is native('libxmmsclient') { ... }
17 20
 
18 21
 sub xmmsc_unref(xmmsc_connection_t)
19 22
     is native('libxmmsclient') { ... }
20 23
 
21  
-sub xmmsc_get_last_error(xmmsc_connection_t --> Str)
  24
+sub xmmsc_get_last_error(xmmsc_connection_t)
  25
+    returns Str
22 26
     is native('libxmmsclient') { ... }
23 27
 
24 28
 # Wrapper around a connection pointer
@@ -30,7 +34,7 @@ method new(Str $client-name, Str $path = %*ENV<XMMS_PATH>) {
30 34
 }
31 35
 
32 36
 # TODO: XMMS' async API not supported yet
33  
-method play(:$sync!) returns Bool {
  37
+method play returns Bool {
34 38
     my Bool $success = XMMS2::Result.new(:result => xmmsc_playback_start($!connection)).ok;
35 39
 
36 40
     warn 'Playback start failed!' if not $success;
7  lib/XMMS2/Result.pm6
@@ -9,7 +9,8 @@ class xmmsc_result_t is OpaquePointer { };
9 9
 sub xmmsc_result_wait(xmmsc_result_t)
10 10
     is native('libxmmsclient') { ... }
11 11
 
12  
-sub xmmsc_result_get_value(xmmsc_result_t --> xmmsv_t)
  12
+sub xmmsc_result_get_value(xmmsc_result_t)
  13
+    returns xmmsv_t
13 14
     is native('libxmmsclient') { ... }
14 15
 
15 16
 sub xmmsc_result_unref(xmmsc_result_t)
@@ -20,9 +21,9 @@ class XMMS2::Result;
20 21
 has xmmsc_result_t $.result;
21 22
 
22 23
 # Check whether this result is an error status
23  
-method ok(:$verbose!) returns Bool {
  24
+method ok(Bool $verbose = True) returns Bool {
24 25
     xmmsc_result_wait($!result);
25  
-    my $status = XMMS2::Value.new: xmmsc_result_get_value($!result);
  26
+    my $status = XMMS2::Value.new(value => xmmsc_result_get_value($!result));
26 27
     my $failed = ?$status.error;
27 28
 
28 29
     if $verbose and $failed {
6  lib/XMMS2/Value.pm6
@@ -5,10 +5,12 @@ use NativeCall;
5 5
 class xmmsv_t is OpaquePointer { };
6 6
 
7 7
 # Native functions
8  
-sub xmmsv_is_error(xmmsv_t --> Int)
  8
+sub xmmsv_is_error(xmmsv_t)
  9
+    returns Int
9 10
     is native('libxmmsclient') { ... }
10 11
 
11  
-sub xmmsv_get_error(xmmsv_t, Str $error is rw --> Int)
  12
+sub xmmsv_get_error(xmmsv_t, Str $error is rw)
  13
+    returns Int
12 14
     is native('libxmmsclient') { ... }
13 15
 
14 16
 # Wrapper around an XMMS2 value struct

0 notes on commit 3ced637

Please sign in to comment.
Something went wrong with that request. Please try again.