Révision 2432
| tmp/org.txm.backtomedia.rcp/src/vlcplayerrcp/messages.properties (revision 2432) | ||
|---|---|---|
| 1 | 1 |
|
| 2 | 2 |
BackToMediaPreferencePage_1 = Open the player with the repeat option enable |
| 3 |
BackToMediaPreferencePage_2 = Use word property to get time
|
|
| 3 |
BackToMediaPreferencePage_2 = Media span build strategy
|
|
| 4 | 4 |
BackToMediaPreferencePage_3 = Span to play |
| 5 | 5 |
BackToMediaPreferencePage_4 = Word time property |
| 6 | 6 |
BackToMediaPreferencePage_5 = Structure |
| ... | ... | |
| 37 | 37 |
|
| 38 | 38 |
playing = Playing {0} from {1} ms to {2} ms ...
|
| 39 | 39 |
|
| 40 |
rate = Speed
|
|
| 40 |
rate = Spd |
|
| 41 | 41 |
|
| 42 | 42 |
repeat = Repeat |
| 43 | 43 |
|
| tmp/org.txm.backtomedia.rcp/src/vlcplayerrcp/messages_fr.properties (revision 2432) | ||
|---|---|---|
| 1 | 1 |
|
| 2 | 2 |
BackToMediaPreferencePage_1 = Répéter le média |
| 3 |
BackToMediaPreferencePage_2 = Récupérer le temps à partir d''une propriété de mot
|
|
| 3 |
BackToMediaPreferencePage_2 = Stratégie de construction de l''empan à jouer
|
|
| 4 | 4 |
BackToMediaPreferencePage_3 = Empan à jouer |
| 5 | 5 |
BackToMediaPreferencePage_4 = Propriété de mot de temps |
| 6 | 6 |
BackToMediaPreferencePage_5 = Structure |
| ... | ... | |
| 37 | 37 |
|
| 38 | 38 |
playing = Joue {0} depuis {1} ms à {2} ms ...
|
| 39 | 39 |
|
| 40 |
rate = Vitesse
|
|
| 40 |
rate = Vit |
|
| 41 | 41 |
|
| 42 | 42 |
repeat = Répéter |
| 43 | 43 |
|
| tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/vlcplayer/VLCPlayer.java (revision 2432) | ||
|---|---|---|
| 48 | 48 |
|
| 49 | 49 |
@Override |
| 50 | 50 |
protected void onFound(String path, NativeDiscoveryStrategy strategy) {
|
| 51 |
Log.finer("VLC NativeDiscovery: Found " + path + " " + strategy);
|
|
| 51 |
Log.finer("VLC NativeDiscovery: onFound " + path + " " + strategy);
|
|
| 52 | 52 |
} |
| 53 | 53 |
|
| 54 | 54 |
@Override |
| 55 | 55 |
protected void onNotFound() {
|
| 56 |
Log.finer("VLC NativeDiscovery: Not found");
|
|
| 56 |
Log.finer("VLC NativeDiscovery: Not found.");
|
|
| 57 | 57 |
} |
| 58 | 58 |
}; |
| 59 | 59 |
boolean found = discovery.discover(); |
| 60 |
Log.finer("VLC NativeDiscovery: " + found);
|
|
| 61 |
libvlc_instance_t instance = libvlc_new(0, new StringArray(new String[0])); |
|
| 62 |
Log.finer("VLC NativeDiscovery: instance " + instance);
|
|
| 63 |
if (instance != null) {
|
|
| 64 |
libvlc_release(instance); |
|
| 60 |
Log.finer("VLC NativeDiscovery: the discovery was succesfull ? " + found);
|
|
| 61 |
if (found) {
|
|
| 62 |
libvlc_instance_t instance = libvlc_new(0, new StringArray(new String[0])); |
|
| 63 |
Log.finer("VLC NativeDiscovery: VLC instance is " + instance);
|
|
| 64 |
if (instance != null) {
|
|
| 65 |
libvlc_release(instance); |
|
| 66 |
} else {
|
|
| 67 |
Log.warning(NLS.bind("** Impossible to use your VLC [{0}] (please check that you have at least VLC version 3.0).", instance));
|
|
| 68 |
} |
|
| 69 |
Log.finer("VLC NativeDiscovery: VLC version is " + new LibVlcVersion().getVersion());
|
|
| 70 |
} else {
|
|
| 71 |
Log.warning("** Impossible to find VLC (please check that you have at least VLC version 3.0).");
|
|
| 65 | 72 |
} |
| 66 |
Log.finer("VLC NativeDiscovery: " + new LibVlcVersion().getVersion());
|
|
| 67 | 73 |
} |
| 68 | 74 |
|
| 69 | 75 |
protected static final String NOMEDIA = ""; //$NON-NLS-1$ |
| ... | ... | |
| 340 | 346 |
|
| 341 | 347 |
@Override |
| 342 | 348 |
public void opening(MediaPlayer mediaPlayer) {
|
| 343 |
Log.info("Opening media...");
|
|
| 349 |
Log.finer("Opening media...");
|
|
| 344 | 350 |
} |
| 345 | 351 |
|
| 346 | 352 |
@Override |
| 347 | 353 |
public void finished(MediaPlayer mediaPlayer) {
|
| 354 |
Log.finer("Finished playing media...");
|
|
| 348 | 355 |
mediaPlayer.submit(new Runnable() {
|
| 349 | 356 |
|
| 350 | 357 |
@Override |
| ... | ... | |
| 357 | 364 |
} |
| 358 | 365 |
} |
| 359 | 366 |
}); |
| 360 |
|
|
| 361 | 367 |
} |
| 362 | 368 |
}); |
| 363 | 369 |
|
| ... | ... | |
| 539 | 545 |
|
| 540 | 546 |
// if (start == end) end = -1; |
| 541 | 547 |
|
| 542 |
Log.fine(MessagesMP.bind(MessagesMP.playing, new Object[] { mrl, startTime, endTime }));
|
|
| 548 |
Log.finer(MessagesMP.bind(MessagesMP.playing, new Object[] { mrl, startTime, endTime }));
|
|
| 543 | 549 |
// vlcPlayer.submit(new Runnable() {
|
| 544 | 550 |
// |
| 545 | 551 |
// @Override |
| 546 | 552 |
// public void run() {
|
| 547 | 553 |
String[] options = { " :live-caching=200" }; // reduce video stream cache duration to 200ms
|
| 548 | 554 |
|
| 549 |
System.out.println("Preparing media...");
|
|
| 555 |
Log.finer("Preparing media...");
|
|
| 550 | 556 |
if (!vlcPlayer.media().prepare(mrl, options)) {
|
| 557 |
Log.finer("** Impossible to prepare media.");
|
|
| 551 | 558 |
return false; |
| 552 | 559 |
} |
| 553 | 560 |
|
| 554 |
System.out.println("Is media valid ?");
|
|
| 561 |
Log.finer("Is media valid ?");
|
|
| 555 | 562 |
if (!vlcPlayer.media().isValid()) {
|
| 563 |
Log.finer("** Invalid media.");
|
|
| 556 | 564 |
return false; |
| 557 | 565 |
} |
| 558 |
System.out.println("Playing media...");
|
|
| 566 |
|
|
| 567 |
Log.info("Playing media...");
|
|
| 559 | 568 |
vlcPlayer.controls().play(); |
| 560 | 569 |
vlcPlayer.audio().setVolume(volume); |
| 561 | 570 |
vlcPlayer.controls().setTime(start); |
| tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/MediaPreferencesDialog.java (revision 2432) | ||
|---|---|---|
| 24 | 24 |
|
| 25 | 25 |
public class MediaPreferencesDialog extends Dialog {
|
| 26 | 26 |
|
| 27 |
public static String[] properties = { BackToMediaPreferences.STRUCTURE_START_PROPERTY,
|
|
| 27 |
public static String[] properties = { BackToMediaPreferences.REPEAT,
|
|
| 28 |
BackToMediaPreferences.STRUCTURE_START_PROPERTY, |
|
| 28 | 29 |
BackToMediaPreferences.STRUCTURE_END_PROPERTY, |
| 29 | 30 |
BackToMediaPreferences.STRUCTURE, |
| 30 | 31 |
BackToMediaPreferences.WORD_PROPERTY, |
| tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/BackToMedia.java (revision 2432) | ||
|---|---|---|
| 504 | 504 |
if (editor != null) {
|
| 505 | 505 |
vlcEditor = associatedEditors.get(editor); |
| 506 | 506 |
} |
| 507 |
if (vlcEditor != null && !vlcEditor.getPlayer().isDisposed()) {
|
|
| 508 |
vlcEditor.getPlayer().play(path, sStartTime, sEndTime); |
|
| 509 |
vlcEditor.getPlayer().setRepeat(true); |
|
| 510 |
} |
|
| 511 |
else {
|
|
| 507 |
|
|
| 508 |
if (vlcEditor == null) {
|
|
| 512 | 509 |
// System.out.println("new editor linked to "+ce);
|
| 513 |
vlcEditor = OpenVLCPlayer.openEditor(path, sStartTime, sEndTime);
|
|
| 510 |
vlcEditor = OpenVLCPlayer.openEditor(); |
|
| 514 | 511 |
|
| 515 | 512 |
// editor.getPlayer().setRepeat(true); |
| 516 | 513 |
if (vlcEditor == null) {
|
| ... | ... | |
| 518 | 515 |
return null; |
| 519 | 516 |
} |
| 520 | 517 |
|
| 521 |
if (!vlcEditor.isMediaLoaded()) {
|
|
| 522 |
|
|
| 523 |
vlcEditor.getSite().getPage().closeEditor(vlcEditor, false); |
|
| 524 |
if (media_auth) {
|
|
| 525 |
Log.warning("The MediaPlayer could not open the media: " + media_directory); // don't show credentials
|
|
| 526 |
System.clearProperty(BackToMediaPreferences.MEDIA_AUTH_PASSWORD); |
|
| 527 |
System.clearProperty(BackToMediaPreferences.MEDIA_AUTH_LOGIN); |
|
| 528 |
} |
|
| 529 |
else {
|
|
| 530 |
Log.warning("The MediaPlayer could not open the media: " + path);
|
|
| 531 |
} |
|
| 532 |
} |
|
| 533 |
|
|
| 534 | 518 |
// move the editor in the window |
| 535 | 519 |
int position = BackToMediaPreferences.getInstance().getInt(BackToMediaPreferences.BACKTOMEDIA_POSITION); |
| 536 | 520 |
if (editor != null) {
|
| ... | ... | |
| 544 | 528 |
} |
| 545 | 529 |
} |
| 546 | 530 |
|
| 531 |
vlcEditor.getPlayer().play(path, sStartTime, sEndTime); |
|
| 532 |
vlcEditor.getPlayer().setRepeat(true); |
|
| 533 |
|
|
| 534 |
if (!vlcEditor.isMediaLoaded()) {
|
|
| 535 |
|
|
| 536 |
vlcEditor.getSite().getPage().closeEditor(vlcEditor, false); |
|
| 537 |
if (media_auth) {
|
|
| 538 |
Log.warning("The MediaPlayer could not open the media: " + media_directory); // don't show credentials
|
|
| 539 |
System.clearProperty(BackToMediaPreferences.MEDIA_AUTH_PASSWORD); |
|
| 540 |
System.clearProperty(BackToMediaPreferences.MEDIA_AUTH_LOGIN); |
|
| 541 |
} |
|
| 542 |
else {
|
|
| 543 |
Log.warning("The MediaPlayer could not open the media: " + path);
|
|
| 544 |
} |
|
| 545 |
} |
|
| 546 |
|
|
| 547 | 547 |
if (path != null) {
|
| 548 | 548 |
vlcEditor.setPartName(textid); |
| 549 | 549 |
} |
| tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/OpenVLCPlayer.java (revision 2432) | ||
|---|---|---|
| 97 | 97 |
return null; |
| 98 | 98 |
} |
| 99 | 99 |
|
| 100 |
public static VLCPlayerEditor openEditor() {
|
|
| 101 |
IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage(); |
|
| 102 |
VLCPlayerEditorInput editorInput = new VLCPlayerEditorInput(); |
|
| 103 |
StatusLine.setMessage(MessagesMP.opening_media); |
|
| 104 |
try {
|
|
| 105 |
IEditorPart editor = page.openEditor(editorInput, VLCPlayerEditor.ID); |
|
| 106 |
if (editor != null && editor instanceof VLCPlayerEditor) {
|
|
| 107 |
return (VLCPlayerEditor) editor; |
|
| 108 |
} |
|
| 109 |
else {
|
|
| 110 |
return null; |
|
| 111 |
} |
|
| 112 |
|
|
| 113 |
} |
|
| 114 |
catch (PartInitException e) {
|
|
| 115 |
e.printStackTrace(); |
|
| 116 |
} |
|
| 117 |
return null; |
|
| 118 |
} |
|
| 119 |
|
|
| 100 | 120 |
public static void openEditor(String mrl, int time) {
|
| 101 | 121 |
IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage(); |
| 102 | 122 |
VLCPlayerEditorInput editorInput = new VLCPlayerEditorInput(); |
| tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/preferences/BackToMediaPreferences.java (revision 2432) | ||
|---|---|---|
| 31 | 31 |
|
| 32 | 32 |
// the sync modes |
| 33 | 33 |
public static final String WORDMODE = "Word"; |
| 34 |
|
|
| 35 | 34 |
public static final String STRUCTUREMODE = "Structure"; |
| 36 |
|
|
| 37 | 35 |
public static final String MILESTONEMODE = "Milestone"; |
| 38 | 36 |
|
| 39 | 37 |
public static final String MEDIA_PATH_PREFIX = "media_path_prefix"; |
| tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/preferences/BackToMediaPreferencePage.java (revision 2432) | ||
|---|---|---|
| 30 | 30 |
import org.eclipse.e4.ui.workbench.modeling.EModelService; |
| 31 | 31 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
| 32 | 32 |
import org.eclipse.jface.preference.FieldEditor; |
| 33 |
import org.eclipse.jface.preference.IntegerFieldEditor; |
|
| 33 | 34 |
import org.eclipse.jface.preference.StringFieldEditor; |
| 34 | 35 |
import org.eclipse.jface.util.PropertyChangeEvent; |
| 35 | 36 |
import org.eclipse.swt.SWT; |
| ... | ... | |
| 76 | 77 |
|
| 77 | 78 |
private StringFieldEditor defaultWordTimeProperty; |
| 78 | 79 |
|
| 80 |
private IntegerFieldEditor wordLeftContextSizeProperty; |
|
| 81 |
|
|
| 82 |
private IntegerFieldEditor wordRightContextSizeProperty; |
|
| 83 |
|
|
| 79 | 84 |
private Group spanGroup; |
| 80 | 85 |
|
| 81 | 86 |
/** |
| ... | ... | |
| 107 | 112 |
loopProperty = new BooleanFieldEditor(BackToMediaPreferences.REPEAT, MessagesMP.BackToMediaPreferencePage_1, getFieldEditorParent()); |
| 108 | 113 |
addField(loopProperty); |
| 109 | 114 |
|
| 115 |
String[][] values = { { "ABOVE", "" + EModelService.ABOVE }, { "BELOW", "" + EModelService.BELOW }, { "LEFT_OF", "" + EModelService.LEFT_OF }, { "RIGHT_OF", "" + EModelService.RIGHT_OF } };
|
|
| 116 |
backtotext_position = new ComboFieldEditor(BackToMediaPreferences.BACKTOMEDIA_POSITION, "BackToMedia position", values, getFieldEditorParent()); |
|
| 117 |
addField(backtotext_position); |
|
| 118 |
|
|
| 110 | 119 |
String[][] choices = { { BackToMediaPreferences.WORDMODE, BackToMediaPreferences.WORDMODE },
|
| 111 | 120 |
{ BackToMediaPreferences.STRUCTUREMODE, BackToMediaPreferences.STRUCTUREMODE },
|
| 112 | 121 |
{ BackToMediaPreferences.MILESTONEMODE, BackToMediaPreferences.MILESTONEMODE }
|
| ... | ... | |
| 115 | 124 |
|
| 116 | 125 |
addField(useWordProperty); |
| 117 | 126 |
|
| 118 |
String[][] values = { { "ABOVE", "" + EModelService.ABOVE }, { "BELOW", "" + EModelService.BELOW }, { "LEFT_OF", "" + EModelService.LEFT_OF }, { "RIGHT_OF", "" + EModelService.RIGHT_OF } };
|
|
| 119 |
backtotext_position = new ComboFieldEditor(BackToMediaPreferences.BACKTOMEDIA_POSITION, "BackToMedia position", values, getFieldEditorParent()); |
|
| 120 |
addField(backtotext_position); |
|
| 121 |
|
|
| 122 | 127 |
spanGroup = new Group(getFieldEditorParent(), SWT.NONE); |
| 123 | 128 |
spanGroup.setText(MessagesMP.BackToMediaPreferencePage_3); |
| 124 | 129 |
GridData gridData2 = new GridData(SWT.FILL, SWT.FILL, true, false); |
| ... | ... | |
| 132 | 137 |
defaultWordTimeProperty = new StringFieldEditor(BackToMediaPreferences.WORD_PROPERTY, MessagesMP.BackToMediaPreferencePage_4, spanGroup); |
| 133 | 138 |
addField(defaultWordTimeProperty); |
| 134 | 139 |
|
| 140 |
wordLeftContextSizeProperty = new IntegerFieldEditor(BackToMediaPreferences.WORD_CONTEXT_LEFT_DISTANCE, "Left length", spanGroup); |
|
| 141 |
addField(wordLeftContextSizeProperty); |
|
| 142 |
|
|
| 143 |
wordRightContextSizeProperty = new IntegerFieldEditor(BackToMediaPreferences.WORD_CONTEXT_RIGHT_DISTANCE, "Right length", spanGroup); |
|
| 144 |
addField(wordRightContextSizeProperty); |
|
| 145 |
|
|
| 135 | 146 |
defaultStructure = new StringFieldEditor(BackToMediaPreferences.STRUCTURE, MessagesMP.BackToMediaPreferencePage_5, spanGroup); |
| 136 | 147 |
addField(defaultStructure); |
| 137 | 148 |
|
| ... | ... | |
| 145 | 156 |
} |
| 146 | 157 |
|
| 147 | 158 |
public void updateEnables(String sync_mode) {
|
| 159 |
|
|
| 148 | 160 |
if (BackToMediaPreferences.WORDMODE.equals(sync_mode)) {
|
| 161 |
defaultWordTimeProperty.setEnabled(true, spanGroup); |
|
| 162 |
wordLeftContextSizeProperty.setEnabled(true, spanGroup); |
|
| 163 |
wordRightContextSizeProperty.setEnabled(true, spanGroup); |
|
| 164 |
|
|
| 149 | 165 |
defaultStructure.setEnabled(false, spanGroup); |
| 150 | 166 |
defaultStructureStartProperty.setEnabled(false, spanGroup); |
| 151 | 167 |
defaultStructureEndProperty.setEnabled(false, spanGroup); |
| 152 |
defaultWordTimeProperty.setEnabled(true, spanGroup); |
|
| 153 | 168 |
} |
| 154 | 169 |
else if (BackToMediaPreferences.STRUCTUREMODE.equals(sync_mode)) {
|
| 170 |
defaultWordTimeProperty.setEnabled(false, spanGroup); |
|
| 171 |
wordLeftContextSizeProperty.setEnabled(false, spanGroup); |
|
| 172 |
wordRightContextSizeProperty.setEnabled(false, spanGroup); |
|
| 173 |
|
|
| 155 | 174 |
defaultStructure.setEnabled(true, spanGroup); |
| 156 | 175 |
defaultStructureStartProperty.setEnabled(true, spanGroup); |
| 157 | 176 |
defaultStructureEndProperty.setEnabled(true, spanGroup); |
| 158 |
defaultWordTimeProperty.setEnabled(false, spanGroup); |
|
| 159 | 177 |
} |
| 160 | 178 |
else { // milestones
|
| 179 |
defaultWordTimeProperty.setEnabled(false, spanGroup); |
|
| 180 |
wordLeftContextSizeProperty.setEnabled(false, spanGroup); |
|
| 181 |
wordRightContextSizeProperty.setEnabled(false, spanGroup); |
|
| 182 |
|
|
| 161 | 183 |
defaultStructure.setEnabled(true, spanGroup); |
| 162 | 184 |
defaultStructureStartProperty.setEnabled(true, spanGroup); |
| 163 | 185 |
defaultStructureEndProperty.setEnabled(false, spanGroup); |
| 164 |
defaultWordTimeProperty.setEnabled(false, spanGroup); |
|
| 165 | 186 |
} |
| 166 | 187 |
} |
| 167 | 188 |
|
Formats disponibles : Unified diff