Skip to content

Commit

Permalink
Update 0320
Browse files Browse the repository at this point in the history
  • Loading branch information
Puiching-Memory committed Mar 20, 2022
1 parent 83e666c commit 189308c
Show file tree
Hide file tree
Showing 11 changed files with 841 additions and 199 deletions.
4 changes: 2 additions & 2 deletions GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__( self, parent ):

wSizer_L1 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )

self.version = wx.Button( self, wx.ID_ANY, u"#V000.00.00", wx.DefaultPosition, wx.Size( 80,25 ), wx.BORDER_NONE )
self.version = wx.Button( self, wx.ID_ANY, u"#V000.00.00", wx.DefaultPosition, wx.Size( 80,25 ), wx.BORDER_NONE|wx.BU_LEFT )
self.version.SetForegroundColour( wx.Colour( 255, 255, 255 ) )
self.version.SetBackgroundColour( wx.Colour( 242, 171, 57 ) )

Expand All @@ -46,7 +46,7 @@ def __init__( self, parent ):

wSizer_L1.Add( self.Network, 0, 0, 5 )

self.Weather = wx.Button( self, wx.ID_ANY, u"---", wx.DefaultPosition, wx.Size( 90,25 ), wx.BORDER_NONE )
self.Weather = wx.Button( self, wx.ID_ANY, u"---", wx.DefaultPosition, wx.Size( 90,25 ), wx.BORDER_NONE|wx.BU_LEFT )
self.Weather.SetFont( wx.Font( 8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "Microsoft YaHei UI" ) )
self.Weather.SetForegroundColour( wx.Colour( 255, 255, 255 ) )
self.Weather.SetBackgroundColour( wx.Colour( 242, 171, 57 ) )
Expand Down
73 changes: 63 additions & 10 deletions GUI_Music.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,94 @@
class Main ( wx.Frame ):

def __init__( self, parent ):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Music", pos = wx.DefaultPosition, size = wx.Size( 400,300 ), style = wx.CAPTION|wx.CLOSE_BOX|wx.TAB_TRAVERSAL )
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Music", pos = wx.DefaultPosition, size = wx.Size( 400,310 ), style = wx.CAPTION|wx.CLOSE_BOX|wx.TAB_TRAVERSAL )

self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
self.SetBackgroundColour( wx.Colour( 255, 255, 255 ) )

bSizer2 = wx.BoxSizer( wx.VERTICAL )

self.NoteBook = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
self.A = wx.Panel( self.NoteBook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
bSizer21 = wx.BoxSizer( wx.VERTICAL )

wSizer1 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )

self.File = wx.FilePickerCtrl( self, wx.ID_ANY, wx.EmptyString, u"Select a file", u"wav File|*.wav|mp3 File|*.mp3|ogg File|*.ogg|flac File|*.flac", wx.DefaultPosition, wx.Size( 300,-1 ), wx.FLP_FILE_MUST_EXIST|wx.FLP_OPEN|wx.FLP_SMALL|wx.FLP_USE_TEXTCTRL )
self.File = wx.FilePickerCtrl( self.A, wx.ID_ANY, wx.EmptyString, u"Select a file", u"wav File|*.wav|mp3 File|*.mp3|ogg File|*.ogg|flac File|*.flac", wx.DefaultPosition, wx.Size( 285,-1 ), wx.FLP_FILE_MUST_EXIST|wx.FLP_OPEN|wx.FLP_SMALL|wx.FLP_USE_TEXTCTRL )
wSizer1.Add( self.File, 0, wx.ALL, 5 )

self.B_Play = wx.Button( self, wx.ID_ANY, u"Play", wx.DefaultPosition, wx.Size( 60,-1 ), 0 )
self.B_Play = wx.Button( self.A, wx.ID_ANY, u"Play", wx.DefaultPosition, wx.Size( 60,-1 ), 0 )
wSizer1.Add( self.B_Play, 0, wx.ALL, 5 )


bSizer2.Add( wSizer1, 0, 0, 5 )
bSizer21.Add( wSizer1, 0, 0, 5 )

InfoChoices = []
self.Info = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,150 ), InfoChoices, wx.LB_NEEDED_SB )
bSizer2.Add( self.Info, 0, wx.ALL, 5 )
self.Info = wx.ListBox( self.A, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,150 ), InfoChoices, wx.LB_NEEDED_SB )
bSizer21.Add( self.Info, 0, wx.ALL, 5 )

wSizer2 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )

self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Export:", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText1 = wx.StaticText( self.A, wx.ID_ANY, u"Export:", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText1.Wrap( -1 )

wSizer2.Add( self.m_staticText1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )

Save_TypeChoices = [ u"OGG", u"MP3", u"WAV" ]
self.Save_Type = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, Save_TypeChoices, 0 )
self.Save_Type = wx.Choice( self.A, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, Save_TypeChoices, 0 )
self.Save_Type.SetSelection( 0 )
wSizer2.Add( self.Save_Type, 0, wx.ALL, 5 )

self.Save = wx.FilePickerCtrl( self, wx.ID_ANY, wx.EmptyString, u"Save as", u"*.*", wx.DefaultPosition, wx.DefaultSize, wx.FLP_SAVE )
self.Save = wx.FilePickerCtrl( self.A, wx.ID_ANY, wx.EmptyString, u"Save as", u"*.*", wx.DefaultPosition, wx.DefaultSize, wx.FLP_SAVE )
wSizer2.Add( self.Save, 0, wx.ALL, 5 )


bSizer2.Add( wSizer2, 0, 0, 5 )
bSizer21.Add( wSizer2, 0, 0, 5 )


self.A.SetSizer( bSizer21 )
self.A.Layout()
bSizer21.Fit( self.A )
self.NoteBook.AddPage( self.A, u"格式转换器", False )
self.B = wx.Panel( self.NoteBook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
bSizer3 = wx.BoxSizer( wx.VERTICAL )

wSizer3 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )

self.m_staticText2 = wx.StaticText( self.B, wx.ID_ANY, u"缓存文件夹", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText2.Wrap( -1 )

wSizer3.Add( self.m_staticText2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )

self.B_CachePath = wx.DirPickerCtrl( self.B, wx.ID_ANY, wx.EmptyString, u"Select a folder", wx.DefaultPosition, wx.Size( 250,-1 ), wx.DIRP_DEFAULT_STYLE )
wSizer3.Add( self.B_CachePath, 0, wx.ALL, 5 )


bSizer3.Add( wSizer3, 0, wx.ALIGN_CENTER_HORIZONTAL, 5 )

wSizer31 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )

self.m_staticText21 = wx.StaticText( self.B, wx.ID_ANY, u"导出文件夹", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText21.Wrap( -1 )

wSizer31.Add( self.m_staticText21, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )

self.B_ExportPath = wx.DirPickerCtrl( self.B, wx.ID_ANY, wx.EmptyString, u"Select a folder", wx.DefaultPosition, wx.Size( 250,-1 ), wx.DIRP_DEFAULT_STYLE )
wSizer31.Add( self.B_ExportPath, 0, wx.ALL, 5 )


bSizer3.Add( wSizer31, 0, wx.ALIGN_CENTER_HORIZONTAL, 5 )

self.B_BRUN = wx.Button( self.B, wx.ID_ANY, u"导出", wx.DefaultPosition, wx.Size( 200,-1 ), 0 )
bSizer3.Add( self.B_BRUN, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )


self.B.SetSizer( bSizer3 )
self.B.Layout()
bSizer3.Fit( self.B )
self.NoteBook.AddPage( self.B, u"网易云缓存转换器", True )

bSizer2.Add( self.NoteBook, 1, wx.EXPAND |wx.ALL, 5 )


self.SetSizer( bSizer2 )
Expand All @@ -68,6 +117,7 @@ def __init__( self, parent ):
self.File.Bind( wx.EVT_FILEPICKER_CHANGED, self.import_file )
self.B_Play.Bind( wx.EVT_BUTTON, self.Play )
self.Save.Bind( wx.EVT_FILEPICKER_CHANGED, self.SaveOnFileChanged )
self.B_BRUN.Bind( wx.EVT_BUTTON, self.B_RUN )

def __del__( self ):
pass
Expand All @@ -86,4 +136,7 @@ def Play( self, event ):
def SaveOnFileChanged( self, event ):
event.Skip()

def B_RUN( self, event ):
event.Skip()


34 changes: 33 additions & 1 deletion GUI_SSC.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def __init__( self, parent ):
self.A.SetSizer( bSizer21 )
self.A.Layout()
bSizer21.Fit( self.A )
self.NoteBook.AddPage( self.A, u"条形码登记", True )
self.NoteBook.AddPage( self.A, u"条形码登记", False )
self.m_panel2 = wx.Panel( self.NoteBook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
bSizer4 = wx.BoxSizer( wx.VERTICAL )

Expand Down Expand Up @@ -267,6 +267,34 @@ def __init__( self, parent ):
self.D.Layout()
bSizer61.Fit( self.D )
self.NoteBook.AddPage( self.D, u"节点", False )
self.E = wx.Panel( self.NoteBook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
bSizer62 = wx.BoxSizer( wx.VERTICAL )

self.E_FilePath = wx.StaticText( self.E, wx.ID_ANY, u"---", wx.DefaultPosition, wx.Size( 250,-1 ), 0 )
self.E_FilePath.Wrap( -1 )

bSizer62.Add( self.E_FilePath, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )

self.E_Tip = wx.StaticText( self.E, wx.ID_ANY, u"---", wx.DefaultPosition, wx.Size( 250,-1 ), 0 )
self.E_Tip.Wrap( -1 )

bSizer62.Add( self.E_Tip, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )

self.E_QRcode = wx.Button( self.E, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,300 ), wx.BORDER_NONE )
self.E_QRcode.SetBackgroundColour( wx.Colour( 192, 192, 192 ) )

bSizer62.Add( self.E_QRcode, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )

self.E_SendBottom = wx.Button( self.E, wx.ID_ANY, u"开始传输", wx.DefaultPosition, wx.Size( 250,-1 ), 0 )
self.E_SendBottom.Enable( False )

bSizer62.Add( self.E_SendBottom, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )


self.E.SetSizer( bSizer62 )
self.E.Layout()
bSizer62.Fit( self.E )
self.NoteBook.AddPage( self.E, u"传输", True )

bSizer2.Add( self.NoteBook, 0, 0, 0 )

Expand Down Expand Up @@ -297,6 +325,7 @@ def __init__( self, parent ):
self.A_GRID.Bind( wx.EVT_KEY_DOWN, self.Hot_Key_Down )
self.A_GRID.Bind( wx.EVT_KILL_FOCUS, self.A_GRIDOnKillFocus )
self.C_PathBox.Bind( wx.EVT_LISTBOX, self.C_Check )
self.E_SendBottom.Bind( wx.EVT_BUTTON, self.E_Send )

def __del__( self ):
pass
Expand Down Expand Up @@ -353,4 +382,7 @@ def A_GRIDOnKillFocus( self, event ):
def C_Check( self, event ):
event.Skip()

def E_Send( self, event ):
event.Skip()


17 changes: 17 additions & 0 deletions M_Music.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import GUI_Music

import pydub,pydub.playback
import Netease_cloud_CaChe # 网易云音乐缓存转换MP3算法

##############################
# GUI的函数桥接
Expand All @@ -17,6 +18,8 @@ def __init__(self, parent):
# 定义主函数
GUI_Music.Main.__init__(self, parent)

self.NoteBook.SetSelection(0)


def import_file(self, event):
global audio_data
Expand Down Expand Up @@ -58,6 +61,20 @@ def SaveOnFileChanged(self, event):
elif self.Save_Type.GetString(self.Save_Type.GetSelection()) == 'WAV':
audio_data.export(self.Save.GetPath() + '.wav', format="wav")

#B-------------------------------------------------------------------------

def B_RUN(self, event):
self.B_BRUN.Enable(False)

UC_PATH = self.B_CachePath.GetPath()
MP3_PATH = self.B_ExportPath.GetPath()
if UC_PATH != '' and MP3_PATH != '':
transform = Netease_cloud_CaChe.Transform()
print(UC_PATH)
transform.do_transform(UC_PATH,MP3_PATH + '/')

self.B_BRUN.Enable(True)

def Close(self, event):
self.Destroy()

Expand Down
Loading

0 comments on commit 189308c

Please sign in to comment.