Added seeking in the audio player menu and in new keystrokes (read changelog)
This commit is contained in:
parent
4f3bb6ac93
commit
9373f10d68
@ -5,6 +5,9 @@
|
|||||||
### New additions
|
### New additions
|
||||||
|
|
||||||
* For users with multiple soundcards, there is a new tab in the preferences dialogue of Socializer, called sound. From there, you can define which soundcard will be used for input and output.
|
* For users with multiple soundcards, there is a new tab in the preferences dialogue of Socializer, called sound. From there, you can define which soundcard will be used for input and output.
|
||||||
|
* the audio player can seek positions in the currently playing track. You can use the menu items (located in the main menu) or use the new available keystrokes dedicated to the actions. Seeking will be made in 5 second intervals.
|
||||||
|
* Alt+Shift+Left arrow: Seek 5 seconds backwards.
|
||||||
|
* Alt+Shift+Right arrow: Seek 5 seconds forwards.
|
||||||
* it is possible to select the language used in socializer from the preferences dialog. When changing the language, the application must be restarted for the changes to take effect.
|
* it is possible to select the language used in socializer from the preferences dialog. When changing the language, the application must be restarted for the changes to take effect.
|
||||||
* A new option, called open in vk.com, has been added in the context menu for almost all objects (items in home timeline, walls, documents, people, group topics and in buffers for conversations). This option will open the selected item in the VK website.
|
* A new option, called open in vk.com, has been added in the context menu for almost all objects (items in home timeline, walls, documents, people, group topics and in buffers for conversations). This option will open the selected item in the VK website.
|
||||||
* when opening the list of friends added by an user, you can display the context menu from an item on the list and view the user profile, open it in VK.com, among other actions.
|
* when opening the list of friends added by an user, you can display the context menu from an item on the list and view the user profile, open it in VK.com, among other actions.
|
||||||
|
@ -542,6 +542,8 @@ class Controller(object):
|
|||||||
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_next, menuitem=self.window.player_next)
|
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_next, menuitem=self.window.player_next)
|
||||||
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_previous, menuitem=self.window.player_previous)
|
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_previous, menuitem=self.window.player_previous)
|
||||||
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_all, menuitem=self.window.player_play_all)
|
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_all, menuitem=self.window.player_play_all)
|
||||||
|
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.seek_left, menuitem=self.window.player_seek_left)
|
||||||
|
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.seek_right, menuitem=self.window.player_seek_right)
|
||||||
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_volume_down, menuitem=self.window.player_volume_down)
|
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_volume_down, menuitem=self.window.player_volume_down)
|
||||||
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_volume_up, menuitem=self.window.player_volume_up)
|
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_volume_up, menuitem=self.window.player_volume_up)
|
||||||
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_mute, menuitem=self.window.player_mute)
|
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_mute, menuitem=self.window.player_mute)
|
||||||
@ -776,6 +778,12 @@ class Controller(object):
|
|||||||
def menu_mute(self, *args, **kwargs):
|
def menu_mute(self, *args, **kwargs):
|
||||||
player.player.volume = 0
|
player.player.volume = 0
|
||||||
|
|
||||||
|
def seek_left(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("seek", ms=-500000)
|
||||||
|
|
||||||
|
def seek_right(self, *args, **kwargs):
|
||||||
|
pub.sendMessage("seek", ms=500000)
|
||||||
|
|
||||||
def view_my_profile(self, *args, **kwargs):
|
def view_my_profile(self, *args, **kwargs):
|
||||||
self.user_profile(self.session.user_id)
|
self.user_profile(self.session.user_id)
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ class audioPlayer(object):
|
|||||||
pub.subscribe(self.stop, "stop")
|
pub.subscribe(self.stop, "stop")
|
||||||
pub.subscribe(self.play_next, "play-next")
|
pub.subscribe(self.play_next, "play-next")
|
||||||
pub.subscribe(self.play_previous, "play-previous")
|
pub.subscribe(self.play_previous, "play-previous")
|
||||||
|
pub.subscribe(self.seek, "seek")
|
||||||
|
|
||||||
def play(self, object, set_info=True, fresh=False):
|
def play(self, object, set_info=True, fresh=False):
|
||||||
""" Play an URl Stream.
|
""" Play an URl Stream.
|
||||||
@ -181,6 +182,16 @@ class audioPlayer(object):
|
|||||||
self.playing_track -= 1
|
self.playing_track -= 1
|
||||||
call_threaded(self.play, self.queue[self.playing_track])
|
call_threaded(self.play, self.queue[self.playing_track])
|
||||||
|
|
||||||
|
def seek(self, ms=0):
|
||||||
|
if self.check_is_playing():
|
||||||
|
if self.stream.position < 500000 and ms < 0:
|
||||||
|
self.stream.position = 0
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
self.stream.position = self.stream.position+ms
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def check_is_playing(self):
|
def check_is_playing(self):
|
||||||
""" check if the player is already playing a stream. """
|
""" check if the player is already playing a stream. """
|
||||||
if self.stream == None:
|
if self.stream == None:
|
||||||
|
@ -41,6 +41,8 @@ class mainWindow(wx.Frame):
|
|||||||
self.player_previous = player.Append(wx.NewId(), _("Previous"))
|
self.player_previous = player.Append(wx.NewId(), _("Previous"))
|
||||||
self.player_next = player.Append(wx.NewId(), _("Next"))
|
self.player_next = player.Append(wx.NewId(), _("Next"))
|
||||||
self.player_shuffle = player.AppendCheckItem(wx.NewId(), _("Shuffle"))
|
self.player_shuffle = player.AppendCheckItem(wx.NewId(), _("Shuffle"))
|
||||||
|
self.player_seek_left = player.Append(wx.NewId(), _("Seek backwards"))
|
||||||
|
self.player_seek_right = player.Append(wx.NewId(), _("Seek forwards"))
|
||||||
self.player_volume_up = player.Append(wx.NewId(), _("Volume up"))
|
self.player_volume_up = player.Append(wx.NewId(), _("Volume up"))
|
||||||
self.player_volume_down = player.Append(wx.NewId(), _("Volume down"))
|
self.player_volume_down = player.Append(wx.NewId(), _("Volume down"))
|
||||||
self.player_mute = player.Append(wx.NewId(), _("Mute"))
|
self.player_mute = player.Append(wx.NewId(), _("Mute"))
|
||||||
@ -65,6 +67,8 @@ class mainWindow(wx.Frame):
|
|||||||
# Translators: Keystroke used to play/pause the current item in the playback queue. Use the latin alphabet, but you can match a different key here. For example if you want to assign this to the key "П", use G.
|
# Translators: Keystroke used to play/pause the current item in the playback queue. Use the latin alphabet, but you can match a different key here. For example if you want to assign this to the key "П", use G.
|
||||||
(wx.ACCEL_CTRL, ord(_("P")), self.player_play.GetId()),
|
(wx.ACCEL_CTRL, ord(_("P")), self.player_play.GetId()),
|
||||||
(wx.ACCEL_CTRL|wx.ACCEL_SHIFT, ord(_("P")), self.player_play_all.GetId()),
|
(wx.ACCEL_CTRL|wx.ACCEL_SHIFT, ord(_("P")), self.player_play_all.GetId()),
|
||||||
|
(wx.ACCEL_ALT|wx.ACCEL_SHIFT, wx.WXK_LEFT, self.player_seek_left.GetId()),
|
||||||
|
(wx.ACCEL_ALT|wx.ACCEL_SHIFT, wx.WXK_RIGHT, self.player_seek_right.GetId()),
|
||||||
])
|
])
|
||||||
self.SetAcceleratorTable(self.accel_tbl)
|
self.SetAcceleratorTable(self.accel_tbl)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user