Index: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcplayer/VLCPlayerEditor.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcplayer/VLCPlayerEditor.java	(revision 0)
+++ tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcplayer/VLCPlayerEditor.java	(revision 2436)
@@ -0,0 +1,101 @@
+package org.txm.backtomedia.editors.vlcplayer;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+
+public class VLCPlayerEditor extends EditorPart {
+	
+	/** The Constant ID. */
+	public static final String ID = VLCPlayerEditor.class.getCanonicalName(); // $NON-NLS-1$
+	
+	VLCPlayer player;
+	
+	@Override
+	public void createPartControl(Composite parent) {
+		player = new VLCPlayer(parent, SWT.NONE);
+	}
+	
+	public void init() {
+		
+	}
+	
+	@Override
+	public void setFocus() {
+		
+	}
+	
+	@Override
+	public void dispose() {
+		try {
+			if (player != null) player.stop();
+		}
+		catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		super.dispose();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	@Override
+	public void doSave(IProgressMonitor monitor) {}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+	 */
+	@Override
+	public void doSaveAs() {}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+	 */
+	@Override
+	public void init(IEditorSite site, IEditorInput input)
+			throws PartInitException {
+		setSite(site);
+		setInput(input);
+		// VLCPlayerEditorInput ii = (VLCPlayerEditorInput) input;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+	 */
+	@Override
+	public boolean isSaveAsAllowed() {
+		return false;
+	}
+	
+	public VLCPlayer getPlayer() {
+		return player;
+	}
+	
+	@Override
+	public void setPartName(String partName) {
+		super.setPartName(partName);
+	}
+	
+	@Override
+	public boolean isDirty() {
+		return false;
+	}
+	
+	/**
+	 * for more test use "player.getEmbeddedMediaPlayer()"
+	 * 
+	 * @return false if the media could not be loaded (file not found, access error...)
+	 */
+	public boolean isMediaLoaded() {
+		return player.getEmbeddedMediaPlayer().isPlayable();
+	}
+}

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcplayer/VLCPlayerEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcplayer/VLCPlayer.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcplayer/VLCPlayer.java	(revision 0)
+++ tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcplayer/VLCPlayer.java	(revision 2436)
@@ -0,0 +1,535 @@
+package org.txm.backtomedia.editors.vlcplayer;
+
+import java.awt.Canvas;
+import java.awt.Frame;
+import java.io.File;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.awt.SWT_AWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Scale;
+import org.txm.backtomedia.commands.function.TripleRangeSlider;
+import org.txm.backtomedia.preferences.BackToMediaPreferences;
+import org.txm.utils.logger.Log;
+
+import uk.co.caprica.vlcj.discovery.NativeDiscovery;
+import uk.co.caprica.vlcj.discovery.linux.DefaultLinuxNativeDiscoveryStrategy;
+import uk.co.caprica.vlcj.discovery.mac.DefaultMacNativeDiscoveryStrategy;
+import uk.co.caprica.vlcj.discovery.windows.DefaultWindowsNativeDiscoveryStrategy;
+import uk.co.caprica.vlcj.player.MediaPlayer;
+import uk.co.caprica.vlcj.player.MediaPlayerEventAdapter;
+import uk.co.caprica.vlcj.player.MediaPlayerFactory;
+import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayer;
+import uk.co.caprica.vlcj.player.embedded.videosurface.CanvasVideoSurface;
+import uk.co.caprica.vlcj.player.embedded.videosurface.VideoSurfaceAdapter;
+import uk.co.caprica.vlcj.player.embedded.videosurface.linux.LinuxVideoSurfaceAdapter;
+import uk.co.caprica.vlcj.player.embedded.videosurface.mac.MacVideoSurfaceAdapter;
+import uk.co.caprica.vlcj.player.embedded.videosurface.windows.WindowsVideoSurfaceAdapter;
+import vlcplayerrcp.MessagesMP;
+
+public class VLCPlayer extends Composite {
+	
+	static {
+		// System.setProperty("jna.nosys", "true"); // TODO understand why I need to do this
+		// NativeDiscovery nd = new NativeDiscovery(new DefaultLinuxNativeDiscoveryStrategy() {
+		// @Override
+		// protected void onGetDirectoryNames(List<String> directoryNames) {
+		// directoryNames.add("/usr/lib");
+		// directoryNames.add("/usr/local/lib");
+		// directoryNames.add("/snap/vlc/current/usr/lib");
+		// }
+		// },
+		// new DefaultWindowsNativeDiscoveryStrategy(),
+		// new DefaultMacNativeDiscoveryStrategy()
+		// );
+		
+		if (!new NativeDiscovery().discover()) {
+			// System.out.println(MessagesMP.error_native_libs);
+		}
+		else {
+			// System.out.println("VLC native libraries found !");
+		}
+	}
+	
+	protected static final String NOMEDIA = ""; //$NON-NLS-1$
+	
+	private MediaPlayerFactory mediaPlayerFactory;
+	
+	private EmbeddedMediaPlayer vlcPlayer;
+	
+	private Composite videoComposite;
+	
+	private CanvasVideoSurface playerCanvas;
+	
+	private Scale rateField;
+	
+	private Label rateValueLabel;
+	
+	private Scale volumeField;
+	
+	private Label volumeValueLabel;
+	
+	private Button playButton;
+	
+	private Button repeatButton;
+	
+	protected String currentlyPlayed = ""; //$NON-NLS-1$
+	
+	// private String startTime, endTime;
+	private int start, end;
+	
+	protected boolean hasEnded = false;
+	
+	private String previouslyPlayed = ""; //$NON-NLS-1$
+	
+	private boolean repeat = false;
+	
+	protected int volume = 100;
+	
+	private Button stopButton;
+	
+	Label timeLabel;
+	
+	TripleRangeSlider timeRange;
+	
+	boolean firstLengthEvent = true;
+	
+	long previous = 0;
+	
+	long time, mins, secs;
+	
+	
+	static {
+		// uncomment to enable VLC logs
+		// Logger.setLevel(Level.TRACE);
+	}
+	
+	public EmbeddedMediaPlayer getEmbeddedMediaPlayer() {
+		return vlcPlayer;
+	}
+	
+	public VLCPlayer(Composite parent, int style) {
+		super(parent, style);
+		this.setLayout(new GridLayout(11, false));
+		
+		// THE PLAYER
+		videoComposite = new Composite(this, SWT.EMBEDDED | SWT.NO_BACKGROUND);
+		
+		Frame videoFrame = SWT_AWT.new_Frame(videoComposite);
+		Canvas canvas = new Canvas();
+		canvas.setBackground(java.awt.Color.black);
+		videoFrame.add(canvas);
+		
+		mediaPlayerFactory = new MediaPlayerFactory();
+		
+		vlcPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer(null);
+		videoComposite.setVisible(true);
+		
+		VideoSurfaceAdapter vadapter;
+		String OS = System.getProperty("os.name"); //$NON-NLS-1$
+		if (OS.indexOf("Windows") >= 0) { //$NON-NLS-1$
+			vadapter = new WindowsVideoSurfaceAdapter();
+		}
+		else if (OS.indexOf("Mac") >= 0) { //$NON-NLS-1$
+			vadapter = new MacVideoSurfaceAdapter();
+		}
+		else {
+			vadapter = new LinuxVideoSurfaceAdapter();
+		}
+		
+		playerCanvas = new CanvasVideoSurface(canvas, vadapter);
+		vlcPlayer.setVideoSurface(playerCanvas);
+		vlcPlayer.setPlaySubItems(true); // for youtube, 2013-12-10: youtube.lua don't work
+		
+		GridData gdata = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gdata.horizontalSpan = 11;
+		videoComposite.setLayoutData(gdata);
+		
+		// THE CONTROL BUTTONS
+		playButton = new Button(this, SWT.PUSH);
+		GridData playLayoutData = new GridData(SWT.FILL, SWT.CENTER, false, false);
+		playButton.setLayoutData(playLayoutData);
+		playButton.setText(MessagesMP.play);
+		playButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				if (currentlyPlayed.length() == 0) {
+					selectMedia();
+					playButton.setText(MessagesMP.pause);
+				}
+				else if (vlcPlayer.isPlaying()) {
+					vlcPlayer.pause();
+					playButton.setText(MessagesMP.resume);
+				}
+				else if (hasEnded) {
+					replay();
+				}
+				else {
+					vlcPlayer.play();
+					playButton.setText(MessagesMP.pause);
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		// Button browseButton = new Button(this,SWT.PUSH);
+		// browseButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
+		// browseButton.setText("Open...");
+		// browseButton.addSelectionListener(new SelectionListener() {
+		// @Override
+		// public void widgetSelected(SelectionEvent e) {
+		// selectMedia();
+		// }
+		//
+		// @Override
+		// public void widgetDefaultSelected(SelectionEvent e) {}
+		// });
+		
+		stopButton = new Button(this, SWT.PUSH);
+		stopButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+		stopButton.setText(MessagesMP.stop);
+		stopButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				stop();
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		timeLabel = new Label(this, SWT.NONE);
+		timeLabel.setText("00:00"); //$NON-NLS-1$
+		
+		timeRange = new TripleRangeSlider(this, SWT.None);
+		timeRange.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+		timeRange.setToolTipText(MessagesMP.time_range);
+		timeRange.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				TripleRangeSlider.SELECTED_KNOB sk = timeRange.getLastSelectedKnob();
+				switch (sk) {
+					case UPPER:
+						end = timeRange.getUpperValue();
+						
+						if (end < time) {
+							// System.out.println("Upper changed: fix time");
+							time = end;
+							vlcPlayer.setTime(time);
+						}
+						break;
+					case LOWER:
+						start = timeRange.getLowerValue();
+						if (start > time) {
+							// System.out.println("Lower changed: fix time");
+							time = start;
+							vlcPlayer.setTime(time);
+						}
+						break;
+					case MIDDLE:
+						
+						time = timeRange.getMiddleValue();
+						// System.out.println("Middle changed: fix time: "+time);
+						vlcPlayer.setTime(time);
+						break;
+					default:
+						// nothing
+				}
+				// System.out.println("time range: "+start+" -> "+end+" time="+time);
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		repeatButton = new Button(this, SWT.CHECK);
+		repeatButton.setText(MessagesMP.repeat);
+		repeat = BackToMediaPreferences.getInstance().getBoolean(BackToMediaPreferences.REPEAT);
+		repeatButton.setSelection(repeat);
+		repeatButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				repeat = repeatButton.getSelection();
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		Label l = new Label(this, SWT.NONE);
+		l.setText(MessagesMP.rate);
+		
+		rateField = new Scale(this, SWT.BORDER);
+		GridData gdata4 = new GridData(SWT.FILL, SWT.CENTER, false, false);
+		gdata4.widthHint = 100;
+		rateField.setLayoutData(gdata4);
+		rateField.setMaximum(140);
+		rateField.setMinimum(70);
+		rateField.setSelection(100);
+		rateField.setPageIncrement(5);
+		
+		rateField.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				float rate = rateField.getSelection() / 100.0f;
+				vlcPlayer.setRate(rate);
+				rateValueLabel.setText("" + rateField.getSelection() + "%");
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		rateValueLabel = new Label(this, SWT.NONE);
+		rateValueLabel.setText("100%");//$NON-NLS-1$
+		
+		l = new Label(this, SWT.NONE);
+		l.setText(MessagesMP.volume);
+		
+		volumeField = new Scale(this, SWT.BORDER);
+		gdata4 = new GridData(SWT.FILL, SWT.CENTER, false, false);
+		gdata4.widthHint = 100;
+		volumeField.setLayoutData(gdata4);
+		volumeField.setMinimum(0);
+		volumeField.setMaximum(100);
+		volumeField.setSelection(volume);
+		volumeField.setPageIncrement(5);
+		volumeField.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				vlcPlayer.setVolume(volumeField.getSelection());
+				volume = volumeField.getSelection();
+				volumeValueLabel.setText("" + volume + "%");
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		volumeValueLabel = new Label(this, SWT.NONE);
+		volumeValueLabel.setText("100%");
+		
+		vlcPlayer.addMediaPlayerEventListener(new MediaPlayerEventAdapter() {
+			
+			@Override
+			public void playing(MediaPlayer mediaPlayer) {
+				if (volumeField != null) {
+					vlcPlayer.setVolume(volume);
+				}
+			}
+			
+			@Override
+			public void finished(MediaPlayer mediaPlayer) {
+				if (repeat) {
+					replay();
+				}
+				else {
+					hasEnded = true;
+				}
+			}
+		});
+		
+		vlcPlayer.addMediaPlayerEventListener(new MediaPlayerEventAdapter() {
+			
+			@Override
+			public void timeChanged(MediaPlayer arg0, final long arg1) {
+				time = arg1;
+				if (previous == time) {
+					return;
+				}
+				previous = time;
+				
+				timeLabel.getDisplay().syncExec(new Runnable() {
+					
+					@Override
+					public void run() {
+						if (timeRange.isDisposed()) {
+							return;
+						}
+						if (!timeRange.isDragMiddleKnob()) {
+							timeRange.setMiddleValue((int) time);
+						}
+						updateTimeLabel();
+						
+						if (arg1 > end && end != start) {
+							// System.out.println("Time > end :"+arg1 +" > "+end);
+							if (repeat) {
+								vlcPlayer.setTime(start);
+							}
+							else {
+								vlcPlayer.stop();
+							}
+						}
+					}
+				});
+			}
+			
+			@Override
+			public void lengthChanged(MediaPlayer arg0, final long arg1) {
+				if (firstLengthEvent) {
+					firstLengthEvent = false;
+					
+					// initialize time range widget limits
+					timeRange.getDisplay().syncExec(new Runnable() {
+						
+						@Override
+						public void run() {
+							if (timeRange.isDisposed()) return;
+							timeRange.setMaximum((int) arg1);
+							// if (start == end) end = (int)arg1;
+							
+							
+							if (end > 0 && start != end) {
+								timeRange.setUpperValue(end);
+							}
+							else {
+								timeRange.setUpperValue((int) arg1);
+							}
+							
+							timeRange.setLowerValue(start);
+							// System.out.println("Range: "+start+" -> "+end+" song length "+arg1);
+						}
+					});
+				}
+			}
+		});
+	}
+	
+	private void updateTimeLabel() {
+		mins = time / 60000;
+		secs = (time / 1000) % 60;
+		timeLabel.setText(String.format("%02d:%02d", mins, secs)); //$NON-NLS-1$
+		timeLabel.update();
+	}
+	
+	protected void replay() {
+		if (currentlyPlayed.length() > 0) {
+			// this.play(currentlyPlayed, startTime, endTime);
+			vlcPlayer.setTime(start);
+			playButton.setText(MessagesMP.pause);
+		}
+	}
+	
+	protected void selectMedia() {
+		Log.fine(MessagesMP.select_file);
+		
+		FileDialog fd = new FileDialog(VLCPlayer.this.getShell(), SWT.OPEN);
+		fd.setText(MessagesMP.select_file_title);
+		File f = new File(previouslyPlayed);
+		if (f.isDirectory()) fd.setFilterPath(f.getPath());
+		else fd.setFilterPath(f.getParent());
+		
+		String[] filterExt = { "*.*", "*.mp3", "*.mp4", "*.avi" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		fd.setFilterExtensions(filterExt);
+		String selected = fd.open();
+		if (selected == null) {
+			System.out.println(MessagesMP.cancel);
+			return;
+		}
+		
+		currentlyPlayed = selected;
+		previouslyPlayed = selected;
+		Log.fine(MessagesMP.opening + currentlyPlayed);
+		play(currentlyPlayed, 0, 0);
+		
+	}
+	
+	/**
+	 * 
+	 * @param mrl
+	 * @param time msec start time
+	 * @param endtime msec end time
+	 */
+	public void play(String mrl, int time, int endtime) {
+		Log.fine(MessagesMP.bind(MessagesMP.playing, new Object[] { mrl, time, endtime }));
+		play(mrl, "" + time / 1000.0f, "" + endtime / 1000.0f); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+	
+	public void play(String mrl, int time) {
+		play(mrl, time, time);
+	}
+	
+	public void hideStopButton() {
+		if (this.stopButton != null && !this.stopButton.isDisposed()) {
+			this.stopButton.dispose();
+		}
+	}
+	
+	DateTimeFormatter hhmmssFormatter = DateTimeFormatter.ISO_LOCAL_TIME;
+	
+	/**
+	 * 
+	 * @param mrl
+	 * @param startTime "0.0" or ""hh:mm:ss" format
+	 * @param endTime "0.0" or ""hh:mm:ss" format
+	 */
+	public void play(String mrl, String startTime, String endTime) {
+		
+		if (startTime.matches("[0-9]+.[0-9]+")) {
+			start = (int) (1000 * Float.parseFloat(startTime));
+		}
+		else if (startTime.matches("[0-9]+:[0-9]+:[0-9]+")) {
+			if (startTime.indexOf(":") == 1) {
+				startTime = "0" + startTime;
+			}
+			LocalTime time1 = LocalTime.parse(startTime, hhmmssFormatter);
+			start = 1000 * ((time1.getHour() * 60 * 60) + (time1.getMinute() * 60) + time1.getSecond());
+		}
+		
+		if (endTime.matches("[0-9]+.[0-9]+")) {
+			end = (int) (1000 * Float.parseFloat(endTime));
+		}
+		else if (endTime.matches("[0-9]+:[0-9]+:[0-9]+")) {
+			if (endTime.indexOf(":") == 1) endTime = "0" + endTime;
+			LocalTime time1 = LocalTime.parse(endTime, hhmmssFormatter);
+			end = 1000 * ((time1.getHour() * 60 * 60) + (time1.getMinute() * 60) + time1.getSecond());
+		}
+		
+		// if (start == end) end = -1;
+		
+		Log.fine(MessagesMP.bind(MessagesMP.playing, new Object[] { mrl, startTime, endTime }));
+		vlcPlayer.playMedia(mrl);
+		vlcPlayer.setTime(start);
+		if (new File(mrl + ".srt").exists()) { //$NON-NLS-1$
+			vlcPlayer.setSubTitleFile(mrl + ".srt"); //$NON-NLS-1$
+		}
+		currentlyPlayed = mrl;
+		previouslyPlayed = mrl;
+		
+		playButton.setText(MessagesMP.pause);
+		firstLengthEvent = true;
+	}
+	
+	public void setRepeat(boolean repeat) {
+		this.repeat = repeat;
+		repeatButton.setSelection(repeat);
+	}
+	
+	public void stop() {
+		vlcPlayer.stop();
+		currentlyPlayed = NOMEDIA;
+		if (!playButton.isDisposed()) {
+			playButton.setText(MessagesMP.play);
+		}
+	}
+}

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcplayer/VLCPlayer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/jna-5.2.0.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/jna-5.2.0.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/jna-platform-5.2.0.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/jna-platform-5.2.0.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcj-3.12.1.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/vlcj-3.12.1.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/slf4j-api-1.7.25.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-3.12.1/slf4j-api-1.7.25.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/OpenVLCPlayer.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/OpenVLCPlayer.java	(revision 2435)
+++ tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/OpenVLCPlayer.java	(revision 2436)
@@ -53,9 +53,8 @@
 
 import vlcplayerrcp.MessagesMP;
 
-// TODO: Auto-generated Javadoc
 /**
- * open the VLCPlayer Editor
+ * open the VLCPlayer Editor with a selected media file. Path or URL
  * 
  * @author mdecorde.
  */
@@ -82,7 +81,7 @@
 		}
 		
 		Shell sh = HandlerUtil.getActiveShell(event);
-		InputDialog fd = new InputDialog(sh, "Opening media file...", "Enter file path or URL", "", null);
+		SimpleFileDialog fd = new SimpleFileDialog(sh, "Opening media file...", "Enter file path or URL", "", null);
 		// FileDialog fd = new FileDialog(new Shell(), SWT.SAVE);
 		// fd.setText(MessagesMP.select_file);
 		
Index: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/SimpleFileDialog.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/SimpleFileDialog.java	(revision 0)
+++ tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/SimpleFileDialog.java	(revision 2436)
@@ -0,0 +1,45 @@
+package org.txm.backtomedia.commands.function;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+
+public class SimpleFileDialog extends InputDialog {
+	
+	Button selectButton;
+	
+	public SimpleFileDialog(Shell parentShell, String dialogTitle, String dialogMessage, String initialValue, IInputValidator validator) {
+		super(parentShell, dialogTitle, dialogMessage, initialValue, validator);
+	}
+	
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		Control p = super.createDialogArea(parent);
+		
+		selectButton = new Button(parent, SWT.PUSH);
+		selectButton.setText("...");
+		selectButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				FileDialog dialog = new FileDialog(e.display.getActiveShell());
+				String path = dialog.open();
+				if (path != null) {
+					SimpleFileDialog.this.getText().setText(path);
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		return p;
+	}
+}

Property changes on: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/SimpleFileDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/pom.xml
===================================================================
--- tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/pom.xml	(revision 2435)
+++ tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/pom.xml	(revision 2436)
@@ -1,317 +0,0 @@
-<!--
-    vlcj pom.
-
-    Add the following content to your own project pom.xml file:
-
-    <dependencies>
-        <dependency>
-            <groupId>uk.co.caprica</groupId>
-            <artifactId>vlcj</artifactId>
-            <version>4.1.0</version>
-        </dependency>
-    </dependencies> 
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.sonatype.oss</groupId>
-        <artifactId>oss-parent</artifactId>
-        <version>9</version>
-    </parent>
-
-    <groupId>uk.co.caprica</groupId>
-    <artifactId>vlcj</artifactId>
-    <version>4.1.0</version>
-
-    <name>vlcj</name>
-    <description>Java Framework for the vlc Media Player.</description>
-    <url>http://capricasoftware.co.uk/projects/vlcj</url>
-    <inceptionYear>2009</inceptionYear>
-
-    <packaging>jar</packaging>
-
-    <licenses>
-        <license>
-            <name>GPL v3</name>
-            <url>http://www.gnu.org/licenses/gpl-3.0.html</url>
-            <distribution>repo</distribution>
-        </license>
-    </licenses>
-
-    <organization>
-        <name>Caprica Software Limited</name>
-        <url>http://www.capricasoftware.co.uk</url>
-    </organization>
-
-    <developers>
-        <developer>
-            <id>mark</id>
-            <name>Mark Lee</name>
-            <email>mark.lee@capricasoftware.co.uk</email>
-            <url>https://github.com/caprica/vlcj</url>
-            <organization>Caprica Software Limited</organization>
-            <organizationUrl>http://www.capricasoftware.co.uk</organizationUrl>
-            <roles>
-                <role>architect</role>
-                <role>developer</role>
-                <role>owner</role>
-            </roles>
-            <timezone>0</timezone>
-        </developer>
-    </developers>
-
-    <issueManagement>
-        <system>Github</system>
-        <url>https://github.com/caprica/vlcj/issues</url>
-    </issueManagement>
-
-    <scm>
-        <connection>scm:git:git@github.com:caprica/vlcj.git</connection>
-        <developerConnection>scm:git:git@github.com:caprica/vlcj.git</developerConnection>
-        <url>git@github.com:caprica/vlcj.git</url>
-    </scm>
-
-    <properties>
-        <vlcjNatives.version>4.1.0</vlcjNatives.version>
-        <vlcjOsxStubs.version>1.0.0</vlcjOsxStubs.version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>uk.co.caprica</groupId>
-            <artifactId>vlcj-natives</artifactId>
-            <version>${vlcjNatives.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>uk.co.caprica</groupId>
-            <artifactId>vlcj-osx-stubs</artifactId>
-            <version>${vlcjOsxStubs.version}</version>
-            <scope>provided</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <groupId>org.eclipse.m2e</groupId>
-                    <artifactId>lifecycle-mapping</artifactId>
-                    <version>1.0.0</version>
-                    <configuration>
-                        <lifecycleMappingMetadata>
-                            <pluginExecutions>
-                                <pluginExecution>
-                                    <pluginExecutionFilter>
-                                        <groupId>org.apache.maven.plugins</groupId>
-                                        <artifactId>maven-enforcer-plugin</artifactId>
-                                        <versionRange>[1.0.0,)</versionRange>
-                                        <goals>
-                                            <goal>enforce</goal>
-                                        </goals>
-                                    </pluginExecutionFilter>
-                                    <action>
-                                        <ignore />
-                                    </action>
-                                </pluginExecution>
-                            </pluginExecutions>
-                        </lifecycleMappingMetadata>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>3.1.0</version>
-                <configuration>
-                    <encoding>UTF-8</encoding>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.0</version>
-                <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
-                    <encoding>UTF-8</encoding>
-                    <compilerArgument>-Xlint:serial</compilerArgument>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>3.1.1</version>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <addClasspath>true</addClasspath>
-                        </manifest>
-                    </archive>
-                </configuration>
-                <executions> 
-                    <execution>
-                        <goals> 
-                            <goal>test-jar</goal>
-                        </goals>
-                        <configuration>
-                            <useDefaultManifestFile>false</useDefaultManifestFile>
-                            <archive>
-                                <addMavenDescriptor>false</addMavenDescriptor>
-                                <manifestEntries>
-                                    <Class-Path>${project.artifactId}-${project.version}.jar</Class-Path>
-                                </manifestEntries>
-                            </archive>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <version>3.0.1</version>
-                <executions>
-                    <execution>
-                        <id>attach-sources</id>
-                        <goals>
-                            <goal>jar-no-fork</goal>
-                            <goal>test-jar-no-fork</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <version>3.0.1</version>
-                <configuration>
-                    <author>true</author>
-                    <charset>UTF-8</charset>
-                    <doctitle>${project.name} ${project.version} API Documentation</doctitle>
-                    <docfilessubdirs>true</docfilessubdirs>
-                    <encoding>UTF-8</encoding>
-                    <footer>(C)2019 Caprica Software Limited</footer>
-                    <show>public</show>
-                    <quiet>true</quiet>
-                    <failOnError>true</failOnError>
-                    <additionalOptions>-html5</additionalOptions>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>attach-javadocs</id>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>3.1.0</version>
-                <configuration>
-                    <attach>false</attach>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>user_distribution</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                        <configuration>
-                            <descriptors>
-                                <descriptor>src/main/assembly/dist.xml</descriptor>
-                            </descriptors>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <version>3.1.1</version>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <includeScope>runtime</includeScope>
-                            <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>false</overWriteSnapshots>
-                            <overWriteIfNewer>true</overWriteIfNewer>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>jdeb</artifactId>
-                <groupId>org.vafer</groupId>
-                <version>1.7</version>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>jdeb</goal>
-                        </goals>
-                        <configuration>
-                            <verbose>true</verbose>
-                            <dataSet>
-                                <data>
-                                    <src>${project.build.directory}/${project.build.finalName}.jar</src>
-                                    <type>file</type>
-                                    <mapper>
-                                        <type>perm</type>
-                                        <prefix>/usr/share/vlcj/lib</prefix>
-                                    </mapper>
-                                </data>
-                                <data>
-                                    <src>${project.build.directory}/dependencies</src>
-                                    <type>directory</type>
-                                    <mapper>
-                                        <type>perm</type>
-                                        <prefix>/usr/share/vlcj/lib</prefix>
-                                    </mapper>
-                                </data>
-                                <data>
-                                    <src>README.md</src>
-                                    <type>file</type>
-                                    <mapper>
-                                        <type>perm</type>
-                                        <prefix>/usr/share/doc/vlcj</prefix>
-                                    </mapper>
-                                </data>
-                                <data>
-                                    <src>doc/copyright</src>
-                                    <type>file</type>
-                                    <mapper>
-                                        <type>perm</type>
-                                        <prefix>/usr/share/doc/vlcj</prefix>
-                                    </mapper>
-                                </data>
-                            </dataSet>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-        <resources>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-                <excludes>
-                    <exclude>.gitignore</exclude>
-                </excludes>
-            </resource>
-        </resources>
-    </build>
-
-</project>
Index: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/README.md
===================================================================
--- tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/README.md	(revision 2435)
+++ tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/README.md	(revision 2436)
@@ -1,444 +0,0 @@
-![vlcj](https://github.com/caprica/vlcj/raw/master/etc/vlcj-logo.png "vlcj")
-
-*You are currently looking at the development branch for vlcj-4.0.0, if you are looking for the previous version of vlcj
-you should switch to the [vlcj-3.x branch](https://github.com/caprica/vlcj/tree/vlcj-3.x).* 
-
-vlcj
-====
-
-The vlcj project provides a Java framework to allow an instance of a native [VLC](http://www.videolan.org/vlc "VLC")
-media player to be embedded in a Java application.
-
-You get more than just simple bindings, you also get a higher level framework that hides a lot of the complexities of
-working with LibVLC.
-
-vlcj is primarily developed and therefore extensively tested on Linux - it does also work just fine on Windows and
-OSX, although there may be some limitations on OSX.
-
-Additionally, whilst not supported as one of the main platforms, this version of vlcj has been tested and shown to be
-working on contemporary Raspberry Pi builds.
-
-At least JDK 1.6 is required.
-
-*This version of vlcj requires VLC 3.0.0 as a minimum, no earlier version is supported.*
-
-This is the open source vlcj project page, see also the 'official'
-[home page](http://capricasoftware.co.uk/projects/vlcj "Official vlcj home page at Caprica Software") where you can find
-more information as well as some new simple tutorials.
-
-News
-====
-
-- 5th April, 2019 - vlcj 4.1.0 release, this release brings JNA "direct mapping" which should give a modest performance boost
-- 1st April, 2019 - vlcj 4.0.8 released, fixes an issue with the BufferedImage in the CallbackMediaPlayerComponent
-- 24th March, 2019 - vlcj 4.0.7 released, minor change to allow to change the callback video surface image painter after creation
-- 18th March, 2019 - published a Yeoman generator for vlcj starter projects, see [generator-vlcj](https://github.com/caprica/generator-vlcj)
-- 5th March, 2019 - vlcj 4.0.6 released, fixes issues with image painters when using CallbackMediaPlayerComponent
-- 4th March, 2019 - vlcj 4.0.5 released, fixes a problem using ByteBuffer on Java8
-- 4th March, 2019 - vlcj 4.0.4 released, audio callbacks can now optionally manage audio volume, some minor API changes
-- 1st March, 2019 - vlcj 4.0.3 released, fixes a problem with native discovery directory providers and minor API changes
-- 28th February, 2019 - vlcj 4.0.2 released, resolves a potential deadlock (upgrade to this version strongly recommended)
-- 27th February, 2019 - vlcj 4.0.1 released, primarily fixes a small number of minor public API issues
-- 20th February, 2019 - vlcj 4.0.0 released
-
-All releases are at available at [Maven Central](https://search.maven.org/search?q=a:vlcj).
-
-You can follow @capricasoftware on Twitter for more vlcj news.
-
-vlcj-4
-======
-
-vlcj-4 has a new API, but there is still a lot of similarity with vlcj-3 and under the covers there is still mostly the
-same mature and stable implementation.
-
-The vlcj-4 API is now pretty much stable, although some changes may be made depending on feedback and usage after the
-first release of 4.0.0 is let loose into the wild - but no further *major* API changes are planned or expected.
-
-If you are interested in using vlcj-4, now is a good time to start.
-
-vlcj-4.1
-========
-
-vlcj-4.1 brings JNA "direct mapping" which should give a modest performance boost at the expense of less helpful error
-messages if things go wrong when loading the native LibVLC library.
-
-If you wish to stay with "traditional" JNA bindings, then stick with the latest vlcj-4.0.x.
-
-This direct mapping approach will be used in all future versions of vlcj, meaning vlcj-4.1.x, vlcj-5.x and later.
-
-Major New Features
-------------------
-
-Headline changes:
-
- - full support for 360 degree video, changing pitch, yaw, roll, field-of-view
- - full support for discovery and usage of alternate media renderers, e.g. Chromecast
- - full support for media-slave API to set subtitle tracks and additional/alternate audio tracks
- - full support for integrated native dialogs, e.g. you can now be prompted for credentials when accessing a protected
-   stream
- - use any AWT Component as a video surface, not just a Canvas (Window will work on OSX, with limitations)
- - easy to add support for alternate video surfaces, e.g. an SWT Composite
- - major changes and improvements to the so-called "direct-rendering" media players, the direct audio and video media
-   players are no longer separate components and are now instead intrinsic to the standard media player. For video, a
-   new "Callback" video surface brings a vastly improved implementation, an optional related component provides a good
-   default implementation for direct-rendering and an easy way to deal with re-sizing of the video, with easy extension
-   points for custom video "painters"
- - improvements to full-screen support with sensible default implementations provided for Linux, Windows and OSX, all
-   using a native solution to provide the best result
- - automatic handling of subitems (e.g. when playing a YouTube video or a streaming playlist) is now intrinsic to the
-   media player and requires no involvement of the client application
- - simplified native library discovery, now intrinsic to the media player factory and it should just work out-of-the-box
-   in the vast majority of cases
- - API support for multiple logos (in series, not concurrent)
- - logo and marquee now work without having to explicitly enable the respective native modules
- - there is now better support for media generally (e.g. using media without a media player, for parsing meta data etc),
-   and also better support for media-lists (e.g. it should now be easier to manage your own play-lists)
-
-There have also been a lot of more general improvements to freshen up the codebase, make it more maintainable for the
-future, and to clear some legacy issues that have dogged the project for quite some time.
-
-For a full list of changes in this release, check the release milestones:
-
-- [vlcj 4.0.0 release milestone](https://github.com/caprica/vlcj/milestone/14?closed=1)
-- [vlcj 4.0.1 release milestone](https://github.com/caprica/vlcj/milestone/32?closed=1)
-- [vlcj 4.0.2 release milestone](https://github.com/caprica/vlcj/milestone/33?closed=1)
-- [vlcj 4.0.3 release milestone](https://github.com/caprica/vlcj/milestone/34?closed=1)
-- [vlcj 4.0.4 release milestone](https://github.com/caprica/vlcj/milestone/35?closed=1)
-- [vlcj 4.0.5 release milestone](https://github.com/caprica/vlcj/milestone/36?closed=1)
-- [vlcj 4.0.6 release milestone](https://github.com/caprica/vlcj/milestone/37?closed=1)
-- [vlcj 4.0.7 release milestone](https://github.com/caprica/vlcj/milestone/38?closed=1)
-- [vlcj 4.0.8 release milestone](https://github.com/caprica/vlcj/milestone/40?closed=1)
-
-vlcj 4.1.0+ uses JNA direct-mapping:
-
-- [vlcj 4.1.0 release milestone](https://github.com/caprica/vlcj/milestone/39?closed=1)
-
-Despite all of these changes, running on JDK 1.6 is still supported!
-
-Known Issues
-------------
-
- - `CallbackMediaPlayerComponent` does not properly render media that does not have a sample-aspect-ratio (SAR) 1:1,
-   this mostly affects DVD ISO, you can still provide your own implementation that handles other SAR's if you need to.
-   In any case, using the callback media player with DVD ISO is somewhat of a niche combination and for the vast
-   majority of media types this will not be an issue. This may be improved in a later release. The fundamental problem
-   right now is that there is simply no *reliable* way to know the SAR - SAR does appear eventually in track information
-   but there is no concrete link between that SAR track information and the currently playing video track. This is an
-   issue in the underlying native library.
-
- - When using the new alternate renderer API, if you attempt to play another media while a media is already being sent
-   to something like Chromecast you may experience problems - even if you stop the current media first. The cause of
-   this is currently unknown, but it may be a native issue.
-
-API Breakage (vlcj-3)
----------------------
-
-This is the *tenth year* of the project, the API has been pretty much static for that entire time. The codebase has
-evolved gradually and incrementally in that time and resulted sometimes in sub-optimal implementations and choices, as
-well as some generally unwieldy individual classes containing literally thousands of lines of code. Keeping the API
-fixed for those almost ten years also locked in some long-standing architectural issues that simply could not be
-resolved.
-
-The decision to break backwards compatibility with the vlcj-3 API was not taken lightly, but the results have been worth
-it. All legacy architectural issues have been resolved, the giant god-classes have been factored to more manageable
-chunks, and ongoing maintenance will be much easier.
-
-The price for these improvements is some API breakage, sorry.
-
-The short version of the situation is that vlcj-4 can *not* be considered a drop-in upgrade for any vlcj-3 applications.
-If you want to move to vlcj-4 with your existing applications, you *will* be impacted, at best you will need to use new
-names for existing methods, at worst although very unlikely you may have to make some *deep* changes in your own
-codebase. 
-
-There is no automatic migration tool.
-
-The longer version of the situation is documented more fully in
-[this ticket](https://github.com/caprica/vlcj/issues/681). 
-
-Tutorials
----------
-
-New tutorials for vlcj-4 are available [here](http://capricasoftware.co.uk/projects/vlcj-4/tutorials).
-
-There are simple tests or demo applications available for pretty much every aspect of vlcj functionality, these are
-provided in the
-[project test sources](https://github.com/caprica/vlcj/tree/master/src/test/java/uk/co/caprica/vlcj/test).
-
-There is also a major demo application available at the [vlcj-player](https://github.com/caprica/vlcj-player) project
-page.
-
-Building vlcj - sun.misc.Unsafe
--------------------------------
-
-Currently the target supported JDK is still 1.6, since there are no new language or platform features used in vlcj
-that need anything past 1.6. There is no particularly strong reason to keep supporting 1.6, but there is no particular
-reason to abandon it either.
-
-On the other hand, the project is at the moment built with OpenJDK 11 on Linux and cross-compiled to 1.6. This will
-work just fine when using Maven to build the project from the command-line, or when working with Eclipse.
-
-However, if you use IntelliJ IDEA you may encounter some compilation problems...
-
-When compiling, IDEA will complain that package sun.misc does not exist - the `Unsafe` class from this package is
-required for the "direct" media players.
-
-This can be worked around in a number of ways:
-
- - use source and target JDK 1.10 in the pom.xml, which IDEA will then incorporate into the project
- - use JDK 1.9 and convert the project to use the Java Module System and add jdk.unsupported as a required module
- - change the IDEA compiler settings to *uncheck* the "Use '--release' option for cross-compilation (Java 9 and later)"
-
-The latter option is probably the simplest to deal with.
-
-When compiling with Maven it is simply not possible to suppress the warnings about using sun.misc.Unsafe.
-
-Maven Dependency
-----------------
-
-Add the following Maven dependency to your own project pom.xml:
-
-```
-<dependency>
-    <groupId>uk.co.caprica</groupId>
-    <artifactId>vlcj</artifactId>
-    <version>4.1.0</version>
-</dependency>
-```
-
-The core vlcj project now no longer contains the required JNA bindings to LibVLC, these are provided instead by the
-separate [vlcj-natives](https://github.com/caprica/vlcj-natives) project. The vlcj core project therefore has a new
-required dependency on the vlcj-natives project.
-
-If you are using Maven (or similar) to manage your dependencies, the vlcj-natives dependency will be handled
-automatically for you (you only need to explicitly add vlcj to your project, not vlcj-natives).
-
-If you are installing vlcj manually, then you will need to include the new vlcj-natives jar file along with the existing
-vlcj jar file.
-
-Threading Model
----------------
-
-This section is very important.
-
-With vlcj-4, every native event coming from LibVLC is processed on the native callback thread. This should give some
-small performance gains when compared with vlcj-3.
-
-The critical issue is that it is generally not permitted to call back into LibVLC from the event callback thread. Doing
-so may cause subtle failures or outright hard JVM crashes.
-
-A prime example of the sort of trap waiting for you is the very common case of handling a media player "finished" event
-so that you can then play the next item in a play-list:
-
-```
-mediaPlayer.events().addMediaPlayerEventListener(new MediaPlayerEventAdapter() {
-    @Override
-    public void finished(MediaPlayer mediaPlayer) {
-        mediaPlayer.media().play(nextMrl); // <-- This is VERY BAD INDEED
-    }
-});
-```
-
-In this example, the `finished` method is being invoked on a native callback thread owned by LibVLC. The implementation
-of this method is calling back into LibVLC when it invokes `play`. This is very likely to cause a JVM crash and
-kill your application.
-
-In cases such as this, you should make use of an asynchronous task-executor queue conveniently provided by the 
-`MediaPlayer` object passed to the listener method:
-
-```
-mediaPlayer.events().addMediaPlayerEventListener(new MediaPlayerEventAdapter() {
-    @Override
-    public void finished(final MediaPlayer mediaPlayer) {
-        mediaPlayer.submit(new Runnable() {
-            @Override
-            public void run() {
-                mediaPlayer.media().play(nextMrl);
-            }
-        });
-    }
-});
-```
-
-You should *not* use this mechanism for *all* of your event handlers, *only those that will call back into LibVLC*.
-
-Other high-level vlcj components may also provide their own asynchronous task executor, it is not limited to the media
-player.
-
-An added caveat for vlcj-4 is that when you implement event handling you must be sure to execute quickly, and to not
-block the native thread with any long-running operation.
-
-Your event handler implementations must *not* throw an `Exception`, failure of your event handlers to catch and handle
-any thrown exception may prevent other listeners from being notified of the event.
-
-If you are attempting to use multiple media players in your application, or using media players from multiple threads,
-you may need to take some extra care so that you do not have multiple threads calling into LibVLC concurrently. You may
-encounter subtle bugs and races that are very difficult to diagnose.
-
-In addition, you must take care not to update Swing UI components from the native thread - all Swing UI updates are
-supposed to go via the Swing Event Dispatch Thread (EDT).
- 
-You can achieve this in the usual way by using `SwingUtilities#invokeLater` in your event handler:
-
-```
-mediaPlayer.events().addMediaPlayerEventListener(new MediaPlayerEventAdapter() {
-    @Override
-    public void finished(MediaPlayer mediaPlayer) {
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                // ...change UI state here...
-            }
-        });
-    }
-});
-```
-
-Garbage Collection
-------------------
-
-This section is also very important.
-
-Ordinarily when developing with Java you will be used to not thinking about the scope and life-cycle of the objects that
-you create, instead you will rely on the garbage collector in the Java Virtual Machine to just take of things for you.
-
-With vlcj's `MediaPlayerFactory`, `MediaPlayer`, and associated classes, you must take care to prevent those objects
-from being garbage collected - if you do not, at best your media player will simply unexpectedly stop working and at
-worst you may see a fatal JVM crash.
-
-Those vlcj objects wrap a native resource (e.g. a native media player). Those media player resources know nothing about
-any JVM. So just because a native media player is still "alive" it will not prevent your object instance from being
-garbage collected. If your object instance does get garbage collected, the native resource still has no idea, and will
-will keeping sending native events back to the JVM via a callback. If your object is gone, that native callback has
-nowhere to go and will most likely crash your JVM.
-
-A very common mistake is to declare vlcj objects on the local heap in some sort of initialisation method:
-
-```
-    private void setup() {
-        MediaPlayerFactory factory = new MediaPlayerFactory();
-        EmbeddedMediaPlayer mediaPlayer = factory.mediaPlayers().newEmbeddedMediaPlayer();
-        // ... other initialisation ...
-    }
-```
-
-When this method returns, the `factory` and `mediaPlayer` objects go out of scope and become eligible for garbage
-collection. The garbage collection may happen immediately, or some time later.
-
-The most common solution is to change those local heap declarations to class fields:
-
-```
-    private MediaPlayerFactory factory;
-
-    private EmbeddedMediaPlayer mediaPlayer;
-
-    private void setup() {
-        factory = new MediaPlayerFactory();
-        mediaPlayer = factory.mediaPlayers().newEmbeddedMediaPlayer();
-        // ... other initialisation ...
-    }
-
-```
-
-This is fine and will work in most cases, but you must still make sure that the enclosing class does not itself get
-garbage collected!
-
-See this [vlcj garbage collection tutorial](http://capricasoftware.co.uk/projects/vlcj-4/tutorials/garbage-collection)
-for more information.
-
-Privacy Considerations
-----------------------
-
-When parsing media, depending on configuration, it may be possible that a remote network access is made for meta data
-and album/cover art. This may unintentionally expose sensitive data regarding the media being parsed.
-
-To affirmatively prevent all network access for meta data, consider using the `--no-metadata-network-access` argument
-when creating a `MediaPlayerFactory`.
-
-It should also be possible to prevent such network accesses by using appropriate `ParseFlag` values when requesting to
-parse media.
-
-Even with network access disabled, some media cover art may still appear locally (e.g. ~/.cache/vlc) - this does not
-necessarily mean that a remote network request was made for the cover art, rather the art that was already embedded in
-the media file was extracted to this temporary cache directory.
-
-In any case, you need to be aware of this issue and inform users of your application about it.
-
-Documentation
--------------
-
-Tutorials will be made available, not yet, at the
-[official project page](http://capricasoftware.co.uk/projects/vlcj/tutorials).
-
-The vlcj project page is at [github](http://caprica.github.com/vlcj "vlcj at github").
-
-Online Javadoc is available here:
-
-JNA direct-mapping:
-
-* [4.1.0 (current)](http://caprica.github.com/vlcj/javadoc/4.1.0/index.html "4.1.0 Javadoc")
-
-JNA traditional mapping:
-
-* [4.0.8 (current)](http://caprica.github.com/vlcj/javadoc/4.0.8/index.html "4.0.8 Javadoc")
-* [4.0.7](http://caprica.github.com/vlcj/javadoc/4.0.7/index.html "4.0.7 Javadoc")
-* [4.0.6](http://caprica.github.com/vlcj/javadoc/4.0.6/index.html "4.0.6 Javadoc")
-* [4.0.5](http://caprica.github.com/vlcj/javadoc/4.0.5/index.html "4.0.5 Javadoc")
-* [4.0.4](http://caprica.github.com/vlcj/javadoc/4.0.4/index.html "4.0.4 Javadoc")
-* [4.0.3](http://caprica.github.com/vlcj/javadoc/4.0.3/index.html "4.0.3 Javadoc")
-* [4.0.2](http://caprica.github.com/vlcj/javadoc/4.0.2/index.html "4.0.2 Javadoc")
-* [4.0.1](http://caprica.github.com/vlcj/javadoc/4.0.1/index.html "4.0.1 Javadoc")
-* [4.0.0](http://caprica.github.com/vlcj/javadoc/4.0.0/index.html "4.0.0 Javadoc")
-
-Examples
---------
-
-There are many examples in the vlcj test sources showing how to use vlcj.
-
-For a more complete example of a feature-rich media player built with vlcj,
-see [vlcj-player](https://github.com/caprica/vlcj-player).
-
-Related Projects
-----------------
-
- * [vlcj-natives](https://github.com/caprica/vlcj-natives)
- * [vlcj-player](https://github.com/caprica/vlcj-player)
- * [vlcj-javafx](https://github.com/caprica/vlcj-javafx)
- * [vlcj-mrls](https://github.com/caprica/vlcj-mrls)
- * [vlcj-file-filters](https://github.com/caprica/vlcj-file-filters)
- * [vlcj-swt](https://github.com/caprica/vlcj-swt)
- * [vlcj-swt-demo](https://github.com/caprica/vlcj-swt-demo)
- * [vlcj-swt-swing](https://github.com/caprica/vlcj-swt-swing)
- * [vlcj-info](https://github.com/caprica/vlcj-info)
- * [vlcj-radio-demo](https://github.com/caprica/vlcj-radio-demo)
- * [generator-vlcj](https://github.com/caprica/generator-vlcj)
-
-Support
--------
-
-Development of vlcj is carried out by [Caprica Software](http://www.capricasoftware.co.uk).
-
-Free support for Open Source and non-commercial projects is generally provided - you can
-use [github issues](https://github.com/caprica/vlcj/issues "vlcj github issues") for this purpose.
-
-Support for commercial projects is provided exclusively on commercial terms - send an email to the following address for
-more information:
-
-> mark [dot] lee [at] capricasoftware [dot] co [dot] uk
-
-License
--------
-
-The vlcj framework is provided under the GPL, version 3 or later.
-
-If you want to consider a commercial license for vlcj that allows you to use and redistribute vlcj without complying
-with the GPL then send an email to the address below:
-
-> mark [dot] lee [at] capricasoftware [dot] co [dot] uk
-
-Contributors
-------------
-
-Contributions are welcome and will always be licensed according to the Open Source license terms of the project (currently GPL).
-
-However, for a contribution to be accepted you must agree to transfer any copyright so that your contribution does not
-impede our ability to provide commercial licenses for vlcj.
Index: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/BaseApi.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/BaseApi.java	(revision 0)
+++ tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/BaseApi.java	(revision 2436)
@@ -0,0 +1,32 @@
+/*
+ * This file is part of VLCJ.
+ *
+ * VLCJ is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * VLCJ is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with VLCJ.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2009-2019 Caprica Software Limited.
+ */
+
+package uk.co.caprica.vlcj.factory.swt;
+
+abstract class BaseApi {
+	
+	protected final SwtMediaPlayerFactory factory;
+	
+	BaseApi(SwtMediaPlayerFactory factory) {
+		this.factory = factory;
+	}
+	
+	protected void release() {}
+	
+}

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/BaseApi.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/SwtApi.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/SwtApi.java	(revision 0)
+++ tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/SwtApi.java	(revision 2436)
@@ -0,0 +1,50 @@
+/*
+ * This file is part of VLCJ.
+ *
+ * VLCJ is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * VLCJ is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with VLCJ.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2009-2019 Caprica Software Limited.
+ */
+
+package uk.co.caprica.vlcj.factory.swt;
+
+import org.eclipse.swt.widgets.Composite;
+import uk.co.caprica.vlcj.player.embedded.videosurface.VideoSurfaceAdapters;
+import uk.co.caprica.vlcj.player.embedded.videosurface.swt.CompositeVideoSurface;
+
+/**
+ *
+ */
+public final class SwtApi extends BaseApi {
+	
+	/**
+	 *
+	 *
+	 * @param mediaPlayerFactory
+	 */
+	public SwtApi(SwtMediaPlayerFactory mediaPlayerFactory) {
+		super(mediaPlayerFactory);
+	}
+	
+	/**
+	 *
+	 *
+	 * @param composite
+	 * @return
+	 */
+	public CompositeVideoSurface newCompositeVideoSurface(Composite composite) {
+		return new CompositeVideoSurface(composite, VideoSurfaceAdapters.getVideoSurfaceAdapter());
+	}
+	
+}

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/SwtApi.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/SwtMediaPlayerFactory.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/SwtMediaPlayerFactory.java	(revision 0)
+++ tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/SwtMediaPlayerFactory.java	(revision 2436)
@@ -0,0 +1,68 @@
+/*
+ * This file is part of VLCJ.
+ *
+ * VLCJ is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * VLCJ is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with VLCJ.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2009-2019 Caprica Software Limited.
+ */
+
+package uk.co.caprica.vlcj.factory.swt;
+
+import uk.co.caprica.vlcj.factory.discovery.NativeDiscovery;
+import uk.co.caprica.vlcj.factory.MediaPlayerFactory;
+
+import java.util.Collection;
+
+// FIXME should we build an SwtEmbeddedMediaPlayerComponent that extends Composite, similar to how we extend JPanel for SWT?
+
+/**
+ * Extension to the default {@link MediaPlayerFactory} that provides SWT components.
+ */
+public class SwtMediaPlayerFactory extends MediaPlayerFactory {
+	
+	private final SwtApi swtApi;
+	
+	public SwtMediaPlayerFactory(NativeDiscovery discovery, String... libvlcArgs) {
+		super(discovery, libvlcArgs);
+		
+		this.swtApi = new SwtApi(this);
+	}
+	
+	public SwtMediaPlayerFactory(String... libvlcArgs) {
+		this(null, libvlcArgs);
+	}
+	
+	public SwtMediaPlayerFactory(NativeDiscovery discovery, Collection<String> libvlcArgs) {
+		this(discovery, libvlcArgs.toArray(new String[libvlcArgs.size()]));
+	}
+	
+	public SwtMediaPlayerFactory(Collection<String> libvlcArgs) {
+		this(null, libvlcArgs.toArray(new String[libvlcArgs.size()]));
+	}
+	
+	/**
+	 *
+	 *
+	 * @return
+	 */
+	public final SwtApi swt() {
+		return swtApi;
+	}
+	
+	@Override
+	public void onBeforeRelease() {
+		swtApi.release();
+	}
+	
+}

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/swt/SwtMediaPlayerFactory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/vlcplayer/VLCPlayer.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/vlcplayer/VLCPlayer.java	(revision 0)
+++ tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/vlcplayer/VLCPlayer.java	(revision 2436)
@@ -0,0 +1,608 @@
+package org.txm.backtomedia.editors.vlcplayer;
+
+import static uk.co.caprica.vlcj.binding.LibVlc.libvlc_new;
+import static uk.co.caprica.vlcj.binding.LibVlc.libvlc_release;
+
+import java.io.File;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Scale;
+import org.txm.backtomedia.commands.function.TripleRangeSlider;
+import org.txm.backtomedia.preferences.BackToMediaPreferences;
+import org.txm.utils.logger.Log;
+
+import com.sun.jna.StringArray;
+
+import uk.co.caprica.vlcj.binding.LibC;
+import uk.co.caprica.vlcj.binding.RuntimeUtil;
+import uk.co.caprica.vlcj.binding.internal.libvlc_instance_t;
+import uk.co.caprica.vlcj.factory.discovery.NativeDiscovery;
+import uk.co.caprica.vlcj.factory.discovery.strategy.NativeDiscoveryStrategy;
+import uk.co.caprica.vlcj.factory.swt.SwtMediaPlayerFactory;
+import uk.co.caprica.vlcj.media.MediaRef;
+import uk.co.caprica.vlcj.player.base.MediaPlayer;
+import uk.co.caprica.vlcj.player.base.MediaPlayerEventAdapter;
+import uk.co.caprica.vlcj.player.component.EmbeddedMediaPlayerComponent;
+import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayer;
+import uk.co.caprica.vlcj.player.embedded.videosurface.swt.CompositeVideoSurface;
+import uk.co.caprica.vlcj.support.version.LibVlcVersion;
+import vlcplayerrcp.MessagesMP;
+
+public class VLCPlayer extends Composite {
+	
+	static { // force native libs discovery -> fix Mac OS X init
+		NativeDiscovery discovery = new NativeDiscovery() {
+			
+			@Override
+			protected void onFound(String path, NativeDiscoveryStrategy strategy) {
+				Log.finer("VLC NativeDiscovery: onFound " + path + " " + strategy);
+			}
+			
+			@Override
+			protected void onNotFound() {
+				Log.finer("VLC NativeDiscovery: Not found.");
+			}
+		};
+		boolean found = discovery.discover();
+		Log.finer("VLC NativeDiscovery: the discovery was succesfull ? " + found);
+		if (found) {
+			libvlc_instance_t instance = libvlc_new(0, new StringArray(new String[0]));
+			Log.finer("VLC NativeDiscovery: VLC instance is " + instance);
+			if (instance != null) {
+				libvlc_release(instance);
+			}
+			else {
+				Log.warning(NLS.bind("** Impossible to use your VLC [{0}] (please check that you have at least VLC version 3.0).", instance));
+			}
+			Log.finer("VLC NativeDiscovery: VLC version is " + new LibVlcVersion().getVersion());
+		}
+		else {
+			Log.warning("** Impossible to find VLC (please check that you have at least VLC version 3.0).");
+		}
+	}
+	
+	protected static final String NOMEDIA = ""; //$NON-NLS-1$
+	
+	private EmbeddedMediaPlayer vlcPlayer;
+	
+	private Composite videoComposite;
+	
+	private CompositeVideoSurface playerCanvas;
+	
+	private Scale rateField;
+	
+	private Label rateValueLabel;
+	
+	private Scale volumeField;
+	
+	private Label volumeValueLabel;
+	
+	private Button playButton;
+	
+	private Button repeatButton;
+	
+	protected String currentlyPlayed = ""; //$NON-NLS-1$
+	
+	// private String startTime, endTime;
+	private int start, end;
+	
+	protected boolean hasEnded = false;
+	
+	private String previouslyPlayed = ""; //$NON-NLS-1$
+	
+	private boolean repeat = false;
+	
+	protected int volume = 100;
+	
+	private Button stopButton;
+	
+	Label timeLabel;
+	
+	TripleRangeSlider timeRange;
+	
+	boolean firstLengthEvent = true;
+	
+	long previous = 0;
+	
+	long time, mins, secs;
+	
+	private SwtMediaPlayerFactory factory;
+	
+	
+	static {
+		// uncomment to enable VLC logs
+		// Logger.setLevel(Level.TRACE);
+	}
+	
+	public EmbeddedMediaPlayer getEmbeddedMediaPlayer() {
+		return vlcPlayer;
+	}
+	
+	public VLCPlayer(Composite parent, int style) {
+		super(parent, style);
+		this.setLayout(new GridLayout(11, false));
+		
+		// THE PLAYER
+		// if (RuntimeUtil.isMac()) {
+		// try {
+		// LibC.INSTANCE.setenv("VLC_PLUGIN_PATH", "/Applications/VLC.app/Contents/MacOS/plugins", 1);
+		// }
+		// catch (Exception ex) {
+		// ex.printStackTrace();
+		// }
+		// }
+		videoComposite = new Composite(this, SWT.EMBEDDED | SWT.NO_BACKGROUND);
+		GridData gdata = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gdata.horizontalSpan = 11;
+		videoComposite.setLayoutData(gdata);
+		
+		factory = new SwtMediaPlayerFactory();
+		playerCanvas = factory.swt().newCompositeVideoSurface(videoComposite);
+		
+		EmbeddedMediaPlayerComponent e = new EmbeddedMediaPlayerComponent();
+		vlcPlayer = e.mediaPlayer();
+		vlcPlayer.videoSurface().set(playerCanvas);
+		
+		videoComposite.addDisposeListener(new DisposeListener() {
+			
+			@Override
+			public void widgetDisposed(DisposeEvent e) {
+				// vlcPlayer.submit(new Runnable() {
+				//
+				// @Override
+				// public void run() {
+				// // vlcPlayer.controls().stop();
+				// }
+				// });
+				vlcPlayer.controls().stop();
+				vlcPlayer.release();
+				factory.release();
+			}
+		});
+		
+		// THE CONTROL BUTTONS
+		playButton = new Button(this, SWT.PUSH);
+		GridData playLayoutData = new GridData(SWT.FILL, SWT.CENTER, false, false);
+		playButton.setLayoutData(playLayoutData);
+		playButton.setText(MessagesMP.play);
+		playButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				vlcPlayer.submit(new Runnable() {
+					
+					@Override
+					public void run() {
+						if (currentlyPlayed.length() == 0) {
+							selectMedia();
+							playButton.setText(MessagesMP.pause);
+						}
+						else if (vlcPlayer.status().isPlaying()) {
+							vlcPlayer.controls().pause();
+							playButton.setText(MessagesMP.resume);
+						}
+						else if (hasEnded) {
+							replay();
+						}
+						else {
+							vlcPlayer.controls().play();
+							playButton.setText(MessagesMP.pause);
+						}
+					}
+				});
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		// Button browseButton = new Button(this,SWT.PUSH);
+		// browseButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
+		// browseButton.setText("Open...");
+		// browseButton.addSelectionListener(new SelectionListener() {
+		// @Override
+		// public void widgetSelected(SelectionEvent e) {
+		// selectMedia();
+		// }
+		//
+		// @Override
+		// public void widgetDefaultSelected(SelectionEvent e) {}
+		// });
+		
+		stopButton = new Button(this, SWT.PUSH);
+		stopButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+		stopButton.setText(MessagesMP.stop);
+		stopButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				stop();
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		timeLabel = new Label(this, SWT.NONE);
+		timeLabel.setText("00:00"); //$NON-NLS-1$
+		
+		timeRange = new TripleRangeSlider(this, SWT.None);
+		timeRange.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+		timeRange.setToolTipText(MessagesMP.time_range);
+		timeRange.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				TripleRangeSlider.SELECTED_KNOB sk = timeRange.getLastSelectedKnob();
+				switch (sk) {
+					case UPPER:
+						end = timeRange.getUpperValue();
+						
+						if (end < time) {
+							// System.out.println("Upper changed: fix time");
+							time = end;
+							vlcPlayer.controls().setTime(time);
+						}
+						break;
+					case LOWER:
+						start = timeRange.getLowerValue();
+						if (start > time) {
+							// System.out.println("Lower changed: fix time");
+							time = start;
+							vlcPlayer.controls().setTime(time);
+						}
+						break;
+					case MIDDLE:
+						
+						time = timeRange.getMiddleValue();
+						// System.out.println("Middle changed: fix time: "+time);
+						vlcPlayer.controls().setTime(time);
+						break;
+					default:
+						// nothing
+				}
+				// System.out.println("time range: "+start+" -> "+end+" time="+time);
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		repeatButton = new Button(this, SWT.CHECK);
+		repeatButton.setText(MessagesMP.repeat);
+		repeat = BackToMediaPreferences.getInstance().getBoolean(BackToMediaPreferences.REPEAT);
+		repeatButton.setSelection(repeat);
+		repeatButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				repeat = repeatButton.getSelection();
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		Label l = new Label(this, SWT.NONE);
+		l.setText(MessagesMP.rate);
+		
+		rateField = new Scale(this, SWT.BORDER);
+		GridData gdata4 = new GridData(SWT.FILL, SWT.CENTER, false, false);
+		gdata4.widthHint = 100;
+		rateField.setLayoutData(gdata4);
+		rateField.setMaximum(140);
+		rateField.setMinimum(70);
+		rateField.setSelection(100);
+		rateField.setPageIncrement(5);
+		
+		rateField.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				float rate = rateField.getSelection() / 100.0f;
+				vlcPlayer.controls().setRate(rate);
+				rateValueLabel.setText("" + rateField.getSelection() + "%");
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		rateValueLabel = new Label(this, SWT.NONE);
+		rateValueLabel.setText("100%");//$NON-NLS-1$
+		
+		l = new Label(this, SWT.NONE);
+		l.setText(MessagesMP.volume);
+		
+		volumeField = new Scale(this, SWT.BORDER);
+		gdata4 = new GridData(SWT.FILL, SWT.CENTER, false, false);
+		gdata4.widthHint = 100;
+		volumeField.setLayoutData(gdata4);
+		volumeField.setMinimum(0);
+		volumeField.setMaximum(100);
+		volumeField.setSelection(volume);
+		volumeField.setPageIncrement(5);
+		volumeField.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				vlcPlayer.audio().setVolume(volumeField.getSelection());
+				volume = volumeField.getSelection();
+				volumeValueLabel.setText("" + volume + "%");
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
+		volumeValueLabel = new Label(this, SWT.NONE);
+		volumeValueLabel.setText("100%");
+		
+		vlcPlayer.events().addMediaPlayerEventListener(new MediaPlayerEventAdapter() {
+			
+			@Override
+			public void opening(MediaPlayer mediaPlayer) {
+				Log.finer("Opening media...");
+			}
+			
+			@Override
+			public void finished(MediaPlayer mediaPlayer) {
+				Log.finer("Finished playing media...");
+				mediaPlayer.submit(new Runnable() {
+					
+					@Override
+					public void run() {
+						if (repeat) {
+							replay();
+						}
+						else {
+							hasEnded = true;
+						}
+					}
+				});
+			}
+		});
+		
+		vlcPlayer.events().addMediaPlayerEventListener(new MediaPlayerEventAdapter() {
+			
+			@Override
+			public void timeChanged(MediaPlayer mediaPlayer, final long arg1) {
+				
+				mediaPlayer.submit(new Runnable() {
+					
+					@Override
+					public void run() {
+						time = arg1;
+						if (previous == time) {
+							return;
+						}
+						previous = time;
+						
+						timeLabel.getDisplay().syncExec(new Runnable() {
+							
+							@Override
+							public void run() {
+								if (timeRange.isDisposed()) {
+									return;
+								}
+								if (!timeRange.isDragMiddleKnob()) {
+									timeRange.setMiddleValue((int) time);
+								}
+								updateTimeLabel();
+								
+								if (arg1 > end && end != start) {
+									// System.out.println("Time > end :"+arg1 +" > "+end);
+									if (repeat) {
+										vlcPlayer.controls().setTime(start);
+									}
+									else {
+										vlcPlayer.controls().stop();
+									}
+								}
+							}
+						});
+					}
+				});
+			}
+			
+			@Override
+			public void lengthChanged(MediaPlayer mediaPlayer, final long arg1) {
+				
+				mediaPlayer.submit(new Runnable() {
+					
+					@Override
+					public void run() {
+						if (firstLengthEvent) {
+							firstLengthEvent = false;
+							
+							// initialize time range widget limits
+							timeRange.getDisplay().syncExec(new Runnable() {
+								
+								@Override
+								public void run() {
+									if (timeRange.isDisposed()) return;
+									timeRange.setMaximum((int) arg1);
+									// if (start == end) end = (int)arg1;
+									
+									
+									if (end > 0 && start != end) {
+										timeRange.setUpperValue(end);
+									}
+									else {
+										timeRange.setUpperValue((int) arg1);
+									}
+									
+									timeRange.setLowerValue(start);
+									// System.out.println("Range: "+start+" -> "+end+" song length "+arg1);
+								}
+							});
+						}
+					}
+				});
+			}
+		});
+	}
+	
+	private void updateTimeLabel() {
+		mins = time / 60000;
+		secs = (time / 1000) % 60;
+		timeLabel.setText(String.format("%02d:%02d", mins, secs)); //$NON-NLS-1$
+		timeLabel.update();
+	}
+	
+	protected void replay() {
+		if (currentlyPlayed.length() > 0) {
+			// this.play(currentlyPlayed, startTime, endTime);
+			vlcPlayer.submit(new Runnable() {
+				
+				@Override
+				public void run() {
+					vlcPlayer.controls().setTime(start);
+				}
+			});
+			
+			playButton.setText(MessagesMP.pause);
+		}
+	}
+	
+	protected void selectMedia() {
+		Log.fine(MessagesMP.select_file);
+		
+		FileDialog fd = new FileDialog(VLCPlayer.this.getShell(), SWT.OPEN);
+		fd.setText(MessagesMP.select_file_title);
+		File f = new File(previouslyPlayed);
+		if (f.isDirectory()) fd.setFilterPath(f.getPath());
+		else fd.setFilterPath(f.getParent());
+		
+		String[] filterExt = { "*.*", "*.mp3", "*.mp4", "*.avi" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		fd.setFilterExtensions(filterExt);
+		String selected = fd.open();
+		if (selected == null) {
+			System.out.println(MessagesMP.cancel);
+			return;
+		}
+		
+		currentlyPlayed = selected;
+		previouslyPlayed = selected;
+		Log.fine(MessagesMP.opening + currentlyPlayed);
+		play(currentlyPlayed, 0, 0);
+	}
+	
+	/**
+	 * 
+	 * @param mrl
+	 * @param time msec start time
+	 * @param endtime msec end time
+	 */
+	public void play(String mrl, int time, int endtime) {
+		Log.fine(MessagesMP.bind(MessagesMP.playing, new Object[] { mrl, time, endtime }));
+		play(mrl, "" + time / 1000.0f, "" + endtime / 1000.0f); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+	
+	public void play(String mrl, int time) {
+		play(mrl, time, time);
+	}
+	
+	public void hideStopButton() {
+		if (this.stopButton != null && !this.stopButton.isDisposed()) {
+			this.stopButton.dispose();
+		}
+	}
+	
+	DateTimeFormatter hhmmssFormatter = DateTimeFormatter.ISO_LOCAL_TIME;
+	
+	/**
+	 * 
+	 * @param mrl
+	 * @param startTime "0.0" or ""hh:mm:ss" format
+	 * @param endTime "0.0" or ""hh:mm:ss" format
+	 */
+	public boolean play(String mrl, String startTime, String endTime) {
+		
+		if (startTime.matches("[0-9]+.[0-9]+")) {
+			start = (int) (1000 * Float.parseFloat(startTime));
+		}
+		else if (startTime.matches("[0-9]+:[0-9]+:[0-9]+")) {
+			if (startTime.indexOf(":") == 1) {
+				startTime = "0" + startTime;
+			}
+			LocalTime time1 = LocalTime.parse(startTime, hhmmssFormatter);
+			start = 1000 * ((time1.getHour() * 60 * 60) + (time1.getMinute() * 60) + time1.getSecond());
+		}
+		
+		if (endTime.matches("[0-9]+.[0-9]+")) {
+			end = (int) (1000 * Float.parseFloat(endTime));
+		}
+		else if (endTime.matches("[0-9]+:[0-9]+:[0-9]+")) {
+			if (endTime.indexOf(":") == 1) endTime = "0" + endTime;
+			LocalTime time1 = LocalTime.parse(endTime, hhmmssFormatter);
+			end = 1000 * ((time1.getHour() * 60 * 60) + (time1.getMinute() * 60) + time1.getSecond());
+		}
+		
+		// if (start == end) end = -1;
+		
+		Log.finer(MessagesMP.bind(MessagesMP.playing, new Object[] { mrl, startTime, endTime }));
+		// vlcPlayer.submit(new Runnable() {
+		//
+		// @Override
+		// public void run() {
+		String[] options = { " :live-caching=200" }; // reduce video stream cache duration to 200ms
+		
+		Log.finer("Preparing media...");
+		if (!vlcPlayer.media().prepare(mrl, options)) {
+			Log.finer("** Impossible to prepare media.");
+			return false;
+		}
+		
+		Log.finer("Is media valid ?");
+		if (!vlcPlayer.media().isValid()) {
+			Log.finer("** Invalid media.");
+			return false;
+		}
+		
+		Log.info("Playing media...");
+		vlcPlayer.controls().play();
+		vlcPlayer.audio().setVolume(volume);
+		vlcPlayer.controls().setTime(start);
+		
+		if (new File(mrl + ".srt").exists()) { //$NON-NLS-1$
+			vlcPlayer.subpictures().setSubTitleFile(mrl + ".srt"); //$NON-NLS-1$
+		}
+		currentlyPlayed = mrl;
+		previouslyPlayed = mrl;
+		
+		if (!playButton.isDisposed()) {
+			playButton.setText(MessagesMP.pause);
+		}
+		firstLengthEvent = true;
+		// }
+		// });
+		return true;
+	}
+	
+	public void setRepeat(boolean repeat) {
+		this.repeat = repeat;
+		repeatButton.setSelection(repeat);
+	}
+	
+	public void stop() {
+		vlcPlayer.controls().stop();
+		currentlyPlayed = NOMEDIA;
+		if (!playButton.isDisposed()) {
+			playButton.setText(MessagesMP.play);
+		}
+	}
+}

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/vlcplayer/VLCPlayer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/vlcplayer/VLCPlayerEditor.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/vlcplayer/VLCPlayerEditor.java	(revision 0)
+++ tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/vlcplayer/VLCPlayerEditor.java	(revision 2436)
@@ -0,0 +1,100 @@
+package org.txm.backtomedia.editors.vlcplayer;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+
+public class VLCPlayerEditor extends EditorPart {
+	
+	/** The Constant ID. */
+	public static final String ID = VLCPlayerEditor.class.getCanonicalName(); // $NON-NLS-1$
+	
+	VLCPlayer player;
+	
+	@Override
+	public void createPartControl(Composite parent) {
+		player = new VLCPlayer(parent, SWT.NONE);
+	}
+	
+	public void init() {
+		
+	}
+	
+	@Override
+	public void setFocus() {
+		
+	}
+	
+	@Override
+	public void dispose() {
+		try {
+			if (player != null) player.stop();
+		}
+		catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		super.dispose();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	@Override
+	public void doSave(IProgressMonitor monitor) {}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+	 */
+	@Override
+	public void doSaveAs() {}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+	 */
+	@Override
+	public void init(IEditorSite site, IEditorInput input)
+			throws PartInitException {
+		setSite(site);
+		setInput(input);
+		// VLCPlayerEditorInput ii = (VLCPlayerEditorInput) input;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+	 */
+	@Override
+	public boolean isSaveAsAllowed() {
+		return false;
+	}
+	
+	public VLCPlayer getPlayer() {
+		return player;
+	}
+	
+	public void setPartName(String partName) {
+		super.setPartName(partName);
+	}
+	
+	@Override
+	public boolean isDirty() {
+		return false;
+	}
+	
+	/**
+	 * for more test use "player.getEmbeddedMediaPlayer()"
+	 * 
+	 * @return false if the media could not be loaded (file not found, access error...)
+	 */
+	public boolean isMediaLoaded() {
+		return player.getEmbeddedMediaPlayer().status().isPlayable();
+	}
+}

Property changes on: tmp/org.txm.backtomedia.rcp/vlcj-4.1.0/vlcplayer/VLCPlayerEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.backtomedia.rcp/.classpath
===================================================================
--- tmp/org.txm.backtomedia.rcp/.classpath	(revision 2435)
+++ tmp/org.txm.backtomedia.rcp/.classpath	(revision 2436)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry exported="true" kind="lib" path="opal-0.9.5.2.jar"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
 		<accessrules>
@@ -8,9 +7,10 @@
 		</accessrules>
 	</classpathentry>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry exported="true" kind="lib" path="vlcj-4.1.0/jna-5.2.0.jar"/>
-	<classpathentry exported="true" kind="lib" path="vlcj-4.1.0/jna-platform-5.2.0.jar"/>
-	<classpathentry exported="true" kind="lib" path="vlcj-4.1.0/vlcj-4.1.0.jar"/>
-	<classpathentry exported="true" kind="lib" path="vlcj-4.1.0/vlcj-natives-4.1.0.jar"/>
+	<classpathentry kind="lib" path="vlcj-4.1.0/jna-5.2.0.jar"/>
+	<classpathentry kind="lib" path="vlcj-4.1.0/jna-platform-5.2.0.jar"/>
+	<classpathentry kind="lib" path="vlcj-4.1.0/vlcj-4.1.0.jar"/>
+	<classpathentry kind="lib" path="vlcj-4.1.0/vlcj-natives-4.1.0.jar"/>
+	<classpathentry kind="lib" path="opal-0.9.5.2.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
