Rework Start - Multiple Database-Only-Playlist that can be managed and sent to the Ultrastar directory
This commit is contained in:
parent
676717cfbf
commit
de1e1e7946
@ -12,7 +12,7 @@
|
||||
</startup>
|
||||
<userSettings>
|
||||
<UltraStarSongPicker.My.MySettings>
|
||||
<setting name="FavDir" serializeAs="String">
|
||||
<setting name="UltraStarDirectory" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</UltraStarSongPicker.My.MySettings>
|
||||
@ -23,12 +23,6 @@
|
||||
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="System.Data.SQLite.EF6" />
|
||||
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
|
||||
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
|
||||
</system.data>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
@ -41,4 +35,10 @@
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="System.Data.SQLite.EF6" />
|
||||
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
|
||||
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
|
||||
</system.data>
|
||||
</configuration>
|
||||
@ -15,7 +15,7 @@ Option Explicit On
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0"), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
@ -57,12 +57,12 @@ Namespace My
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public Property FavDir() As String
|
||||
Public Property UltraStarDirectory() As String
|
||||
Get
|
||||
Return CType(Me("FavDir"),String)
|
||||
Return CType(Me("UltraStarDirectory"),String)
|
||||
End Get
|
||||
Set
|
||||
Me("FavDir") = value
|
||||
Me("UltraStarDirectory") = value
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="FavDir" Type="System.String" Scope="User">
|
||||
<Setting Name="UltraStarDirectory" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
|
||||
@ -14,7 +14,6 @@ Public Class Song
|
||||
Public Property Songfilename As String
|
||||
Public Property CoverFilename As String
|
||||
Public Property VideoFilename As String
|
||||
|
||||
Public Property SongInfos As New Dictionary(Of String, String)
|
||||
|
||||
'Weitere Properties
|
||||
52
UltraStarSongPicker/Repositories/LibraryRepository.vb
Normal file
52
UltraStarSongPicker/Repositories/LibraryRepository.vb
Normal file
@ -0,0 +1,52 @@
|
||||
Imports System.Data.Common
|
||||
Imports System.Data.SQLite
|
||||
|
||||
Public Class LibraryRepository
|
||||
|
||||
|
||||
Friend Shared Async Function GetLibraries() As Task(Of List(Of String))
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SQLiteCommand(Nothing, con)
|
||||
Dim reader As DbDataReader
|
||||
Dim result As New List(Of String)
|
||||
'Pfade aus Datenbank auslesen
|
||||
Await con.OpenAsync()
|
||||
cmd.CommandText = "SELECT p_path FROM t_paths ORDER BY p_path"
|
||||
reader = Await cmd.ExecuteReaderAsync
|
||||
Do While Await reader.ReadAsync
|
||||
result.Add(CStr(reader("p_path")))
|
||||
Loop
|
||||
con.Close()
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Friend Shared Async Sub AddLibraries(paths As List(Of String))
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SQLiteCommand(Nothing, con)
|
||||
cmd.Parameters.Add("@path", DbType.String)
|
||||
Await con.OpenAsync()
|
||||
|
||||
cmd.CommandText = "INSERT INTO t_paths (p_path) VALUES (@path)"
|
||||
For Each p As String In paths
|
||||
cmd.Parameters("@path").Value = p
|
||||
cmd.ExecuteNonQuery()
|
||||
Next
|
||||
con.Close()
|
||||
End Sub
|
||||
|
||||
|
||||
Friend Shared Async Sub DeleteLibraries(paths As List(Of String))
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SQLiteCommand(Nothing, con)
|
||||
cmd.Parameters.Add("@path", DbType.String)
|
||||
Await con.OpenAsync()
|
||||
|
||||
cmd.CommandText = "DELETE FROM t_paths WHERE p_path = @path"
|
||||
For Each p As String In paths
|
||||
cmd.Parameters("@path").Value = p
|
||||
cmd.ExecuteNonQuery()
|
||||
Next
|
||||
con.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
131
UltraStarSongPicker/Repositories/SongRepository.vb
Normal file
131
UltraStarSongPicker/Repositories/SongRepository.vb
Normal file
@ -0,0 +1,131 @@
|
||||
Imports System.Data.Common
|
||||
Imports System.Data.SQLite
|
||||
Imports DevExpress.Text
|
||||
|
||||
Public Class SongRepository
|
||||
|
||||
|
||||
Friend Shared Async Function GetSongs() As Task(Of List(Of Song))
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SQLiteCommand(Nothing, con)
|
||||
Dim reader As DbDataReader
|
||||
Await con.OpenAsync
|
||||
Dim result As New List(Of Song)
|
||||
cmd.CommandText = "SELECT * FROM t_songs"
|
||||
reader = Await cmd.ExecuteReaderAsync
|
||||
result.Clear()
|
||||
Dim s As Song
|
||||
Do While Await reader.ReadAsync
|
||||
s = New Song
|
||||
s.ID = CInt(reader("S_ID"))
|
||||
s.RootDir = CStr(reader("S_Path"))
|
||||
s.SubDirectory = CStr(reader("S_Subpath"))
|
||||
s.Artist = TryCast(reader("S_Info_Artist"), String)
|
||||
s.Title = TryCast(reader("S_Info_Title"), String)
|
||||
s.Year = CInt(reader("S_Info_Year"))
|
||||
s.Language = TryCast(reader("S_Info_Language"), String)
|
||||
s.Genre = TryCast(reader("S_Info_Genre"), String)
|
||||
s.Previewstart = CDec(reader("S_Info_Previewstart"))
|
||||
s.BPM = CInt(reader("S_Info_BPM"))
|
||||
s.GAP = CInt(reader("S_Info_GAP"))
|
||||
s.IsFavorite = CBool(reader("S_Favorite"))
|
||||
s.InfoFile = TryCast(reader("S_File_Info"), String)
|
||||
s.Songfilename = TryCast(reader("S_File_Song"), String)
|
||||
s.CoverFilename = TryCast(reader("S_File_Cover"), String)
|
||||
s.VideoFilename = TryCast(reader("S_File_Video"), String)
|
||||
s.SongInfos = Newtonsoft.Json.JsonConvert.DeserializeObject(Of Dictionary(Of String, String))(TryCast(reader("S_Info_Additional"), String))
|
||||
result.Add(s)
|
||||
'ToDo:Songinfos laden (oder erst beim Anklicken des Liedes)
|
||||
Loop
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Friend Shared Async Sub DeleteAllSongs()
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SQLiteCommand(Nothing, con)
|
||||
Await con.OpenAsync()
|
||||
cmd.CommandText = "DELETE FROM t_songs"
|
||||
Await cmd.ExecuteNonQueryAsync()
|
||||
con.Close()
|
||||
End Sub
|
||||
|
||||
Friend Shared Async Sub SaveSongs(songs As List(Of Song))
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SQLiteCommand(Nothing, con)
|
||||
With cmd.Parameters
|
||||
.Add("@path", DbType.String)
|
||||
.Add("@subpath", DbType.String)
|
||||
.Add("@artist", DbType.String)
|
||||
.Add("@title", DbType.String)
|
||||
.Add("@year", DbType.Int32)
|
||||
.Add("@language", DbType.String)
|
||||
.Add("@genre", DbType.String)
|
||||
.Add("@previewstart", DbType.Double)
|
||||
.Add("@bpm", DbType.Int32)
|
||||
.Add("@gap", DbType.Int32)
|
||||
.Add("@additional", DbType.String)
|
||||
.Add("@favorite", DbType.Boolean)
|
||||
.Add("@fileinfo", DbType.String)
|
||||
.Add("@filesong", DbType.String)
|
||||
.Add("@filecover", DbType.String)
|
||||
.Add("@filevideo", DbType.String)
|
||||
End With
|
||||
Await con.OpenAsync()
|
||||
|
||||
cmd.CommandText = "INSERT INTO t_songs (
|
||||
S_Path,
|
||||
S_Subpath,
|
||||
S_Info_Artist,
|
||||
S_Info_Title,
|
||||
S_Info_Year,
|
||||
S_Info_Language,
|
||||
S_Info_Genre,
|
||||
S_Info_Previewstart,
|
||||
S_Info_BPM,
|
||||
S_Info_GAP,
|
||||
S_Info_Additional,
|
||||
S_Favorite,
|
||||
S_File_Info,
|
||||
S_File_Song,
|
||||
S_File_Cover,
|
||||
S_File_Video
|
||||
) VALUES (
|
||||
@path,
|
||||
@subpath,
|
||||
@artist,
|
||||
@title,
|
||||
@year,
|
||||
@language,
|
||||
@genre,
|
||||
@previewstart,
|
||||
@bpm,
|
||||
@gap,
|
||||
@additional,
|
||||
@favorite,
|
||||
@fileinfo,
|
||||
@filesong,
|
||||
@filecover,
|
||||
@filevideo
|
||||
)"
|
||||
For Each s As Song In songs
|
||||
cmd.Parameters("@path").Value = s.RootDir
|
||||
cmd.Parameters("@subpath").Value = s.SubDirectory
|
||||
cmd.Parameters("@artist").Value = s.Artist
|
||||
cmd.Parameters("@title").Value = s.Title
|
||||
cmd.Parameters("@year").Value = s.Year
|
||||
cmd.Parameters("@language").Value = s.Language
|
||||
cmd.Parameters("@genre").Value = s.Genre
|
||||
cmd.Parameters("@previewstart").Value = s.Previewstart
|
||||
cmd.Parameters("@bpm").Value = s.BPM
|
||||
cmd.Parameters("@gap").Value = s.GAP
|
||||
cmd.Parameters("@additional").Value = Newtonsoft.Json.JsonConvert.SerializeObject(s.SongInfos)
|
||||
cmd.Parameters("@favorite").Value = s.IsFavorite
|
||||
cmd.Parameters("@fileinfo").Value = s.InfoFile
|
||||
cmd.Parameters("@filesong").Value = s.Songfilename
|
||||
cmd.Parameters("@filecover").Value = s.CoverFilename
|
||||
cmd.Parameters("@filevideo").Value = s.VideoFilename
|
||||
Await cmd.ExecuteNonQueryAsync()
|
||||
Next
|
||||
con.Close()
|
||||
End Sub
|
||||
End Class
|
||||
@ -107,7 +107,7 @@
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
@ -115,14 +115,14 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.117.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.118.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SQLite.EF6, Version=1.0.117.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.117.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
|
||||
<Reference Include="System.Data.SQLite.EF6, Version=1.0.118.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.118.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SQLite.Linq, Version=1.0.117.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.117.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
|
||||
<Reference Include="System.Data.SQLite.Linq, Version=1.0.118.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.118.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
@ -157,13 +157,13 @@
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="clsDB.vb" />
|
||||
<Compile Include="clsFileFunctions.vb" />
|
||||
<Compile Include="clsSong.vb" />
|
||||
<Compile Include="ctrlAudioVideoPlayer.Designer.vb">
|
||||
<Compile Include="DB.vb" />
|
||||
<Compile Include="FileFunctions.vb" />
|
||||
<Compile Include="Objects\Song.vb" />
|
||||
<Compile Include="Controls\ctrlAudioVideoPlayer.Designer.vb">
|
||||
<DependentUpon>ctrlAudioVideoPlayer.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ctrlAudioVideoPlayer.vb">
|
||||
<Compile Include="Controls\ctrlAudioVideoPlayer.vb">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmErrorList.Designer.vb">
|
||||
@ -207,9 +207,11 @@
|
||||
<Compile Include="repFavoritesList.vb">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Repositories\LibraryRepository.vb" />
|
||||
<Compile Include="Repositories\SongRepository.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="ctrlAudioVideoPlayer.resx">
|
||||
<EmbeddedResource Include="Controls\ctrlAudioVideoPlayer.resx">
|
||||
<DependentUpon>ctrlAudioVideoPlayer.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmErrorList.resx">
|
||||
@ -291,8 +293,8 @@
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||
<Import Project="..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
|
||||
<Import Project="..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
|
||||
</Project>
|
||||
108
UltraStarSongPicker/frmMain.Designer.vb
generated
108
UltraStarSongPicker/frmMain.Designer.vb
generated
@ -44,6 +44,11 @@ Partial Class frmMain
|
||||
Me.grdSongInfos = New DevExpress.XtraGrid.GridControl()
|
||||
Me.grdvSongInfos = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.SFD = New System.Windows.Forms.SaveFileDialog()
|
||||
Me.splLibraryPlaylists = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.grdPlaylist = New DevExpress.XtraGrid.GridControl()
|
||||
Me.grdvPlaylist = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.rpgPlaylists = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
|
||||
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
|
||||
CType(Me.rcMain, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.grdSongs, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.cmsSongs.SuspendLayout()
|
||||
@ -62,14 +67,22 @@ Partial Class frmMain
|
||||
Me.splSongInfo.SuspendLayout()
|
||||
CType(Me.grdSongInfos, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.grdvSongInfos, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.splLibraryPlaylists, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.splLibraryPlaylists.Panel1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.splLibraryPlaylists.Panel1.SuspendLayout()
|
||||
CType(Me.splLibraryPlaylists.Panel2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.splLibraryPlaylists.Panel2.SuspendLayout()
|
||||
Me.splLibraryPlaylists.SuspendLayout()
|
||||
CType(Me.grdPlaylist, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.grdvPlaylist, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'rcMain
|
||||
'
|
||||
Me.rcMain.ExpandCollapseItem.Id = 0
|
||||
Me.rcMain.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.rcMain.ExpandCollapseItem, Me.rcMain.SearchEditItem, Me.btnSettings, Me.btnReread, Me.btnSave, Me.btnPrint})
|
||||
Me.rcMain.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.rcMain.ExpandCollapseItem, Me.rcMain.SearchEditItem, Me.btnSettings, Me.btnReread, Me.btnSave, Me.btnPrint, Me.BarButtonItem1})
|
||||
Me.rcMain.Location = New System.Drawing.Point(0, 0)
|
||||
Me.rcMain.MaxItemId = 5
|
||||
Me.rcMain.MaxItemId = 6
|
||||
Me.rcMain.Name = "rcMain"
|
||||
Me.rcMain.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.rpGeneral})
|
||||
Me.rcMain.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
|
||||
@ -86,7 +99,7 @@ Partial Class frmMain
|
||||
'
|
||||
'btnReread
|
||||
'
|
||||
Me.btnReread.Caption = "Ordner neu einlesen"
|
||||
Me.btnReread.Caption = "Bibliothek neu einlesen"
|
||||
Me.btnReread.Id = 2
|
||||
Me.btnReread.ImageOptions.SvgImage = Global.UltraStarSongPicker.My.Resources.Resources.changeview
|
||||
Me.btnReread.Name = "btnReread"
|
||||
@ -111,7 +124,7 @@ Partial Class frmMain
|
||||
'
|
||||
'rpGeneral
|
||||
'
|
||||
Me.rpGeneral.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.rpgGeneral, Me.rpgManagement})
|
||||
Me.rpGeneral.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.rpgGeneral, Me.rpgManagement, Me.rpgPlaylists})
|
||||
Me.rpGeneral.Name = "rpGeneral"
|
||||
Me.rpGeneral.Text = "Allgemein"
|
||||
'
|
||||
@ -149,7 +162,7 @@ Partial Class frmMain
|
||||
Me.grdSongs.MainView = Me.grdvSongs
|
||||
Me.grdSongs.MenuManager = Me.rcMain
|
||||
Me.grdSongs.Name = "grdSongs"
|
||||
Me.grdSongs.Size = New System.Drawing.Size(655, 603)
|
||||
Me.grdSongs.Size = New System.Drawing.Size(655, 342)
|
||||
Me.grdSongs.TabIndex = 1
|
||||
Me.grdSongs.UseEmbeddedNavigator = True
|
||||
Me.grdSongs.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.grdvSongs})
|
||||
@ -180,6 +193,8 @@ Partial Class frmMain
|
||||
Me.grdvSongs.OptionsBehavior.AutoExpandAllGroups = True
|
||||
Me.grdvSongs.OptionsFind.AlwaysVisible = True
|
||||
Me.grdvSongs.OptionsSelection.MultiSelect = True
|
||||
Me.grdvSongs.OptionsView.ShowViewCaption = True
|
||||
Me.grdvSongs.ViewCaption = "Bibiliothek"
|
||||
'
|
||||
'splMain
|
||||
'
|
||||
@ -190,8 +205,8 @@ Partial Class frmMain
|
||||
'
|
||||
'splMain.Panel1
|
||||
'
|
||||
Me.splMain.Panel1.Controls.Add(Me.splLibraryPlaylists)
|
||||
Me.splMain.Panel1.Controls.Add(Me.prgMain)
|
||||
Me.splMain.Panel1.Controls.Add(Me.grdSongs)
|
||||
Me.splMain.Panel1.Text = "Panel1"
|
||||
'
|
||||
'splMain.Panel2
|
||||
@ -270,6 +285,74 @@ Partial Class frmMain
|
||||
Me.SFD.FileName = "Songliste.pdf"
|
||||
Me.SFD.Filter = "PDF-Dateien (*.pdf)|*.pdf|Alle Dateien (*.*)|*.*"
|
||||
'
|
||||
'splLibraryPlaylists
|
||||
'
|
||||
Me.splLibraryPlaylists.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.splLibraryPlaylists.Horizontal = False
|
||||
Me.splLibraryPlaylists.Location = New System.Drawing.Point(0, 0)
|
||||
Me.splLibraryPlaylists.Name = "splLibraryPlaylists"
|
||||
'
|
||||
'splLibraryPlaylists.splLibraryPlaylists_Panel1
|
||||
'
|
||||
Me.splLibraryPlaylists.Panel1.Controls.Add(Me.grdSongs)
|
||||
Me.splLibraryPlaylists.Panel1.Text = "Panel1"
|
||||
'
|
||||
'splLibraryPlaylists.splLibraryPlaylists_Panel2
|
||||
'
|
||||
Me.splLibraryPlaylists.Panel2.Controls.Add(Me.grdPlaylist)
|
||||
Me.splLibraryPlaylists.Panel2.Text = "Panel2"
|
||||
Me.splLibraryPlaylists.Size = New System.Drawing.Size(655, 603)
|
||||
Me.splLibraryPlaylists.SplitterPosition = 342
|
||||
Me.splLibraryPlaylists.TabIndex = 3
|
||||
'
|
||||
'grdPlaylist
|
||||
'
|
||||
Me.grdPlaylist.ContextMenuStrip = Me.cmsSongs
|
||||
Me.grdPlaylist.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.Append.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.CancelEdit.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.Edit.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.EndEdit.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.First.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.Last.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.Next.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.NextPage.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.Prev.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.PrevPage.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.Buttons.Remove.Visible = False
|
||||
Me.grdPlaylist.EmbeddedNavigator.TextStringFormat = "Song {0} von {1}"
|
||||
Me.grdPlaylist.Location = New System.Drawing.Point(0, 0)
|
||||
Me.grdPlaylist.MainView = Me.grdvPlaylist
|
||||
Me.grdPlaylist.MenuManager = Me.rcMain
|
||||
Me.grdPlaylist.Name = "grdPlaylist"
|
||||
Me.grdPlaylist.Size = New System.Drawing.Size(655, 251)
|
||||
Me.grdPlaylist.TabIndex = 2
|
||||
Me.grdPlaylist.UseEmbeddedNavigator = True
|
||||
Me.grdPlaylist.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.grdvPlaylist})
|
||||
'
|
||||
'grdvPlaylist
|
||||
'
|
||||
Me.grdvPlaylist.GridControl = Me.grdPlaylist
|
||||
Me.grdvPlaylist.Name = "grdvPlaylist"
|
||||
Me.grdvPlaylist.OptionsBehavior.AutoExpandAllGroups = True
|
||||
Me.grdvPlaylist.OptionsFind.AlwaysVisible = True
|
||||
Me.grdvPlaylist.OptionsSelection.MultiSelect = True
|
||||
Me.grdvPlaylist.OptionsView.ShowGroupPanel = False
|
||||
Me.grdvPlaylist.OptionsView.ShowViewCaption = True
|
||||
Me.grdvPlaylist.ViewCaption = "Playlist"
|
||||
'
|
||||
'rpgPlaylists
|
||||
'
|
||||
Me.rpgPlaylists.ItemLinks.Add(Me.BarButtonItem1)
|
||||
Me.rpgPlaylists.Name = "rpgPlaylists"
|
||||
Me.rpgPlaylists.Text = "Playlist"
|
||||
'
|
||||
'BarButtonItem1
|
||||
'
|
||||
Me.BarButtonItem1.Caption = "Playlist öffnen"
|
||||
Me.BarButtonItem1.Id = 5
|
||||
Me.BarButtonItem1.Name = "BarButtonItem1"
|
||||
'
|
||||
'frmMain
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@ -299,6 +382,14 @@ Partial Class frmMain
|
||||
Me.splSongInfo.ResumeLayout(False)
|
||||
CType(Me.grdSongInfos, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.grdvSongInfos, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.splLibraryPlaylists.Panel1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.splLibraryPlaylists.Panel1.ResumeLayout(False)
|
||||
CType(Me.splLibraryPlaylists.Panel2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.splLibraryPlaylists.Panel2.ResumeLayout(False)
|
||||
CType(Me.splLibraryPlaylists, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.splLibraryPlaylists.ResumeLayout(False)
|
||||
CType(Me.grdPlaylist, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.grdvPlaylist, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
@ -324,4 +415,9 @@ Partial Class frmMain
|
||||
Friend WithEvents btnPrint As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents rpgManagement As DevExpress.XtraBars.Ribbon.RibbonPageGroup
|
||||
Friend WithEvents SFD As SaveFileDialog
|
||||
Friend WithEvents splLibraryPlaylists As DevExpress.XtraEditors.SplitContainerControl
|
||||
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents rpgPlaylists As DevExpress.XtraBars.Ribbon.RibbonPageGroup
|
||||
Friend WithEvents grdPlaylist As DevExpress.XtraGrid.GridControl
|
||||
Friend WithEvents grdvPlaylist As DevExpress.XtraGrid.Views.Grid.GridView
|
||||
End Class
|
||||
|
||||
@ -103,65 +103,21 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
Private Sub btnReread_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnReread.ItemClick
|
||||
RereadFolders()
|
||||
ScanLibrary()
|
||||
End Sub
|
||||
|
||||
Private Async Sub GetSongsFromDB()
|
||||
grdvSongs.BeginDataUpdate()
|
||||
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SQLiteCommand(Nothing, con)
|
||||
Dim reader As DbDataReader
|
||||
Await con.OpenAsync
|
||||
|
||||
cmd.CommandText = "SELECT * FROM t_songs"
|
||||
reader = Await cmd.ExecuteReaderAsync
|
||||
Songs.Clear()
|
||||
Dim s As Song
|
||||
Do While Await reader.ReadAsync
|
||||
s = New Song
|
||||
s.ID = CInt(reader("S_ID"))
|
||||
s.RootDir = CStr(reader("S_Path"))
|
||||
s.SubDirectory = CStr(reader("S_Subpath"))
|
||||
s.Artist = TryCast(reader("S_Info_Artist"), String)
|
||||
s.Title = TryCast(reader("S_Info_Title"), String)
|
||||
s.Year = CInt(reader("S_Info_Year"))
|
||||
s.Language = TryCast(reader("S_Info_Language"), String)
|
||||
s.Genre = TryCast(reader("S_Info_Genre"), String)
|
||||
s.Previewstart = CDec(reader("S_Info_Previewstart"))
|
||||
s.BPM = CInt(reader("S_Info_BPM"))
|
||||
s.GAP = CInt(reader("S_Info_GAP"))
|
||||
s.IsFavorite = CBool(reader("S_Favorite"))
|
||||
s.InfoFile = TryCast(reader("S_File_Info"), String)
|
||||
s.Songfilename = TryCast(reader("S_File_Song"), String)
|
||||
s.CoverFilename = TryCast(reader("S_File_Cover"), String)
|
||||
s.VideoFilename = TryCast(reader("S_File_Video"), String)
|
||||
s.SongInfos = Newtonsoft.Json.JsonConvert.DeserializeObject(Of Dictionary(Of String, String))(TryCast(reader("S_Info_Additional"), String))
|
||||
Songs.Add(s)
|
||||
'ToDo:Songinfos laden (oder erst beim Anklicken des Liedes)
|
||||
Loop
|
||||
reader.Close()
|
||||
con.Close()
|
||||
Songs = Await SongRepository.GetSongs()
|
||||
CheckFavorites()
|
||||
|
||||
grdvSongs.EndDataUpdate()
|
||||
grdvSongs.BestFitColumns()
|
||||
End Sub
|
||||
Private Async Sub RereadFolders()
|
||||
Private Async Sub ScanLibrary()
|
||||
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SQLiteCommand(Nothing, con)
|
||||
Dim reader As DbDataReader
|
||||
Dim Pfade As New List(Of String)
|
||||
|
||||
'Pfade aus Datenbank auslesen
|
||||
Await con.OpenAsync()
|
||||
cmd.CommandText = "SELECT p_path FROM t_paths ORDER BY p_path"
|
||||
reader = Await cmd.ExecuteReaderAsync
|
||||
Do While Await reader.ReadAsync
|
||||
Pfade.Add(CStr(reader("p_path")))
|
||||
Loop
|
||||
con.Close()
|
||||
Dim Pfade As List(Of String) = Await LibraryRepository.GetLibraries()
|
||||
|
||||
'Ordner auslesen
|
||||
prgMain.Visible = True
|
||||
@ -170,9 +126,7 @@ Public Class frmMain
|
||||
prgMain.Visible = False
|
||||
|
||||
ErrorMsgs.Clear()
|
||||
If Pfade.Count = 0 Then
|
||||
ErrorMsgs.Add("Es sind keine Pfade hinterlegt.")
|
||||
End If
|
||||
If Pfade.Count = 0 Then ErrorMsgs.Add("Es sind keine Pfade hinterlegt.")
|
||||
|
||||
If ErrorMsgs.Count > 0 Then
|
||||
MessageBox.Show(String.Join(vbCrLf, ErrorMsgs), Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
@ -182,8 +136,8 @@ Public Class frmMain
|
||||
|
||||
Private Sub ImportSongsToDB(Pfade As List(Of String))
|
||||
|
||||
Dim FavDirExists As Boolean = Directory.Exists(My.Settings.FavDir)
|
||||
Dim FavDir As String = My.Settings.FavDir
|
||||
Dim FavDirExists As Boolean = Directory.Exists(My.Settings.UltraStarDirectory)
|
||||
Dim FavDir As String = My.Settings.UltraStarDirectory
|
||||
If FavDir.EndsWith("\") = False Then FavDir &= "\"
|
||||
Dim songinfofiles() As String
|
||||
Dim duetinfofiles() As String
|
||||
@ -221,11 +175,12 @@ Public Class frmMain
|
||||
ErrorMsgs.Add($"Der Pfad {pfad} existiert nicht oder konnte nicht gelesen werden.")
|
||||
End If
|
||||
Next
|
||||
SaveSongsInDB(templist)
|
||||
SongRepository.DeleteAllSongs()
|
||||
SongRepository.SaveSongs(templist)
|
||||
End Sub
|
||||
|
||||
Private Sub CheckFavorites()
|
||||
Dim FavDir As String = My.Settings.FavDir
|
||||
Dim FavDir As String = My.Settings.UltraStarDirectory
|
||||
If FavDir.EndsWith("\") = False Then FavDir &= "\"
|
||||
If Directory.Exists(FavDir) Then
|
||||
For Each s As Song In Songs
|
||||
@ -250,89 +205,7 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
|
||||
Private Async Sub SaveSongsInDB(songs As List(Of Song))
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SQLiteCommand(Nothing, con)
|
||||
With cmd.Parameters
|
||||
.Add("@path", DbType.String)
|
||||
.Add("@subpath", DbType.String)
|
||||
.Add("@artist", DbType.String)
|
||||
.Add("@title", DbType.String)
|
||||
.Add("@year", DbType.Int32)
|
||||
.Add("@language", DbType.String)
|
||||
.Add("@genre", DbType.String)
|
||||
.Add("@previewstart", DbType.Double)
|
||||
.Add("@bpm", DbType.Int32)
|
||||
.Add("@gap", DbType.Int32)
|
||||
.Add("@additional", DbType.String)
|
||||
.Add("@favorite", DbType.Boolean)
|
||||
.Add("@fileinfo", DbType.String)
|
||||
.Add("@filesong", DbType.String)
|
||||
.Add("@filecover", DbType.String)
|
||||
.Add("@filevideo", DbType.String)
|
||||
End With
|
||||
Await con.OpenAsync()
|
||||
cmd.CommandText = "DELETE FROM t_songs"
|
||||
Await cmd.ExecuteNonQueryAsync()
|
||||
|
||||
cmd.CommandText = "INSERT INTO t_songs (
|
||||
S_Path,
|
||||
S_Subpath,
|
||||
S_Info_Artist,
|
||||
S_Info_Title,
|
||||
S_Info_Year,
|
||||
S_Info_Language,
|
||||
S_Info_Genre,
|
||||
S_Info_Previewstart,
|
||||
S_Info_BPM,
|
||||
S_Info_GAP,
|
||||
S_Info_Additional,
|
||||
S_Favorite,
|
||||
S_File_Info,
|
||||
S_File_Song,
|
||||
S_File_Cover,
|
||||
S_File_Video
|
||||
) VALUES (
|
||||
@path,
|
||||
@subpath,
|
||||
@artist,
|
||||
@title,
|
||||
@year,
|
||||
@language,
|
||||
@genre,
|
||||
@previewstart,
|
||||
@bpm,
|
||||
@gap,
|
||||
@additional,
|
||||
@favorite,
|
||||
@fileinfo,
|
||||
@filesong,
|
||||
@filecover,
|
||||
@filevideo
|
||||
)"
|
||||
For Each s As Song In songs
|
||||
cmd.Parameters("@path").Value = s.RootDir
|
||||
cmd.Parameters("@subpath").Value = s.SubDirectory
|
||||
cmd.Parameters("@artist").Value = s.Artist
|
||||
cmd.Parameters("@title").Value = s.Title
|
||||
cmd.Parameters("@year").Value = s.Year
|
||||
cmd.Parameters("@language").Value = s.Language
|
||||
cmd.Parameters("@genre").Value = s.Genre
|
||||
cmd.Parameters("@previewstart").Value = s.Previewstart
|
||||
cmd.Parameters("@bpm").Value = s.BPM
|
||||
cmd.Parameters("@gap").Value = s.GAP
|
||||
cmd.Parameters("@additional").Value = Newtonsoft.Json.JsonConvert.SerializeObject(s.SongInfos)
|
||||
cmd.Parameters("@favorite").Value = s.IsFavorite
|
||||
cmd.Parameters("@fileinfo").Value = s.InfoFile
|
||||
cmd.Parameters("@filesong").Value = s.Songfilename
|
||||
cmd.Parameters("@filecover").Value = s.CoverFilename
|
||||
cmd.Parameters("@filevideo").Value = s.VideoFilename
|
||||
Await cmd.ExecuteNonQueryAsync()
|
||||
Next
|
||||
|
||||
con.Close()
|
||||
|
||||
End Sub
|
||||
Private Sub grdvSongs_RowClick(sender As Object, e As RowClickEventArgs) Handles grdvSongs.RowClick
|
||||
If e.Clicks = 2 AndAlso e.Button = MouseButtons.Left Then
|
||||
Dim s As Song = CType(grdvSongs.GetFocusedRow, Song)
|
||||
@ -417,7 +290,7 @@ Public Class frmMain
|
||||
|
||||
Private Async Sub btnSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSave.ItemClick
|
||||
grdvSongs.CloseEditor()
|
||||
Dim FavDir = My.Settings.FavDir
|
||||
Dim FavDir = My.Settings.UltraStarDirectory
|
||||
|
||||
Dim ToAddToFavs As List(Of Song) = Songs.Where(Function(s) s.IsFavorite = True AndAlso s.ExistsInFavDir = False).ToList
|
||||
Dim ToDeleteFromFavs As List(Of Song) = Songs.Where(Function(s) s.IsFavorite = False AndAlso s.ExistsInFavDir = True).ToList
|
||||
@ -438,7 +311,7 @@ Public Class frmMain
|
||||
Private Async Sub SyncFavDir(songlist As List(Of Song))
|
||||
Dim ToAddToFavs As List(Of Song) = songlist.Where(Function(s) s.IsFavorite = True AndAlso s.ExistsInFavDir = False).ToList
|
||||
Dim ToDeleteFromFavs As List(Of Song) = songlist.Where(Function(s) s.IsFavorite = False AndAlso s.ExistsInFavDir = True).ToList
|
||||
Dim FavDir = My.Settings.FavDir
|
||||
Dim FavDir = My.Settings.UltraStarDirectory
|
||||
Dim errors As New List(Of String)
|
||||
|
||||
Dim con As SQLiteConnection = DB.getConnection
|
||||
|
||||
98
UltraStarSongPicker/frmSettings.Designer.vb
generated
98
UltraStarSongPicker/frmSettings.Designer.vb
generated
@ -1,9 +1,9 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class frmSettings
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
@ -20,7 +20,7 @@ Partial Class frmSettings
|
||||
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmSettings))
|
||||
Me.lstPaths = New DevExpress.XtraEditors.ListBoxControl()
|
||||
@ -31,19 +31,19 @@ Partial Class frmSettings
|
||||
Me.rpGeneral = New DevExpress.XtraBars.Ribbon.RibbonPage()
|
||||
Me.rpgGeneral = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
|
||||
Me.rpgPaths = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
|
||||
Me.grpPaths = New DevExpress.XtraEditors.GroupControl()
|
||||
Me.grpLibraries = New DevExpress.XtraEditors.GroupControl()
|
||||
Me.FBD = New System.Windows.Forms.FolderBrowserDialog()
|
||||
Me.grpGeneral = New DevExpress.XtraEditors.GroupControl()
|
||||
Me.btnFavDir = New DevExpress.XtraEditors.SimpleButton()
|
||||
Me.lblFavDir = New DevExpress.XtraEditors.LabelControl()
|
||||
Me.txtFavDir = New DevExpress.XtraEditors.TextEdit()
|
||||
Me.lblUSDir = New DevExpress.XtraEditors.LabelControl()
|
||||
Me.btnUSDir = New DevExpress.XtraEditors.SimpleButton()
|
||||
Me.txtUSDir = New DevExpress.XtraEditors.TextEdit()
|
||||
CType(Me.lstPaths, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.rcMain, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.grpPaths, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.grpPaths.SuspendLayout()
|
||||
CType(Me.grpLibraries, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.grpLibraries.SuspendLayout()
|
||||
CType(Me.grpGeneral, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.grpGeneral.SuspendLayout()
|
||||
CType(Me.txtFavDir.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.txtUSDir.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'lstPaths
|
||||
@ -106,17 +106,17 @@ Partial Class frmSettings
|
||||
Me.rpgPaths.Name = "rpgPaths"
|
||||
Me.rpgPaths.Text = "Pfade"
|
||||
'
|
||||
'grpPaths
|
||||
'grpLibraries
|
||||
'
|
||||
Me.grpPaths.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Me.grpLibraries.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.grpPaths.Controls.Add(Me.lstPaths)
|
||||
Me.grpPaths.Location = New System.Drawing.Point(12, 153)
|
||||
Me.grpPaths.Name = "grpPaths"
|
||||
Me.grpPaths.Size = New System.Drawing.Size(434, 309)
|
||||
Me.grpPaths.TabIndex = 2
|
||||
Me.grpPaths.Text = "Pfade"
|
||||
Me.grpLibraries.Controls.Add(Me.lstPaths)
|
||||
Me.grpLibraries.Location = New System.Drawing.Point(12, 153)
|
||||
Me.grpLibraries.Name = "grpLibraries"
|
||||
Me.grpLibraries.Size = New System.Drawing.Size(434, 309)
|
||||
Me.grpLibraries.TabIndex = 2
|
||||
Me.grpLibraries.Text = "Bibliotheken"
|
||||
'
|
||||
'FBD
|
||||
'
|
||||
@ -127,41 +127,41 @@ Partial Class frmSettings
|
||||
'
|
||||
Me.grpGeneral.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.grpGeneral.Controls.Add(Me.btnFavDir)
|
||||
Me.grpGeneral.Controls.Add(Me.lblFavDir)
|
||||
Me.grpGeneral.Controls.Add(Me.txtFavDir)
|
||||
Me.grpGeneral.Controls.Add(Me.btnUSDir)
|
||||
Me.grpGeneral.Controls.Add(Me.lblUSDir)
|
||||
Me.grpGeneral.Controls.Add(Me.txtUSDir)
|
||||
Me.grpGeneral.Location = New System.Drawing.Point(12, 89)
|
||||
Me.grpGeneral.Name = "grpGeneral"
|
||||
Me.grpGeneral.Size = New System.Drawing.Size(434, 58)
|
||||
Me.grpGeneral.TabIndex = 3
|
||||
Me.grpGeneral.Text = "Allgemein"
|
||||
'
|
||||
'btnFavDir
|
||||
'lblUSDir
|
||||
'
|
||||
Me.btnFavDir.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.btnFavDir.Location = New System.Drawing.Point(334, 26)
|
||||
Me.btnFavDir.Name = "btnFavDir"
|
||||
Me.btnFavDir.Size = New System.Drawing.Size(95, 23)
|
||||
Me.btnFavDir.TabIndex = 2
|
||||
Me.btnFavDir.Text = "Durchsuchen..."
|
||||
Me.lblUSDir.Location = New System.Drawing.Point(5, 31)
|
||||
Me.lblUSDir.Name = "lblUSDir"
|
||||
Me.lblUSDir.Size = New System.Drawing.Size(102, 13)
|
||||
Me.lblUSDir.TabIndex = 1
|
||||
Me.lblUSDir.Text = "Ultrastar-Songordner"
|
||||
'
|
||||
'lblFavDir
|
||||
'btnUSDir
|
||||
'
|
||||
Me.lblFavDir.Location = New System.Drawing.Point(5, 31)
|
||||
Me.lblFavDir.Name = "lblFavDir"
|
||||
Me.lblFavDir.Size = New System.Drawing.Size(99, 13)
|
||||
Me.lblFavDir.TabIndex = 1
|
||||
Me.lblFavDir.Text = "Favoritenverzeichnis"
|
||||
Me.btnUSDir.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.btnUSDir.Location = New System.Drawing.Point(334, 26)
|
||||
Me.btnUSDir.Name = "btnUSDir"
|
||||
Me.btnUSDir.Size = New System.Drawing.Size(95, 23)
|
||||
Me.btnUSDir.TabIndex = 2
|
||||
Me.btnUSDir.Text = "Durchsuchen..."
|
||||
'
|
||||
'txtFavDir
|
||||
'txtUSDir
|
||||
'
|
||||
Me.txtFavDir.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Me.txtUSDir.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.txtFavDir.Location = New System.Drawing.Point(127, 28)
|
||||
Me.txtFavDir.MenuManager = Me.rcMain
|
||||
Me.txtFavDir.Name = "txtFavDir"
|
||||
Me.txtFavDir.Size = New System.Drawing.Size(201, 20)
|
||||
Me.txtFavDir.TabIndex = 0
|
||||
Me.txtUSDir.Location = New System.Drawing.Point(127, 28)
|
||||
Me.txtUSDir.MenuManager = Me.rcMain
|
||||
Me.txtUSDir.Name = "txtUSDir"
|
||||
Me.txtUSDir.Size = New System.Drawing.Size(201, 20)
|
||||
Me.txtUSDir.TabIndex = 0
|
||||
'
|
||||
'frmSettings
|
||||
'
|
||||
@ -169,19 +169,19 @@ Partial Class frmSettings
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(458, 474)
|
||||
Me.Controls.Add(Me.grpGeneral)
|
||||
Me.Controls.Add(Me.grpPaths)
|
||||
Me.Controls.Add(Me.grpLibraries)
|
||||
Me.Controls.Add(Me.rcMain)
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.Name = "frmSettings"
|
||||
Me.Text = "Einstellungen"
|
||||
CType(Me.lstPaths, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.rcMain, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.grpPaths, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.grpPaths.ResumeLayout(False)
|
||||
CType(Me.grpLibraries, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.grpLibraries.ResumeLayout(False)
|
||||
CType(Me.grpGeneral, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.grpGeneral.ResumeLayout(False)
|
||||
Me.grpGeneral.PerformLayout()
|
||||
CType(Me.txtFavDir.Properties, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.txtUSDir.Properties, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
@ -191,14 +191,14 @@ Partial Class frmSettings
|
||||
Friend WithEvents rcMain As DevExpress.XtraBars.Ribbon.RibbonControl
|
||||
Friend WithEvents rpGeneral As DevExpress.XtraBars.Ribbon.RibbonPage
|
||||
Friend WithEvents rpgGeneral As DevExpress.XtraBars.Ribbon.RibbonPageGroup
|
||||
Friend WithEvents grpPaths As DevExpress.XtraEditors.GroupControl
|
||||
Friend WithEvents grpLibraries As DevExpress.XtraEditors.GroupControl
|
||||
Friend WithEvents btnSave As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents btnPathAdd As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents btnPathDelete As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents rpgPaths As DevExpress.XtraBars.Ribbon.RibbonPageGroup
|
||||
Friend WithEvents FBD As FolderBrowserDialog
|
||||
Friend WithEvents grpGeneral As DevExpress.XtraEditors.GroupControl
|
||||
Friend WithEvents lblFavDir As DevExpress.XtraEditors.LabelControl
|
||||
Friend WithEvents txtFavDir As DevExpress.XtraEditors.TextEdit
|
||||
Friend WithEvents btnFavDir As DevExpress.XtraEditors.SimpleButton
|
||||
Friend WithEvents btnUSDir As DevExpress.XtraEditors.SimpleButton
|
||||
Friend WithEvents lblUSDir As DevExpress.XtraEditors.LabelControl
|
||||
Friend WithEvents txtUSDir As DevExpress.XtraEditors.TextEdit
|
||||
End Class
|
||||
|
||||
@ -120,7 +120,7 @@
|
||||
<assembly alias="DevExpress.Data.v22.1" name="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<data name="btnSave.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v22.1" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIwLjIsIFZlcnNpb249MjAuMi40
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIyLjEsIFZlcnNpb249MjIuMS42
|
||||
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
|
||||
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAMICAAAC77u/
|
||||
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
|
||||
|
||||
@ -9,26 +9,16 @@ Public Class frmSettings
|
||||
End Sub
|
||||
|
||||
Private Sub LoadSettings()
|
||||
txtFavDir.Text = My.Settings.FavDir
|
||||
txtUSDir.Text = My.Settings.UltraStarDirectory
|
||||
|
||||
fillPaths()
|
||||
End Sub
|
||||
|
||||
Private Async Sub fillPaths()
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SqliteCommand(Nothing, con)
|
||||
Dim reader As SQLiteDataReader
|
||||
|
||||
cmd.CommandText = "SELECT p_path FROM t_paths ORDER BY p_path"
|
||||
|
||||
Await con.OpenAsync()
|
||||
reader = cmd.ExecuteReader
|
||||
lstPaths.Items.Clear()
|
||||
Do While Await reader.ReadAsync
|
||||
lstPaths.Items.Add(CStr(reader("p_path")))
|
||||
Loop
|
||||
reader.Close()
|
||||
con.Close()
|
||||
For Each p As String In Await LibraryRepository.GetLibraries
|
||||
lstPaths.Items.Add(p)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub btnPathAdd_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnPathAdd.ItemClick
|
||||
@ -47,31 +37,16 @@ Public Class frmSettings
|
||||
|
||||
Private Sub SaveSettings()
|
||||
'Allgemein speichern
|
||||
My.Settings.FavDir = txtFavDir.Text
|
||||
My.Settings.UltraStarDirectory = txtUSDir.Text
|
||||
My.Settings.Save()
|
||||
|
||||
|
||||
'Pfade speichern
|
||||
Dim con = DB.getConnection
|
||||
Dim cmd As New SqliteCommand(Nothing, con)
|
||||
cmd.Parameters.Add("@path", DbType.String)
|
||||
con.OpenAsync()
|
||||
|
||||
cmd.CommandText = "INSERT INTO t_paths (p_path) VALUES (@path)"
|
||||
For Each pfad As String In ToAdd
|
||||
cmd.Parameters("@path").Value = pfad
|
||||
cmd.ExecuteNonQuery()
|
||||
Next
|
||||
LibraryRepository.AddLibraries(ToAdd)
|
||||
ToAdd.Clear()
|
||||
|
||||
cmd.CommandText = "DELETE FROM t_paths WHERE p_path = @path"
|
||||
For Each pfad As String In ToDelete
|
||||
cmd.Parameters("@path").Value = pfad
|
||||
cmd.ExecuteNonQuery()
|
||||
Next
|
||||
LibraryRepository.DeleteLibraries(ToDelete)
|
||||
ToDelete.Clear()
|
||||
|
||||
con.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub btnPathDelete_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnPathDelete.ItemClick
|
||||
@ -93,9 +68,9 @@ Public Class frmSettings
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnUSDX_Click(sender As Object, e As EventArgs) Handles btnFavDir.Click
|
||||
Private Sub btnUSDX_Click(sender As Object, e As EventArgs) Handles btnUSDir.Click
|
||||
If FBD.ShowDialog = DialogResult.OK Then
|
||||
txtFavDir.Text = FBD.SelectedPath
|
||||
txtUSDir.Text = FBD.SelectedPath
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="13.0.2" targetFramework="net48" />
|
||||
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.117.0" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.118.0" targetFramework="net48" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||
<package id="System.Data.SQLite" version="1.0.117.0" targetFramework="net472" />
|
||||
<package id="System.Data.SQLite.Core" version="1.0.117.0" targetFramework="net472" />
|
||||
<package id="System.Data.SQLite.EF6" version="1.0.117.0" targetFramework="net472" />
|
||||
<package id="System.Data.SQLite.Linq" version="1.0.117.0" targetFramework="net472" />
|
||||
<package id="System.Data.SQLite" version="1.0.118.0" targetFramework="net48" />
|
||||
<package id="System.Data.SQLite.Core" version="1.0.118.0" targetFramework="net48" />
|
||||
<package id="System.Data.SQLite.EF6" version="1.0.118.0" targetFramework="net48" />
|
||||
<package id="System.Data.SQLite.Linq" version="1.0.118.0" targetFramework="net48" />
|
||||
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user