Skip to content

Commit 42577cd

Browse files
committed
no default instance... we are expert.. else use emm
1 parent fc4d5d7 commit 42577cd

File tree

1 file changed

+3
-49
lines changed

1 file changed

+3
-49
lines changed

src/VLC/VLCLibrary.class.st

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"
2-
When you use me, I automatically create one VLCInstance.. but you can create other with #createVLCInstance or #createVLCWithArguments:
2+
When you use me:
3+
4+
1. create an instance of me with #createVLCInstance or #createVLCWithArguments:
35
"
46
Class {
57
#name : #VLCLibrary,
68
#superclass : #FFILibrary,
7-
#instVars : [
8-
'libVLCInstance'
9-
],
109
#category : #'VLC-Library'
1110
}
1211

@@ -56,21 +55,11 @@ VLCLibrary >> attachToEventManager: anEventManager forEvent: aTypeOfEvent withCa
5655
) '
5756
]
5857

59-
{ #category : #'media list player' }
60-
VLCLibrary >> createListPlayer [
61-
^ self createListPlayerForInstance: libVLCInstance
62-
]
63-
6458
{ #category : #'media list player' }
6559
VLCLibrary >> createListPlayerForInstance: anInstance [
6660
^ self ffiCall: 'void* libvlc_media_list_player_new(void* anInstance)'
6761
]
6862

69-
{ #category : #'media list' }
70-
VLCLibrary >> createMediaList [
71-
^ self createMediaListFromInstance: libVLCInstance
72-
]
73-
7463
{ #category : #'media list' }
7564
VLCLibrary >> createMediaListFromInstance: aVLCInstance [
7665
^ self ffiCall: 'void* libvlc_media_list_new(void* aVLCInstance)'
@@ -150,24 +139,6 @@ VLCLibrary >> getMediaInsideMediaPlayer: aMediaPlayer [
150139
{ #category : #initialization }
151140
VLCLibrary >> initialize [
152141
super initialize.
153-
libVLCInstance := self createVLCInstance
154-
]
155-
156-
{ #category : #initialization }
157-
VLCLibrary >> initializeVLCWithArguments: aCollectionOfString [
158-
"colArguments := OrderedCollection new.
159-
colArguments add: '--novideo'.
160-
vlc := VLCLibrary uniqueInstance initializeVLCWithArguments: colArguments.
161-
media := vlc mediaFileFromStringLocation: 'https://s6.onlinevideoconverter.com/download?file=d3a0d3e4a0c2f5'.
162-
player := vlc createPlayerForMedia: media.
163-
vlc playMediaPlayer: player.
164-
vlc pauseMediaPlayer: player.
165-
vlc isMediaPlayerPlaying: player"
166-
167-
| externalArray |
168-
externalArray := (FFIExternalArray externalNewType: 'void*' size: aCollectionOfString size) autoRelease.
169-
aCollectionOfString withIndexDo: [ :string :index | externalArray at: index put: (ExternalAddress fromString: string) autoRelease ].
170-
libVLCInstance := self initializeVLCWithArguments: externalArray getHandle andNumberOfArgs: aCollectionOfString size.
171142
]
172143

173144
{ #category : #initialization }
@@ -218,23 +189,6 @@ VLCLibrary >> mediaFileForInstance: aVLCInstance fromStringPath: aStringPath [
218189
^ self ffiCall: 'void* libvlc_media_new_path(void* aVLCInstance, String aStringPath);'
219190
]
220191

221-
{ #category : #media }
222-
VLCLibrary >> mediaFileFromFileDescriptor: fileDescriptor [
223-
^ self mediaFileForInstance: libVLCInstance fromFileDescriptor: fileDescriptor
224-
]
225-
226-
{ #category : #media }
227-
VLCLibrary >> mediaFileFromStringLocation: aLocation [
228-
"ex self mediaFileFromStringPath: '/home/badetitou/Musique/Coda.mp3'"
229-
^ self mediaFileForInstance: libVLCInstance fromStringLocation: aLocation
230-
]
231-
232-
{ #category : #media }
233-
VLCLibrary >> mediaFileFromStringPath: aStringPath [
234-
"ex self mediaFileFromStringPath: '/home/badetitou/Musique/Coda.mp3'"
235-
^ self mediaFileForInstance: libVLCInstance fromStringPath: aStringPath
236-
]
237-
238192
{ #category : #'media list player' }
239193
VLCLibrary >> nextListPlayer: aListPlayer [
240194
^ self ffiCall: 'void* libvlc_media_list_player_next (void* aListPlayer)'

0 commit comments

Comments
 (0)