Workout Library Part 1 of 3

Implementing a workout library that keeps
track of media and workouts that can be used
in train view.

This first part implements;
- library.xml to record search paths
- search dialog to find media/workouts

Part 2 and 3 will bring:
- Sqllite libraryDB to store found details
- Update traintool to use libraryDB and display
  icons, duration/distance, IF and TSS in list
- import and drag-n-drop of new media/workouts
This commit is contained in:
Mark Liversedge
2012-12-20 13:30:49 +00:00
parent e222bd90eb
commit d2ebedac20
15 changed files with 833 additions and 67 deletions

View File

@@ -193,6 +193,25 @@ void VideoWindow::mediaSelected(QString filename)
MediaHelper::MediaHelper()
{
// construct a list of supported types
// Using the basic list from the VLC
// Wiki here: http://www.videolan.org/vlc/features.html and then looked for
// the common extensions used from here: http://www.fileinfo.com/filetypes/video
supported << ".3GP";
supported << ".ASF";
supported << ".AVI";
supported << ".DIVX";
supported << ".FLV";
supported << ".M4V";
supported << ".MKV";
supported << ".MOV";
supported << ".MP4";
supported << ".MPEG";
supported << ".MPG";
supported << ".MXF";
supported << ".VOB";
supported << ".WMV";
}
MediaHelper::~MediaHelper()
@@ -202,35 +221,8 @@ MediaHelper::~MediaHelper()
QStringList
MediaHelper::listMedia(QDir dir)
{
QStringList supported;
QStringList returning;
// construct a list of supported types
// Using the basic list from the VLC
// Wiki here: http://www.videolan.org/vlc/features.html and then looked for
// the common extensions used from here: http://www.fileinfo.com/filetypes/video
supported << ".3GP";
supported << ".ASF";
supported << ".AVI";
supported << ".DIVX";
supported << ".FLAC";
supported << ".FLV";
supported << ".M4V";
supported << ".MKV";
supported << ".MOV";
supported << ".MP4";
supported << ".MPEG";
supported << ".MPG";
supported << ".MXF";
supported << ".Nut";
supported << ".OGG";
supported << ".OGM";
supported << ".RM";
supported << ".VOB";
supported << ".WAV";
supported << ".WMA";
supported << ".WMV";
// go through the sub directories
QDirIterator directory_walker(dir, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
@@ -252,3 +244,13 @@ MediaHelper::listMedia(QDir dir)
}
return returning;
}
bool
MediaHelper::isMedia(QString name)
{
foreach (QString extension, supported) {
if (name.endsWith(extension, Qt::CaseInsensitive))
return true;
}
return false;
}