]> Dogcows Code - chaz/yoink/blobdiff - src/moof/sound.cc
build system enhancements
[chaz/yoink] / src / moof / sound.cc
index 34c30ce78929b172d2165bad3eff78fec4c2081b..864c68abda05f3820f823e8a81922fb2a9b909ea 100644 (file)
@@ -23,6 +23,8 @@
 #include "log.hh"
 #include "sound.hh"
 #include "resource.hh"
+#include "runloop.hh"
+#include "thread.hh"
 #include "timer.hh"
 
 
@@ -36,6 +38,9 @@
 namespace moof {
 
 
+thread stream_thread_;
+
+
 /*] Sound backend
  *************************************************************************/
 
@@ -356,10 +361,18 @@ public:
                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()
@@ -531,10 +544,8 @@ public:
 
        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
        }
 
 
This page took 0.021329 seconds and 4 git commands to generate.