package com.vaadin.addon.audio.shared;

import java.io.Serializable;

@SuppressWarnings("serial")
public class ChunkDescriptor implements Serializable {

	// Common chunk ID
	private int id;

	// General info
	private int startTimeOffset;
	private int endTimeOffset;
	private int leadInDuration;
	private int leadOutDuration;

	// PCM source stream data offsets
	private int startStreamByteOffset;
	private int endStreamByteOffset;

		
	public void setId(int id) {
		this.id = id;
	}

	public void setStartTimeOffset(int startTimeOffset) {
		this.startTimeOffset = startTimeOffset;
	}

	public void setEndTimeOffset(int endTimeOffset) {
		this.endTimeOffset = endTimeOffset;
	}

	public void setLeadInDuration(int leadInDuration) {
		this.leadInDuration = leadInDuration;
	}

	public void setLeadOutDuration(int leadOutDuration) {
		this.leadOutDuration = leadOutDuration;
	}

	public void setStartStreamByteOffset(int startStreamByteOffset) {
		this.startStreamByteOffset = startStreamByteOffset;
	}

	public void setEndStreamByteOffset(int endStreamByteOffset) {
		this.endStreamByteOffset = endStreamByteOffset;
	}

	public int getId() {
		return id;
	}

	public int getStartTimeOffset() {
		return startTimeOffset;
	}

	public int getEndTimeOffset() {
		return endTimeOffset;
	}

	public int getLeadInDuration() {
		return leadInDuration;
	}

	public int getLeadOutDuration() {
		return leadOutDuration;
	}

	public int getStartSampleOffset() {
		return startStreamByteOffset;
	}

	public int getEndSampleOffset() {
		return endStreamByteOffset;
	}

	@Override
	public String toString() {
		return "[Descriptor for chunk " + id + " time: " + startTimeOffset + "-" + endTimeOffset + " bytes: " + startStreamByteOffset
				+ "-" + endStreamByteOffset + "]";
	}

}

@@ -370,32 +370,28 @@
 e int startS
-treamByt
+ampl
 eOffset;%0A%09pr
@@ -400,32 +400,28 @@
 ate int endS
-treamByt
+ampl
 eOffset;%0A%0A%09%09
@@ -880,32 +880,28 @@
 id setStartS
-treamByt
+ampl
 eOffset(int 
@@ -902,32 +902,28 @@
 t(int startS
-treamByt
+ampl
 eOffset) %7B%0A%09
@@ -930,32 +930,28 @@
 %09this.startS
-treamByt
+ampl
 eOffset = st
@@ -950,32 +950,28 @@
 set = startS
-treamByt
+ampl
 eOffset;%0A%09%7D%0A
@@ -991,24 +991,20 @@
  setEndS
-treamByt
+ampl
 eOffset(
@@ -1007,32 +1007,28 @@
 set(int endS
-treamByt
+ampl
 eOffset) %7B%0A%09
@@ -1033,32 +1033,28 @@
 %0A%09%09this.endS
-treamByt
+ampl
 eOffset = en
@@ -1051,32 +1051,28 @@
 ffset = endS
-treamByt
+ampl
 eOffset;%0A%09%7D%0A
@@ -1413,32 +1413,28 @@
 eturn startS
-treamByt
+ampl
 eOffset;%0A%09%7D%0A
@@ -1478,32 +1478,28 @@
 %09return endS
-treamByt
+ampl
 eOffset;%0A%09%7D%0A
@@ -1637,11 +1637,13 @@
 + %22 
-byt
+sampl
 es: 
@@ -1652,24 +1652,20 @@
 + startS
-treamByt
+ampl
 eOffset%0A
@@ -1684,16 +1684,12 @@
 endS
-treamByt
+ampl
 eOff

Fix ChunkDescriptor serialization and semantic errors