diff --git a/libresonic-main/src/main/java/org/libresonic/player/ajax/PlayQueueService.java b/libresonic-main/src/main/java/org/libresonic/player/ajax/PlayQueueService.java index 73a91d69..a2496290 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/ajax/PlayQueueService.java +++ b/libresonic-main/src/main/java/org/libresonic/player/ajax/PlayQueueService.java @@ -119,6 +119,22 @@ public class PlayQueueService { return convert(request, player, true); } + public PlayQueueInfo toggleStartStop() throws Exception { + HttpServletRequest request = WebContextFactory.get().getHttpServletRequest(); + HttpServletResponse response = WebContextFactory.get().getHttpServletResponse(); + return doToggleStartStop(request, response); + } + + public PlayQueueInfo doToggleStartStop(HttpServletRequest request, HttpServletResponse response) throws Exception { + Player player = getCurrentPlayer(request, response); + if (player.getPlayQueue().getStatus() == PlayQueue.Status.STOPPED) { + player.getPlayQueue().setStatus(PlayQueue.Status.PLAYING); + } else if (player.getPlayQueue().getStatus() == PlayQueue.Status.PLAYING) { + player.getPlayQueue().setStatus(PlayQueue.Status.STOPPED); + } + return convert(request, player, true); + } + public PlayQueueInfo skip(int index) throws Exception { HttpServletRequest request = WebContextFactory.get().getHttpServletRequest(); HttpServletResponse response = WebContextFactory.get().getHttpServletResponse(); diff --git a/libresonic-main/src/main/java/org/libresonic/player/command/PersonalSettingsCommand.java b/libresonic-main/src/main/java/org/libresonic/player/command/PersonalSettingsCommand.java index bea8cd23..1f182583 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/command/PersonalSettingsCommand.java +++ b/libresonic-main/src/main/java/org/libresonic/player/command/PersonalSettingsCommand.java @@ -52,6 +52,7 @@ public class PersonalSettingsCommand { private boolean showArtistInfoEnabled; private boolean nowPlayingAllowed; private boolean autoHidePlayQueue; + private boolean keyboardShortcutsEnabled; private boolean finalVersionNotificationEnabled; private boolean betaVersionNotificationEnabled; private boolean songNotificationEnabled; @@ -230,6 +231,14 @@ public class PersonalSettingsCommand { this.autoHidePlayQueue = autoHidePlayQueue; } + public boolean isKeyboardShortcutsEnabled() { + return keyboardShortcutsEnabled; + } + + public void setKeyboardShortcutsEnabled(boolean keyboardShortcutsEnabled) { + this.keyboardShortcutsEnabled = keyboardShortcutsEnabled; + } + public boolean isLastFmEnabled() { return lastFmEnabled; } diff --git a/libresonic-main/src/main/java/org/libresonic/player/controller/MultiController.java b/libresonic-main/src/main/java/org/libresonic/player/controller/MultiController.java index e37b736e..c332e2e4 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/controller/MultiController.java +++ b/libresonic-main/src/main/java/org/libresonic/player/controller/MultiController.java @@ -238,6 +238,7 @@ public class MultiController extends MultiActionController { map.put("showRight", userSettings.isShowNowPlayingEnabled() || userSettings.isShowChatEnabled()); map.put("autoHidePlayQueue", userSettings.isAutoHidePlayQueue()); map.put("listReloadDelay", userSettings.getListReloadDelay()); + map.put("keyboardShortcutsEnabled", userSettings.isKeyboardShortcutsEnabled()); map.put("showSideBar", userSettings.isShowSideBar()); map.put("brand", settingsService.getBrand()); return new ModelAndView("index", "model", map); diff --git a/libresonic-main/src/main/java/org/libresonic/player/controller/PersonalSettingsController.java b/libresonic-main/src/main/java/org/libresonic/player/controller/PersonalSettingsController.java index e772c224..3a0cb5f0 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/controller/PersonalSettingsController.java +++ b/libresonic-main/src/main/java/org/libresonic/player/controller/PersonalSettingsController.java @@ -74,6 +74,7 @@ public class PersonalSettingsController extends SimpleFormController { command.setSongNotificationEnabled(userSettings.isSongNotificationEnabled()); command.setAutoHidePlayQueue(userSettings.isAutoHidePlayQueue()); command.setListReloadDelay(userSettings.getListReloadDelay()); + command.setKeyboardShortcutsEnabled(userSettings.isKeyboardShortcutsEnabled()); command.setLastFmEnabled(userSettings.isLastFmEnabled()); command.setLastFmUsername(userSettings.getLastFmUsername()); command.setLastFmPassword(userSettings.getLastFmPassword()); @@ -137,6 +138,7 @@ public class PersonalSettingsController extends SimpleFormController { settings.setSongNotificationEnabled(command.isSongNotificationEnabled()); settings.setAutoHidePlayQueue(command.isAutoHidePlayQueue()); settings.setListReloadDelay(command.getListReloadDelay()); + settings.setKeyboardShortcutsEnabled(command.isKeyboardShortcutsEnabled()); settings.setLastFmEnabled(command.isLastFmEnabled()); settings.setLastFmUsername(command.getLastFmUsername()); settings.setSystemAvatarId(getSystemAvatarId(command)); diff --git a/libresonic-main/src/main/java/org/libresonic/player/dao/UserDao.java b/libresonic-main/src/main/java/org/libresonic/player/dao/UserDao.java index 87c3d81a..b8aa5e45 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/dao/UserDao.java +++ b/libresonic-main/src/main/java/org/libresonic/player/dao/UserDao.java @@ -44,7 +44,7 @@ public class UserDao extends AbstractDao { "playlist_year, playlist_bit_rate, playlist_duration, playlist_format, playlist_file_size, " + "last_fm_enabled, last_fm_username, last_fm_password, transcode_scheme, show_now_playing, selected_music_folder_id, " + "party_mode_enabled, now_playing_allowed, avatar_scheme, system_avatar_id, changed, show_chat, show_artist_info, auto_hide_play_queue, " + - "view_as_list, default_album_list, queue_following_songs, show_side_bar, list_reload_delay"; + "view_as_list, default_album_list, queue_following_songs, show_side_bar, list_reload_delay, keyboard_shortcuts_enabled"; private static final Integer ROLE_ID_ADMIN = 1; private static final Integer ROLE_ID_DOWNLOAD = 2; @@ -188,7 +188,7 @@ public class UserDao extends AbstractDao { settings.getAvatarScheme().name(), settings.getSystemAvatarId(), settings.getChanged(), settings.isShowChatEnabled(), settings.isShowArtistInfoEnabled(), settings.isAutoHidePlayQueue(), settings.isViewAsList(), settings.getDefaultAlbumList().getId(), settings.isQueueFollowingSongs(), - settings.isShowSideBar(), settings.getListReloadDelay()}); + settings.isShowSideBar(), settings.getListReloadDelay(), settings.isKeyboardShortcutsEnabled()}); } private static String encrypt(String s) { @@ -350,6 +350,7 @@ public class UserDao extends AbstractDao { settings.setQueueFollowingSongs(rs.getBoolean(col++)); settings.setShowSideBar(rs.getBoolean(col++)); settings.setListReloadDelay((Integer) rs.getObject(col++)); + settings.setKeyboardShortcutsEnabled(rs.getBoolean(col++)); return settings; } diff --git a/libresonic-main/src/main/java/org/libresonic/player/dao/schema/hsql/Schema61.java b/libresonic-main/src/main/java/org/libresonic/player/dao/schema/hsql/Schema61.java index d2634efa..378d11c3 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/dao/schema/hsql/Schema61.java +++ b/libresonic-main/src/main/java/org/libresonic/player/dao/schema/hsql/Schema61.java @@ -44,5 +44,11 @@ public class Schema61 extends Schema { template.execute("alter table user_settings add list_reload_delay int default 60 not null"); LOG.info("Database column 'user_settings.list_reload_delay' was added successfully."); } + + if (!columnExists(template, "keyboard_shortcuts_enabled", "user_settings")) { + LOG.info("Database column 'user_settings.keyboard_shortcuts_enabled' not found. Creating it."); + template.execute("alter table user_settings add keyboard_shortcuts_enabled boolean default false not null"); + LOG.info("Database column 'user_settings.keyboard_shortcuts_enabled' was added successfully."); + } } } diff --git a/libresonic-main/src/main/java/org/libresonic/player/domain/UserSettings.java b/libresonic-main/src/main/java/org/libresonic/player/domain/UserSettings.java index 05a9139c..3d88454a 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/domain/UserSettings.java +++ b/libresonic-main/src/main/java/org/libresonic/player/domain/UserSettings.java @@ -38,6 +38,7 @@ public class UserSettings { private boolean finalVersionNotificationEnabled; private boolean betaVersionNotificationEnabled; private boolean songNotificationEnabled; + private boolean keyboardShortcutsEnabled; private boolean autoHidePlayQueue; private boolean showSideBar; private boolean viewAsList; @@ -221,6 +222,14 @@ public class UserSettings { this.autoHidePlayQueue = autoHidePlayQueue; } + public boolean isKeyboardShortcutsEnabled() { + return keyboardShortcutsEnabled; + } + + public void setKeyboardShortcutsEnabled(boolean keyboardShortcutsEnabled) { + this.keyboardShortcutsEnabled = keyboardShortcutsEnabled; + } + public boolean isShowSideBar() { return showSideBar; } diff --git a/libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java b/libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java index 2c579baf..4ca1eeef 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java +++ b/libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java @@ -1264,6 +1264,7 @@ public class SettingsService { settings.setPartyModeEnabled(false); settings.setNowPlayingAllowed(true); settings.setAutoHidePlayQueue(true); + settings.setKeyboardShortcutsEnabled(false); settings.setShowSideBar(true); settings.setShowArtistInfoEnabled(true); settings.setViewAsList(false); diff --git a/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_de.properties b/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_de.properties index 5cf701c7..b7da1d8a 100644 --- a/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_de.properties +++ b/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_de.properties @@ -350,6 +350,7 @@ personalsettings.nowplayingallowed = Zeige anderen was ich h\u00F6re personalsettings.showchat = Zeige Chat Nachrichten personalsettings.showartistinfo = Zeige Artisten-Info personalsettings.autohideplayqueue = Playlist automatisch ausblenden +personalsettings.keyboardshortcutsenabled = Tastaturk\u00FCrzeln aktivieren personalsettings.finalversionnotification = Informiere mich \u00FCber neue Versionen personalsettings.betaversionnotification = Informiere mich \u00FCber neue Beta Versionen personalsettings.songnotification = Benachrichtigen Sie mich, wenn neue Songs gespielt werden (nicht von allen Browsern unterst\u00FCtzt) diff --git a/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_en.properties b/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_en.properties index a71e11bb..5fac1bc9 100644 --- a/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_en.properties +++ b/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_en.properties @@ -248,6 +248,28 @@ more.jamstash.text =

Jamstash is an HTML5 player for Libresonic. Chrome App.

more.status.title = Network Status more.status.text = Monitor the real-time status of all network media streams. +more.keyboard.title = Keyboard Shortcuts +more.keyboard.text = Keyboard shortcuts can be enabled in the user preferences page. Supported shortcuts are below. +more.keyboard.playback = Playback +more.keyboard.navigation = Navigation +more.keyboard.general = General +more.keyboard.playpause = Play or pause music +more.keyboard.previous = Go to the previous song +more.keyboard.next = Go to the next song +more.keyboard.volumedown = Decrease the player volume +more.keyboard.volumeup = Increase the player volume +more.keyboard.home = Go to Home +more.keyboard.playlists = Go to Playlists +more.keyboard.podcasts = Go to Podcasts +more.keyboard.settings = Go to Settings +more.keyboard.starred = Go to Starred +more.keyboard.more = Go to More +more.keyboard.about = Go to About +more.keyboard.search = Search +more.keyboard.sidebar = Toggle left sidebar +more.keyboard.playqueue = Toggle play queue +more.keyboard.shortcuts = Show keyboard shortcuts +more.keyboard.then = then more.mobile.title = Mobile phone more.mobile.text =

You can control {0} from any WAP-enabled mobile phone or PDA.
\ Simply visit the following URL from your phone: http://yourhostname/wap

\ @@ -375,6 +397,7 @@ personalsettings.nowplayingallowed = Let others see what I am playing personalsettings.showchat = Show chat messages personalsettings.showartistinfo = Show artist info personalsettings.autohideplayqueue = Auto-hide play queue +personalsettings.keyboardshortcutsenabled = Enable keyboard shortcuts personalsettings.finalversionnotification = Notify me about new versions personalsettings.betaversionnotification = Notify me about new beta versions personalsettings.songnotification = Notify me when new songs are played (not supported by all browsers) diff --git a/libresonic-main/src/main/resources/org/libresonic/player/theme/default_dark.properties b/libresonic-main/src/main/resources/org/libresonic/player/theme/default_dark.properties index 7c9e67aa..397c8824 100644 --- a/libresonic-main/src/main/resources/org/libresonic/player/theme/default_dark.properties +++ b/libresonic-main/src/main/resources/org/libresonic/player/theme/default_dark.properties @@ -21,6 +21,7 @@ helpImage = icons/default_dark/help.png helpPopupImage = icons/default_dark/help_small.png homeImage = icons/default_dark/home.png html5Image = icons/default_dark/html5.png +keyboardImage = icons/default_dark/keyboard.png logImage = icons/default_dark/log.png logoImage = icons/default_dark/logo_light.png moreImage = icons/default_dark/more.png diff --git a/libresonic-main/src/main/resources/org/libresonic/player/theme/default_light.properties b/libresonic-main/src/main/resources/org/libresonic/player/theme/default_light.properties index 3c346cd9..92ee2559 100644 --- a/libresonic-main/src/main/resources/org/libresonic/player/theme/default_light.properties +++ b/libresonic-main/src/main/resources/org/libresonic/player/theme/default_light.properties @@ -21,6 +21,7 @@ helpImage = icons/default_light/help.png helpPopupImage = icons/default_light/help_small.png homeImage = icons/default_light/home.png html5Image = icons/default_light/html5.png +keyboardImage = icons/default_light/keyboard.png logImage = icons/default_light/log.png logoImage = icons/default_light/logo.png moreImage = icons/default_light/more.png diff --git a/libresonic-main/src/main/webapp/WEB-INF/jsp/head.jsp b/libresonic-main/src/main/webapp/WEB-INF/jsp/head.jsp index b14d62a2..45dea935 100644 --- a/libresonic-main/src/main/webapp/WEB-INF/jsp/head.jsp +++ b/libresonic-main/src/main/webapp/WEB-INF/jsp/head.jsp @@ -10,3 +10,40 @@ Libresonic + + + + + + + diff --git a/libresonic-main/src/main/webapp/WEB-INF/jsp/index.jsp b/libresonic-main/src/main/webapp/WEB-INF/jsp/index.jsp index 21010cf5..8cba809f 100644 --- a/libresonic-main/src/main/webapp/WEB-INF/jsp/index.jsp +++ b/libresonic-main/src/main/webapp/WEB-INF/jsp/index.jsp @@ -11,7 +11,7 @@ - + diff --git a/libresonic-main/src/main/webapp/WEB-INF/jsp/more.jsp b/libresonic-main/src/main/webapp/WEB-INF/jsp/more.jsp index 1f0e016c..4993717f 100644 --- a/libresonic-main/src/main/webapp/WEB-INF/jsp/more.jsp +++ b/libresonic-main/src/main/webapp/WEB-INF/jsp/more.jsp @@ -38,6 +38,12 @@ } + + @@ -182,9 +188,58 @@

-
+
- \ No newline at end of file + +

+ " alt=""/> + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Spaceg h/
g pm
g oq
g s?
+g t
g r
g a
+ + diff --git a/libresonic-main/src/main/webapp/WEB-INF/jsp/personalSettings.jsp b/libresonic-main/src/main/webapp/WEB-INF/jsp/personalSettings.jsp index 449e18f6..f57974d3 100644 --- a/libresonic-main/src/main/webapp/WEB-INF/jsp/personalSettings.jsp +++ b/libresonic-main/src/main/webapp/WEB-INF/jsp/personalSettings.jsp @@ -179,6 +179,13 @@ + + + + + +
+ @@ -253,4 +260,4 @@ - \ No newline at end of file + diff --git a/libresonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp b/libresonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp index 7f539ddd..c8917a44 100644 --- a/libresonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp +++ b/libresonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp @@ -31,12 +31,13 @@ - +