Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed method StreamPlayer.getPositionByte() #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1174,21 +1174,6 @@ public long getTotalBytes() {
return encodedAudioLength;
}

/**
* @return BytePosition
*/
@Override
public int getPositionByte() {
final int positionByte = AudioSystem.NOT_SPECIFIED;
if (audioProperties != null) {
if (audioProperties.containsKey("mp3.position.byte"))
return (Integer) audioProperties.get("mp3.position.byte");
if (audioProperties.containsKey("ogg.position.byte"))
return (Integer) audioProperties.get("ogg.position.byte");
}
return positionByte;
}

/** The source data line. */
public Outlet getOutlet() {
return outlet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ public interface StreamPlayerInterface {
*/
long getTotalBytes();

/**
* @return BytePosition
*/
int getPositionByte();

/**
* Gets the source data line.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,4 @@ void playingUnopenedSourceThrowsException() {
assertThrows(Exception.class, () -> player.play());
}

@Test
void seekBytes() throws StreamPlayerException {
player.open(audioFile);
player.play();
int positionByte1 = player.getPositionByte();

player.seekBytes(100);
int positionByte2 = player.getPositionByte();

assertTrue( positionByte2 > positionByte1);

// TODO: It seems that getPositionByte doesn't work.
// It isn't called from within this project, except for in this test.
// It is however called by XR3Player. If XR3Player needs this method, it must be tested
// within this project. The method relies on a map, which doesn't seem to be updated by play()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -540,13 +540,6 @@ void minimumGain() {
fail("Test not done");
}

@Test
void positionByte() {
player.getPositionByte();

fail("Test not done");
}

@Test
void precision() throws StreamPlayerException {
assertEquals(0f, player.getPrecision());
Expand Down