// Path: src/main/java/songo/ResourceUtil.java
// public class ResourceUtil {
// 	private ResourceUtil() {
// 
// 	}
// 	public static InputStream iconStream(String name) {
// 		return ResourceUtil.class.getResourceAsStream("/songo/icons/dark/" + name + ".png");
// 	}
// }
// 
// Path: src/main/java/songo/ResourceUtil.java
// public static InputStream iconStream(String name) {
// 	return ResourceUtil.class.getResourceAsStream("/songo/icons/dark/" + name + ".png");
// }


import com.google.common.eventbus.EventBus;
import com.google.inject.Inject;
import com.google.inject.servlet.SessionScoped;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ControlEditor;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import songo.ResourceUtil;
import songo.annotation.GlobalBus;
import songo.annotation.SessionBus;
import static songo.ResourceUtil.iconStream;
package songo.view;



@SessionScoped
public class PlayerControl extends Composite {
	private final EventBus globalBus;
	private final ProgressBar progress;
	private int duration = 0;
	private ProgressBar downloadProgress;
	private ToolItem playButton;
	private Image playIcon;
	private Image pauseIcon;

	@Inject
	public PlayerControl(MainView mainView, @GlobalBus EventBus globalBus, @SessionBus final EventBus sessionBus) {
		super(mainView.getShell(), SWT.NONE);
		this.globalBus = globalBus;
		moveAbove(mainView.getShell().getChildren()[0]);
		setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
		GridLayout thisLayout = new GridLayout(2, false);
		thisLayout.marginWidth = 0;
		thisLayout.marginHeight = 0;
		thisLayout.horizontalSpacing = 0;
		thisLayout.verticalSpacing = 0;
		setLayout(thisLayout);
		ToolBar toolbar = new ToolBar(this, SWT.FLAT);
		GridData toolbarData = new GridData(SWT.CENTER, SWT.FILL, false, true);
		toolbarData.verticalSpan = 2;
		toolbar.setLayoutData(toolbarData);
		ToolItem prevButton = new ToolItem(toolbar, SWT.FLAT);
// Path: src/main/java/songo/ResourceUtil.java
// public class ResourceUtil {
// 	private ResourceUtil() {
// 
// 	}
// 	public static InputStream iconStream(String name) {
// 		return ResourceUtil.class.getResourceAsStream("/songo/icons/dark/" + name + ".png");
// 	}
// }
// 
// Path: src/main/java/songo/ResourceUtil.java
// public static InputStream iconStream(String name) {
// 	return ResourceUtil.class.getResourceAsStream("/songo/icons/dark/" + name + ".png");
// }


// Path: src/main/java/songo/view/PlayerControl.java
import com.google.common.eventbus.EventBus;
import com.google.inject.Inject;
import com.google.inject.servlet.SessionScoped;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ControlEditor;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import songo.ResourceUtil;
import songo.annotation.GlobalBus;
import songo.annotation.SessionBus;
import static songo.ResourceUtil.iconStream;

package songo.view;



@SessionScoped
public class PlayerControl extends Composite {
	private final EventBus globalBus;
	private final ProgressBar progress;
	private int duration = 0;
	private ProgressBar downloadProgress;
	private ToolItem playButton;
	private Image playIcon;
	private Image pauseIcon;

	@Inject
	public PlayerControl(MainView mainView, @GlobalBus EventBus globalBus, @SessionBus final EventBus sessionBus) {
		super(mainView.getShell(), SWT.NONE);
		this.globalBus = globalBus;
		moveAbove(mainView.getShell().getChildren()[0]);
		setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
		GridLayout thisLayout = new GridLayout(2, false);
		thisLayout.marginWidth = 0;
		thisLayout.marginHeight = 0;
		thisLayout.horizontalSpacing = 0;
		thisLayout.verticalSpacing = 0;
		setLayout(thisLayout);
		ToolBar toolbar = new ToolBar(this, SWT.FLAT);
		GridData toolbarData = new GridData(SWT.CENTER, SWT.FILL, false, true);
		toolbarData.verticalSpan = 2;
		toolbar.setLayoutData(toolbarData);
		ToolItem prevButton = new ToolItem(toolbar, SWT.FLAT);
		prevButton.setImage(new Image(getDisplay(), iconStream("prev")));