Skip to content
Browse files

fixing volume bug

git-svn-id: svn://rubyforge.org/var/svn/raop/trunk@13 55bd698d-9d04-498c-8937-980560813b27
  • Loading branch information...
1 parent 0f7141a commit 415328b6a69a40b8ff3eee62660812d5478a9ff1 aaronp committed
Showing with 7 additions and 3 deletions.
  1. +4 −0 CHANGELOG.txt
  2. +3 −3 lib/raop/client.rb
View
4 CHANGELOG.txt
@@ -1,5 +1,9 @@
= Net::RAOP::Client CHANGELOG
+== 0.1.1
+
+* Fixing a bug with setting volume.
+
== 0.1.0
* Birthday!
View
6 lib/raop/client.rb
@@ -55,8 +55,8 @@ def connect
##
# Set the +volume+ on the Airport Express. -144 is quiet, 0 is loud.
def volume=(volume)
- volume = 0 + volume if volume < 0
- raise ArgumentError if volume < 0 || volume > 144
+ volume = volume.abs
+ raise ArgumentError if volume > 144
params = Net::RTSP::SetParameter.new(@session_id,
{ :volume => "-#{volume}".to_i }
)
@@ -103,7 +103,7 @@ def send_sample(sample, pos = 0, count = sample.length)
@aes_crypt.update(sample.slice(0, crypt_length)) +
sample.slice(crypt_length, sample.length)
- @data_socket.syswrite(data)
+ @data_socket.write(data)
end
def rsa_encrypt(plain_text)

0 comments on commit 415328b

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