Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@flussence authored
View
2  bin/p6xmms2
@@ -13,7 +13,7 @@ multi sub MAIN(Str $command) {
exit 1;
}
- XMMS2::Client.new(:client-name<p6xmms2>).$command;
+ XMMS2::Client.new(:client-name<p6xmms2>)."$command"();
}
sub USAGE {
View
10 lib/XMMS2/Client.pm6
@@ -16,23 +16,23 @@ method play returns Bool {
}
method pause returns Bool {
- ...
+ ???
}
method toggle returns Bool {
- ...
+ ???
}
method stop returns Bool {
- ...
+ ???
}
method prev returns Bool {
- ...
+ ???
}
method next returns Bool {
- ...
+ ???
}
submethod BUILD(Str $client-name, Str $path) {
View
14 lib/XMMS2/Connection.pm6
@@ -6,19 +6,23 @@ use XMMS2::Result;
class xmmsc_connection_t is OpaquePointer { };
# Native functions
-sub xmmsc_playback_start(xmmsc_connection_t --> xmmsc_result_t)
+sub xmmsc_playback_start(xmmsc_connection_t)
+ returns xmmsc_result_t
is native('libxmmsclient') { ... }
-sub xmmsc_init(Str $clientname --> xmmsc_connection_t)
+sub xmmsc_init(Str $clientname)
+ returns xmmsc_connection_t
is native('libxmmsclient') { ... }
-sub xmmsc_connect(xmmsc_connection_t, Str $path --> Int)
+sub xmmsc_connect(xmmsc_connection_t, Str $path)
+ returns Int
is native('libxmmsclient') { ... }
sub xmmsc_unref(xmmsc_connection_t)
is native('libxmmsclient') { ... }
-sub xmmsc_get_last_error(xmmsc_connection_t --> Str)
+sub xmmsc_get_last_error(xmmsc_connection_t)
+ returns Str
is native('libxmmsclient') { ... }
# Wrapper around a connection pointer
@@ -30,7 +34,7 @@ method new(Str $client-name, Str $path = %*ENV<XMMS_PATH>) {
}
# TODO: XMMS' async API not supported yet
-method play(:$sync!) returns Bool {
+method play returns Bool {
my Bool $success = XMMS2::Result.new(:result => xmmsc_playback_start($!connection)).ok;
warn 'Playback start failed!' if not $success;
View
7 lib/XMMS2/Result.pm6
@@ -9,7 +9,8 @@ class xmmsc_result_t is OpaquePointer { };
sub xmmsc_result_wait(xmmsc_result_t)
is native('libxmmsclient') { ... }
-sub xmmsc_result_get_value(xmmsc_result_t --> xmmsv_t)
+sub xmmsc_result_get_value(xmmsc_result_t)
+ returns xmmsv_t
is native('libxmmsclient') { ... }
sub xmmsc_result_unref(xmmsc_result_t)
@@ -20,9 +21,9 @@ class XMMS2::Result;
has xmmsc_result_t $.result;
# Check whether this result is an error status
-method ok(:$verbose!) returns Bool {
+method ok(Bool $verbose = True) returns Bool {
xmmsc_result_wait($!result);
- my $status = XMMS2::Value.new: xmmsc_result_get_value($!result);
+ my $status = XMMS2::Value.new(value => xmmsc_result_get_value($!result));
my $failed = ?$status.error;
if $verbose and $failed {
View
6 lib/XMMS2/Value.pm6
@@ -5,10 +5,12 @@ use NativeCall;
class xmmsv_t is OpaquePointer { };
# Native functions
-sub xmmsv_is_error(xmmsv_t --> Int)
+sub xmmsv_is_error(xmmsv_t)
+ returns Int
is native('libxmmsclient') { ... }
-sub xmmsv_get_error(xmmsv_t, Str $error is rw --> Int)
+sub xmmsv_get_error(xmmsv_t, Str $error is rw)
+ returns Int
is native('libxmmsclient') { ... }
# Wrapper around an XMMS2 value struct
Please sign in to comment.
Something went wrong with that request. Please try again.