New features: add or remove audio files to the library (needs work for reflecting these changes in buffers)

This commit is contained in:
2016-02-19 04:17:49 -06:00
parent 34cbfb2251
commit 4fd4bd07a4
2 changed files with 43 additions and 0 deletions

View File

@@ -134,12 +134,21 @@ class audio(widgetUtils.BaseDialog):
sizer.Add(lbox, 0, wx.ALL, 5)
self.play = wx.Button(panel, wx.NewId(), _(u"Play"))
self.download = wx.Button(panel, wx.NewId(), _(u"Download"))
self.add = wx.Button(panel, wx.NewId(), _(u"Add to your library"))
self.remove = wx.Button(panel, wx.NewId(), _(u"Remove from your library"))
self.add.Enable(False)
self.remove.Enable(False)
close = wx.Button(panel, wx.ID_CANCEL)
bbox = wx.BoxSizer(wx.HORIZONTAL)
bbox.Add(self.play, 0, wx.ALL, 5)
bbox.Add(self.download, 0, wx.ALL, 5)
bbox.Add(self.add, 0, wx.ALL, 5)
bbox.Add(self.remove, 0, wx.ALL, 5)
bbox.Add(close, 0, wx.ALL, 5)
def change_state(self, button_name, state):
getattr(self, button_name).Enable(state)
def get_destination_path(self, filename):
saveFileDialog = wx.FileDialog(self, _(u"Save this file"), "", filename, _(u"Audio Files(*.mp3)|*.mp3"), wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
if saveFileDialog.ShowModal() == wx.ID_OK: