#include "log.hh"
#include "sound.hh"
#include "resource.hh"
+#include "runloop.hh"
+#include "thread.hh"
#include "timer.hh"
namespace moof {
+thread stream_thread_;
+
+
/*] Sound backend
*************************************************************************/
alSourcePlay(source_);
}
+
void start_update_timer()
{
stream_timer_.init(boost::bind(&impl::stream_update, this, _1, _2),
- SCALAR(0.1), timer::repeat);
+ SCALAR(0.1), timer::repeat);
+
+ //thread thread;
+ //thread.runloop().add_timer(stream_timer_);
+ if (!stream_thread_.is_valid())
+ {
+ stream_thread_ = thread::detach(stream_timer_);
+ }
}
void fill_stream()
void stream_update(timer& timer, scalar t)
{
- //log_error("blaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhrrrrrg");
+ log_debug("blaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhrrrrrg");
fill_stream();
- // TODO: might be nice to also allow using threads for streaming
- // rather than a timer, probably as a compile-time option
}