| 93 |
93 |
public static void openEditor(String mrl, int time) {
|
| 94 |
94 |
IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
|
| 95 |
95 |
VLCPlayerEditorInput editorInput = new VLCPlayerEditorInput();
|
| 96 |
|
StatusLine.setMessage(MessagesMP.opening_media+mrl);
|
|
96 |
StatusLine.setMessage(MessagesMP.opening_media);
|
| 97 |
97 |
try {
|
| 98 |
98 |
VLCPlayerEditor player = (VLCPlayerEditor) page
|
| 99 |
99 |
.openEditor(editorInput,VLCPlayerEditor.ID);
|
| 100 |
|
if (player != null)
|
|
100 |
if (player != null) {
|
| 101 |
101 |
player.getPlayer().play(mrl, time);
|
| 102 |
|
if (mrl != null) {
|
| 103 |
|
player.setPartName(new File(mrl).getName());
|
|
102 |
StatusLine.setMessage("");
|
|
103 |
if (mrl != null) {
|
|
104 |
player.setPartName(new File(mrl).getName());
|
|
105 |
}
|
|
106 |
} else {
|
|
107 |
System.out.println(MessagesMP.error_open_media);
|
| 104 |
108 |
}
|
| 105 |
|
else
|
| 106 |
|
System.out.println(MessagesMP.error_open_media);
|
| 107 |
109 |
} catch (PartInitException e) {
|
| 108 |
110 |
e.printStackTrace();
|
| 109 |
111 |
}
|
| ... | ... | |
| 112 |
114 |
public static VLCPlayerEditor openEditor(String mrl, int time, int endtime) {
|
| 113 |
115 |
IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
|
| 114 |
116 |
VLCPlayerEditorInput editorInput = new VLCPlayerEditorInput();
|
| 115 |
|
StatusLine.setMessage(MessagesMP.opening_media+mrl);
|
|
117 |
StatusLine.setMessage(MessagesMP.opening_media);
|
| 116 |
118 |
try {
|
| 117 |
|
VLCPlayerEditor player = (VLCPlayerEditor) page
|
| 118 |
|
.openEditor(editorInput,VLCPlayerEditor.ID);
|
|
119 |
VLCPlayerEditor player = (VLCPlayerEditor) page.openEditor(editorInput,VLCPlayerEditor.ID);
|
| 119 |
120 |
|
| 120 |
|
boolean isAudio = mrl.matches(".+\\.(mp3|ogg|wav|wpa)"); //$NON-NLS-1$
|
|
121 |
//boolean isAudio = mrl.matches(".+\\.(mp3|ogg|wav|wpa)"); //$NON-NLS-1$
|
| 121 |
122 |
if (player != null) {
|
| 122 |
123 |
player.getPlayer().play(mrl, time, endtime);
|
|
124 |
StatusLine.setMessage("");
|
| 123 |
125 |
} else {
|
| 124 |
126 |
System.out.println(MessagesMP.error_open_media);
|
| 125 |
127 |
return null;
|
| ... | ... | |
| 136 |
138 |
String sEndTime) {
|
| 137 |
139 |
IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
|
| 138 |
140 |
VLCPlayerEditorInput editorInput = new VLCPlayerEditorInput();
|
| 139 |
|
StatusLine.setMessage(MessagesMP.opening_media+path);
|
|
141 |
StatusLine.setMessage(MessagesMP.opening_media);
|
| 140 |
142 |
try {
|
| 141 |
|
VLCPlayerEditor player = (VLCPlayerEditor) page
|
| 142 |
|
.openEditor(editorInput,VLCPlayerEditor.ID);
|
|
143 |
VLCPlayerEditor player = (VLCPlayerEditor) page.openEditor(editorInput,VLCPlayerEditor.ID);
|
| 143 |
144 |
|
| 144 |
145 |
//boolean isAudio = mrl.matches(".+\\.(mp3|ogg|wav|wpa)");
|
| 145 |
146 |
if (player != null) {
|
| 146 |
147 |
player.getPlayer().play(path, sStartTime, sEndTime);
|
|
148 |
StatusLine.setMessage("");
|
| 147 |
149 |
} else {
|
| 148 |
150 |
System.out.println(MessagesMP.error_open_media);
|
| 149 |
151 |
return null;
|