Commit Graph

168 Commits

Author SHA1 Message Date
Dave Hoover 1daf5c206b And of course, if I were thinking this morning, I would've rerun the organize imports
thing before committing instead of just going "oh yeah, I've been having this stuff
sitting around uncommitted for a while waiting on it to be blessed" and missing
out on things that'd changed in the meantime.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@665 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-09-26 17:35:27 +00:00
Dave Hoover b473318b12 More import cleanups to go with r662, along with a little bit of foreaching, widening, etc.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@664 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-09-26 17:29:23 +00:00
Michael Bayne 8e69ff612e Some import cleanups from Dave.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@662 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-09-25 22:16:10 +00:00
Charlie Groves 62740fe546 Rather than trying to restrict the drift adjustment into a sane range, just stop applying it if it's huge or tiny.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@656 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-09-14 23:27:29 +00:00
Dave Hoover 1c864bf169 Javadoc warnings cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@655 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-09-12 18:04:58 +00:00
Charlie Groves aa171bdd0e Expose sound types being enabled or disabled
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@646 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-23 19:42:54 +00:00
Charlie Groves 329bedd523 Choose a random sound from multi-option sounds in the SoundLoader when told to
play a particular key.
Set the gain on streams before returning them in addition to during each update.



git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@644 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-22 02:02:54 +00:00
Charlie Groves c06de7d51f Add ogg streaming to OpenALSoundPlayer
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@642 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-21 05:33:19 +00:00
Charlie Groves 81a2d3d104 Clean up some possible nulls to quiet Eclipse
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@641 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-21 01:50:06 +00:00
Charlie Groves 0abacd42d3 Give OpenALSoundPlayer its own thread and queue to keep it from sharing with the EDT and possibly blocking
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@639 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-20 23:31:21 +00:00
Charlie Groves 4aefa977b4 Expose shouldPlay
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@629 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-14 19:02:17 +00:00
Charlie Groves 8febded3b3 Nip a compiler warning
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@628 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-14 18:29:09 +00:00
Charlie Groves fbf539580e Readd a deprecated SoundManager that just extends JavaSoundPlayer to keep it around with its original name
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@626 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-14 00:51:34 +00:00
Charlie Groves fc32634412 Rename all the media.SoundManager stuff to variants on SoundPlayer to conflict
less with openal.SoundManager.



git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@625 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-14 00:50:17 +00:00
Michael Bayne 5c234af875 This needs to live in the openal package because all the OpenAL must not be
visible to things that don't want or care about OpenAL. Also, the openal
package is conditionally compiled, so this would have broken a Narya build that
didn't use the OpenAL libraries.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@624 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-13 22:49:34 +00:00
Charlie Groves e678d36262 Look at the big smart programmer using the library code instead of rolling his own, hacked-up shit
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@623 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-13 22:12:25 +00:00
Charlie Groves e4801b954f Pull the generic sound playing api from SoundManager up into
AbstractSoundManager and implement the actual sound playing with Java sound in
SoundManager and with OpenAL in OpenALSoundManager.  I left the SoundManager
name alone so nothing using it will need to change, but if nothing besides
yohoho is using it, I can refactor it to a more sane naming scheme.

Rip out all the music and alternative format stuff since it didn't work anyway.



git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@622 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-13 21:47:42 +00:00
Dave Hoover 3122ae7e65 Checking if (foo = bar) is begging for disaster.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@610 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-05 21:13:41 +00:00
Charlie Groves 7386c62a68 Calculate the drain time using a long as a decent sized clip can overflow an int
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@609 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-05 20:28:15 +00:00
Charlie Groves db0e6f93e1 Document the return on play
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@608 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-05 18:49:33 +00:00
Charlie Groves 2e25cb021f Add a music sound type
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@607 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-05 18:46:01 +00:00
Charlie Groves e8103138e5 Add a run queue to dispatch the various key processing runnables on to keep them off the spooler threads
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@606 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-05 18:45:45 +00:00
Charlie Groves 66d476dcb3 Allow play, loop and unlock to pass in a Runnable to be called when they're processed to match lock
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@605 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-05 01:13:21 +00:00
Charlie Groves 2b5a96b147 A for effort on the auto-naming Eclipse, but there's no need to drag the underscore along. Too bad you can't make generic arrays not suck.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@601 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-04 23:51:07 +00:00
Charlie Groves 5567dcf2a1 Only dirty regions in the MediaOverlay corresponding to its actual media.
Since its dirty regions propagate out to the repaint manager, a big update
there would lead to dirty calls ping-ponging back and forth for a few cycles.



git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@600 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-04 23:38:12 +00:00
Charlie Groves ee6bf4a5b9 Whoops, that was supposed to be a regular loop. Caught by the Raydar.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@598 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-02 00:06:51 +00:00
Charlie Groves 4432a9d6f8 Add a second looping mode, LOOP_TO_COMPLETION, that finishes playing its
current run through the sound when stop is called before actually stopping.

Add a runnable to the lock method that will be called on the spooler thread
when locking is complete.



git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@597 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-01 23:46:17 +00:00
Mike Thomas d1de5f411d Rollback the sound manager change - it's causing significant slowdown.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@596 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-01 20:49:10 +00:00
Mike Thomas 8fd2dffd13 And, don't need this import either.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@595 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-01 17:23:12 +00:00
Mike Thomas a2324b526e Add a clarifying comment, and remove unnecessary assignment. I don't honestly recall if this was even intentionally included or a copy-paste error, but it does seem like knowing your image is busted at compile time is much better than not knowing til runtime.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@594 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-01 17:18:37 +00:00
Michael Bayne 659f5bc5e2 Code hygiene. Not as pedantic as I'd like, but I couldn't resist the huge time
saver that is Eclipse's "Infer generic types" which leaves HashMap and
ArrayList as the declared type where I would normally prefer to change those to
Map and List and use Maps and Lists to instantiate them.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@593 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-01 15:56:37 +00:00
Michael Bayne 60622c3590 Some code hygiene.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@592 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-01 14:39:57 +00:00
Michael Bayne 786dd4f7ff Type our result listener.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@591 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-01 13:27:14 +00:00
Charlie Groves 1255109f57 Pump up the size of our line buffer to get longer sounds to play less
skiptacularly and try going back to using line.drain since our sleep until we
figure the sound will be done method wasn't working so well with the larger
buffer.  Hopefully drain has been fixed in the 4 years since it was commented
out.



git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@590 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-08-01 01:23:04 +00:00
Michael Bayne 3fad5fb569 Nixed unused variable references.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@579 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-07-26 22:04:15 +00:00
Dave Hoover 5f1eed7b94 Add in @Overrides across the board, clean up the comments around them some, and remove
unneeded imports.
I've got partially completed patches for narya & vilya, too, but nenya was the 
only one that wound up in a decent state after a friday evening puttering at it,
killing time waiting on other things to finish.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@572 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-07-14 18:19:23 +00:00
Mike Thomas 3ab8bde582 Add the ability to add "Obscurers" or components that will be drawing on top of a MediaPanel - these then force additional redrawing of the Media Panel, so should be used with extreme caution. I suspect there may be cleaner ways to do this, so there may be further changes to this in the near future, but this seems good enough for my current needs.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@568 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-07-08 22:48:36 +00:00
Michael Bayne 45edaccf6d The plot, she is thick. The Nenya framework supports a MediaOverlay that can
render sprites and animations over the top of everything in the frame:
JComponents, MediaPanels anything we like. To support this, we have the
MediaOverlay tell the ActiveRepaintManager when it has dirtied an area of the
screen and it will mark that component as needing repainting. Peachy.

However, if a component decides on its own that it needs repainting, we need to
propagate that now dirty region up to the MediaOverlay so that it can repaint
anything that's above the just-repainted component on the same frame tick.
This also fixes a potential problem if a changed sprite dirties a component
which then repaints itself but the bounds of that component overlapped some
other sprite which was not going to be repainted on this tick.

There were also potential problems if components were put in the JLayeredPane
layers (which are "above" the normal components and MediaPanels but "below" the
MediaOverlay). They too should now properly dirty regions in the overlay.

It occurs to me though that if a MediaOverlay sprite is on top of a MediaPanel,
the MediaPanel will probably not properly propagate its dirty region to the
overlay because the MediaPanel is a frame participant, not a JComponent and its
repainting is handled by the FrameManager not the ActiveRepaintManager. I may
just use the sledgehammer approach and dirty in the media overlay the entire
bounds of a frame participant if it paints anything on a frame rather than try
to translated and propagate its underlying dirty regions up to the overlay.

Oh the twisty maze of passages we've created in trying to create an active
rendering system that works magically with Swing.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@566 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-07-07 19:24:26 +00:00
Michael Bayne 83a7c58017 Move this getter up with his friends.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@565 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-07-07 19:00:31 +00:00
Michael Bayne f69a3d550e More generics.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@564 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-07-07 18:57:51 +00:00
Michael Bayne d5b1c1faf5 Generics.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@563 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-07-07 18:53:18 +00:00
Michael Bayne 1b7832dd8a Fixed the comment.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@562 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-07-07 18:44:16 +00:00
Charlie Groves 550c360df6 Allow image preparation to be turned off on a run by run basis
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@552 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-06-24 23:44:50 +00:00
Charlie Groves cd30b42cd8 Allow the size of the sound cache to be set in the sound manager's constructor.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@549 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-06-23 22:00:22 +00:00
Charlie Groves 49777fab3f Everybody's favorite new game show, Name That Thread
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@538 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-06-11 00:46:48 +00:00
Charlie Groves ef4e27cdd0 Need to synchronize around adjustSize as it can lead to a flush
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@536 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-06-10 23:33:58 +00:00
Charlie Groves d67c0bd7b7 Only use the set cache value for the current set of managers, don't store it in the RuntimeAdjust
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@535 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-06-10 21:37:57 +00:00
Mike Thomas 06e3217d6b Well that's just peachy. When we drawImage from a BufferedImage, the performance is relative to the size of the source image, not to the size of the resulting tile subimage. Therefore, for largish tileset sources, this was taking a Very Long Time. So, we take a subimage first and use that for our drawing. (I believe it's still accurate that we cannot just use the subimage directly due to various factors - though if we somehow could, it would save us some cache space).
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@534 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-06-10 20:29:20 +00:00
Charlie Groves 70ef6a644a Widened and genericized
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@528 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-06-06 21:16:45 +00:00
Charlie Groves 7d613a999a Allow cache sizes to be set programatically
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@527 ed5b42cb-e716-0410-a449-f6a68f950b19
2008-06-06 21:15:05 +00:00