Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Casanowow Life for love
VLC-Android
Commits
55287184
Commit
55287184
authored
Feb 21, 2014
by
Adrien Maglo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AudioService: update the playlist when a media file has been removed
parent
31831bf9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
2 deletions
+33
-2
vlc-android/src/org/videolan/libvlc/MediaList.java
vlc-android/src/org/videolan/libvlc/MediaList.java
+11
-0
vlc-android/src/org/videolan/vlc/AudioService.java
vlc-android/src/org/videolan/vlc/AudioService.java
+5
-0
vlc-android/src/org/videolan/vlc/AudioServiceController.java
vlc-android/src/org/videolan/vlc/AudioServiceController.java
+6
-0
vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
.../org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+1
-0
vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
.../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+3
-1
vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
...oid/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+6
-1
vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
...ndroid/src/org/videolan/vlc/interfaces/IAudioService.aidl
+1
-0
No files found.
vlc-android/src/org/videolan/libvlc/MediaList.java
View file @
55287184
...
...
@@ -166,6 +166,17 @@ public class MediaList {
signal_list_event
(
EventHandler
.
CustomMediaListItemDeleted
,
position
,
uri
);
}
public
void
remove
(
String
location
)
{
for
(
int
i
=
0
;
i
<
mInternalList
.
size
();
++
i
)
{
String
uri
=
mInternalList
.
get
(
i
).
m
.
getLocation
();
if
(
uri
.
equals
(
location
))
{
mInternalList
.
remove
(
i
);
signal_list_event
(
EventHandler
.
CustomMediaListItemDeleted
,
i
,
uri
);
i
--;
}
}
}
public
int
size
()
{
return
mInternalList
.
size
();
}
...
...
vlc-android/src/org/videolan/vlc/AudioService.java
View file @
55287184
...
...
@@ -1229,6 +1229,11 @@ public class AudioService extends Service {
mLibVLC
.
getMediaList
().
remove
(
position
);
}
@Override
public
void
removeLocation
(
String
location
)
{
mLibVLC
.
getMediaList
().
remove
(
location
);
}
@Override
public
List
<
String
>
getMediaLocations
()
{
ArrayList
<
String
>
medias
=
new
ArrayList
<
String
>();
...
...
vlc-android/src/org/videolan/vlc/AudioServiceController.java
View file @
55287184
...
...
@@ -261,6 +261,12 @@ public class AudioServiceController implements IAudioPlayerControl {
new
Object
[]
{
position
}
);
}
public
void
removeLocation
(
String
location
)
{
remoteProcedureCall
(
mAudioServiceBinder
,
Void
.
class
,
(
Void
)
null
,
"removeLocation"
,
new
Class
<?>[]
{
String
.
class
},
new
Object
[]
{
location
}
);
}
@SuppressWarnings
(
"unchecked"
)
public
List
<
String
>
getMediaLocations
()
{
List
<
String
>
def
=
new
ArrayList
<
String
>();
...
...
vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
View file @
55287184
...
...
@@ -263,6 +263,7 @@ public class AudioAlbumsSongsFragment extends SherlockFragment {
mMediaLibrary
.
getMediaItems
().
remove
(
media
);
mSongsAdapter
.
removeMedia
(
media
);
mAlbumsAdapter
.
removeMedia
(
media
);
mAudioController
.
removeLocation
(
media
.
getLocation
());
}
});
alertDialog
.
show
();
...
...
vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
View file @
55287184
...
...
@@ -255,7 +255,9 @@ public class AudioBrowserFragment extends SherlockFragment {
@Override
public
void
run
(
Object
o
)
{
AudioBrowserListAdapter
.
ListItem
listItem
=
(
AudioBrowserListAdapter
.
ListItem
)
o
;
mMediaLibrary
.
getMediaItems
().
remove
(
listItem
.
mMediaList
.
get
(
0
));
Media
media
=
listItem
.
mMediaList
.
get
(
0
);
mMediaLibrary
.
getMediaItems
().
remove
(
media
);
mAudioController
.
removeLocation
(
media
.
getLocation
());
updateLists
();
}
});
...
...
vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
View file @
55287184
...
...
@@ -99,6 +99,8 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
private
Thumbnailer
mThumbnailer
;
private
VideoGridAnimator
mAnimator
;
private
AudioServiceController
mAudioController
;
/* All subclasses of Fragment must include a public empty constructor. */
public
VideoGridFragment
()
{
}
...
...
@@ -106,6 +108,8 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
mAudioController
=
AudioServiceController
.
getInstance
();
mVideoAdapter
=
new
VideoListAdapter
(
getActivity
(),
this
);
mMediaLibrary
=
MediaLibrary
.
getInstance
(
getActivity
());
setListAdapter
(
mVideoAdapter
);
...
...
@@ -270,7 +274,7 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
}
protected
void
playAudio
(
Media
media
)
{
Audio
Service
Controller
.
getInstance
().
load
(
media
.
getLocation
(),
true
);
m
AudioController
.
load
(
media
.
getLocation
(),
true
);
}
private
boolean
handleContextItemSelected
(
MenuItem
menu
,
int
position
)
{
...
...
@@ -301,6 +305,7 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
Media
media
=
(
Media
)
o
;
mMediaLibrary
.
getMediaItems
().
remove
(
media
);
mVideoAdapter
.
remove
(
media
);
mAudioController
.
removeLocation
(
media
.
getLocation
());
}
});
alertDialog
.
show
();
...
...
vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
View file @
55287184
...
...
@@ -33,6 +33,7 @@ interface IAudioService {
void
append
(
in
List
<
String
>
mediaPathList
);
void
moveItem
(
int
positionStart
,
int
positionEnd
);
void
remove
(
int
position
);
void
removeLocation
(
String
location
);
List
<
String
>
getMediaLocations
();
String
getCurrentMediaLocation
();
boolean
isPlaying
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment