|
| 1 | +<html><head><title>Audio::XMMSClient::Result</title> |
| 2 | +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" > |
| 3 | +<link rel="stylesheet" title="blkbluw" type="text/css" href="../../_blkbluw.css" media="all" > |
| 4 | +<link rel="alternate stylesheet" title="blkmagw" type="text/css" href="../../_blkmagw.css" media="all" > |
| 5 | +<link rel="alternate stylesheet" title="blkcynw" type="text/css" href="../../_blkcynw.css" media="all" > |
| 6 | +<link rel="alternate stylesheet" title="whtprpk" type="text/css" href="../../_whtprpk.css" media="all" > |
| 7 | +<link rel="alternate stylesheet" title="whtnavk" type="text/css" href="../../_whtnavk.css" media="all" > |
| 8 | +<link rel="alternate stylesheet" title="grygrnk" type="text/css" href="../../_grygrnk.css" media="all" > |
| 9 | +<link rel="alternate stylesheet" title="whtgrng" type="text/css" href="../../_whtgrng.css" media="all" > |
| 10 | +<link rel="alternate stylesheet" title="blkgrng" type="text/css" href="../../_blkgrng.css" media="all" > |
| 11 | +<link rel="alternate stylesheet" title="grygrnw" type="text/css" href="../../_grygrnw.css" media="all" > |
| 12 | +<link rel="alternate stylesheet" title="blkbluw" type="text/css" href="../../_blkbluw.css" media="all" > |
| 13 | +<link rel="alternate stylesheet" title="whtpurk" type="text/css" href="../../_whtpurk.css" media="all" > |
| 14 | +<link rel="alternate stylesheet" title="whtgrng" type="text/css" href="../../_whtgrng.css" media="all" > |
| 15 | +<link rel="alternate stylesheet" title="grygrnw" type="text/css" href="../../_grygrnw.css" media="all" > |
| 16 | + |
| 17 | +<script type="text/javascript" src="../../_podly.js"></script> |
| 18 | + |
| 19 | +</head> |
| 20 | +<body class='pod'> |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +<p class="backlinktop"><b><a name="___top" href="../../index.html" accesskey="1" title="All Documents"><<</a></b></p> |
| 25 | + |
| 26 | +<div class='indexgroup'> |
| 27 | +<ul class='indexList indexList1'> |
| 28 | + <li class='indexItem indexItem1'><a href='#NAME'>NAME</a> |
| 29 | + <li class='indexItem indexItem1'><a href='#SYNOPSIS'>SYNOPSIS</a> |
| 30 | + <li class='indexItem indexItem1'><a href='#DESCRIPTION'>DESCRIPTION</a> |
| 31 | + <li class='indexItem indexItem1'><a href='#METHODS'>METHODS</a> |
| 32 | + <ul class='indexList indexList2'> |
| 33 | + <li class='indexItem indexItem2'><a href='#get_class'>get_class</a> |
| 34 | + <li class='indexItem indexItem2'><a href='#notifier_set'>notifier_set</a> |
| 35 | + <li class='indexItem indexItem2'><a href='#wait'>wait</a> |
| 36 | + <li class='indexItem indexItem2'><a href='#get_type'>get_type</a> |
| 37 | + <li class='indexItem indexItem2'><a href='#iserror'>iserror</a> |
| 38 | + <li class='indexItem indexItem2'><a href='#get_error'>get_error</a> |
| 39 | + <li class='indexItem indexItem2'><a href='#value'>value</a> |
| 40 | + <li class='indexItem indexItem2'><a href='#decode_url'>decode_url</a> |
| 41 | + </ul> |
| 42 | + <li class='indexItem indexItem1'><a href='#AUTHOR'>AUTHOR</a> |
| 43 | + <li class='indexItem indexItem1'><a href='#SEE_ALSO'>SEE ALSO</a> |
| 44 | + <li class='indexItem indexItem1'><a href='#COPYRIGHT_AND_LICENSE'>COPYRIGHT AND LICENSE</a> |
| 45 | +</ul> |
| 46 | +</div> |
| 47 | + |
| 48 | +<h1><a class='u' href='#___top' title='click to go to top of document' |
| 49 | +name="NAME" |
| 50 | +>NAME</a></h1> |
| 51 | + |
| 52 | +<p>Audio::XMMSClient::Result - Results of Audio::XMMSClient operations</p> |
| 53 | + |
| 54 | +<h1><a class='u' href='#___top' title='click to go to top of document' |
| 55 | +name="SYNOPSIS" |
| 56 | +>SYNOPSIS</a></h1> |
| 57 | + |
| 58 | +<pre> use Audio::XMMSClient; |
| 59 | + |
| 60 | + my $conn = Audio::XMMSClient->new($client_name); |
| 61 | + $conn->connect or die $c->get_last_error; |
| 62 | + |
| 63 | + my $result = $c->playback_status; |
| 64 | + $result->wait; |
| 65 | + print $result->value;</pre> |
| 66 | + |
| 67 | +<h1><a class='u' href='#___top' title='click to go to top of document' |
| 68 | +name="DESCRIPTION" |
| 69 | +>DESCRIPTION</a></h1> |
| 70 | + |
| 71 | +<p>This module provides an abstract, asyncronous interface to for retrieving results of <code>Audio::XMMSClient</code> server operations.</p> |
| 72 | + |
| 73 | +<h1><a class='u' href='#___top' title='click to go to top of document' |
| 74 | +name="METHODS" |
| 75 | +>METHODS</a></h1> |
| 76 | + |
| 77 | +<h2><a class='u' href='#___top' title='click to go to top of document' |
| 78 | +name="get_class" |
| 79 | +>get_class</a></h2> |
| 80 | + |
| 81 | +<dl> |
| 82 | +<dt><a name="Arguments:_none" |
| 83 | +>Arguments: none</a></dt> |
| 84 | + |
| 85 | +<dd> |
| 86 | +<dt><a name="Return_Value:_$class" |
| 87 | +>Return Value: $class</a></dt> |
| 88 | +</dl> |
| 89 | + |
| 90 | +<pre> my $class = $result->get_class;</pre> |
| 91 | + |
| 92 | +<p>Get the class of the result. This may be one of "default", "signal" and "broadcast".</p> |
| 93 | + |
| 94 | +<h2><a class='u' href='#___top' title='click to go to top of document' |
| 95 | +name="notifier_set" |
| 96 | +>notifier_set</a></h2> |
| 97 | + |
| 98 | +<dl> |
| 99 | +<dt><a name="Arguments:_\&func,_$data?" |
| 100 | +>Arguments: \&func, $data?</a></dt> |
| 101 | + |
| 102 | +<dd> |
| 103 | +<dt><a name="Return_Value:_none" |
| 104 | +>Return Value: none</a></dt> |
| 105 | +</dl> |
| 106 | + |
| 107 | +<pre> $result->notifier_set(sub { die 'got an answer!' });</pre> |
| 108 | + |
| 109 | +<p>Set up a callback for the result retrival. This callback will be called when the answers arrives. It's arguments will be the result itself as well as an optional userdata if <code>$data</code> is passed.</p> |
| 110 | + |
| 111 | +<h2><a class='u' href='#___top' title='click to go to top of document' |
| 112 | +name="wait" |
| 113 | +>wait</a></h2> |
| 114 | + |
| 115 | +<dl> |
| 116 | +<dt><a name="Arguments:_none" |
| 117 | +>Arguments: none</a></dt> |
| 118 | + |
| 119 | +<dd> |
| 120 | +<dt><a name="Return_Value:_$result" |
| 121 | +>Return Value: $result</a></dt> |
| 122 | +</dl> |
| 123 | + |
| 124 | +<pre> my $value = $result->wait->value;</pre> |
| 125 | + |
| 126 | +<p>Block for the reply. In a synchronous application this can be used to wait for the result. Will return the <code>$result</code> this method was called when the server replyed.</p> |
| 127 | + |
| 128 | +<h2><a class='u' href='#___top' title='click to go to top of document' |
| 129 | +name="get_type" |
| 130 | +>get_type</a></h2> |
| 131 | + |
| 132 | +<dl> |
| 133 | +<dt><a name="Arguments:_none" |
| 134 | +>Arguments: none</a></dt> |
| 135 | + |
| 136 | +<dd> |
| 137 | +<dt><a name="Return_Value:_$type" |
| 138 | +>Return Value: $type</a></dt> |
| 139 | +</dl> |
| 140 | + |
| 141 | +<pre> my $type = $result->get_type;</pre> |
| 142 | + |
| 143 | +<p>Get the type of the result. May be one of "none", "error", "uint", "int", "string", "dict", "bin", "coll" or "list".</p> |
| 144 | + |
| 145 | +<h2><a class='u' href='#___top' title='click to go to top of document' |
| 146 | +name="iserror" |
| 147 | +>iserror</a></h2> |
| 148 | + |
| 149 | +<dl> |
| 150 | +<dt><a name="Arguments:_none" |
| 151 | +>Arguments: none</a></dt> |
| 152 | + |
| 153 | +<dd> |
| 154 | +<dt><a name="Return_Value:_1_|_0" |
| 155 | +>Return Value: 1 | 0</a></dt> |
| 156 | +</dl> |
| 157 | + |
| 158 | +<pre> my $has_error = $result->iserror;</pre> |
| 159 | + |
| 160 | +<p>Check if the result represents an error. Returns a true value if the result is an error, false otherwise.</p> |
| 161 | + |
| 162 | +<h2><a class='u' href='#___top' title='click to go to top of document' |
| 163 | +name="get_error" |
| 164 | +>get_error</a></h2> |
| 165 | + |
| 166 | +<dl> |
| 167 | +<dt><a name="Arguments:_none" |
| 168 | +>Arguments: none</a></dt> |
| 169 | + |
| 170 | +<dd> |
| 171 | +<dt><a name="Return_Value:_$message" |
| 172 | +>Return Value: $message</a></dt> |
| 173 | +</dl> |
| 174 | + |
| 175 | +<pre> my $message = $result->get_error;</pre> |
| 176 | + |
| 177 | +<p>Get an error <code>$message</code> describing the error that occoured.</p> |
| 178 | + |
| 179 | +<h2><a class='u' href='#___top' title='click to go to top of document' |
| 180 | +name="value" |
| 181 | +>value</a></h2> |
| 182 | + |
| 183 | +<dl> |
| 184 | +<dt><a name="Arguments:_none" |
| 185 | +>Arguments: none</a></dt> |
| 186 | + |
| 187 | +<dd> |
| 188 | +<dt><a name="Return_Value:_$scalar_|_\@arrayref_|_\%hashref_|_\%propdict" |
| 189 | +>Return Value: $scalar | \@arrayref | \%hashref | \%propdict</a></dt> |
| 190 | +</dl> |
| 191 | + |
| 192 | +<pre> my $value = $result->value;</pre> |
| 193 | + |
| 194 | +<p>Gets the return value of the <code>$result</code>. Depending of the results type (<a href="#get_type" class="podlinkpod" |
| 195 | +>"get_type"</a>) you might get other types of return values.</p> |
| 196 | + |
| 197 | +<h2><a class='u' href='#___top' title='click to go to top of document' |
| 198 | +name="decode_url" |
| 199 | +>decode_url</a></h2> |
| 200 | + |
| 201 | +<dl> |
| 202 | +<dt><a name="Arguments:_$string" |
| 203 | +>Arguments: $string</a></dt> |
| 204 | + |
| 205 | +<dd> |
| 206 | +<dt><a name="Return_Value:_$decoded_url" |
| 207 | +>Return Value: $decoded_url</a></dt> |
| 208 | +</dl> |
| 209 | + |
| 210 | +<pre> my $decoded_url = $result->decode_url($url); |
| 211 | + my $decoded_url = Audio::XMMSClient::Result->decode_url($url);</pre> |
| 212 | + |
| 213 | +<p>Decode an URL-encoded <code>$string</code>.</p> |
| 214 | + |
| 215 | +<p>Some strings (currently only the url of media) has no known encoding, and must be encoded in an UTF-8 clean way. This is done similar to the url encoding web browsers do. This functions decodes a string encoded in that way. OBSERVE that the decoded string HAS NO KNOWN ENCODING and you cannot display it on screen in a 100% guaranteed correct way (a good heuristic is to try to validate the decoded string as UTF-8, and if it validates assume that it is an UTF-8 encoded string, and otherwise fall back to some other encoding).</p> |
| 216 | + |
| 217 | +<p>Do not use this function if you don't understand the implications. The best thing is not to try to display the url at all.</p> |
| 218 | + |
| 219 | +<p>Note that the fact that the string has NO KNOWN ENCODING and CAN NOT BE DISPLAYED does not stop you from open the file if it is a local file (if it starts with "file://").</p> |
| 220 | + |
| 221 | +<p>This method can either be called as a class or instance method.</p> |
| 222 | + |
| 223 | +<h1><a class='u' href='#___top' title='click to go to top of document' |
| 224 | +name="AUTHOR" |
| 225 | +>AUTHOR</a></h1> |
| 226 | + |
| 227 | +<p>Florian Ragwitz <rafl@debian.org></p> |
| 228 | + |
| 229 | +<h1><a class='u' href='#___top' title='click to go to top of document' |
| 230 | +name="SEE_ALSO" |
| 231 | +>SEE ALSO</a></h1> |
| 232 | + |
| 233 | +<p><a href="../../Audio/XMMSClient.html" class="podlinkpod" |
| 234 | +>Audio::XMMSClient</a>, <a href="../../Audio/XMMSClient/Result/PropDict.html" class="podlinkpod" |
| 235 | +>Audio::XMMSClient::Result::PropDict</a></p> |
| 236 | + |
| 237 | +<h1><a class='u' href='#___top' title='click to go to top of document' |
| 238 | +name="COPYRIGHT_AND_LICENSE" |
| 239 | +>COPYRIGHT AND LICENSE</a></h1> |
| 240 | + |
| 241 | +<p>Copyright (C) 2006-2008, Florian Ragwitz</p> |
| 242 | + |
| 243 | +<p>This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.</p> |
| 244 | +<p class="backlinkbottom"><b><a name="___bottom" href="../../index.html" title="All Documents"><<</a></b></p> |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | +</body></html> |
0 commit comments