Skip to content
Browse files

Added done() method to Music interface to determine when a Music comp…

…letes. Updated docs.
  • Loading branch information...
1 parent dc780ba commit cf6368ed6f471fceccc1f86c3cf0f994f20ade89 @finnkuusisto committed
Showing with 261 additions and 70 deletions.
  1. +2 −2 doc/allclasses-frame.html
  2. +2 −2 doc/allclasses-noframe.html
  3. +2 −2 doc/constant-values.html
  4. +2 −2 doc/deprecated-list.html
  5. +2 −2 doc/help-doc.html
  6. +14 −2 doc/index-all.html
  7. +1 −1 doc/index.html
  8. +24 −2 doc/kuusisto/tinysound/Music.html
  9. +2 −2 doc/kuusisto/tinysound/Sound.html
  10. +2 −2 doc/kuusisto/tinysound/TinySound.html
  11. +2 −2 doc/kuusisto/tinysound/internal/ByteList.html
  12. +27 −2 doc/kuusisto/tinysound/internal/MemMusic.html
  13. +2 −2 doc/kuusisto/tinysound/internal/MemSound.html
  14. +2 −2 doc/kuusisto/tinysound/internal/Mixer.html
  15. +25 −2 doc/kuusisto/tinysound/internal/MusicReference.html
  16. +2 −2 doc/kuusisto/tinysound/internal/SoundReference.html
  17. +2 −2 doc/kuusisto/tinysound/internal/StreamInfo.html
  18. +27 −2 doc/kuusisto/tinysound/internal/StreamMusic.html
  19. +2 −2 doc/kuusisto/tinysound/internal/StreamSound.html
  20. +2 −2 doc/kuusisto/tinysound/internal/UpdateRunner.html
  21. +2 −2 doc/kuusisto/tinysound/internal/package-frame.html
  22. +2 −2 doc/kuusisto/tinysound/internal/package-summary.html
  23. +2 −2 doc/kuusisto/tinysound/internal/package-tree.html
  24. +2 −2 doc/kuusisto/tinysound/package-frame.html
  25. +2 −2 doc/kuusisto/tinysound/package-summary.html
  26. +2 −2 doc/kuusisto/tinysound/package-tree.html
  27. +2 −2 doc/overview-frame.html
  28. +2 −2 doc/overview-summary.html
  29. +2 −2 doc/overview-tree.html
  30. +6 −0 src/kuusisto/tinysound/Music.java
  31. +38 −8 src/kuusisto/tinysound/internal/MemMusic.java
  32. +7 −0 src/kuusisto/tinysound/internal/MusicReference.java
  33. +46 −5 src/kuusisto/tinysound/internal/StreamMusic.java
  34. BIN tinysound.zip
View
4 doc/allclasses-frame.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
All Classes
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
View
4 doc/allclasses-noframe.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
All Classes
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
View
4 doc/constant-values.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
Constant Field Values
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
View
4 doc/deprecated-list.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
Deprecated List
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
View
4 doc/help-doc.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
API Help
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
View
16 doc/index-all.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
Index
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">
@@ -132,6 +132,18 @@
Method in interface kuusisto.tinysound.internal.<A HREF="./kuusisto/tinysound/internal/SoundReference.html" title="interface in kuusisto.tinysound.internal">SoundReference</A>
<DD>Does any cleanup necessary to dispose of resources in use by this
SoundReference.
+<DT><A HREF="./kuusisto/tinysound/internal/MemMusic.html#done()"><B>done()</B></A> -
+Method in class kuusisto.tinysound.internal.<A HREF="./kuusisto/tinysound/internal/MemMusic.html" title="class in kuusisto.tinysound.internal">MemMusic</A>
+<DD>Determine if this MemMusic has reached its end and is done playing.
+<DT><A HREF="./kuusisto/tinysound/internal/MusicReference.html#done()"><B>done()</B></A> -
+Method in interface kuusisto.tinysound.internal.<A HREF="./kuusisto/tinysound/internal/MusicReference.html" title="interface in kuusisto.tinysound.internal">MusicReference</A>
+<DD>Determine if there are no bytes remaining and play has stopped.
+<DT><A HREF="./kuusisto/tinysound/internal/StreamMusic.html#done()"><B>done()</B></A> -
+Method in class kuusisto.tinysound.internal.<A HREF="./kuusisto/tinysound/internal/StreamMusic.html" title="class in kuusisto.tinysound.internal">StreamMusic</A>
+<DD>Determine if this StreamMusic has reached its end and is done playing.
+<DT><A HREF="./kuusisto/tinysound/Music.html#done()"><B>done()</B></A> -
+Method in interface kuusisto.tinysound.<A HREF="./kuusisto/tinysound/Music.html" title="interface in kuusisto.tinysound">Music</A>
+<DD>Determine if this Music has reached its end and is done playing.
</DL>
<HR>
<A NAME="_F_"><!-- --></A><H2>
View
2 doc/index.html
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc on Mon Aug 20 21:31:05 CDT 2012-->
+<!-- Generated by javadoc on Tue Sep 11 21:06:53 CDT 2012-->
<TITLE>
Generated Documentation (Untitled)
</TITLE>
View
26 doc/kuusisto/tinysound/Music.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:04 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:52 CDT 2012 -->
<TITLE>
Music
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
@@ -123,6 +123,14 @@
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;boolean</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../kuusisto/tinysound/Music.html#done()">done</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determine if this Music has reached its end and is done playing.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../kuusisto/tinysound/Music.html#getLoopPositionByFrame()">getLoopPositionByFrame</A></B>()</CODE>
@@ -378,6 +386,20 @@
</DL>
<HR>
+<A NAME="done()"><!-- --></A><H3>
+done</H3>
+<PRE>
+boolean <B>done</B>()</PRE>
+<DL>
+<DD>Determine if this Music has reached its end and is done playing.
+<P>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>true if this Music is at the end and is done playing</DL>
+</DD>
+</DL>
+<HR>
+
<A NAME="loop()"><!-- --></A><H3>
loop</H3>
<PRE>
View
4 doc/kuusisto/tinysound/Sound.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:52 CDT 2012 -->
<TITLE>
Sound
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/TinySound.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:52 CDT 2012 -->
<TITLE>
TinySound
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/internal/ByteList.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
ByteList
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
29 doc/kuusisto/tinysound/internal/MemMusic.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
MemMusic
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -145,6 +145,14 @@
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;boolean</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../kuusisto/tinysound/internal/MemMusic.html#done()">done</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determine if this MemMusic has reached its end and is done playing.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../kuusisto/tinysound/internal/MemMusic.html#getLoopPositionByFrame()">getLoopPositionByFrame</A></B>()</CODE>
@@ -457,6 +465,23 @@
</DL>
<HR>
+<A NAME="done()"><!-- --></A><H3>
+done</H3>
+<PRE>
+public boolean <B>done</B>()</PRE>
+<DL>
+<DD>Determine if this MemMusic has reached its end and is done playing.
+<P>
+<DD><DL>
+<DT><B>Specified by:</B><DD><CODE><A HREF="../../../kuusisto/tinysound/Music.html#done()">done</A></CODE> in interface <CODE><A HREF="../../../kuusisto/tinysound/Music.html" title="interface in kuusisto.tinysound">Music</A></CODE></DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>true if this MemMusic has reached the end and is done playing</DL>
+</DD>
+</DL>
+<HR>
+
<A NAME="loop()"><!-- --></A><H3>
loop</H3>
<PRE>
View
4 doc/kuusisto/tinysound/internal/MemSound.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
MemSound
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/internal/Mixer.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
Mixer
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
27 doc/kuusisto/tinysound/internal/MusicReference.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
MusicReference
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -139,6 +139,14 @@
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../kuusisto/tinysound/internal/MusicReference.html#done()">done</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determine if there are no bytes remaining and play has stopped.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../kuusisto/tinysound/internal/MusicReference.html#getLoop()">getLoop</A></B>()</CODE>
<BR>
@@ -397,6 +405,21 @@
</DL>
<HR>
+<A NAME="done()"><!-- --></A><H3>
+done</H3>
+<PRE>
+boolean <B>done</B>()</PRE>
+<DL>
+<DD>Determine if there are no bytes remaining and play has stopped.
+<P>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>true if there are no bytes remaining and the reference is no
+ longer playing</DL>
+</DD>
+</DL>
+<HR>
+
<A NAME="skipBytes(long)"><!-- --></A><H3>
skipBytes</H3>
<PRE>
View
4 doc/kuusisto/tinysound/internal/SoundReference.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
SoundReference
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/internal/StreamInfo.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
StreamInfo
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
29 doc/kuusisto/tinysound/internal/StreamMusic.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
StreamMusic
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -145,6 +145,14 @@
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;boolean</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../kuusisto/tinysound/internal/StreamMusic.html#done()">done</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determine if this StreamMusic has reached its end and is done playing.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../kuusisto/tinysound/internal/StreamMusic.html#getLoopPositionByFrame()">getLoopPositionByFrame</A></B>()</CODE>
@@ -461,6 +469,23 @@
</DL>
<HR>
+<A NAME="done()"><!-- --></A><H3>
+done</H3>
+<PRE>
+public boolean <B>done</B>()</PRE>
+<DL>
+<DD>Determine if this StreamMusic has reached its end and is done playing.
+<P>
+<DD><DL>
+<DT><B>Specified by:</B><DD><CODE><A HREF="../../../kuusisto/tinysound/Music.html#done()">done</A></CODE> in interface <CODE><A HREF="../../../kuusisto/tinysound/Music.html" title="interface in kuusisto.tinysound">Music</A></CODE></DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>true if this StreamMusic has reached the end and is done playing</DL>
+</DD>
+</DL>
+<HR>
+
<A NAME="loop()"><!-- --></A><H3>
loop</H3>
<PRE>
View
4 doc/kuusisto/tinysound/internal/StreamSound.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
StreamSound
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/internal/UpdateRunner.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
UpdateRunner
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/internal/package-frame.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
kuusisto.tinysound.internal
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/internal/package-summary.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
kuusisto.tinysound.internal
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/internal/package-tree.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
kuusisto.tinysound.internal Class Hierarchy
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/package-frame.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
kuusisto.tinysound
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/package-summary.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
kuusisto.tinysound
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
View
4 doc/kuusisto/tinysound/package-tree.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
kuusisto.tinysound Class Hierarchy
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
View
4 doc/overview-frame.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
Overview List
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
View
4 doc/overview-summary.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
Overview
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
View
4 doc/overview-tree.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_11) on Mon Aug 20 21:31:05 CDT 2012 -->
+<!-- Generated by javadoc (build 1.6.0_11) on Tue Sep 11 21:06:53 CDT 2012 -->
<TITLE>
Class Hierarchy
</TITLE>
-<META NAME="date" CONTENT="2012-08-20">
+<META NAME="date" CONTENT="2012-09-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
View
6 src/kuusisto/tinysound/Music.java
@@ -80,6 +80,12 @@
public boolean playing();
/**
+ * Determine if this Music has reached its end and is done playing.
+ * @return true if this Music is at the end and is done playing
+ */
+ public boolean done();
+
+ /**
* Determine if this Music will loop.
* @return true if this Music will loop
*/
View
46 src/kuusisto/tinysound/internal/MemMusic.java
@@ -64,8 +64,8 @@ public MemMusic(byte[] left, byte[] right, Mixer mixer) {
*/
@Override
public void play(boolean loop) {
- this.reference.setPlaying(true);
this.reference.setLoop(loop);
+ this.reference.setPlaying(true);
}
/**
@@ -75,9 +75,9 @@ public void play(boolean loop) {
*/
@Override
public void play(boolean loop, double volume) {
- this.reference.setPlaying(true);
this.setLoop(loop);
this.setVolume(volume);
+ this.reference.setPlaying(true);
}
/**
@@ -132,6 +132,15 @@ public boolean playing() {
}
/**
+ * Determine if this MemMusic has reached its end and is done playing.
+ * @return true if this MemMusic has reached the end and is done playing
+ */
+ @Override
+ public boolean done() {
+ return this.reference.done();
+ }
+
+ /**
* Determine if this MemMusic will loop.
* @return true if this MemMusic will loop
*/
@@ -383,6 +392,17 @@ public synchronized long bytesAvailable() {
}
/**
+ * Determine if there are no bytes remaining and play has stopped.
+ * @return true if there are no bytes remaining and the reference is no
+ * longer playing
+ */
+ @Override
+ public synchronized boolean done() {
+ long available = this.left.length - this.position;
+ return available <= 0 && !this.playing;
+ }
+
+ /**
* Skip a specified number of bytes of the audio data.
* @param num number of bytes to skip
*/
@@ -390,9 +410,14 @@ public synchronized long bytesAvailable() {
public synchronized void skipBytes(long num) {
for (int i = 0; i < num; i++) {
this.position++;
- //wrap if looping
- if (this.loop && this.position >= this.left.length) {
- this.position = this.loopPosition;
+ //wrap if looping, stop otherwise
+ if (this.position >= this.left.length) {
+ if (this.loop) {
+ this.position = this.loopPosition;
+ }
+ else {
+ this.playing = false;
+ }
}
}
}
@@ -423,9 +448,14 @@ public synchronized void nextTwoBytes(int[] data, boolean bigEndian) {
(this.right[this.position] & 0xFF));
}
this.position += 2;
- //wrap if looping
- if (this.loop && this.position >= this.left.length) {
- this.position = this.loopPosition;
+ //wrap if looping, stop otherwise
+ if (this.position >= this.left.length) {
+ if (this.loop) {
+ this.position = this.loopPosition;
+ }
+ else {
+ this.playing = false;
+ }
}
}
View
7 src/kuusisto/tinysound/internal/MusicReference.java
@@ -103,6 +103,13 @@
public long bytesAvailable();
/**
+ * Determine if there are no bytes remaining and play has stopped.
+ * @return true if there are no bytes remaining and the reference is no
+ * longer playing
+ */
+ public boolean done();
+
+ /**
* Skip a specified number of bytes of the audio data.
* @param num number of bytes to skip
*/
View
51 src/kuusisto/tinysound/internal/StreamMusic.java
@@ -67,9 +67,10 @@ public StreamMusic(URL dataURL, long numBytesPerChannel, Mixer mixer)
* Play this StreamMusic and loop if specified.
* @param loop if this StreamMusic should loop
*/
+ @Override
public void play(boolean loop) {
- this.reference.setPlaying(true);
this.reference.setLoop(loop);
+ this.reference.setPlaying(true);
}
/**
@@ -77,15 +78,17 @@ public void play(boolean loop) {
* @param loop if this StreamMusic should loop
* @param volume the volume to play the this StreamMusic
*/
+ @Override
public void play(boolean loop, double volume) {
- this.reference.setPlaying(true);
this.setLoop(loop);
this.setVolume(volume);
+ this.reference.setPlaying(true);
}
/**
* Stop playing this StreamMusic and set its position to the beginning.
*/
+ @Override
public void stop() {
this.reference.setPlaying(false);
this.rewind();
@@ -94,6 +97,7 @@ public void stop() {
/**
* Stop playing this StreamMusic and keep its current position.
*/
+ @Override
public void pause() {
this.reference.setPlaying(false);
}
@@ -101,6 +105,7 @@ public void pause() {
/**
* Play this StreamMusic from its current position.
*/
+ @Override
public void resume() {
this.reference.setPlaying(true);
}
@@ -108,6 +113,7 @@ public void resume() {
/**
* Set this StreamMusic's position to the beginning.
*/
+ @Override
public void rewind() {
this.reference.setPosition(0);
}
@@ -115,6 +121,7 @@ public void rewind() {
/**
* Set this StreamMusic's position to the loop position.
*/
+ @Override
public void rewindToLoopPosition() {
long byteIndex = this.reference.getLoopPosition();
this.reference.setPosition(byteIndex);
@@ -124,14 +131,25 @@ public void rewindToLoopPosition() {
* Determine if this StreamMusic is playing.
* @return true if this StreamMusic is playing
*/
+ @Override
public boolean playing() {
return this.reference.getPlaying();
}
/**
+ * Determine if this StreamMusic has reached its end and is done playing.
+ * @return true if this StreamMusic has reached the end and is done playing
+ */
+ @Override
+ public boolean done() {
+ return this.reference.done();
+ }
+
+ /**
* Determine if this StreamMusic will loop.
* @return true if this StreamMusic will loop
*/
+ @Override
public boolean loop() {
return this.reference.getLoop();
}
@@ -140,6 +158,7 @@ public boolean loop() {
* Set whether this StreamMusic will loop.
* @param loop whether this StreamMusic will loop
*/
+ @Override
public void setLoop(boolean loop) {
this.reference.setLoop(loop);
}
@@ -200,6 +219,7 @@ public void setLoopPositionBySeconds(double seconds) {
* Get the volume of this StreamMusic.
* @return volume of this StreamMusic
*/
+ @Override
public double getVolume() {
return this.reference.getVolume();
}
@@ -208,6 +228,7 @@ public double getVolume() {
* Set the volume of this StreamMusic.
* @param volume the desired volume of this StreamMusic
*/
+ @Override
public void setVolume(double volume) {
if (volume >= 0.0) {
this.reference.setVolume(volume);
@@ -401,6 +422,17 @@ public synchronized void setVolume(double volume) {
public synchronized long bytesAvailable() {
return this.numBytesPerChannel - this.position;
}
+
+ /**
+ * Determine if there are no bytes remaining and play has stopped.
+ * @return true if there are no bytes remaining and the reference is no
+ * longer playing
+ */
+ @Override
+ public synchronized boolean done() {
+ long available = this.numBytesPerChannel - this.position;
+ return available <= 0 && !this.playing;
+ }
/**
* Skip a specified number of bytes of the audio data.
@@ -413,6 +445,8 @@ public synchronized void skipBytes(long num) {
//if we're not looping, nothing special needs to happen
if (!this.loop) {
this.position += num;
+ //now stop since we're out
+ this.playing = false;
return;
}
else {
@@ -447,10 +481,12 @@ public synchronized void skipBytes(long num) {
} catch (IOException e) {
//hmm... I guess invalidate this reference
this.position = this.numBytesPerChannel;
+ this.playing = false;
}
//increment the position appropriately
if (tmpRead == -1) { //reached end of file in the middle of reading
this.position = this.numBytesPerChannel;
+ this.playing = false;
}
else {
this.position += num;
@@ -506,9 +542,14 @@ public synchronized void nextTwoBytes(int[] data, boolean bigEndian) {
else {
this.position += 2;
}
- //wrap if looping
- if (this.loop && this.position >= this.numBytesPerChannel) {
- this.setPosition(this.loopPosition);
+ //wrap if looping, stop otherwise
+ if (this.position >= this.numBytesPerChannel) {
+ if (this.loop) {
+ this.setPosition(this.loopPosition);
+ }
+ else {
+ this.playing = false;
+ }
}
}
View
BIN tinysound.zip
Binary file not shown.

0 comments on commit cf6368e

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