diff --git a/src/main/java/com/github/nutomic/controldlna/gui/MainActivity.java b/src/main/java/com/github/nutomic/controldlna/gui/MainActivity.java index 855e12e..ee3c00b 100644 --- a/src/main/java/com/github/nutomic/controldlna/gui/MainActivity.java +++ b/src/main/java/com/github/nutomic/controldlna/gui/MainActivity.java @@ -188,6 +188,9 @@ public class MainActivity extends ActionBarActivity { case R.id.refreshdev: mServerFragment.triggerSearch(); return true; + case R.id.clearplaylist: + mRouteFragment.clearPlaylist(); + return true; case R.id.about: Intent a = new Intent(this, AboutActivity.class); startActivity(a); diff --git a/src/main/java/com/github/nutomic/controldlna/gui/RouteFragment.java b/src/main/java/com/github/nutomic/controldlna/gui/RouteFragment.java index 3480399..6caefcb 100644 --- a/src/main/java/com/github/nutomic/controldlna/gui/RouteFragment.java +++ b/src/main/java/com/github/nutomic/controldlna/gui/RouteFragment.java @@ -624,6 +624,17 @@ public class RouteFragment extends MediaRouteDiscoveryFragment implements mMediaRouterPlayService.append(playlist); } + /** + * Deletes the current playlist and stops playback + */ + public void clearPlaylist() + { + mMediaRouterPlayService.stop(); + changePlayPauseState(false); + mPlaylistAdapter.clear(); + mMediaRouterPlayService.setPlaylist(new ArrayList()); + } + /** * Generates a time string in the format mm:ss from a time value in seconds. * diff --git a/src/main/res/menu/menu.xml b/src/main/res/menu/menu.xml index 7962260..f3792b2 100644 --- a/src/main/res/menu/menu.xml +++ b/src/main/res/menu/menu.xml @@ -8,6 +8,9 @@ + diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index f7675b5..b54a5a9 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -46,10 +46,13 @@ Refresh Devices + + Clear Playlist + About - + ControlDLNA - a UPnP media control point \nOriginal version: \nCopyright (c) 2013, Felix Ableitner, All rights reserved.