| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,10 @@ public Env (PApplet theParent) { | |||
| 17 | 17 | public void play(SoundObject input, float attackTime, float sustainTime, float sustainLevel, float releaseTime){ | |
| 18 | 18 | m_nodeId = m_engine.envelopePlay(input.returnId(), attackTime, sustainTime, sustainLevel, releaseTime); | |
| 19 | 19 | } | |
| 20 | + | ||
| 21 | + public int returnId(){ | ||
| 22 | + return m_nodeId; | ||
| 23 | + } | ||
| 20 | 24 | ||
| 21 | 25 | public void dispose(){ | |
| 22 | 26 | //m_engine.synthStop(m_nodeId); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,6 +14,7 @@ public class SoundFile implements SoundObject { | |||
| 14 | 14 | float m_add=0; | |
| 15 | 15 | int m_cue=0; | |
| 16 | 16 | float m_pos=0; | |
| 17 | + boolean m_loop; | ||
| 17 | 18 | ||
| 18 | 19 | ||
| 19 | 20 | public SoundFile(PApplet theParent, String path) { | |
@@ -43,6 +44,7 @@ public float duration(){ | |||
| 43 | 44 | } | |
| 44 | 45 | ||
| 45 | 46 | public void play(){ | |
| 47 | + m_loop=false; | ||
| 46 | 48 | if(this.channels() == 1){ | |
| 47 | 49 | m_nodeId = methCla.soundFilePlayMono(m_rate, m_pos, m_amp, m_add, false, m_filePath, this.duration()*(1/m_rate), m_cue); | |
| 48 | 50 | } | |
@@ -77,6 +79,7 @@ public void play(float rate){ | |||
| 77 | 79 | } | |
| 78 | 80 | ||
| 79 | 81 | public void loop(){ | |
| 82 | + m_loop=true; | ||
| 80 | 83 | if(this.channels() < 2){ | |
| 81 | 84 | m_nodeId = methCla.soundFilePlayMono(m_rate, m_pos, m_amp, m_add, true, m_filePath, this.duration()*(1/m_rate), m_cue); | |
| 82 | 85 | } | |
@@ -118,12 +121,24 @@ public void jump(float time){ | |||
| 118 | 121 | ||
| 119 | 122 | m_cue = (int)time * m_info[1]; | |
| 120 | 123 | ||
| 121 | - if(this.channels() < 2){ | ||
| 122 | - m_nodeId = methCla.soundFilePlayMono(m_rate, m_pos, m_amp, m_add, false, m_filePath, this.duration()*(1/m_rate), m_cue); | ||
| 123 | - } | ||
| 124 | - else if(this.channels() == 2){ | ||
| 125 | - m_nodeId = methCla.soundFilePlayMulti(m_rate, m_amp, m_add, false, m_filePath, this.duration()*(1/m_rate), m_cue); | ||
| 126 | - } | ||
| 124 | + if(m_loop == true) { | ||
| 125 | + if(this.channels() < 2){ | ||
| 126 | + m_nodeId = methCla.soundFilePlayMono(m_rate, m_pos, m_amp, m_add, true, m_filePath, this.duration()*(1/m_rate), m_cue); | ||
| 127 | + } | ||
| 128 | + else if(this.channels() == 2){ | ||
| 129 | + m_nodeId = methCla.soundFilePlayMulti(m_rate, m_amp, m_add, true, m_filePath, this.duration()*(1/m_rate), m_cue); | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + else { | ||
| 133 | + if(this.channels() < 2){ | ||
| 134 | + m_nodeId = methCla.soundFilePlayMono(m_rate, m_pos, m_amp, m_add, false, m_filePath, this.duration()*(1/m_rate), m_cue); | ||
| 135 | + } | ||
| 136 | + else if(this.channels() == 2){ | ||
| 137 | + m_nodeId = methCla.soundFilePlayMulti(m_rate, m_amp, m_add, false, m_filePath, this.duration()*(1/m_rate), m_cue); | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + m_cue = 0; | ||
| 127 | 142 | } | |
| 128 | 143 | ||
| 129 | 144 | public void cue(float time){ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments