Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WindowsStore/WindowsPhone: MPfm.Library is partially working; SQLite …
…references have been added in both cases (requires the use of a NuGet package + C++ wrapper in case of WP8). SQLiteGateway will need to be reimplemented for WindowsStore/WindowsPhone because DbConnection isn't available. Related to issue #423 and issue #424.
- Loading branch information
1 parent
6496173
commit 4532ad8
Showing
19 changed files
with
2,855 additions
and
2,286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,46 @@ | ||
// Copyright © 2011-2013 Yanick Castonguay | ||
// | ||
// This file is part of MPfm. | ||
// | ||
// MPfm is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// MPfm is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with MPfm. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Data.Common; | ||
|
||
//using System.Data.Linq; | ||
|
||
namespace MPfm.Library.Database.Interfaces | ||
{ | ||
/// <summary> | ||
/// Interface for the SQLiteGateway class. | ||
/// </summary> | ||
public interface ISQLiteGateway | ||
{ | ||
DbConnection GenerateConnection(); | ||
Dictionary<string, string> GetMap<T>(); | ||
string FormatSQLValue(object value); | ||
int Execute(string sql); | ||
object ExecuteScalar(string sql); | ||
void CompactDatabase(); | ||
IEnumerable<object> SelectList(string sql); | ||
List<Tuple<object, object>> SelectTuple(string sql); | ||
T SelectOne<T>(string sql) where T : new(); | ||
List<T> Select<T>(string sql) where T : new(); | ||
int Update<T>(T obj, string tableName, string whereFieldName, object whereValue); | ||
int Update<T>(T obj, string tableName, Dictionary<string, object> where); | ||
int Insert<T>(T obj, string tableName); | ||
void Delete(string tableName, string idFieldName, Guid id); | ||
void Delete(string tableName); | ||
void Delete(string tableName, string where); | ||
} | ||
} | ||
// Copyright © 2011-2013 Yanick Castonguay | ||
// | ||
// This file is part of MPfm. | ||
// | ||
// MPfm is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// MPfm is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with MPfm. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Data.Common; | ||
|
||
namespace MPfm.Library.Database.Interfaces | ||
{ | ||
/// <summary> | ||
/// Interface for the SQLiteGateway class. | ||
/// </summary> | ||
public interface ISQLiteGateway | ||
{ | ||
DbConnection GenerateConnection(); | ||
Dictionary<string, string> GetMap<T>(); | ||
string FormatSQLValue(object value); | ||
int Execute(string sql); | ||
object ExecuteScalar(string sql); | ||
void CompactDatabase(); | ||
IEnumerable<object> SelectList(string sql); | ||
List<Tuple<object, object>> SelectTuple(string sql); | ||
T SelectOne<T>(string sql) where T : new(); | ||
List<T> Select<T>(string sql) where T : new(); | ||
int Update<T>(T obj, string tableName, string whereFieldName, object whereValue); | ||
int Update<T>(T obj, string tableName, Dictionary<string, object> where); | ||
int Insert<T>(T obj, string tableName); | ||
void Delete(string tableName, string idFieldName, Guid id); | ||
void Delete(string tableName); | ||
void Delete(string tableName, string where); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,76 @@ | ||
// Copyright © 2011-2013 Yanick Castonguay | ||
// | ||
// This file is part of MPfm. | ||
// | ||
// MPfm is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// MPfm is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with MPfm. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using MPfm.Library.Database; | ||
using MPfm.Library.UpdateLibrary; | ||
using MPfm.Sound.AudioFiles; | ||
|
||
namespace MPfm.Library | ||
{ | ||
/// <summary> | ||
/// Interface for the Library class. | ||
/// </summary> | ||
interface ILibrary | ||
{ | ||
event Library.UpdateLibraryFinished OnUpdateLibraryFinished; | ||
event Library.UpdateLibraryProgress OnUpdateLibraryProgress; | ||
|
||
void AddAudioFilesToLibrary(List<string> filePaths); | ||
void RefreshCache(); | ||
void RemoveAudioFilesWithBrokenFilePaths(); | ||
void RemoveSongsFromLibrary(string folderPath); | ||
|
||
List<string> SearchMediaFilesInFolders(); | ||
List<string> SearchMediaFilesInFolders(string folderPath, bool recursive); | ||
|
||
Dictionary<string, List<string>> SelectAlbumTitles(); | ||
Dictionary<string, List<string>> SelectAlbumTitles(AudioFileFormat audioFileFormat); | ||
|
||
List<string> SelectArtistAlbumTitles(string artistName); | ||
List<string> SelectArtistAlbumTitles(string artistName, AudioFileFormat audioFileFormat); | ||
|
||
List<string> SelectArtistNames(); | ||
List<string> SelectArtistNames(AudioFileFormat audioFileFormat); | ||
|
||
AudioFile SelectAudioFile(Guid audioFileId); | ||
List<AudioFile> SelectAudioFiles(); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat, string orderBy, bool orderByAscending); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat, string orderBy, bool orderByAscending, string artistName); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat, string orderBy, bool orderByAscending, string artistName, string albumTitle); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat, string orderBy, bool orderByAscending, string artistName, string albumTitle, string searchTerms); | ||
|
||
void UpdateAudioFilePlayCount(Guid audioFileId); | ||
|
||
void ResetLibrary(); | ||
void UpdateLibrary(); | ||
void UpdateLibrary(UpdateLibraryMode mode, List<string> filePaths, string folderPath); | ||
void UpdateLibraryReportProgress(string title, string message); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition, string logEntry); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition, string logEntry, string filePath); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition, string logEntry, string filePath, UpdateLibraryProgressDataSong song); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition, string logEntry, string filePath, UpdateLibraryProgressDataSong song, Exception ex); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, string logEntry); | ||
} | ||
} | ||
// Copyright © 2011-2013 Yanick Castonguay | ||
// | ||
// This file is part of MPfm. | ||
// | ||
// MPfm is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// MPfm is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with MPfm. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#if !PCL && !WINDOWSSTORE && !WINDOWS_PHONE | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using MPfm.Library.Database; | ||
using MPfm.Library.UpdateLibrary; | ||
using MPfm.Sound.AudioFiles; | ||
|
||
namespace MPfm.Library | ||
{ | ||
/// <summary> | ||
/// Interface for the Library class. | ||
/// </summary> | ||
interface ILibrary | ||
{ | ||
event Library.UpdateLibraryFinished OnUpdateLibraryFinished; | ||
event Library.UpdateLibraryProgress OnUpdateLibraryProgress; | ||
|
||
void AddAudioFilesToLibrary(List<string> filePaths); | ||
void RefreshCache(); | ||
void RemoveAudioFilesWithBrokenFilePaths(); | ||
void RemoveSongsFromLibrary(string folderPath); | ||
|
||
List<string> SearchMediaFilesInFolders(); | ||
List<string> SearchMediaFilesInFolders(string folderPath, bool recursive); | ||
|
||
Dictionary<string, List<string>> SelectAlbumTitles(); | ||
Dictionary<string, List<string>> SelectAlbumTitles(AudioFileFormat audioFileFormat); | ||
|
||
List<string> SelectArtistAlbumTitles(string artistName); | ||
List<string> SelectArtistAlbumTitles(string artistName, AudioFileFormat audioFileFormat); | ||
|
||
List<string> SelectArtistNames(); | ||
List<string> SelectArtistNames(AudioFileFormat audioFileFormat); | ||
|
||
AudioFile SelectAudioFile(Guid audioFileId); | ||
List<AudioFile> SelectAudioFiles(); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat, string orderBy, bool orderByAscending); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat, string orderBy, bool orderByAscending, string artistName); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat, string orderBy, bool orderByAscending, string artistName, string albumTitle); | ||
List<AudioFile> SelectAudioFiles(AudioFileFormat audioFileFormat, string orderBy, bool orderByAscending, string artistName, string albumTitle, string searchTerms); | ||
|
||
void UpdateAudioFilePlayCount(Guid audioFileId); | ||
|
||
void ResetLibrary(); | ||
void UpdateLibrary(); | ||
void UpdateLibrary(UpdateLibraryMode mode, List<string> filePaths, string folderPath); | ||
void UpdateLibraryReportProgress(string title, string message); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition, string logEntry); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition, string logEntry, string filePath); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition, string logEntry, string filePath, UpdateLibraryProgressDataSong song); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, int totalNumberOfFiles, int currentFilePosition, string logEntry, string filePath, UpdateLibraryProgressDataSong song, Exception ex); | ||
void UpdateLibraryReportProgress(string title, string message, double percentage, string logEntry); | ||
} | ||
} | ||
#endif |
Binary file not shown.
Oops, something went wrong.