OSDN Git Service

[VM] Commit lacked files to commit.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 6 Mar 2017 17:42:53 +0000 (02:42 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 6 Mar 2017 17:42:53 +0000 (02:42 +0900)
source/src/vm/event.cpp
source/src/vm/pcm1bit.cpp

index a185f38..80ecf99 100644 (file)
@@ -411,7 +411,7 @@ double EVENT::get_event_remaining_usec(int register_id)
 void EVENT::touch_sound(void)
 {
        if(!config.sound_strict_rendering) {
-               if((need_mix <= 0) && !sound_touched) {
+               if((need_mix <= 0) /* && !sound_touched */) {
                        int samples = mix_counter;
                        if(samples >= (sound_tmp_samples - buffer_ptr)) {
                                samples = sound_tmp_samples - buffer_ptr - 1; 
@@ -420,9 +420,9 @@ void EVENT::touch_sound(void)
                                mix_sound(samples);
                                mix_counter -= samples;
                        }
-                       if(mix_counter < 1) {
-                               mix_counter = 1;
-                       }
+                       //if(mix_counter < 1) {
+                       //      mix_counter = 1;
+                       //}
                        sound_touched = true;
                }
        }
@@ -464,18 +464,19 @@ void EVENT::event_callback(int event_id, int err)
                        mix_counter = 1;
                        sound_touched = false;
                } else {
-                       if(/*(need_mix > 0) || */(mix_counter >= mix_limit) || sound_touched) {
+                       if((need_mix > 0) || (mix_counter >= mix_limit) /* || sound_touched */) {
                                if(samples > 0) {
                                        mix_sound(samples);
                                        mix_counter -= samples;
                                }
-                               if(mix_counter < 1) {
-                                       mix_counter = 1;
-                               }
+                               //      if(mix_counter < 1) {
+                               //      mix_counter = 1;
+                               //}
                                sound_touched = false;
-                       } else {
-                               mix_counter++;
+                       //} else {
+                       //      mix_counter++;
                        }
+                       mix_counter++;
                }
        }
 }
index 084dccc..f7efd7f 100644 (file)
@@ -32,6 +32,7 @@ void PCM1BIT::write_signal(int id, uint32_t data, uint32_t mask)
        if(id == SIG_PCM1BIT_SIGNAL) {
                bool next = ((data & mask) != 0);
                if(signal != next) {
+                       touch_sound();
                        if(signal) {
                                positive_clocks += get_passed_clock(prev_clock);
                        } else {