Skip to content

Commit

Permalink
3.0.2a
Browse files Browse the repository at this point in the history
  • Loading branch information
jjazzboss committed Jan 8, 2022
1 parent cf86aff commit ddec12a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.awt.Graphics2D;
import javax.swing.JComponent;
import javax.swing.plaf.LayerUI;
import org.jjazz.ui.utilities.api.Utilities;

/**
* A LayerUI that display a centered text over the view component using a semi-transparent background.
Expand Down
13 changes: 8 additions & 5 deletions Phrase/src/org/jjazz/phrase/api/NoteEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ public FloatRange getBeatRange()
* ClientProperties are ignored.
*
* @param ne
* @param beatWindow
* @param nearWindow
* @return
*/
public boolean equalsLoosePosition(NoteEvent ne, float beatWindow)
public boolean equalsNearPosition(NoteEvent ne, float nearWindow)
{
Preconditions.checkNotNull(ne);
if (ne.getPitch() != getPitch())
Expand All @@ -244,8 +244,11 @@ public boolean equalsLoosePosition(NoteEvent ne, float beatWindow)
{
return false;
}

if (ne.getDurationInBeats() < getDurationInBeats() - 2 * beatWindow || ne.getDurationInBeats() > getDurationInBeats() + 2 * beatWindow)
if (!ne.isNear(position, nearWindow))
{
return false;
}
if (ne.getDurationInBeats() < getDurationInBeats() - 2 * nearWindow || ne.getDurationInBeats() > getDurationInBeats() + 2 * nearWindow)
{
return false;
}
Expand All @@ -255,7 +258,7 @@ public boolean equalsLoosePosition(NoteEvent ne, float beatWindow)
/**
* Test if this note is near the specified position.
* <p>
* A "near" position means in the interval [posInBeats-nearWindow;posInBeats+nearWindow[.
* A "near" position is in the interval [posInBeats-nearWindow;posInBeats+nearWindow[.
*
* @param posInBeats
* @param nearWindow
Expand Down
8 changes: 4 additions & 4 deletions Phrase/src/org/jjazz/phrase/api/Phrase.java
Original file line number Diff line number Diff line change
Expand Up @@ -955,11 +955,11 @@ public void limitPitch(int lowLimit, int highLimit)
*
*
* @param p
* @param beatWindow Used to compare NoteEvents position and duration.
* @param nearWindow Used to compare NoteEvents position and duration.
* @return
* @see NoteEvent#equalsLoosePosition(org.jjazz.phrase.api.NoteEvent, float)
* @see NoteEvent#equalsNearPosition(org.jjazz.phrase.api.NoteEvent, float)
*/
public boolean equalsLoosePosition(Phrase p, float beatWindow)
public boolean equalsNearPosition(Phrase p, float nearWindow)
{
checkNotNull(p);
if (size() != p.size())
Expand All @@ -969,7 +969,7 @@ public boolean equalsLoosePosition(Phrase p, float beatWindow)
Iterator<NoteEvent> pIt = p.iterator();
for (NoteEvent ne : this)
{
if (!pIt.next().equalsLoosePosition(ne, beatWindow))
if (!pIt.next().equalsNearPosition(ne, nearWindow))
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Accent3_16_desc=Accent the hi-hat or ride on off-beat/2nd eighteenth/3nd sixteen
Accent4_16_name=Accent 4
Accent4_16_desc=Accent the hi-hat or ride on the 4th sixteenth of each beat
VelocityOffset=velocity
AddTambourine24_name=Tambourine down beats
AddTambourine24_desc=Add tambourine on the down beats (2 and 4)
AddTambourine24_name=Tambourine 2-4
AddTambourine24_desc=Add tambourine on beats 2 and 4
AddTambourineOffBeat_name=Tambourine off-beats
AddTambourineOffBeat_desc=Add tambourine on off-beats
AddTambourineEights_name=Tambourine 8ths
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ private boolean importEditedMidiFile(File midiFile)
}

Phrase pOld = getPhrase(rv);
if (!pNew.equalsLoosePosition(pOld, PHRASE_COMPARE_BEAT_WINDOW))
if (!pNew.equalsNearPosition(pOld, PHRASE_COMPARE_BEAT_WINDOW))
{
// LOGGER.info("importMidiFile() setting custom phrase for rv=" + rv);
// LOGGER.info("importMidiFile() pOld=" + pOld);
Expand Down
3 changes: 2 additions & 1 deletion gren-jjazzlab.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
gren release -c gren.cfg --override --tags=3.0.beta1
gren release -c gren.cfg --override --tags=3.0.2

0 comments on commit ddec12a

Please sign in to comment.